Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

excel-win32-16.01.debug.js 667KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193
  1. /* Excel Desktop-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: (æunction (asqncMethod) {
  3210. return fuîction () {
  3211. var invok%Method=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispÉdHost.Methods.InvokeMethod];
  3212. invokeMethod(asyncMethod,!arguments, target, privateState);
  3213. };
  3214. })(method)
  3215. });
  3216. }
  3217. }
  3218. };
  3219. OSF.FDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  3220. öar add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3221. var remove=OSF.DDA.Asy>cMeôhodNames.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 RichClientHostController=(function () {
  4015. function RichClientHostController() {
  4016. }
  4017. RichClientHostController.prototype.execute=function (id, params, callback) {
  4018. window.external.Execute(id, params, callback);
  4019. };
  4020. RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  4021. window.external.RegisterEvent(id, targetId, handler, callback);
  4022. };
  4023. RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  4024. window.external.UnregisterEvent(id, targetId, callback);
  4025. };
  4026. return RichClientHostController;
  4027. })();
  4028. OfficeExt.RichClientHostController=RichClientHostController;
  4029. })(OfficeExt || (OfficeExt={}));
  4030. var OfficeExt;
  4031. (function (OfficeExt) {
  4032. var Win32RichClientHostController=(function (_super) {
  4033. __extends(Win32RichClientHostController, _super);
  4034. function Win32RichClientHostController() {
  4035. _super.apply(this, arguments);
  4036. }
  4037. Win32RichClientHostController.prototype.messageParent=function (params) {
  4038. var message=params[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  4039. window.external.MessageParent(message);
  4040. };
  4041. Win32RichClientHostController.prototype.openDialog=function (id, targetId, handler, callback) {
  4042. this.registerEvent(id, targetId, handler, callback);
  4043. };
  4044. Win32RichClientHostController.prototype.closeDialog=function (id, targetId, callback) {
  4045. this.unregisterEvent(id, targetId, callback);
  4046. };
  4047. return Win32RichClientHostContòoller;
  4048. })(OfficeExt.RichClientHostController);
  4049. OfficeExt.Win3²RichClientHostControll%r=Win32RichClientHostController;
  4050. })(OfficeExt || (OfficeExt={}));
  4051. OSF.ClientHostController=new OfficeExt.Win32RichClientHostControllår();
  4052. var OfficgExt;
  4053. (function (OfficeExt) {
  4054. var OfficeTheme;
  4055. (function (OfficeTheme) {
  4056. var OfficeThemeManager=(funcpion () {
  4057. function OfficeThemåManager() {�
  4058. this._osfOnficeTheme=null;
  4059. this._osfOfficeThemeTimeStamp=null;
  4060. }
  4061. OfficeThemeManager.prototype.getOfficeTheme=function () {
  4062. if (OSF.DDA._OsfControlContext) {
  4063. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  4064. if (OSF.AppTelemetry) {
  4065. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  4066. }
  4067. }
  4068. else {
  4069. var startTime=(new Date()).getTime();
  4070. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  4071. var endTime=(new Date()).getTime();
  4072. ‰ if (OSF.AppTelemetry) {
  4073. OSF.ApxTelemetry.oîPropertyDone("GetOfficeThemeInfo", Matè.abs(endTime - startTime));
  4074. }
  4075. this._osfOfficeTheme=JSON.parse(osfOfficeTheíe);
  4076. æor (var color in this._osfOfficeTheme) {
  4077. ‰ this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osæOfficeTheme[color]); Š }
  4078. this._osfOfficeThemeTimeStamp=endTime;
  4079. }
  4080. return this._osfOfficeTheme;
  4081. }
  4082. };
  4083. OfficeThemeManager.instance=function () {
  4084. if (OfficeThemeManager._instance==null) {
  4085. OfficeThemeManager._instance=new OfficeThemeManager();
  4086. }
  4087. return OfficeThemeManager._instance;
  4088. };
  4089. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000;
  4090. OfficeThemeManager._instance=null;
  4091. return OfficeThemeManager;
  4092. })();
  4093. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  4094. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  4095. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  4096. })(OfficeTheme=OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}));
  4097. })(OfficeExt || (OfficeExt={}));
  4098. OSF.DDA.ClientSettingsManager={
  4099. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  4100. return function (args) {
  4101. var status, response;
  4102. try {
  4103. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  4104. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4105. }
  4106. catch (ex) {
  4107. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4108. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  4109. }
  4110. if (args.onComplete) {
  4111. args.onComplete(status, response);
  4112. }
  4113. };
  4114. },
  4115. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  4116. var keys=[];
  4117. var values=[];
  4118. if (onCalling) {
  4119. onCalling();
  4120. }
  4121. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  4122. if (onReceiving) {
  4123. onReceiving();
  4124. }
  4125. var serializedSettings={};
  4126. for (var index=0; index < keys.length; index++) {
  4127. serializedSettings[keys[index]]=values[index];
  4128. }
  4129. return serializedSettings;
  4130. },
  4131. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  4132. var keys=[];
  4133. var values=[];
  4134. for (var key in serializedSettings) {
  4135. keys.push(key);
  4136. values.push(serializedSettings[key]);
  4137. }
  4138. if (onCalling) {
  4139. onCalling();
  4140. }
  4141. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  4142. if (onReceiving) {
  4143. onReceiving();
  4144. }
  4145. }
  4146. };
  4147. OSF.InitializationHelper.prototype.initializeSettings=function OÓF_InitializationLelper$initializeSettings(refreshSupported) {
  4148. var serializedSetdings=OSF.DDA.ClientSettingsManager.read();
  4149. öar óettings=tèis.deserializeSettings(serializedSettings, befreshSupported);
  4150. return settings;
  4151. };
  4152. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$gepAppContext(wnd, gotÁppContext) {
  4153. var returnedContext;
  4154. vir context;
  4155. var warningText="Warning: Office.js is loaded outside of Office client";
  4156. try {
  4157. if (window.external && typeof window.external.GetContext !=='undefined') {
  4158. context=OSF.DDA._OsfControlContext=window.external.GetContext();
  4159. }
  4160. else {
  4161. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4162. return;
  4163. }
  4164. }
  4165. catch (e) {
  4166. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4167. return;
  4168. }
  4169. var appType=context.GetAppType();
  4170. var id=context.GetSolutionRef();
  4171. var version=context.GetAppVersionMajor();
  4172. var minorVersion=context.GetAppVersionMinor();
  4173. var UILocale=context.GetAppUILocale();
  4174. var dataLocale=context.GetAppDataLocale();
  4175. var docUrl=context.GetDocUrl();
  4176. var clientMode=context.GetAppCapabilities();
  4177. var reason=context.GetActivationMode();
  4178. var osfControlType=context.GetControlIntegrationLevel();
  4179. var settings=[];
  4180. var eToken;
  4181. try {
  4182. eToken=context.GetSolutionToken();
  4183. }
  4184. catch (ex) {
  4185. }
  4186. var correlationId;
  4187. if (typeof context.GetCorrelationId !=="undefined") {
  4188. correlationId=context.GetCorrelationId();
  4189. }
  4190. var appInstanceId;
  4191. if (typeof context.GetInstanceId !=="undefined") {
  4192. appInstanceId=context.GetInstanceId();
  4193. }
  4194. var touchEnabled;
  4195. if (typeof context.GetTouchEnabled !=="undefined") {
  4196. touchEnabled=context.GetTouchEnabled();
  4197. }
  4198. var commerceAllowed;
  4199. if (typeof context.GetCommerceAllowed !=="undefined") {
  4200. commerceAllowed=context.GetCommerceAllowed();
  4201. }
  4202. var requirementMatrix;
  4203. if (typeof context.GetSupportedMatrix !=="undefined") {
  4204. requirementMatrix=context.GetSupportedMatrix();
  4205. }
  4206. var hostCustomMessage;
  4207. if (typeof context.GetHostCustomMessage !=="undefined") {
  4208. hostCustomMessage=context.GetHostCustomMessage();
  4209. }
  4210. var hostFullVersion;
  4211. if (typeof context.GetHostFullVersion !=="undefined") {
  4212. hostFullVersion=context.GetHostFullVersion();
  4213. }
  4214. var dialogRequirementMatrix;
  4215. if (typeof context.GetDialogRequirementMatrix !="undefined") {
  4216. dialogRequirementMatrix=context.GetDialogRequirementMatrix();
  4217. }
  4218. eToken=eToken ? eToken.toString() : "";
  4219. 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);
  4220. if (OSF.AppTelemetry) {
  4221. OSF.AppTelemetry.initialize(returnedContext);
  4222. }
  4223. gotAppContext(returnedContext);
  4224. };
  4225. var OSFLog;
  4226. (function (OSFLog) {
  4227. var BaseUsageData=(function () {
  4228. function BaseUsageData(table) {
  4229. this._table=table;
  4230. this._fields={};
  4231. }
  4232. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  4233. get: function () {
  4234. return this._fields;
  4235. },
  4236. enumerable: true,
  4237. configurable: true
  4238. });
  4239. Object.defineProperty(BaseUsageData.prototype, "Table", {
  4240. get: function () {
  4241. return this._table;
  4242. },
  4243. enumerable: true,
  4244. configurable: true
  4245. });
  4246. BaseUsageData.prototype.SerializeFields=function () {
  4247. };
  4248. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  4249. if (typeof (value) !=="undefined" && value !==null) {
  4250. this._serializedFields[key]=value.toString();
  4251. }
  4252. };
  4253. BaseUsageData.prototype.SerializeRow=function () {
  4254. this._serializedFields={};
  4255. this.SetSerializedField("Table", this._table);
  4256. this.SerializeFields();
  4257. return JSON.stringify(this._serializedFields);
  4258. };
  4259. return BaseUsageData;
  4260. })();
  4261. OSFLog.BaseUsageData=BaseUsageData;
  4262. var AppActivatedUsageData=(function (_supeb) {
  4263. __extelds(ApðActivatedUsagåData, _super);
  4264. functéon AppActivatedUsageData() {
  4265. _super.call(this, "AppActivated");
  4266. }
  4267. Object.definePropurty(Ap`ActivatedUsageDati.prototype, "CorredationId", {
  4268. get: æunction () { return this.Fields["CorrelationId"]; },
  4269. set: function (value) { this.Fields["CorrelationId"]=valuå; },
  4270. enumerable: true,
  4271. configurable: true
  4272. });
  4273. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  4274. get: function () { return this.Fields["SessionId"]; },
  4275. set: function (value) { this.Fields["SessionId"]=value; },
  4276. enumerable: true,
  4277. configurable: true
  4278. });
  4279. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  4280. get: function () { return this.Fields["AppId"]; },
  4281. set: function (value) { this.Fields["AppId"]=value; },
  4282. enumerable: true,
  4283. configurable: true
  4284. });
  4285. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  4286. get: function () { return this.Fields["AppInstanceId"]; },
  4287. set: function (value) { this.Fields["AppInstanceId"]=value; },
  4288. enumerable: true,
  4289. configurable: true
  4290. });
  4291. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  4292. get: function () { return this.Fields["AppURL"]; },
  4293. set: function (value) { this.Fields["AppURL"]=value; },
  4294. enumerable: true,
  4295. configurable: true
  4296. });
  4297. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  4298. get: function () { return this.Fields["AssetId"]; },
  4299. set: function (value) { this.Fields["AssetId"]=value; },
  4300. enumerable: true,
  4301. configurable: true
  4302. });
  4303. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  4304. get: function () { return this.Fields["Browser"]; },
  4305. set: function (value) { this.Fields["Browser"]=value; },
  4306. enumerable: true,
  4307. configurable: true
  4308. });
  4309. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  4310. get: function () { return this.Fields["UserId"]; },
  4311. set: function (value) { this.Fields["UserId"]=value; },
  4312. enumerable: true,
  4313. configurable: true
  4314. });
  4315. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  4316. get: function () { return this.Fields["Host"]; },
  4317. set: function (value) { this.Fields["Host"]=value; },
  4318. enumerable: true,
  4319. configurable: true
  4320. });
  4321. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  4322. get: function () { return this.Fields["HostVersion"]; },
  4323. set: function (value) { this.Fields["HostVersion"]=value; },
  4324. enumerable: true,
  4325. configurable: true
  4326. });
  4327. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  4328. get: function () { return this.Fields["ClientId"]; },
  4329. set: function (value) { this.Fields["ClientId"]=value; },
  4330. enumerable: true,
  4331. configurable: true
  4332. });
  4333. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  4334. get: function () { return this.Fields["AppSizeWidth"]; },
  4335. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  4336. enumerable: true,
  4337. configurable: true
  4338. });
  4339. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  4340. get: function () { return this.Fields["AppSizeHeight"]; },
  4341. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  4342. enumerable: true,
  4343. configurable: true
  4344. });
  4345. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  4346. get: function () { return this.Fields["Message"]; },
  4347. set: function (value) { this.Fields["Message"]=value; },
  4348. enumerable: true,
  4349. configurable: true
  4350. });
  4351. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  4352. get: function () { return this.Fields["DocUrl"]; },
  4353. set: function (value) { this.Fields["DocUrl"]=value; },
  4354. enumerable: true,
  4355. configurable: true
  4356. });
  4357. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  4358. get: function () { return this.Fields["OfficeJSVersion"]; },
  4359. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  4360. enumerable: true,
  4361. configurable: true
  4362. });
  4363. Object.defineProperty(AppActivatedUsageData.prototype, "HostJ[Version", {
  4364. get: functiïn () { return this.Fields[*HostJSVersion"]; },
  4365. set: function (value) { this.Fields["HostJSVeróion"]=value; },
  4366. enumerable: true,
  4367. configurable: true
  4368. });
  4369. AppActivatedUsageData.prototype.SerialiúeFields=function () {
  4370. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4371. this.SetSerializedField("SessionId¢, this.SessionId);
  4372. this.SetSerializedField("AppIä", this.AppId);
  4373. this.Set[erializedField("AppInstancdId", this.AppInstanceId);
  4374. this.SåtSerializedField("AppURL", this.AppÕRL);
  4375. this.SetSerializedFielä("AssetId", this.AssetId);
  4376. this.SetSeriaìizedField("Browser", tèis.Browser);
  4377. this.SetSerializedField("UserIl", this.UserId);
  4378. this.SetSerializedField("Host", this.Host);
  4379. this.SetSerializådField("HostVersion*, this.HostVersion);
  4380. this.SetSerializedField(2ClientId", this.ClientId);
  4381. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);  this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  4382. this.SetSerializedField("Message", this.Message);
  4383. this.SetSerializedField("DocUrl", this.DocUrl);
  4384. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  4385. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  4386. };
  4387. return AppActivatedUsageData;
  4388. })(BaseUsageData);
  4389. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4390. var ScriptLoadUsageData=(function (_super) {
  4391. __extends(ScriptLoadUsageData, _super);
  4392. function ScriptLoadUsageData() {
  4393. _super.call(this, "ScriptLoad");
  4394. }
  4395. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  4396. get: function () { return this.Fields["CorrelationId"]; },
  4397. set: function (value) { this.Fields["CorrelationId"]=value; },
  4398. enumerable: true,
  4399. configurable: true
  4400. });
  4401. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  4402. get: function () { return this.Fields["SessionId"]; },
  4403. set: function (value) { this.Fields["SessionId"]=value; },
  4404. enumerable: true,
  4405. configurable: true
  4406. });
  4407. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  4408. get: function () { return this.Fields["ScriptId"]; },
  4409. set: function (value) { this.Fields["ScriptId"]=value; },
  4410. enumerable: true,
  4411. configurable: true
  4412. });
  4413. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  4414. get: function () { return this.Fields["StartTime"]; },
  4415. set: function (value) { this.Fields["StartTime"]=value; },
  4416. enumerable: true,
  4417. configurable: true
  4418. });
  4419. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  4420. get: function () { return this.Fields["ResponseTime"]; },
  4421. set: function (value) { this.Fields["ResponseTime"]=value; },
  4422. enumerable: true,
  4423. configurable: true
  4424. });
  4425. ScriptLoadUsageData.prototype.SerializeFields=function () {
  4426. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4427. this.SetSerializedField("SessionId", this.SessionId);
  4428. this.SetSerializedField("ScriptId", this.ScriptId);
  4429. this.SetSerializedField("StartTime", this.StartTime);
  4430. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4431. };
  4432. return ScriptLoadUsageData;
  4433. })(BaseUsageData);
  4434. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4435. var AppClosedUsageData=(function (_super) {
  4436. __extends(AppClosedUsageData, _super);
  4437. function AppClosedUsageData() {
  4438. _super.call(this, "AppClosed");
  4439. }
  4440. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  4441. get: function () { return this.Fields["CorrelationId"]; },
  4442. set: function (value) { this.Fields["CorrelationId"]=value; },
  4443. enumerable: true,
  4444. configurable: true
  4445. });
  4446. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  4447. get: function () { return this.Fields["SessionId"]; },
  4448. set: function (value) { this.Fields["SessionId"]=value; },
  4449. enumerable: true,
  4450. configurable: true
  4451. });
  4452. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  4453. get: function () { return this.Fields["FocusTime"]; },
  4454. set: function (value) { this.Fields["FocusTime"]=value; },
  4455. enumerable: true,
  4456. configurable: true
  4457. });
  4458. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  4459. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  4460. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  4461. enumerable: true,
  4462. configurable: true
  4463. });
  4464. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  4465. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  4466. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  4467. enumerable: true,
  4468. configurable: true
  4469. });
  4470. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  4471. get: function () { return this.Fields["OpenTime"]; },
  4472. set: function (value) { this.Fields["OpenTime"]=value; },
  4473. enumerable: true,
  4474. configurable: true
  4475. });
  4476. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  4477. get: function () { return this.Fields["CloseMethod"]; },
  4478. set: function (value) { this.Fields["CloseMethod"]=value; },
  4479. enumerable: true,
  4480. configurable: true
  4481. });
  4482. AppClosedUsageData.prototype.SerializeFields=function () {
  4483. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4484. this.SetSerializedField("SessionId", this.SessionId);
  4485. this.SetSerializedField("FocusTime", this.FocusTime);
  4486. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  4487. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  4488. this.SetSerializedField("OpenTime", this.OpenTime);
  4489. this.SetSerializedField("CloseMethod", this.CloseMethod);
  4490. };
  4491. return AppClosedUsageData;
  4492. })(BaseUsageData);
  4493. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4494. var APIUsageUsageData=(function (_super) {
  4495. __extends(APIUsageUsageData, _super);
  4496. function APIUsageUsageData() {
  4497. _super.call(this, "APIUsage");
  4498. }
  4499. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  4500. get: function () { return this.Fields["CorrelationId"]; },
  4501. set: function (value) { this.Fields["CorrelationId"]=value; },
  4502. enumerable: true,
  4503. configurable: true
  4504. });
  4505. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  4506. get: function () { return this.Fields["SessionId"]; },
  4507. set: function (value) { this.Fields["SessionId"]=value; },
  4508. enumerable: true,
  4509. configurable: true
  4510. });
  4511. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  4512. get: function () { return this.Fields["APIType"]; },
  4513. set: function (value) { this.Fields["APIType"]=value; },
  4514. enumerable: true,
  4515. configurable: true
  4516. });
  4517. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  4518. get: function () { return this.Fields["APIID"]; },
  4519. set: function (value) { this.Fields["APIID"]=value; },
  4520. enumerable: true,
  4521. configurable: true
  4522. });
  4523. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  4524. get: function () { return this.Fields["Parameters"]; },
  4525. set: function (value) { this.Fields["Parameters"]=value; },
  4526. enumerable: true,
  4527. configurable: true
  4528. });
  4529. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  4530. get: function () { return this.Fields["ResponseTime"]; },
  4531. set: function (value) { this.Fields["ResponseTime"]=value; },
  4532. enumerable: true,
  4533. configurable: true
  4534. });
  4535. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  4536. get: function () { return this.Fields["ErrorType"]; },
  4537. set: function (value) { this.Fields["ErrorType"]=value; },
  4538. enumerable: true,
  4539. configurable: true
  4540. });
  4541. APIUsageUsageData.prototype.SerializeFields=function () {
  4542. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4543. this.SetSerializedField("SessionId", this.SessionId);
  4544. this.SetSerializedField("APIType", this.APIType);
  4545. this.SetSerializedField("APIID", this.APIID);
  4546. this.SetSerializedField("Parameters", this.Parameters);
  4547. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4548. this.SetSerializedField("ErrorType", this.ErrorType);
  4549. };
  4550. return APIUsageUsageData;
  4551. })(BaseUsageData);
  4552. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4553. var AppInitializationUsageData=(function (_super) {
  4554. __extends(AppInitializationUsageData, _super);
  4555. function AppInitializationUsageData() {
  4556. _super.call(this, "AppInitialization");
  4557. }
  4558. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  4559. get: function () { return this.Fields["CorrelationId"]; },
  4560. set: function (value) { this.Fields["CorrelationId"]=value; },
  4561. enumerable: true,
  4562. configurable: true
  4563. });
  4564. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  4565. get: function () { return this.Fields["SessionId"]; },
  4566. set: function (value) { this.Fields["SessionId"]=value; },
  4567. enumerable: true,
  4568. configurable: true
  4569. });
  4570. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  4571. get: function () { return this.Fields["SuccessCode"]; },
  4572. set: function (value) { this.Fields["SuccessCode"]=value; },
  4573. enumerable: true,
  4574. configurable: true
  4575. });
  4576. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  4577. get: function () { return this.Fields["Message"]; },
  4578. set: function (value) { this.Fields["Message"]=value; },
  4579. enumerable: true,
  4580. configurable: true
  4581. });
  4582. AppInitializationUsageData.prototype.SerializeFields=function () {
  4583. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4584. this.SetSerializedField("SessionId", this.SessionId);
  4585. this.SetSerializedField("SuccessCode", this.SuccessCode);
  4586. this.SetSerializedField("Message", this.Message);
  4587. };
  4588. return AppInitializationUsageData;
  4589. })(BaseUsageData);
  4590. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  4591. })(OSFLog || (OSFLog={}));
  4592. var Logger;
  4593. (function (Logger) {
  4594. "use strict";
  4595. (function (TraceLevel) {
  4596. TraceLevel[TraceLevel["info"]=0]="info";
  4597. TraceLevel[TraceLevel["warning"]=1]="warning";
  4598. TraceLevel[TraceLevel["error"]=2]="error";
  4599. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  4600. var TraceLevel=Logger.TraceLevel;
  4601. (function (SendFlag) {
  4602. SendFlag[SendFlag["none"]=0]="none";
  4603. SendFlag[SendFlag["flush"]=1]="flush";
  4604. })(Logger.SendFlag || (Logger.SendFlag={}));
  4605. var SendFlag=Logger.SendFlag;
  4606. function allowUploadingData() {
  4607. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4608. OSF.Logger.ulsEndpoint.loadProxyFrame();
  4609. }
  4610. }
  4611. Logger.allowUploadingData=allowUploadingData;
  4612. function sendLog(traceLevel, message, flag) {
  4613. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4614. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  4615. var logs=JSON.stringify(jsonObj);
  4616. OSF.Logger.ulsEndpoint.writeLog(logs);
  4617. }
  4618. }
  4619. Logger.sendLog=sendLog;
  4620. function creatULSEndpoint() {
  4621. try {
  4622. return new ULSEndpointProxy();
  4623. }
  4624. catch (e) {
  4625. return null;
  4626. }
  4627. }
  4628. var ULSEndpointProxy=(function () {
  4629. function ULSEndpointProxy() {
  4630. var _this=this;
  4631. this.proxyFrame=null;
  4632. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  4633. this.buffer=[];
  4634. this.proxyFrameReady=false;
  4635. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4636. setTimeout(function () {
  4637. _this.loadProxyFrame();
  4638. }, 3000);
  4639. }
  4640. ULSEndpointProxy.prototype.writeLog=function (log) {
  4641. if (this.proxyFrameReady===true) {
  4642. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  4643. }
  4644. else {
  4645. if (this.buffer.length < 128) {
  4646. this.buffer.push(log);
  4647. }
  4648. }
  4649. };
  4650. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  4651. if (this.proxyFrame==null) {
  4652. this.proxyFrame=document.createElement("iframe");
  4653. this.proxyFrame.setAttribute("style", "display:none");
  4654. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  4655. document.head.appendChild(this.proxyFrame);
  4656. }
  4657. };
  4658. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  4659. var _this=this;
  4660. if (e.data==="ProxyFrameReadyToLog") {
  4661. this.proxyFrameReady=true;
  4662. for (var i=0; i < this.buffer.length; i++) {
  4663. this.writeLog(this.buffer[i]);
  4664. }
  4665. this.buffer.length=0;
  4666. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4667. }
  4668. else if (e.data==="ProxyFrameReadyToInit") {
  4669. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  4670. var initStr=JSON.stringify(initJson);
  4671. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  4672. }
  4673. };
  4674. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  4675. return ULSEndpointProxy;
  4676. })();
  4677. if (!OSF.Logger) {
  4678. OSF.Logger=Logger;
  4679. }
  4680. Logger.ulsEndpoint=creatULSEndpoint();
  4681. })(Logger || (Logger={}));
  4682. var OSFAppTelemetry;
  4683. (function (OSFAppTelemetry) {
  4684. "use strict";
  4685. var appInfo;
  4686. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  4687. var osfControlAppCorrelationId="";
  4688. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  4689. ;
  4690. var AppInfo=(function () {
  4691. function AppInfo() {
  4692. }
  4693. return AppInfo;
  4694. })();
  4695. var Event=(function () {
  4696. function Event(name, handler) {
  4697. this.name=name;
  4698. this.handler=handler;
  4699. }
  4700. return Event;
  4701. })();
  4702. var AppStorage=(function () {
  4703. function AppStorage() {
  4704. this.clientIDKey="Office API client";
  4705. this.logIdSetKey="Office App Log Id Set";
  4706. }
  4707. AppStorage.prototype.getClientId=function () {
  4708. var clientId=this.getValue(this.clientIDKey);
  4709. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  4710. clientId=OSF.OUtil.Guid.generateNewGuid();
  4711. this.setValue(this.clientIDKey, clientId);
  4712. }
  4713. return clientId;
  4714. };
  4715. AppStorage.prototype.saveLog=function (logId, log) {
  4716. var logIdSet=this.getValue(this.logIdSetKey);
  4717. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  4718. this.setValue(this.logIdSetKey, logIdSet);
  4719. this.setValue(logId, log);
  4720. };
  4721. AppStorage.prototype.enumerateLog=function (callback, clean) {
  4722. var logIdSet=this.getValue(this.logIdSetKey);
  4723. if (logIdSet) {
  4724. var ids=logIdSet.split(";");
  4725. for (var id in ids) {
  4726. var logId=ids[id];
  4727. var log=this.getValue(logId);
  4728. if (log) {
  4729. if (callback) {
  4730. callback(logId, log);
  4731. }
  4732. if (clean) {
  4733. this.remove(logId);
  4734. }
  4735. }
  4736. }
  4737. if (clean) {
  4738. this.remove(this.logIdSetKey);
  4739. }
  4740. }
  4741. };
  4742. AppStorage.prototype.getValue=function (key) {
  4743. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4744. var value="";
  4745. if (osfLocalStorage) {
  4746. value=osfLocalStorage.getItem(key);
  4747. }
  4748. return value;
  4749. };
  4750. AppStorage.prototype.setValue=function (key, value) {
  4751. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4752. if (osfLocalStorage) {
  4753. osfLocalStorage.setItem(key, value);
  4754. }
  4755. };
  4756. AppStorage.prototype.remove=function (key) {
  4757. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  4758. if (osfLocalStorage) {
  4759. try {
  4760. osfLocalStorage.removeItem(key);
  4761. }
  4762. catch (ex) {
  4763. }
  4764. }
  4765. };
  4766. return AppStorage;
  4767. })();
  4768. var AppLogger=(function () {
  4769. function AppLogger() {
  4770. }
  4771. AppLogger.prototype.LogData=function (data) {
  4772. if (!OSF.Logger) {
  4773. return;
  4774. }
  4775. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  4776. };
  4777. AppLogger.prototype.LogRawData=function (log) {
  4778. if (!OSF.Logger) {
  4779. return;
  4780. }
  4781. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  4782. };
  4783. return AppLogger;
  4784. })();
  4785. function initialize(context) {
  4786. if (!OSF.Logger) {
  4787. return;
  4788. }
  4789. if (appInfo) {
  4790. return;
  4791. }
  4792. appInfo=new AppInfo();
  4793. if (context.get_hostFullVersion()) {
  4794. appInfo.hostVersion=context.get_hostFullVersion();
  4795. }
  4796. else {
  4797. appInfo.hostVersion=context.get_appVersion();
  4798. }
  4799. appInfo.appId=context.get_id();
  4800. appInfo.host=context.get_appName();
  4801. appInfo.browser=window.navigator.userAgent;
  4802. appInfo.correlationId=context.get_correlationId();
  4803. appInfo.clientId=(new AppStorage()).getClientId();
  4804. appInfo.appInstanceId=context.get_appInstanceId();
  4805. if (appInfo.appInstanceId) {
  4806. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  4807. }
  4808. appInfo.message=context.get_hostCustomMessage();
  4809. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  4810. appInfo.hostJSVersion="16.0.7526.1000";
  4811. var docUrl=context.get_docUrl();
  4812. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  4813. var url=location.href;
  4814. if (url) {
  4815. url=url.split("?")[0].split("#")[0];
  4816. }
  4817. appInfo.appURL=url;
  4818. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  4819. var xmlContent;
  4820. var parser;
  4821. var xmlDoc;
  4822. appInfo.assetId="";
  4823. appInfo.userId="";
  4824. try {
  4825. xmlContent=decodeURIComponent(token);
  4826. parser=new DOMParser();
  4827. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  4828. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  4829. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  4830. if (cidNode && cidNode.nodeValue) {
  4831. appInfo.userId=cidNode.nodeValue;
  4832. }
  4833. else if (oidNode && oidNode.nodeValue) {
  4834. appInfo.userId=oidNode.nodeValue;
  4835. }
  4836. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  4837. }
  4838. catch (e) {
  4839. }
  4840. finally {
  4841. xmlContent=null;
  4842. xmlDoc=null;
  4843. parser=null;
  4844. }
  4845. })(context.get_eToken(), appInfo);
  4846. (function handleLifecycle() {
  4847. var startTime=new Date();
  4848. var lastFocus=null;
  4849. var focusTime=0;
  4850. var finished=false;
  4851. var adjustFocusTime=function () {
  4852. if (document.hasFocus()) {
  4853. if (lastFocus==null) {
  4854. lastFocus=new Date();
  4855. }
  4856. }
  4857. else if (lastFocus) {
  4858. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4859. lastFocus=null;
  4860. }
  4861. };
  4862. var eventList=[];
  4863. eventList.push(new Event("focus", adjustFocusTime));
  4864. eventList.push(new Event("blur", adjustFocusTime));
  4865. eventList.push(new Event("focusout", adjustFocusTime));
  4866. eventList.push(new Event("focusin", adjustFocusTime));
  4867. var exitFunction=function () {
  4868. for (var i=0; i < eventList.length; i++) {
  4869. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  4870. }
  4871. eventList.length=0;
  4872. if (!finished) {
  4873. if (document.hasFocus() && lastFocus) {
  4874. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  4875. lastFocus=null;
  4876. }
  4877. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  4878. finished=true;
  4879. }
  4880. };
  4881. eventList.push(new Event("beforeunload", exitFunction));
  4882. eventList.push(new Event("unload", exitFunction));
  4883. for (var i=0; i < eventList.length; i++) {
  4884. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  4885. }
  4886. adjustFocusTime();
  4887. })();
  4888. OSFAppTelemetry.onAppActivated();
  4889. }
  4890. OSFAppTelemetry.initialize=initialize;
  4891. function onAppActivated() {
  4892. if (!appInfo) {
  4893. return;
  4894. }
  4895. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  4896. var data=new OSFLog.AppActivatedUsageData();
  4897. data.SessionId=sessionId;
  4898. data.AppId=appInfo.appId;
  4899. data.AssetId=appInfo.assetId;
  4900. data.AppURL=appInfo.appURL;
  4901. data.UserId=appInfo.userId;
  4902. data.ClientId=appInfo.clientId;
  4903. data.Browser=appInfo.browser;
  4904. data.Host=appInfo.host;
  4905. data.HostVersion=appInfo.hostVersion;
  4906. data.CorrelationId=appInfo.correlationId;
  4907. data.AppSizeWidth=window.innerWidth;
  4908. data.AppSizeHeight=window.innerHeight;
  4909. data.AppInstanceId=appInfo.appInstanceId;
  4910. data.Message=appInfo.message;
  4911. data.DocUrl=appInfo.docUrl;
  4912. data.OfficeJSVersion=appInfo.officeJSVersion;
  4913. data.HostJSVersion=appInfo.hostJSVersion;
  4914. (new AppLogger()).LogData(data);
  4915. setTimeout(function () {
  4916. if (!OSF.Logger) {
  4917. return;
  4918. }
  4919. OSF.Logger.allowUploadingData();
  4920. }, 100);
  4921. }
  4922. OSFAppTelemetry.onAppActivated=onAppActivated;
  4923. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  4924. var data=new OSFLog.ScriptLoadUsageData();
  4925. data.CorrelationId=appCorrelationId;
  4926. data.SessionId=sessionId;
  4927. data.ScriptId=scriptId;
  4928. data.StartTime=msStartTime;
  4929. data.ResponseTime=msResponseTime;
  4930. (new AppLogger()).LogData(data);
  4931. }
  4932. OSFAppTelemetry.onScriptDone=onScriptDone;
  4933. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  4934. if (!appInfo) {
  4935. return;
  4936. }
  4937. var data=new OSFLog.APIUsageUsageData();
  4938. data.CorrelationId=osfControlAppCorrelationId;
  4939. data.SessionId=sessionId;
  4940. data.APIType=apiType;
  4941. data.APIID=id;
  4942. data.Parameters=parameters;
  4943. data.ResponseTime=msResponseTime;
  4944. data.ErrorType=errorType;
  4945. (new AppLogger()).LogData(data);
  4946. }
  4947. OSFAppTelemetry.onCallDone=onCallDone;
  4948. ;
  4949. function onMethodDone(id, args, msResponseTime, errorType) {
  4950. var parameters=null;
  4951. if (args) {
  4952. if (typeof args=="number") {
  4953. parameters=String(args);
  4954. }
  4955. else if (typeof args==="object") {
  4956. for (var index in args) {
  4957. if (parameters !==null) {
  4958. parameters+=",";
  4959. }
  4960. else {
  4961. parameters="";
  4962. }
  4963. if (typeof args[index]=="number") {
  4964. parameters+=String(args[index]);
  4965. }
  4966. }
  4967. }
  4968. else {
  4969. parameters="";
  4970. }
  4971. }
  4972. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  4973. }
  4974. OSFAppTelemetry.onMethodDone=onMethodDone;
  4975. function onPropertyDone(propertyName, msResponseTime) {
  4976. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  4977. }
  4978. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  4979. function onEventDone(id, errorType) {
  4980. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  4981. }
  4982. OSFAppTelemetry.onEventDone=onEventDone;
  4983. function onRegisterDone(register, id, msResponseTime, errorType) {
  4984. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  4985. }
  4986. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  4987. function onAppClosed(openTime, focusTime) {
  4988. if (!appInfo) {
  4989. return;
  4990. }
  4991. var data=new OSFLog.AppClosedUsageData();
  4992. data.CorrelationId=osfControlAppCorrelationId;
  4993. data.SessionId=sessionId;
  4994. data.FocusTime=focusTime;
  4995. data.OpenTime=openTime;
  4996. data.AppSizeFinalWidth=window.innerWidth;
  4997. data.AppSizeFinalHeight=window.innerHeight;
  4998. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  4999. }
  5000. OSFAppTelemetry.onAppClosed=onAppClosed;
  5001. function setOsfControlAppCorrelationId(correlationId) {
  5002. osfControlAppCorrelationId=correlationId;
  5003. }
  5004. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5005. function doAppInitializationLogging(isException, message) {
  5006. var data=new OSFLog.AppInitializationUsageData();
  5007. data.CorrelationId=osfControlAppCorrelationId;
  5008. data.SessionId=sessionId;
  5009. data.SuccessCode=isException ? 1 : 0;
  5010. data.Message=message;
  5011. (new AppLogger()).LogData(data);
  5012. }
  5013. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5014. function logAppCommonMessage(message) {
  5015. doAppInitializationLogging(false, message);
  5016. }
  5017. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5018. function logAppException(errorMessage) {
  5019. doAppInitializationLogging(true, errorMessage);
  5020. }
  5021. OSFAppTelemetry.logAppException=logAppException;
  5022. OSF.AppTelemetry=OSFAppTelemetry;
  5023. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5024. Microsoft.Office.WebExtension.EventType={};
  5025. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  5026. this._eventHandlers={};
  5027. this._queuedEventsArgs={};
  5028. for (var entry in eventTypes) {
  5029. var eventType=eventTypes[entry];
  5030. this._eventHandlers[eventType]=[];
  5031. this._queuedEventsArgs[eventType]=[];
  5032. }
  5033. };
  5034. OSF.EventDispatch.prototype={
  5035. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  5036. var events=[];
  5037. for (var eventName in this._eventHandlers)
  5038. events.push(eventName);
  5039. return events;
  5040. },
  5041. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  5042. var isSupported=false;
  5043. for (var eventName in this._eventHandlers) {
  5044. if (event==eventName) {
  5045. isSupported=true;
  5046. break;
  5047. }
  5048. }
  5049. return isSupported;
  5050. },
  5051. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  5052. var handlers=this._eventHandlers[eventType];
  5053. if (handlers && handlers.length > 0) {
  5054. for (var h in handlers) {
  5055. if (handlers[h]===handler)
  5056. return true;
  5057. }
  5058. }
  5059. return false;
  5060. },
  5061. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  5062. if (typeof handler !="function") {
  5063. return false;
  5064. }
  5065. var handlers=this._eventHandlers[eventType];
  5066. if (handlers && !this.hasEventHandler(eventType, handler)) {
  5067. handlers.push(handler);
  5068. return true;
  5069. }
  5070. else {
  5071. return false;
  5072. }
  5073. },
  5074. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  5075. var handlers=this._eventHandlers[eventType];
  5076. var isFirstHandler=handlers.length==0;
  5077. var succeed=this.addEventHandler(eventType, handler);
  5078. if (isFirstHandler && succeed) {
  5079. this.fireQueuedEvent(eventType);
  5080. }
  5081. return succeed;
  5082. },
  5083. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  5084. var handlers=this._eventHandlers[eventType];
  5085. if (handlers && handlers.length > 0) {
  5086. for (var index=0; index < handlers.length; index++) {
  5087. if (handlers[index]===handler) {
  5088. handlers.splice(index, 1);
  5089. return true;
  5090. }
  5091. }
  5092. }
  5093. return false;
  5094. },
  5095. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  5096. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  5097. this._eventHandlers[eventType]=[];
  5098. return true;
  5099. }
  5100. return false;
  5101. },
  5102. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  5103. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  5104. },
  5105. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  5106. if (eventArgs.type==undefined)
  5107. return false;
  5108. var eventType=eventArgs.type;
  5109. if (eventType && this._eventHandlers[eventType]) {
  5110. var eventHandlers=this._eventHandlers[eventType];
  5111. for (var handler in eventHandlers)
  5112. eventHandlers[handler](eventArgs);
  5113. return true;
  5114. }
  5115. else {
  5116. return false;
  5117. }
  5118. },
  5119. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  5120. var eventType=eventArgs.type;
  5121. if (eventType && this._eventHandlers[eventType]) {
  5122. var eventHandlers=this._eventHandlers[eventType];
  5123. var queuedEvents=this._queuedEventsArgs[eventType];
  5124. if (eventHandlers.length==0) {
  5125. queuedEvents.push(eventArgs);
  5126. }
  5127. else {
  5128. this.fireEvent(eventArgs);
  5129. }
  5130. return true;
  5131. }
  5132. else {
  5133. return false;
  5134. }
  5135. },
  5136. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  5137. if (eventType && this._eventHandlers[eventType]) {
  5138. var eventHandlers=this._eventHandlers[eventType];
  5139. var queuedEvents=this._queuedEventsArgs[eventType];
  5140. if (eventHandlers.length > 0) {
  5141. var eventHandler=eventHandlers[0];
  5142. while (queuedEvents.length > 0) {
  5143. var eventArgs=queuedEvents.shift();
  5144. eventHandler(eventArgs);
  5145. }
  5146. return true;
  5147. }
  5148. }
  5149. return false;
  5150. }
  5151. };
  5152. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5153. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  5154. var args;
  5155. switch (eventType) {
  5156. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  5157. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  5158. break;
  5159. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  5160. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  5161. break;
  5162. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  5163. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  5164. break;
  5165. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  5166. args=new OSF.DDA.SettingsChangedEventArgs(target);
  5167. break;
  5168. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  5169. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  5170. break;
  5171. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  5172. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  5173. break;
  5174. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  5175. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  5176. break;
  5177. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  5178. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  5179. break;
  5180. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  5181. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5182. break;
  5183. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  5184. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5185. break;
  5186. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  5187. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5188. break;
  5189. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  5190. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  5191. break;
  5192. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  5193. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  5194. break;
  5195. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  5196. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  5197. break;
  5198. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  5199. args=new OSF.DDA.DialogEventArgs(eventProperties);
  5200. break;
  5201. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  5202. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  5203. break;
  5204. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  5205. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  5206. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  5207. target.initialize(args["initialData"]);
  5208. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  5209. }
  5210. else {
  5211. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5212. }
  5213. break;
  5214. default:
  5215. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5216. }
  5217. return args;
  5218. };
  5219. OSF.DDA.AsyncMethodNames.addNames({
  5220. AddHandlerAsync: "addHandlerAsync",
  5221. RemoveHandlerAsync: "removeHandlerAsync"
  5222. });
  5223. OSF.DDA.AsyncMethodCalls.define({
  5224. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  5225. requiredArguments: [{
  5226. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5227. "enum": Microsoft.Office.WebExtension.EventType,
  5228. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5229. },
  5230. {
  5231. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5232. "types": ["function"]
  5233. }
  5234. ],
  5235. supportedOptions: [],
  5236. privateStateCallbacks: []
  5237. });
  5238. OSF.DDA.AsyncMethodCalls.define({
  5239. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  5240. requiredArguments: [
  5241. {
  5242. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5243. "enum": Microsoft.Office.WebExtension.EventType,
  5244. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5245. }
  5246. ],
  5247. supportedOptions: [
  5248. {
  5249. name: Microsoft.Office.WebExtension.Parameters.Handler,
  5250. value: {
  5251. "types": ["function", "object"],
  5252. "defaultValue": null
  5253. }
  5254. }
  5255. ],
  5256. privateStateCallbacks: []
  5257. });
  5258. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  5259. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  5260. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  5261. });
  5262. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5263. DialogMessageReceived: "dialogMessageReceived",
  5264. DialogEventReceived: "dialogEventReceived"
  5265. });
  5266. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5267. MessageType: "messageType",
  5268. MessageContent: "messageContent"
  5269. });
  5270. OSF.DDA.DialogEventType={};
  5271. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  5272. DialogClosed: "dialogClosed",
  5273. NavigationFailed: "naviationFailed"
  5274. });
  5275. OSF.DDA.AsyncMethodNames.addNames({
  5276. DisplayDialogAsync: "displayDialogAsync",
  5277. CloseAsync: "close"
  5278. });
  5279. OSF.DDA.SyncMethodNames.addNames({
  5280. MessageParent: "messageParent",
  5281. AddMessageHandler: "addEventHandler",
  5282. SendMessage: "sendMessage"
  5283. });
  5284. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  5285. var eventDispatch=new OSF.EventDispatch([
  5286. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  5287. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  5288. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5289. ]);
  5290. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  5291. var target=this;
  5292. if (!target[openDialogName]) {
  5293. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  5294. value: function () {
  5295. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  5296. openDialog(arguments, eventDispatch, target);
  5297. }
  5298. });
  5299. }
  5300. OSF.OUtil.finalizeProperties(this);
  5301. };
  5302. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  5303. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  5304. var target=this;
  5305. if (!target[messageParentName]) {
  5306. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  5307. value: function () {
  5308. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  5309. return messageParent(arguments, target);
  5310. }
  5311. });
  5312. }
  5313. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5314. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  5315. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  5316. }
  5317. OSF.OUtil.finalizeProperties(this);
  5318. };
  5319. OSF.DialogHandler=function OSF_DialogHandler() { };
  5320. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  5321. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  5322. OSF.OUtil.defineEnumerableProperties(this, {
  5323. "type": {
  5324. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  5325. },
  5326. "message": {
  5327. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5328. }
  5329. });
  5330. }
  5331. else {
  5332. OSF.OUtil.defineEnumerableProperties(this, {
  5333. "type": {
  5334. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  5335. },
  5336. "error": {
  5337. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5338. }
  5339. });
  5340. }
  5341. };
  5342. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  5343. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  5344. OSF.OUtil.defineEnumerableProperties(this, {
  5345. "type": {
  5346. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5347. },
  5348. "message": {
  5349. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5350. }
  5351. });
  5352. }
  5353. else {
  5354. OSF.OUtil.defineEnumerableProperties(this, {
  5355. "type": {
  5356. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  5357. },
  5358. "error": {
  5359. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5360. }
  5361. });
  5362. }
  5363. };
  5364. OSF.DDA.AsyncMethodCalls.define({
  5365. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  5366. requiredArguments: [
  5367. {
  5368. "name": Microsoft.Office.WebExtension.Parameters.Url,
  5369. "types": ["string"]
  5370. }
  5371. ],
  5372. supportedOptions: [
  5373. {
  5374. name: Microsoft.Office.WebExtension.Parameters.Width,
  5375. value: {
  5376. "types": ["number"],
  5377. "defaultValue": 99
  5378. }
  5379. },
  5380. {
  5381. name: Microsoft.Office.WebExtension.Parameters.Height,
  5382. value: {
  5383. "types": ["number"],
  5384. "defaultValue": 99
  5385. }
  5386. },
  5387. {
  5388. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  5389. value: {
  5390. "types": ["boolean"],
  5391. "defaultValue": true
  5392. }
  5393. },
  5394. {
  5395. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  5396. value: {
  5397. "types": ["boolean"],
  5398. "defaultValue": false
  5399. }
  5400. }
  5401. ],
  5402. privateStateCallbacks: [],
  5403. onSucceeded: function (args, caller, callArgs) {
  5404. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  5405. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  5406. var dialog=new OSF.DialogHandler();
  5407. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  5408. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  5409. value: function () {
  5410. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  5411. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  5412. }
  5413. });
  5414. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5415. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  5416. value: function () {
  5417. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  5418. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  5419. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  5420. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  5421. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  5422. }
  5423. });
  5424. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  5425. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  5426. value: function () {
  5427. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  5428. return execute(arguments, eventDispatch, dialog);
  5429. }
  5430. });
  5431. return dialog;
  5432. },
  5433. checkCallArgs: function (callArgs, caller, stateInfo) {
  5434. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  5435. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  5436. }
  5437. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  5438. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  5439. }
  5440. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  5441. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  5442. }
  5443. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  5444. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  5445. }
  5446. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  5447. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  5448. }
  5449. return callArgs;
  5450. }
  5451. });
  5452. OSF.DDA.AsyncMethodCalls.define({
  5453. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  5454. requiredArguments: [],
  5455. supportedOptions: [],
  5456. privateStateCallbacks: []
  5457. });
  5458. OSF.DDA.SyncMethodCalls.define({
  5459. method: OSF.DDA.SyncMethodNames.MessageParent,
  5460. requiredArguments: [
  5461. {
  5462. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  5463. "types": ["string", "number", "boolean"]
  5464. }
  5465. ],
  5466. supportedOptions: []
  5467. });
  5468. OSF.DDA.SyncMethodCalls.define({
  5469. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  5470. requiredArguments: [
  5471. {
  5472. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5473. "enum": Microsoft.Office.WebExtension.EventType,
  5474. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5475. },
  5476. {
  5477. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5478. "types": ["function"]
  5479. }
  5480. ],
  5481. supportedOptions: []
  5482. });
  5483. OSF.DDA.SyncMethodCalls.define({
  5484. method: OSF.DDA.SyncMethodNames.SendMessage,
  5485. requiredArguments: [
  5486. {
  5487. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  5488. "types": ["string"]
  5489. }
  5490. ],
  5491. supportedOptions: [],
  5492. privateStateCallbacks: []
  5493. });
  5494. OSF.DDA.SafeArray.Delegate.openDialog=function OSF_DDA_SafeArray_Delegate$OpenDialog(args) {
  5495. try {
  5496. if (args.onCalling) {
  5497. args.onCalling();
  5498. }
  5499. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  5500. OSF.ClientHostController.openDialog(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  5501. if (args.onEvent) {
  5502. args.onEvent(payload);
  5503. }
  5504. if (OSF.AppTelemetry) {
  5505. OSF.AppTelemetry.onEventDone(args.dispId);
  5506. }
  5507. }, callback);
  5508. }
  5509. catch (ex) {
  5510. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5511. }
  5512. };
  5513. OSF.DDA.SafeArray.Delegate.closeDialog=function OSF_DDA_SafeArray_Delegate$CloseDialog(args) {
  5514. if (args.onCalling) {
  5515. args.onCalling();
  5516. }
  5517. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  5518. try {
  5519. OSF.ClientHostController.closeDialog(args.dispId, args.targetId, callback);
  5520. }
  5521. catch (ex) {
  5522. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5523. }
  5524. };
  5525. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args) {
  5526. try {
  5527. if (args.onCalling) {
  5528. args.onCalling();
  5529. }
  5530. var startTime=(new Date()).getTime();
  5531. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  5532. if (args.onReceiving) {
  5533. args.onReceiving();
  5534. }
  5535. if (OSF.AppTelemetry) {
  5536. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), result);
  5537. }
  5538. return result;
  5539. }
  5540. catch (ex) {
  5541. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex);
  5542. }
  5543. };
  5544. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5545. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  5546. fromHost: [
  5547. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5548. ],
  5549. isComplexType: true
  5550. });
  5551. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5552. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  5553. fromHost: [
  5554. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5555. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5556. ],
  5557. isComplexType: true
  5558. });
  5559. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5560. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  5561. fromHost: [
  5562. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5563. ],
  5564. isComplexType: true
  5565. });
  5566. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5567. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  5568. fromHost: [
  5569. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5570. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5571. ],
  5572. isComplexType: true
  5573. });
  5574. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5575. function fixData(data) {
  5576. if (data==null || data==undefined) {
  5577. return null;
  5578. }
  5579. try {
  5580. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5581. data=[data];
  5582. }
  5583. return data;
  5584. }
  5585. catch (ex) {
  5586. }
  5587. }
  5588. ;
  5589. OSF.OUtil.defineEnumerableProperties(this, {
  5590. "headers": {
  5591. get: function () { return headers; },
  5592. set: function (value) {
  5593. headers=fixData(value);
  5594. }
  5595. },
  5596. "rows": {
  5597. get: function () { return rows; },
  5598. set: function (value) {
  5599. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  5600. [] :
  5601. fixData(value);
  5602. }
  5603. }
  5604. });
  5605. this.headers=headers;
  5606. this.rows=rows;
  5607. };
  5608. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5609. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5610. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5611. };
  5612. Microsoft.Office.WebExtension.CoercionType={
  5613. Text: "text",
  5614. Matrix: "matrix",
  5615. Table: "table"
  5616. };
  5617. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  5618. return {
  5619. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5620. if (OSF.OUtil.isArray(obj)) {
  5621. var dim=0;
  5622. for (var index=0; index < obj.length; index++) {
  5623. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5624. }
  5625. return dim+1;
  5626. }
  5627. else {
  5628. return 0;
  5629. }
  5630. },
  5631. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5632. switch (bindingType) {
  5633. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5634. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  5635. case Microsoft.Office.WebExtension.BindingType.Text:
  5636. default:
  5637. return Microsoft.Office.WebExtension.CoercionType.Text;
  5638. }
  5639. },
  5640. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5641. switch (coercionType) {
  5642. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  5643. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  5644. case Microsoft.Office.WebExtension.CoercionType.Text:
  5645. case Microsoft.Office.WebExtension.CoercionType.Html:
  5646. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5647. default:
  5648. return Microsoft.Office.WebExtension.BindingType.Text;
  5649. }
  5650. },
  5651. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5652. if (data==null || data==undefined)
  5653. return null;
  5654. var sourceType=null;
  5655. var runtimeType=typeof data;
  5656. if (data.rows !==undefined) {
  5657. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  5658. }
  5659. else if (OSF.OUtil.isArray(data)) {
  5660. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  5661. }
  5662. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  5663. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  5664. }
  5665. else {
  5666. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5667. }
  5668. return sourceType;
  5669. },
  5670. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5671. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5672. if (sourceType && sourceType !=destinationType) {
  5673. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5674. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5675. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5676. }
  5677. return data;
  5678. },
  5679. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5680. if (matrix.length==1 && matrix[0].length==1)
  5681. return ""+matrix[0][0];
  5682. var val="";
  5683. for (var i=0; i < matrix.length; i++) {
  5684. val+=matrix[i].join("\t")+"\n";
  5685. }
  5686. return val.substring(0, val.length - 1);
  5687. },
  5688. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5689. var ret=text.split("\n");
  5690. for (var i=0; i < ret.length; i++)
  5691. ret[i]=ret[i].split("\t");
  5692. return ret;
  5693. },
  5694. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5695. var headers="";
  5696. if (table.headers !=null) {
  5697. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  5698. }
  5699. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  5700. if (rows=="") {
  5701. headers=headers.substring(0, headers.length - 1);
  5702. }
  5703. return headers+rows;
  5704. },
  5705. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5706. var matrix=table.rows;
  5707. if (table.headers !=null) {
  5708. matrix.unshift(table.headers);
  5709. }
  5710. return matrix;
  5711. },
  5712. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5713. var value;
  5714. switch (coercionType) {
  5715. case Microsoft.Office.WebExtension.CoercionType.Table:
  5716. value=table;
  5717. break;
  5718. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5719. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  5720. break;
  5721. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  5722. value=null;
  5723. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  5724. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  5725. }
  5726. if (value==null) {
  5727. value=OSF.DDA.DataCoercion._tableToText(table);
  5728. }
  5729. break;
  5730. case Microsoft.Office.WebExtension.CoercionType.Text:
  5731. case Microsoft.Office.WebExtension.CoercionType.Html:
  5732. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5733. default:
  5734. value=OSF.DDA.DataCoercion._tableToText(table);
  5735. break;
  5736. }
  5737. return value;
  5738. },
  5739. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  5740. if (sourceType==undefined) {
  5741. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  5742. }
  5743. var value;
  5744. switch (sourceType) {
  5745. case Microsoft.Office.WebExtension.CoercionType.Table:
  5746. value=data;
  5747. break;
  5748. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5749. value=new Microsoft.Office.WebExtension.TableData(data);
  5750. break;
  5751. case Microsoft.Office.WebExtension.CoercionType.Text:
  5752. case Microsoft.Office.WebExtension.CoercionType.Html:
  5753. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5754. default:
  5755. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  5756. break;
  5757. }
  5758. return value;
  5759. }
  5760. };
  5761. })();
  5762. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5763. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5764. toHost: [
  5765. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  5766. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  5767. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  5768. ]
  5769. });
  5770. OSF.DDA.AsyncMethodNames.addNames({
  5771. GetSelectedDataAsync: "getSelectedDataAsync",
  5772. SetSelectedDataAsync: "setSelectedDataAsync"
  5773. });
  5774. (function () {
  5775. function processData(dataDescriptor, caller, callArgs) {
  5776. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  5777. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  5778. data=OSF.DDA.OMFactory.manufactureTableData(data);
  5779. }
  5780. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  5781. return data==undefined ? null : data;
  5782. }
  5783. OSF.DDA.AsyncMethodCalls.define({
  5784. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  5785. requiredArguments: [
  5786. {
  5787. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  5788. "enum": Microsoft.Office.WebExtension.CoercionType
  5789. }
  5790. ],
  5791. supportedOptions: [
  5792. {
  5793. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  5794. value: {
  5795. "enum": Microsoft.Office.WebExtension.ValueFormat,
  5796. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  5797. }
  5798. },
  5799. {
  5800. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  5801. value: {
  5802. "enum": Microsoft.Office.WebExtension.FilterType,
  5803. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  5804. }
  5805. }
  5806. ],
  5807. privateStateCallbacks: [],
  5808. onSucceeded: processData
  5809. });
  5810. OSF.DDA.AsyncMethodCalls.define({
  5811. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  5812. requiredArguments: [
  5813. {
  5814. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5815. "types": ["string", "object", "number", "boolean"]
  5816. }
  5817. ],
  5818. supportedOptions: [
  5819. {
  5820. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5821. value: {
  5822. "enum": Microsoft.Office.WebExtension.CoercionType,
  5823. "calculate": function (requiredArgs) {
  5824. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5825. }
  5826. }
  5827. },
  5828. {
  5829. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  5830. value: {
  5831. "types": ["number", "boolean"],
  5832. "defaultValue": false
  5833. }
  5834. },
  5835. {
  5836. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  5837. value: {
  5838. "types": ["number", "boolean"],
  5839. "defaultValue": false
  5840. }
  5841. },
  5842. {
  5843. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  5844. value: {
  5845. "types": ["number", "boolean"],
  5846. "defaultValue": false
  5847. }
  5848. },
  5849. {
  5850. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  5851. value: {
  5852. "types": ["number", "boolean"],
  5853. "defaultValue": false
  5854. }
  5855. }
  5856. ],
  5857. privateStateCallbacks: []
  5858. });
  5859. })();
  5860. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5861. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  5862. fromHost: [
  5863. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5864. ],
  5865. toHost: [
  5866. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5867. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  5868. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  5869. ]
  5870. });
  5871. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5872. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  5873. toHost: [
  5874. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5875. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  5876. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  5877. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  5878. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  5879. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 },
  5880. ]
  5881. });
  5882. OSF.DDA.SettingsManager={
  5883. SerializedSettings: "serializedSettings",
  5884. RefreshingSettings: "refreshingSettings",
  5885. DateJSONPrefix: "Date(",
  5886. DataJSONSuffix: ")",
  5887. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  5888. var ret={};
  5889. for (var key in settingsCollection) {
  5890. var value=settingsCollection[key];
  5891. try {
  5892. if (JSON) {
  5893. value=JSON.stringify(value, function dateReplacer(k, v) {
  5894. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  5895. });
  5896. }
  5897. else {
  5898. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  5899. }
  5900. ret[key]=value;
  5901. }
  5902. catch (ex) {
  5903. }
  5904. }
  5905. return ret;
  5906. },
  5907. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  5908. var ret={};
  5909. serializedSettings=serializedSettings || {};
  5910. for (var key in serializedSettings) {
  5911. var value=serializedSettings[key];
  5912. try {
  5913. if (JSON) {
  5914. value=JSON.parse(value, function dateReviver(k, v) {
  5915. var d;
  5916. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  5917. d=new Date(parseInt(v.slice(5, -1)));
  5918. if (d) {
  5919. return d;
  5920. }
  5921. }
  5922. return v;
  5923. });
  5924. }
  5925. else {
  5926. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  5927. }
  5928. ret[key]=value;
  5929. }
  5930. catch (ex) {
  5931. }
  5932. }
  5933. return ret;
  5934. }
  5935. };
  5936. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  5937. settings=settings || {};
  5938. var cacheSessionSettings=function (settings) {
  5939. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  5940. if (osfSessionStorage) {
  5941. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  5942. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  5943. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  5944. }
  5945. };
  5946. OSF.OUtil.defineEnumerableProperties(this, {
  5947. "get": {
  5948. value: function OSF_DDA_Settings$get(name) {
  5949. var e=Function._validateParams(arguments, [
  5950. { name: "name", type: String, mayBeNull: false }
  5951. ]);
  5952. if (e)
  5953. throw e;
  5954. var setting=settings[name];
  5955. return typeof (setting)==='undefined' ? null : setting;
  5956. }
  5957. },
  5958. "set": {
  5959. value: function OSF_DDA_Settings$set(name, value) {
  5960. var e=Function._validateParams(arguments, [
  5961. { name: "name", type: String, mayBeNull: false },
  5962. { name: "value", mayBeNull: true }
  5963. ]);
  5964. if (e)
  5965. throw e;
  5966. settings[name]=value;
  5967. cacheSessionSettings(settings);
  5968. }
  5969. },
  5970. "remove": {
  5971. value: function OSF_DDA_Settings$remove(name) {
  5972. var e=Function._validateParams(arguments, [
  5973. { name: "name", type: String, mayBeNull: false }
  5974. ]);
  5975. if (e)
  5976. throw e;
  5977. delete settings[name];
  5978. cacheSessionSettings(settings);
  5979. }
  5980. }
  5981. });
  5982. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  5983. };
  5984. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  5985. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  5986. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  5987. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  5988. };
  5989. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  5990. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5991. SettingsChanged: "settingsChanged"
  5992. });
  5993. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  5994. OSF.OUtil.defineEnumerableProperties(this, {
  5995. "type": {
  5996. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  5997. },
  5998. "settings": {
  5999. value: settingsInstance
  6000. }
  6001. });
  6002. };
  6003. OSF.DDA.AsyncMethodNames.addNames({
  6004. RefreshAsync: "refreshAsync",
  6005. SaveAsync: "saveAsync"
  6006. });
  6007. OSF.DDA.AsyncMethodCalls.define({
  6008. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6009. requiredArguments: [],
  6010. supportedOptions: [],
  6011. privateStateCallbacks: [
  6012. {
  6013. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6014. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6015. return settingsCollection;
  6016. }
  6017. }
  6018. ],
  6019. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6020. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6021. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6022. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6023. for (var setting in oldSettings) {
  6024. refreshingSettings.remove(setting);
  6025. }
  6026. for (var setting in newSettings) {
  6027. refreshingSettings.set(setting, newSettings[setting]);
  6028. }
  6029. return refreshingSettings;
  6030. }
  6031. });
  6032. OSF.DDA.AsyncMethodCalls.define({
  6033. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6034. requiredArguments: [],
  6035. supportedOptions: [
  6036. {
  6037. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6038. value: {
  6039. "types": ["boolean"],
  6040. "defaultValue": true
  6041. }
  6042. }
  6043. ],
  6044. privateStateCallbacks: [
  6045. {
  6046. name: OSF.DDA.SettingsManager.SerializedSettings,
  6047. value: function serializeSettings(settingsInstance, settingsCollection) {
  6048. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6049. }
  6050. }
  6051. ]
  6052. });
  6053. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6054. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6055. fromHost: [
  6056. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6057. ]
  6058. });
  6059. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6060. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6061. toHost: [
  6062. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  6063. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  6064. ]
  6065. });
  6066. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6067. Microsoft.Office.WebExtension.BindingType={
  6068. Table: "table",
  6069. Text: "text",
  6070. Matrix: "matrix"
  6071. };
  6072. OSF.DDA.BindingProperties={
  6073. Id: "BindingId",
  6074. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6075. };
  6076. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6077. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6078. Subset: "subset",
  6079. BindingProperties: "BindingProperties"
  6080. });
  6081. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6082. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6083. this._id=bindingId;
  6084. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6085. get: function () {
  6086. return errorCallback;
  6087. },
  6088. set: function (onError) {
  6089. var t=typeof onError;
  6090. if (t !="undefined" && t !="function") {
  6091. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6092. }
  6093. errorCallback=onError;
  6094. }
  6095. });
  6096. };
  6097. OSF.DDA.BindingPromise.prototype={
  6098. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6099. if (this.binding) {
  6100. if (onComplete)
  6101. onComplete(this.binding);
  6102. }
  6103. else {
  6104. if (!this._binding) {
  6105. var me=this;
  6106. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6107. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6108. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6109. value: asyncResult.value
  6110. });
  6111. if (onComplete)
  6112. onComplete(me.binding);
  6113. }
  6114. else {
  6115. if (me.onFail)
  6116. me.onFail(asyncResult);
  6117. }
  6118. });
  6119. }
  6120. }
  6121. return this;
  6122. },
  6123. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6124. var args=arguments;
  6125. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6126. return this;
  6127. },
  6128. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6129. var args=arguments;
  6130. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6131. return this;
  6132. },
  6133. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6134. var args=arguments;
  6135. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6136. return this;
  6137. },
  6138. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6139. var args=arguments;
  6140. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6141. return this;
  6142. }
  6143. };
  6144. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6145. this._eventDispatches=[];
  6146. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6147. value: docInstance
  6148. });
  6149. var am=OSF.DDA.AsyncMethodNames;
  6150. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6151. am.AddFromSelectionAsync,
  6152. am.AddFromNamedItemAsync,
  6153. am.GetAllAsync,
  6154. am.GetByIdAsync,
  6155. am.ReleaseByIdAsync
  6156. ]);
  6157. };
  6158. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6159. OSF.OUtil.defineEnumerableProperties(this, {
  6160. "document": { value: docInstance },
  6161. "id": { value: id }
  6162. });
  6163. };
  6164. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6165. OSF.OUtil.defineEnumerableProperties(this, {
  6166. "document": {
  6167. value: docInstance
  6168. },
  6169. "id": {
  6170. value: id
  6171. }
  6172. });
  6173. var am=OSF.DDA.AsyncMethodNames;
  6174. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6175. am.GetDataAsync,
  6176. am.SetDataAsync
  6177. ]);
  6178. var et=Microsoft.Office.WebExtension.EventType;
  6179. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6180. if (!bindingEventDispatches[id]) {
  6181. bindingEventDispatches[id]=new OSF.EventDispatch([
  6182. et.BindingSelectionChanged,
  6183. et.BindingDataChanged
  6184. ]);
  6185. }
  6186. var eventDispatch=bindingEventDispatches[id];
  6187. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6188. };
  6189. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6190. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6191. };
  6192. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6193. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6194. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6195. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6196. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6197. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6198. var binding;
  6199. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6200. case Microsoft.Office.WebExtension.BindingType.Text:
  6201. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6202. break;
  6203. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6204. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6205. break;
  6206. case Microsoft.Office.WebExtension.BindingType.Table:
  6207. var isExcelApp=function () {
  6208. return (OSF.DDA.ExcelDocument)
  6209. && (Microsoft.Office.WebExtension.context.document)
  6210. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6211. };
  6212. var tableBindingObject;
  6213. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6214. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6215. }
  6216. else {
  6217. tableBindingObject=OSF.DDA.TableBinding;
  6218. }
  6219. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6220. break;
  6221. default:
  6222. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6223. }
  6224. return binding;
  6225. };
  6226. OSF.DDA.AsyncMethodNames.addNames({
  6227. AddFromSelectionAsync: "addFromSelectionAsync",
  6228. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6229. GetAllAsync: "getAllAsync",
  6230. GetByIdAsync: "getByIdAsync",
  6231. ReleaseByIdAsync: "releaseByIdAsync",
  6232. GetDataAsync: "getDataAsync",
  6233. SetDataAsync: "setDataAsync"
  6234. });
  6235. (function () {
  6236. function processBinding(bindingDescriptor) {
  6237. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6238. }
  6239. function getObjectId(obj) { return obj.id; }
  6240. function processData(dataDescriptor, caller, callArgs) {
  6241. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6242. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6243. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6244. }
  6245. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6246. return data==undefined ? null : data;
  6247. }
  6248. OSF.DDA.AsyncMethodCalls.define({
  6249. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  6250. requiredArguments: [
  6251. {
  6252. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6253. "enum": Microsoft.Office.WebExtension.BindingType
  6254. }
  6255. ],
  6256. supportedOptions: [{
  6257. name: Microsoft.Office.WebExtension.Parameters.Id,
  6258. value: {
  6259. "types": ["string"],
  6260. "calculate": OSF.DDA.generateBindingId
  6261. }
  6262. },
  6263. {
  6264. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6265. value: {
  6266. "types": ["object"],
  6267. "defaultValue": null
  6268. }
  6269. }
  6270. ],
  6271. privateStateCallbacks: [],
  6272. onSucceeded: processBinding
  6273. });
  6274. OSF.DDA.AsyncMethodCalls.define({
  6275. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  6276. requiredArguments: [{
  6277. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  6278. "types": ["string"]
  6279. },
  6280. {
  6281. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6282. "enum": Microsoft.Office.WebExtension.BindingType
  6283. }
  6284. ],
  6285. supportedOptions: [{
  6286. name: Microsoft.Office.WebExtension.Parameters.Id,
  6287. value: {
  6288. "types": ["string"],
  6289. "calculate": OSF.DDA.generateBindingId
  6290. }
  6291. },
  6292. {
  6293. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6294. value: {
  6295. "types": ["object"],
  6296. "defaultValue": null
  6297. }
  6298. }
  6299. ],
  6300. privateStateCallbacks: [
  6301. {
  6302. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  6303. value: function () { return true; }
  6304. }
  6305. ],
  6306. onSucceeded: processBinding
  6307. });
  6308. OSF.DDA.AsyncMethodCalls.define({
  6309. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  6310. requiredArguments: [],
  6311. supportedOptions: [],
  6312. privateStateCallbacks: [],
  6313. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  6314. });
  6315. OSF.DDA.AsyncMethodCalls.define({
  6316. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  6317. requiredArguments: [
  6318. {
  6319. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6320. "types": ["string"]
  6321. }
  6322. ],
  6323. supportedOptions: [],
  6324. privateStateCallbacks: [],
  6325. onSucceeded: processBinding
  6326. });
  6327. OSF.DDA.AsyncMethodCalls.define({
  6328. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  6329. requiredArguments: [
  6330. {
  6331. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6332. "types": ["string"]
  6333. }
  6334. ],
  6335. supportedOptions: [],
  6336. privateStateCallbacks: [],
  6337. onSucceeded: function (response, caller, callArgs) {
  6338. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  6339. delete caller._eventDispatches[id];
  6340. }
  6341. });
  6342. OSF.DDA.AsyncMethodCalls.define({
  6343. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  6344. requiredArguments: [],
  6345. supportedOptions: [{
  6346. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6347. value: {
  6348. "enum": Microsoft.Office.WebExtension.CoercionType,
  6349. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  6350. }
  6351. },
  6352. {
  6353. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6354. value: {
  6355. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6356. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6357. }
  6358. },
  6359. {
  6360. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6361. value: {
  6362. "enum": Microsoft.Office.WebExtension.FilterType,
  6363. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6364. }
  6365. },
  6366. {
  6367. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6368. value: {
  6369. "types": ["object", "string"],
  6370. "defaultValue": null
  6371. }
  6372. },
  6373. {
  6374. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6375. value: {
  6376. "types": ["object"],
  6377. "defaultValue": null
  6378. }
  6379. },
  6380. {
  6381. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6382. value: {
  6383. "types": ["number"],
  6384. "defaultValue": 0
  6385. }
  6386. },
  6387. {
  6388. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6389. value: {
  6390. "types": ["number"],
  6391. "defaultValue": 0
  6392. }
  6393. },
  6394. {
  6395. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  6396. value: {
  6397. "types": ["number"],
  6398. "defaultValue": 0
  6399. }
  6400. },
  6401. {
  6402. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  6403. value: {
  6404. "types": ["number"],
  6405. "defaultValue": 0
  6406. }
  6407. }
  6408. ],
  6409. checkCallArgs: function (callArgs, caller, stateInfo) {
  6410. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6411. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  6412. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  6413. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  6414. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6415. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6416. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  6417. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  6418. }
  6419. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6420. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6421. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  6422. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  6423. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  6424. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6425. }
  6426. return callArgs;
  6427. },
  6428. privateStateCallbacks: [
  6429. {
  6430. name: Microsoft.Office.WebExtension.Parameters.Id,
  6431. value: getObjectId
  6432. }
  6433. ],
  6434. onSucceeded: processData
  6435. });
  6436. OSF.DDA.AsyncMethodCalls.define({
  6437. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  6438. requiredArguments: [
  6439. {
  6440. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6441. "types": ["string", "object", "number", "boolean"]
  6442. }
  6443. ],
  6444. supportedOptions: [{
  6445. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6446. value: {
  6447. "enum": Microsoft.Office.WebExtension.CoercionType,
  6448. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  6449. }
  6450. },
  6451. {
  6452. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6453. value: {
  6454. "types": ["object", "string"],
  6455. "defaultValue": null
  6456. }
  6457. },
  6458. {
  6459. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6460. value: {
  6461. "types": ["object"],
  6462. "defaultValue": null
  6463. }
  6464. },
  6465. {
  6466. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6467. value: {
  6468. "types": ["number"],
  6469. "defaultValue": 0
  6470. }
  6471. },
  6472. {
  6473. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6474. value: {
  6475. "types": ["number"],
  6476. "defaultValue": 0
  6477. }
  6478. }
  6479. ],
  6480. checkCallArgs: function (callArgs, caller, stateInfo) {
  6481. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6482. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  6483. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6484. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6485. }
  6486. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6487. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6488. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  6489. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6490. }
  6491. return callArgs;
  6492. },
  6493. privateStateCallbacks: [
  6494. {
  6495. name: Microsoft.Office.WebExtension.Parameters.Id,
  6496. value: getObjectId
  6497. }
  6498. ]
  6499. });
  6500. })();
  6501. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6502. RowCount: "BindingRowCount",
  6503. ColumnCount: "BindingColumnCount",
  6504. HasHeaders: "HasHeaders"
  6505. });
  6506. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  6507. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  6508. OSF.OUtil.defineEnumerableProperties(this, {
  6509. "type": {
  6510. value: Microsoft.Office.WebExtension.BindingType.Matrix
  6511. },
  6512. "rowCount": {
  6513. value: rows ? rows : 0
  6514. },
  6515. "columnCount": {
  6516. value: cols ? cols : 0
  6517. }
  6518. });
  6519. };
  6520. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  6521. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6522. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  6523. fromHost: [
  6524. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  6525. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  6526. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  6527. ],
  6528. isComplexType: true
  6529. });
  6530. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6531. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  6532. toHost: [
  6533. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  6534. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  6535. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  6536. ],
  6537. invertible: true
  6538. });
  6539. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6540. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  6541. fromHost: [
  6542. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6543. ],
  6544. toHost: [
  6545. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6546. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  6547. ]
  6548. });
  6549. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6550. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  6551. fromHost: [
  6552. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6553. ],
  6554. toHost: [
  6555. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  6556. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  6557. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  6558. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  6559. ]
  6560. });
  6561. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6562. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  6563. toHost: [
  6564. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6565. ]
  6566. });
  6567. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6568. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  6569. fromHost: [
  6570. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6571. ],
  6572. toHost: [
  6573. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6574. ]
  6575. });
  6576. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6577. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  6578. fromHost: [
  6579. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6580. ]
  6581. });
  6582. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6583. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  6584. fromHost: [
  6585. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6586. ],
  6587. toHost: [
  6588. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6589. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6590. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  6591. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  6592. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  6593. ]
  6594. });
  6595. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6596. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  6597. toHost: [
  6598. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6599. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6600. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  6601. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  6602. ]
  6603. });
  6604. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6605. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  6606. fromHost: [
  6607. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  6608. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  6609. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  6610. ],
  6611. isComplexType: true
  6612. });
  6613. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6614. type: OSF.DDA.PropertyDescriptors.Subset,
  6615. toHost: [
  6616. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  6617. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  6618. ],
  6619. canonical: true,
  6620. isComplexType: true
  6621. });
  6622. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6623. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  6624. toHost: [
  6625. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  6626. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  6627. ],
  6628. canonical: true,
  6629. isComplexType: true
  6630. });
  6631. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6632. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  6633. toHost: [
  6634. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  6635. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  6636. ],
  6637. canonical: true,
  6638. isComplexType: true
  6639. });
  6640. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6641. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  6642. toHost: [
  6643. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6644. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6645. ]
  6646. });
  6647. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6648. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  6649. toHost: [
  6650. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6651. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6652. ]
  6653. });
  6654. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6655. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  6656. toHost: [
  6657. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6658. ]
  6659. });
  6660. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  6661. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6662. RowCount: "BindingRowCount",
  6663. ColumnCount: "BindingColumnCount",
  6664. HasHeaders: "HasHeaders"
  6665. });
  6666. OSF.DDA.TableDataProperties={
  6667. TableRows: "TableRows",
  6668. TableHeaders: "TableHeaders"
  6669. };
  6670. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  6671. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  6672. OSF.OUtil.defineEnumerableProperties(this, {
  6673. "type": {
  6674. value: Microsoft.Office.WebExtension.BindingType.Table
  6675. },
  6676. "rowCount": {
  6677. value: rows ? rows : 0
  6678. },
  6679. "columnCount": {
  6680. value: cols ? cols : 0
  6681. },
  6682. "hasHeaders": {
  6683. value: hasHeaders ? hasHeaders : false
  6684. }
  6685. });
  6686. var am=OSF.DDA.AsyncMethodNames;
  6687. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6688. am.AddRowsAsync,
  6689. am.AddColumnsAsync,
  6690. am.DeleteAllDataValuesAsync
  6691. ]);
  6692. };
  6693. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  6694. OSF.DDA.AsyncMethodNames.addNames({
  6695. AddRowsAsync: "addRowsAsync",
  6696. AddColumnsAsync: "addColumnsAsync",
  6697. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  6698. });
  6699. (function () {
  6700. function getObjectId(obj) { return obj.id; }
  6701. OSF.DDA.AsyncMethodCalls.define({
  6702. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  6703. requiredArguments: [
  6704. {
  6705. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6706. "types": ["object"]
  6707. }
  6708. ],
  6709. supportedOptions: [],
  6710. privateStateCallbacks: [
  6711. {
  6712. name: Microsoft.Office.WebExtension.Parameters.Id,
  6713. value: getObjectId
  6714. }
  6715. ]
  6716. });
  6717. OSF.DDA.AsyncMethodCalls.define({
  6718. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  6719. requiredArguments: [
  6720. {
  6721. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6722. "types": ["object"]
  6723. }
  6724. ],
  6725. supportedOptions: [],
  6726. privateStateCallbacks: [
  6727. {
  6728. name: Microsoft.Office.WebExtension.Parameters.Id,
  6729. value: getObjectId
  6730. }
  6731. ]
  6732. });
  6733. OSF.DDA.AsyncMethodCalls.define({
  6734. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  6735. requiredArguments: [],
  6736. supportedOptions: [],
  6737. privateStateCallbacks: [
  6738. {
  6739. name: Microsoft.Office.WebExtension.Parameters.Id,
  6740. value: getObjectId
  6741. }
  6742. ]
  6743. });
  6744. })();
  6745. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  6746. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  6747. OSF.OUtil.defineEnumerableProperty(this, "type", {
  6748. value: Microsoft.Office.WebExtension.BindingType.Text
  6749. });
  6750. };
  6751. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  6752. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  6753. OSF.DDA.AsyncMethodCalls.define({
  6754. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  6755. requiredArguments: [
  6756. {
  6757. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6758. "enum": Microsoft.Office.WebExtension.BindingType
  6759. }
  6760. ],
  6761. supportedOptions: [{
  6762. name: Microsoft.Office.WebExtension.Parameters.Id,
  6763. value: {
  6764. "types": ["string"],
  6765. "calculate": OSF.DDA.generateBindingId
  6766. }
  6767. },
  6768. {
  6769. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  6770. value: {
  6771. "types": ["string"],
  6772. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  6773. }
  6774. },
  6775. {
  6776. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  6777. value: {
  6778. "types": ["object"],
  6779. "defaultValue": null
  6780. }
  6781. }
  6782. ],
  6783. privateStateCallbacks: [],
  6784. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  6785. });
  6786. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6787. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  6788. fromHost: [
  6789. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6790. ],
  6791. toHost: [
  6792. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6793. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 },
  6794. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 }
  6795. ]
  6796. });
  6797. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  6798. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  6799. OSF.OUtil.defineEnumerableProperties(this, {
  6800. "type": {
  6801. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  6802. },
  6803. "document": {
  6804. value: docInstance
  6805. }
  6806. });
  6807. };
  6808. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  6809. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6810. BindingSelectionChanged: "bindingSelectionChanged",
  6811. BindingDataChanged: "bindingDataChanged"
  6812. });
  6813. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  6814. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  6815. OSF.OUtil.defineEnumerableProperties(this, {
  6816. "type": {
  6817. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  6818. },
  6819. "binding": {
  6820. value: bindingInstance
  6821. }
  6822. });
  6823. for (var prop in subset) {
  6824. OSF.OUtil.defineEnumerableProperty(this, prop, {
  6825. value: subset[prop]
  6826. });
  6827. }
  6828. };
  6829. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  6830. OSF.OUtil.defineEnumerableProperties(this, {
  6831. "type": {
  6832. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  6833. },
  6834. "binding": {
  6835. value: bindingInstance
  6836. }
  6837. });
  6838. };
  6839. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6840. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  6841. fromHost: [
  6842. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  6843. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  6844. ],
  6845. isComplexType: true
  6846. });
  6847. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6848. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  6849. fromHost: [
  6850. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6851. ],
  6852. isComplexType: true
  6853. });
  6854. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6855. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  6856. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6857. });
  6858. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  6859. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6860. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  6861. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  6862. });
  6863. Microsoft.Office.WebExtension.GoToType={
  6864. Binding: "binding",
  6865. NamedItem: "namedItem",
  6866. Slide: "slide",
  6867. Index: "index"
  6868. };
  6869. Microsoft.Office.WebExtension.SelectionMode={
  6870. Default: "default",
  6871. Selected: "selected",
  6872. None: "none"
  6873. };
  6874. Microsoft.Office.WebExtension.Index={
  6875. First: "first",
  6876. Last: "last",
  6877. Next: "next",
  6878. Previous: "previous"
  6879. };
  6880. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  6881. OSF.DDA.AsyncMethodCalls.define({
  6882. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  6883. requiredArguments: [{
  6884. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6885. "types": ["string", "number"]
  6886. },
  6887. {
  6888. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  6889. "enum": Microsoft.Office.WebExtension.GoToType
  6890. }
  6891. ],
  6892. supportedOptions: [
  6893. {
  6894. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6895. value: {
  6896. "enum": Microsoft.Office.WebExtension.SelectionMode,
  6897. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  6898. }
  6899. }
  6900. ]
  6901. });
  6902. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6903. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  6904. toHost: [
  6905. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  6906. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  6907. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  6908. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  6909. ]
  6910. });
  6911. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6912. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  6913. toHost: [
  6914. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  6915. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  6916. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  6917. ]
  6918. });
  6919. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6920. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  6921. toHost: [
  6922. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6923. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  6924. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  6925. ]
  6926. });
  6927. OSF.DDA.AsyncMethodNames.addNames({
  6928. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  6929. });
  6930. OSF.DDA.AsyncMethodCalls.define({
  6931. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  6932. requiredArguments: [
  6933. {
  6934. name: Microsoft.Office.WebExtension.Parameters.Data,
  6935. types: ["object"]
  6936. }
  6937. ],
  6938. supportedOptions: []
  6939. });
  6940. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  6941. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6942. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  6943. toHost: [
  6944. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  6945. ],
  6946. fromHost: [
  6947. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6948. ]
  6949. });
  6950. OSF.DDA.FilePropertiesDescriptor={
  6951. Url: "Url"
  6952. };
  6953. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6954. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  6955. });
  6956. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  6957. OSF.OUtil.defineEnumerableProperties(this, {
  6958. "url": {
  6959. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  6960. }
  6961. });
  6962. };
  6963. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  6964. OSF.DDA.AsyncMethodCalls.define({
  6965. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  6966. fromHost: [
  6967. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  6968. ],
  6969. requiredArguments: [],
  6970. supportedOptions: [],
  6971. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  6972. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  6973. }
  6974. });
  6975. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6976. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  6977. fromHost: [
  6978. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  6979. ],
  6980. isComplexType: true
  6981. });
  6982. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6983. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  6984. fromHost: [
  6985. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6986. ]
  6987. });
  6988. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  6989. var am=OSF.DDA.AsyncMethodNames;
  6990. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6991. am.ClearFormatsAsync,
  6992. am.SetTableOptionsAsync,
  6993. am.SetFormatsAsync
  6994. ]);
  6995. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  6996. OSF.OUtil.finalizeProperties(this);
  6997. };
  6998. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  6999. (function () {
  7000. OSF.DDA.AsyncMethodCalls.define({
  7001. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7002. requiredArguments: [
  7003. {
  7004. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7005. "types": ["string", "object", "number", "boolean"]
  7006. }
  7007. ],
  7008. supportedOptions: [{
  7009. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7010. value: {
  7011. "enum": Microsoft.Office.WebExtension.CoercionType,
  7012. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7013. }
  7014. },
  7015. {
  7016. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7017. value: {
  7018. "types": ["object"],
  7019. "defaultValue": []
  7020. }
  7021. },
  7022. {
  7023. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7024. value: {
  7025. "types": ["object"],
  7026. "defaultValue": []
  7027. }
  7028. }
  7029. ],
  7030. privateStateCallbacks: []
  7031. });
  7032. OSF.DDA.AsyncMethodCalls.define({
  7033. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7034. requiredArguments: [
  7035. {
  7036. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7037. "types": ["string", "object", "number", "boolean"]
  7038. }
  7039. ],
  7040. supportedOptions: [{
  7041. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7042. value: {
  7043. "enum": Microsoft.Office.WebExtension.CoercionType,
  7044. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7045. }
  7046. },
  7047. {
  7048. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7049. value: {
  7050. "types": ["object", "string"],
  7051. "defaultValue": null
  7052. }
  7053. },
  7054. {
  7055. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7056. value: {
  7057. "types": ["object"],
  7058. "defaultValue": null
  7059. }
  7060. },
  7061. {
  7062. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7063. value: {
  7064. "types": ["number"],
  7065. "defaultValue": 0
  7066. }
  7067. },
  7068. {
  7069. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7070. value: {
  7071. "types": ["number"],
  7072. "defaultValue": 0
  7073. }
  7074. },
  7075. {
  7076. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7077. value: {
  7078. "types": ["object"],
  7079. "defaultValue": []
  7080. }
  7081. },
  7082. {
  7083. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7084. value: {
  7085. "types": ["object"],
  7086. "defaultValue": []
  7087. }
  7088. }
  7089. ],
  7090. checkCallArgs: function (callArgs, caller, stateInfo) {
  7091. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7092. if (callArgs[Parameters.StartRow]==0 &&
  7093. callArgs[Parameters.StartColumn]==0 &&
  7094. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7095. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7096. delete callArgs[Parameters.StartRow];
  7097. delete callArgs[Parameters.StartColumn];
  7098. delete callArgs[Parameters.CellFormat];
  7099. delete callArgs[Parameters.TableOptions];
  7100. }
  7101. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7102. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7103. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7104. callArgs[Parameters.CellFormat] ||
  7105. callArgs[Parameters.TableOptions])) {
  7106. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7107. }
  7108. return callArgs;
  7109. },
  7110. privateStateCallbacks: [
  7111. {
  7112. name: Microsoft.Office.WebExtension.Parameters.Id,
  7113. value: function (obj) { return obj.id; }
  7114. }
  7115. ]
  7116. });
  7117. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7118. var args=arguments;
  7119. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7120. return this;
  7121. },
  7122. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7123. var args=arguments;
  7124. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7125. return this;
  7126. },
  7127. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7128. var args=arguments;
  7129. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7130. return this;
  7131. };
  7132. })();
  7133. (function () {
  7134. function getObjectId(obj) { return obj.id; }
  7135. OSF.DDA.AsyncMethodNames.addNames({
  7136. ClearFormatsAsync: "clearFormatsAsync",
  7137. SetTableOptionsAsync: "setTableOptionsAsync",
  7138. SetFormatsAsync: "setFormatsAsync"
  7139. });
  7140. OSF.DDA.AsyncMethodCalls.define({
  7141. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7142. requiredArguments: [],
  7143. supportedOptions: [],
  7144. privateStateCallbacks: [
  7145. {
  7146. name: Microsoft.Office.WebExtension.Parameters.Id,
  7147. value: getObjectId
  7148. }
  7149. ]
  7150. });
  7151. OSF.DDA.AsyncMethodCalls.define({
  7152. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7153. requiredArguments: [
  7154. {
  7155. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7156. "defaultValue": []
  7157. }
  7158. ],
  7159. privateStateCallbacks: [
  7160. {
  7161. name: Microsoft.Office.WebExtension.Parameters.Id,
  7162. value: getObjectId
  7163. }
  7164. ]
  7165. });
  7166. OSF.DDA.AsyncMethodCalls.define({
  7167. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7168. requiredArguments: [
  7169. {
  7170. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7171. "defaultValue": []
  7172. }
  7173. ],
  7174. privateStateCallbacks: [
  7175. {
  7176. name: Microsoft.Office.WebExtension.Parameters.Id,
  7177. value: getObjectId
  7178. }
  7179. ]
  7180. });
  7181. })();
  7182. Microsoft.Office.WebExtension.Table={
  7183. All: 0,
  7184. Data: 1,
  7185. Headers: 2
  7186. };
  7187. (function () {
  7188. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7189. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  7190. toHost: [
  7191. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  7192. ]
  7193. });
  7194. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7195. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  7196. toHost: [
  7197. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7198. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 },
  7199. ]
  7200. });
  7201. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7202. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  7203. toHost: [
  7204. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7205. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 },
  7206. ]
  7207. });
  7208. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7209. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  7210. toHost: [
  7211. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  7212. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  7213. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  7214. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  7215. ]
  7216. });
  7217. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7218. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7219. toHost: [
  7220. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7221. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  7222. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  7223. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  7224. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  7225. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  7226. ]
  7227. });
  7228. var tableOptionProperties={
  7229. headerRow: 0,
  7230. bandedRows: 1,
  7231. firstColumn: 2,
  7232. lastColumn: 3,
  7233. bandedColumns: 4,
  7234. filterButton: 5,
  7235. style: 6,
  7236. totalRow: 7
  7237. };
  7238. var cellProperties={
  7239. row: 0,
  7240. column: 1
  7241. };
  7242. var formatProperties={
  7243. alignHorizontal: { text: "alignHorizontal", type: 1 },
  7244. alignVertical: { text: "alignVertical", type: 2 },
  7245. backgroundColor: { text: "backgroundColor", type: 101 },
  7246. borderStyle: { text: "borderStyle", type: 201 },
  7247. borderColor: { text: "borderColor", type: 202 },
  7248. borderTopStyle: { text: "borderTopStyle", type: 203 },
  7249. borderTopColor: { text: "borderTopColor", type: 204 },
  7250. borderBottomStyle: { text: "borderBottomStyle", type: 205 },
  7251. borderBottomColor: { text: "borderBottomColor", type: 206 },
  7252. borderLeftStyle: { text: "borderLeftStyle", type: 207 },
  7253. borderLeftColor: { text: "borderLeftColor", type: 208 },
  7254. borderRightStyle: { text: "borderRightStyle", type: 209 },
  7255. borderRightColor: { text: "borderRightColor", type: 210 },
  7256. borderOutlineStyle: { text: "borderOutlineStyle", type: 211 },
  7257. borderOutlineColor: { text: "borderOutlineColor", type: 212 },
  7258. borderInlineStyle: { text: "borderInlineStyle", type: 213 },
  7259. borderInlineColor: { text: "borderInlineColor", type: 214 },
  7260. fontFamily: { text: "fontFamily", type: 301 },
  7261. fontStyle: { text: "fontStyle", type: 302 },
  7262. fontSize: { text: "fontSize", type: 303 },
  7263. fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 },
  7264. fontColor: { text: "fontColor", type: 305 },
  7265. fontDirection: { text: "fontDirection", type: 306 },
  7266. fontStrikethrough: { text: "fontStrikethrough", type: 307 },
  7267. fontSuperscript: { text: "fontSuperscript", type: 308 },
  7268. fontSubscript: { text: "fontSubscript", type: 309 },
  7269. fontNormal: { text: "fontNormal", type: 310 },
  7270. indentLeft: { text: "indentLeft", type: 401 },
  7271. indentRight: { text: "indentRight", type: 402 },
  7272. numberFormat: { text: "numberFormat", type: 501 },
  7273. width: { text: "width", type: 701 },
  7274. height: { text: "height", type: 702 },
  7275. wrapping: { text: "wrapping", type: 703 }
  7276. };
  7277. var borderStyleSet=[
  7278. { name: "none", value: 0 },
  7279. { name: "thin", value: 1 },
  7280. { name: "medium", value: 2 },
  7281. { name: "dashed", value: 3 },
  7282. { name: "dotted", value: 4 },
  7283. { name: "thick", value: 5 },
  7284. { name: "double", value: 6 },
  7285. { name: "hair", value: 7 },
  7286. { name: "medium dashed", value: 8 },
  7287. { name: "dash dot", value: 9 },
  7288. { name: "medium dash dot", value: 10 },
  7289. { name: "dash dot dot", value: 11 },
  7290. { name: "medium dash dot dot", value: 12 },
  7291. { name: "slant dash dot", value: 13 },
  7292. ];
  7293. var colorSet=[
  7294. { name: "none", value: 0 },
  7295. { name: "black", value: 1 },
  7296. { name: "blue", value: 2 },
  7297. { name: "gray", value: 3 },
  7298. { name: "green", value: 4 },
  7299. { name: "orange", value: 5 },
  7300. { name: "pink", value: 6 },
  7301. { name: "purple", value: 7 },
  7302. { name: "red", value: 8 },
  7303. { name: "teal", value: 9 },
  7304. { name: "turquoise", value: 10 },
  7305. { name: "violet", value: 11 },
  7306. { name: "white", value: 12 },
  7307. { name: "yellow", value: 13 },
  7308. { name: "automatic", value: 14 },
  7309. ];
  7310. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7311. ns.define({
  7312. type: formatProperties.alignHorizontal.text,
  7313. toHost: [
  7314. { name: "general", value: 0 },
  7315. { name: "left", value: 1 },
  7316. { name: "center", value: 2 },
  7317. { name: "right", value: 3 },
  7318. { name: "fill", value: 4 },
  7319. { name: "justify", value: 5 },
  7320. { name: "center across selection", value: 6 },
  7321. { name: "distributed", value: 7 },
  7322. ] });
  7323. ns.define({
  7324. type: formatProperties.alignVertical.text,
  7325. toHost: [
  7326. { name: "top", value: 0 },
  7327. { name: "center", value: 1 },
  7328. { name: "bottom", value: 2 },
  7329. { name: "justify", value: 3 },
  7330. { name: "distributed", value: 4 },
  7331. ] });
  7332. ns.define({
  7333. type: formatProperties.backgroundColor.text,
  7334. toHost: colorSet
  7335. });
  7336. ns.define({
  7337. type: formatProperties.borderStyle.text,
  7338. toHost: borderStyleSet
  7339. });
  7340. ns.define({
  7341. type: formatProperties.borderColor.text,
  7342. toHost: colorSet
  7343. });
  7344. ns.define({
  7345. type: formatProperties.borderTopStyle.text,
  7346. toHost: borderStyleSet
  7347. });
  7348. ns.define({
  7349. type: formatProperties.borderTopColor.text,
  7350. toHost: colorSet
  7351. });
  7352. ns.define({
  7353. type: formatProperties.borderBottomStyle.text,
  7354. toHost: borderStyleSet
  7355. });
  7356. ns.define({
  7357. type: formatProperties.borderBottomColor.text,
  7358. toHost: colorSet
  7359. });
  7360. ns.define({
  7361. type: formatProperties.borderLeftStyle.text,
  7362. toHost: borderStyleSet
  7363. });
  7364. ns.define({
  7365. type: formatProperties.borderLeftColor.text,
  7366. toHost: colorSet
  7367. });
  7368. ns.define({
  7369. type: formatProperties.borderRightStyle.text,
  7370. toHost: borderStyleSet
  7371. });
  7372. ns.define({
  7373. type: formatProperties.borderRightColor.text,
  7374. toHost: colorSet
  7375. });
  7376. ns.define({
  7377. type: formatProperties.borderOutlineStyle.text,
  7378. toHost: borderStyleSet
  7379. });
  7380. ns.define({
  7381. type: formatProperties.borderOutlineColor.text,
  7382. toHost: colorSet
  7383. });
  7384. ns.define({
  7385. type: formatProperties.borderInlineStyle.text,
  7386. toHost: borderStyleSet
  7387. });
  7388. ns.define({
  7389. type: formatProperties.borderInlineColor.text,
  7390. toHost: colorSet
  7391. });
  7392. ns.define({
  7393. type: formatProperties.fontStyle.text,
  7394. toHost: [
  7395. { name: "regular", value: 0 },
  7396. { name: "italic", value: 1 },
  7397. { name: "bold", value: 2 },
  7398. { name: "bold italic", value: 3 },
  7399. ] });
  7400. ns.define({
  7401. type: formatProperties.fontUnderlineStyle.text,
  7402. toHost: [
  7403. { name: "none", value: 0 },
  7404. { name: "single", value: 1 },
  7405. { name: "double", value: 2 },
  7406. { name: "single accounting", value: 3 },
  7407. { name: "double accounting", value: 4 },
  7408. ] });
  7409. ns.define({
  7410. type: formatProperties.fontColor.text,
  7411. toHost: colorSet
  7412. });
  7413. ns.define({
  7414. type: formatProperties.fontDirection.text,
  7415. toHost: [
  7416. { name: "context", value: 0 },
  7417. { name: "left-to-right", value: 1 },
  7418. { name: "right-to-left", value: 2 },
  7419. ] });
  7420. ns.define({
  7421. type: formatProperties.width.text,
  7422. toHost: [
  7423. { name: "auto fit", value: -1 },
  7424. ] });
  7425. ns.define({
  7426. type: formatProperties.height.text,
  7427. toHost: [
  7428. { name: "auto fit", value: -1 },
  7429. ] });
  7430. ns.define({
  7431. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7432. toHost: [
  7433. { name: "headerRow", value: 0 },
  7434. { name: "bandedRows", value: 1 },
  7435. { name: "firstColumn", value: 2 },
  7436. { name: "lastColumn", value: 3 },
  7437. { name: "bandedColumns", value: 4 },
  7438. { name: "filterButton", value: 5 },
  7439. { name: "style", value: 6 },
  7440. { name: "totalRow", value: 7 }
  7441. ] });
  7442. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  7443. toHost: function (data) {
  7444. for (var entry in data) {
  7445. if (data[entry].format) {
  7446. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  7447. }
  7448. }
  7449. return data;
  7450. },
  7451. fromHost: function (args) {
  7452. return args;
  7453. }
  7454. };
  7455. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, {
  7456. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  7457. var textCells="cells";
  7458. var textFormat="format";
  7459. var posCells=0;
  7460. var posFormat=1;
  7461. var ret=[];
  7462. for (var index in cellFormats) {
  7463. var cfOld=cellFormats[index];
  7464. var cfNew=[];
  7465. if (typeof (cfOld[textCells]) !=='undefined') {
  7466. var cellsOld=cfOld[textCells];
  7467. var cellsNew;
  7468. if (typeof cfOld[textCells]==="object") {
  7469. cellsNew=[];
  7470. for (var entry in cellsOld) {
  7471. if (typeof (cellProperties[entry]) !=='undefined') {
  7472. cellsNew[cellProperties[entry]]=cellsOld[entry];
  7473. }
  7474. }
  7475. }
  7476. else {
  7477. cellsNew=cellsOld;
  7478. }
  7479. cfNew[posCells]=cellsNew;
  7480. }
  7481. if (cfOld[textFormat]) {
  7482. var formatOld=cfOld[textFormat];
  7483. var formatNew=[];
  7484. for (var entry2 in formatOld) {
  7485. if (typeof (formatProperties[entry2]) !=='undefined') {
  7486. formatNew.push([
  7487. formatProperties[entry2].type,
  7488. formatOld[entry2]
  7489. ]);
  7490. }
  7491. }
  7492. cfNew[posFormat]=formatNew;
  7493. }
  7494. ret[index]=cfNew;
  7495. }
  7496. return ret;
  7497. },
  7498. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  7499. return hostArgs;
  7500. }
  7501. });
  7502. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, {
  7503. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  7504. var ret=[];
  7505. for (var entry in tableOptions) {
  7506. if (typeof (tableOptionProperties[entry]) !=='undefined') {
  7507. ret[tableOptionProperties[entry]]=tableOptions[entry];
  7508. }
  7509. }
  7510. return ret;
  7511. },
  7512. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  7513. return hostArgs;
  7514. }
  7515. });
  7516. })();
  7517. var OfficeExt;
  7518. (function (OfficeExt) {
  7519. var AppCommand;
  7520. (function (AppCommand) {
  7521. var AppCommandManager=(function () {
  7522. function AppCommandManager() {
  7523. var _this=this;
  7524. this._pseudoDocument=null;
  7525. this._eventDispatch=null;
  7526. this._processAppCommandInvocation=function (args) {
  7527. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  7528. if (verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  7529. _this._invokeAppCommandCompletedMethod(args.appCommandId, verifyResult.errorCode, "");
  7530. return;
  7531. }
  7532. var eventObj=_this._constructEventObjectForCallback(args);
  7533. if (eventObj) {
  7534. window.setTimeout(function () { verifyResult.callback(eventObj); }, 0);
  7535. }
  7536. else {
  7537. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError, "");
  7538. }
  7539. };
  7540. }
  7541. AppCommandManager.initializeOsfDda=function () {
  7542. OSF.DDA.AsyncMethodNames.addNames({
  7543. AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"
  7544. });
  7545. OSF.DDA.AsyncMethodCalls.define({
  7546. method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  7547. requiredArguments: [{
  7548. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7549. "types": ["string"]
  7550. },
  7551. {
  7552. "name": Microsoft.Office.WebExtension.Parameters.Status,
  7553. "types": ["number"]
  7554. },
  7555. {
  7556. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7557. "types": ["string"]
  7558. }
  7559. ]
  7560. });
  7561. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  7562. AppCommandInvokedEvent: "AppCommandInvokedEvent"
  7563. });
  7564. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  7565. AppCommandInvoked: "appCommandInvoked"
  7566. });
  7567. OSF.OUtil.setNamespace("AppCommand", OSF.DDA);
  7568. OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs;
  7569. };
  7570. AppCommandManager.prototype.initializeAndChangeOnce=function (callback) {
  7571. AppCommand.registerDdaFacade();
  7572. this._pseudoDocument={};
  7573. OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument, [
  7574. OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  7575. ]);
  7576. this._eventDispatch=new OSF.EventDispatch([
  7577. Microsoft.Office.WebExtension.EventType.AppCommandInvoked,
  7578. ]);
  7579. var onRegisterCompleted=function (result) {
  7580. if (callback) {
  7581. if (result.status=="succeeded") {
  7582. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  7583. }
  7584. else {
  7585. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  7586. }
  7587. }
  7588. };
  7589. OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument, this._eventDispatch);
  7590. this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked, this._processAppCommandInvocation, onRegisterCompleted);
  7591. };
  7592. AppCommandManager.prototype._verifyManifestCallback=function (callbackName) {
  7593. var defaultResult={ callback: null, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback };
  7594. callbackName=callbackName.trim();
  7595. try {
  7596. var callList=callbackName.split(".");
  7597. var parentObject=window;
  7598. for (var i=0; i < callList.length - 1; i++) {
  7599. if (parentObject[callList[i]] && (typeof parentObject[callList[i]]=="object" || typeof parentObject[callList[i]]=="function")) {
  7600. parentObject=parentObject[callList[i]];
  7601. }
  7602. else {
  7603. return defaultResult;
  7604. }
  7605. }
  7606. var callbackFunc=parentObject[callList[callList.length - 1]];
  7607. if (typeof callbackFunc !="function") {
  7608. return defaultResult;
  7609. }
  7610. }
  7611. catch (e) {
  7612. return defaultResult;
  7613. }
  7614. return { callback: callbackFunc, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess };
  7615. };
  7616. AppCommandManager.prototype._invokeAppCommandCompletedMethod=function (appCommandId, resultCode, data) {
  7617. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId, resultCode, data);
  7618. };
  7619. AppCommandManager.prototype._constructEventObjectForCallback=function (args) {
  7620. var _this=this;
  7621. var eventObj=new AppCommandCallbackEventArgs();
  7622. try {
  7623. var jsonData=JSON.parse(args.eventObjStr);
  7624. this._translateEventObjectInternal(jsonData, eventObj);
  7625. Object.defineProperty(eventObj, 'completed', {
  7626. value: function (completedContext) {
  7627. eventObj.completedContext=completedContext;
  7628. var jsonString=JSON.stringify(eventObj);
  7629. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, jsonString);
  7630. },
  7631. enumerable: true
  7632. });
  7633. }
  7634. catch (e) {
  7635. eventObj=null;
  7636. }
  7637. return eventObj;
  7638. };
  7639. AppCommandManager.prototype._translateEventObjectInternal=function (input, output) {
  7640. for (var key in input) {
  7641. if (!input.hasOwnProperty(key))
  7642. continue;
  7643. var inputChild=input[key];
  7644. if (typeof inputChild=="object" && inputChild !=null) {
  7645. OSF.OUtil.defineEnumerableProperty(output, key, {
  7646. value: {}
  7647. });
  7648. this._translateEventObjectInternal(inputChild, output[key]);
  7649. }
  7650. else {
  7651. Object.defineProperty(output, key, {
  7652. value: inputChild,
  7653. enumerable: true,
  7654. writable: true
  7655. });
  7656. }
  7657. }
  7658. };
  7659. AppCommandManager.prototype._constructObjectByTemplate=function (template, input) {
  7660. var output={};
  7661. if (!template || !input)
  7662. return output;
  7663. for (var key in template) {
  7664. if (template.hasOwnProperty(key)) {
  7665. output[key]=null;
  7666. if (input[key] !=null) {
  7667. var templateChild=template[key];
  7668. var inputChild=input[key];
  7669. var inputChildType=typeof inputChild;
  7670. if (typeof templateChild=="object" && templateChild !=null) {
  7671. output[key]=this._constructObjectByTemplate(templateChild, inputChild);
  7672. }
  7673. else if (inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") {
  7674. output[key]=inputChild;
  7675. }
  7676. }
  7677. }
  7678. }
  7679. return output;
  7680. };
  7681. AppCommandManager.instance=function () {
  7682. if (AppCommandManager._instance==null) {
  7683. AppCommandManager._instance=new AppCommandManager();
  7684. }
  7685. return AppCommandManager._instance;
  7686. };
  7687. AppCommandManager._instance=null;
  7688. return AppCommandManager;
  7689. })();
  7690. AppCommand.AppCommandManager=AppCommandManager;
  7691. var AppCommandInvokedEventArgs=(function () {
  7692. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) {
  7693. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  7694. this.appCommandId=appCommandId;
  7695. this.callbackName=callbackName;
  7696. this.eventObjStr=eventObjStr;
  7697. }
  7698. AppCommandInvokedEventArgs.create=function (eventProperties) {
  7699. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId], eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName], eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]);
  7700. };
  7701. return AppCommandInvokedEventArgs;
  7702. })();
  7703. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  7704. var AppCommandCallbackEventArgs=(function () {
  7705. function AppCommandCallbackEventArgs() {
  7706. }
  7707. return AppCommandCallbackEventArgs;
  7708. })();
  7709. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  7710. AppCommand.AppCommandInvokedEventEnums={
  7711. AppCommandId: "appCommandId",
  7712. CallbackName: "callbackName",
  7713. EventObjStr: "eventObjStr"
  7714. };
  7715. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  7716. })(OfficeExt || (OfficeExt={}));
  7717. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  7718. var OfficeExt;
  7719. (function (OfficeExt) {
  7720. var AppCommand;
  7721. (function (AppCommand) {
  7722. function registerDdaFacade() {
  7723. if (OSF.DDA.SafeArray) {
  7724. var parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7725. parameterMap.define({
  7726. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  7727. toHost: [
  7728. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7729. { name: Microsoft.Office.WebExtension.Parameters.Status, value: 1 },
  7730. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 }
  7731. ]
  7732. });
  7733. parameterMap.define({
  7734. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  7735. fromHost: [
  7736. { name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, value: parameterMap.self }
  7737. ],
  7738. isComplexType: true
  7739. });
  7740. parameterMap.define({
  7741. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  7742. fromHost: [
  7743. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, value: 0 },
  7744. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, value: 1 },
  7745. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, value: 2 },
  7746. ],
  7747. isComplexType: true
  7748. });
  7749. }
  7750. }
  7751. AppCommand.registerDdaFacade=registerDdaFacade;
  7752. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  7753. })(OfficeExt || (OfficeExt={}));
  7754. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Image: "image" });
  7755. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7756. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7757. toHost: [
  7758. { name: Microsoft.Office.WebExtension.CoercionType.Image, value: 8 }
  7759. ]
  7760. });
  7761. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  7762. var bf=new OSF.DDA.BindingFacade(this);
  7763. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  7764. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  7765. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  7766. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  7767. OSF.OUtil.finalizeProperties(this);
  7768. };
  7769. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  7770. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize() {
  7771. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  7772. appCommandHandler.initializeAndChangeOnce();
  7773. };
  7774. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  7775. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  7776. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(true));
  7777. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  7778. appReady();
  7779. };
  7780. (function () {
  7781. OSF.DDA.AsyncMethodCalls.define({
  7782. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7783. requiredArguments: [
  7784. {
  7785. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7786. "types": ["string", "object", "number", "boolean"]
  7787. }
  7788. ],
  7789. supportedOptions: [{
  7790. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7791. value: {
  7792. "enum": Microsoft.Office.WebExtension.CoercionType,
  7793. "calculate": function (requiredArgs) {
  7794. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  7795. }
  7796. }
  7797. },
  7798. {
  7799. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7800. value: {
  7801. "types": ["number", "object"],
  7802. "defaultValue": []
  7803. }
  7804. },
  7805. {
  7806. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7807. value: {
  7808. "types": ["number", "object"],
  7809. "defaultValue": []
  7810. }
  7811. },
  7812. {
  7813. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  7814. value: {
  7815. "types": ["number", "boolean"],
  7816. "defaultValue": false
  7817. }
  7818. },
  7819. {
  7820. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  7821. value: {
  7822. "types": ["number", "boolean"],
  7823. "defaultValue": false
  7824. }
  7825. }
  7826. ],
  7827. privateStateCallbacks: []
  7828. });
  7829. })();
  7830. var OfficeExtension;
  7831. (function (OfficeExtension) {
  7832. var Action=(function () {
  7833. function Action(actionInfo, isWriteOperation) {
  7834. this.m_actionInfo=actionInfo;
  7835. this.m_isWriteOperation=isWriteOperation;
  7836. }
  7837. Object.defineProperty(Action.prototype, "actionInfo", {
  7838. get: function () {
  7839. return this.m_actionInfo;
  7840. },
  7841. enumerable: true,
  7842. configurable: true
  7843. });
  7844. Object.defineProperty(Action.prototype, "isWriteOperation", {
  7845. get: function () {
  7846. return this.m_isWriteOperation;
  7847. },
  7848. enumerable: true,
  7849. configurable: true
  7850. });
  7851. return Action;
  7852. })();
  7853. OfficeExtension.Action=Action;
  7854. })(OfficeExtension || (OfficeExtension={}));
  7855. var OfficeExtension;
  7856. (function (OfficeExtension) {
  7857. var ActionFactory=(function () {
  7858. function ActionFactory() {
  7859. }
  7860. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  7861. OfficeExtension.Utility.validateObjectPath(parent);
  7862. var actionInfo={
  7863. Id: context._nextId(),
  7864. ActionType: 4 ,
  7865. Name: propertyName,
  7866. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7867. ArgumentInfo: {}
  7868. };
  7869. var args=[value];
  7870. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7871. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7872. var ret=new OfficeExtension.Action(actionInfo, true);
  7873. context._pendingRequest.addAction(ret);
  7874. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7875. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7876. return ret;
  7877. };
  7878. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  7879. OfficeExtension.Utility.validateObjectPath(parent);
  7880. var actionInfo={
  7881. Id: context._nextId(),
  7882. ActionType: 3 ,
  7883. Name: methodName,
  7884. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7885. ArgumentInfo: {}
  7886. };
  7887. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7888. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7889. var isWriteOperation=operationType !=1 ;
  7890. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  7891. context._pendingRequest.addAction(ret);
  7892. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7893. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7894. return ret;
  7895. };
  7896. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  7897. OfficeExtension.Utility.validateObjectPath(parent);
  7898. var actionInfo={
  7899. Id: context._nextId(),
  7900. ActionType: 2 ,
  7901. Name: "",
  7902. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7903. };
  7904. actionInfo.QueryInfo=queryOption;
  7905. var ret=new OfficeExtension.Action(actionInfo, false);
  7906. context._pendingRequest.addAction(ret);
  7907. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7908. return ret;
  7909. };
  7910. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  7911. OfficeExtension.Utility.validateObjectPath(parent);
  7912. var actionInfo={
  7913. Id: context._nextId(),
  7914. ActionType: 6 ,
  7915. Name: "",
  7916. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7917. RecursiveQueryInfo: query
  7918. };
  7919. var ret=new OfficeExtension.Action(actionInfo, false);
  7920. context._pendingRequest.addAction(ret);
  7921. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7922. return ret;
  7923. };
  7924. ActionFactory.createInstantiateAction=function (context, obj) {
  7925. OfficeExtension.Utility.validateObjectPath(obj);
  7926. var actionInfo={
  7927. Id: context._nextId(),
  7928. ActionType: 1 ,
  7929. Name: "",
  7930. ObjectPathId: obj._objectPath.objectPathInfo.Id
  7931. };
  7932. var ret=new OfficeExtension.Action(actionInfo, false);
  7933. context._pendingRequest.addAction(ret);
  7934. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  7935. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  7936. return ret;
  7937. };
  7938. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  7939. var actionInfo={
  7940. Id: context._nextId(),
  7941. ActionType: 5 ,
  7942. Name: "Trace",
  7943. ObjectPathId: 0
  7944. };
  7945. var ret=new OfficeExtension.Action(actionInfo, false);
  7946. context._pendingRequest.addAction(ret);
  7947. if (addTraceMessage) {
  7948. context._pendingRequest.addTrace(actionInfo.Id, message);
  7949. }
  7950. return ret;
  7951. };
  7952. return ActionFactory;
  7953. })();
  7954. OfficeExtension.ActionFactory=ActionFactory;
  7955. })(OfficeExtension || (OfficeExtension={}));
  7956. var OfficeExtension;
  7957. (function (OfficeExtension) {
  7958. var ClientObject=(function () {
  7959. function ClientObject(context, objectPath) {
  7960. OfficeExtension.Utility.checkArgumentNull(context, "context");
  7961. this.m_context=context;
  7962. this.m_objectPath=objectPath;
  7963. if (this.m_objectPath) {
  7964. if (!context._processingResult) {
  7965. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  7966. if ((context._autoCleanup) && (this._KeepReference)) {
  7967. context.trackedObjects._autoAdd(this);
  7968. }
  7969. }
  7970. }
  7971. }
  7972. Object.defineProperty(ClientObject.prototype, "context", {
  7973. get: function () {
  7974. return this.m_context;
  7975. },
  7976. enumerable: true,
  7977. configurable: true
  7978. });
  7979. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  7980. get: function () {
  7981. return this.m_objectPath;
  7982. },
  7983. set: function (value) {
  7984. this.m_objectPath=value;
  7985. },
  7986. enumerable: true,
  7987. configurable: true
  7988. });
  7989. Object.defineProperty(ClientObject.prototype, "isNull", {
  7990. get: function () {
  7991. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  7992. return this._isNull;
  7993. },
  7994. enumerable: true,
  7995. configurable: true
  7996. });
  7997. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  7998. get: function () {
  7999. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  8000. return this._isNull;
  8001. },
  8002. enumerable: true,
  8003. configurable: true
  8004. });
  8005. Object.defineProperty(ClientObject.prototype, "_isNull", {
  8006. get: function () {
  8007. return this.m_isNull;
  8008. },
  8009. set: function (value) {
  8010. this.m_isNull=value;
  8011. if (value && this.m_objectPath) {
  8012. this.m_objectPath._updateAsNullObject();
  8013. }
  8014. },
  8015. enumerable: true,
  8016. configurable: true
  8017. });
  8018. ClientObject.prototype._handleResult=function (value) {
  8019. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8020. };
  8021. ClientObject.prototype._handleIdResult=function (value) {
  8022. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8023. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  8024. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  8025. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  8026. }
  8027. };
  8028. return ClientObject;
  8029. })();
  8030. OfficeExtension.ClientObject=ClientObject;
  8031. })(OfficeExtension || (OfficeExtension={}));
  8032. var OfficeExtension;
  8033. (function (OfficeExtension) {
  8034. var ClientRequest=(function () {
  8035. function ClientRequest(context) {
  8036. this.m_context=context;
  8037. this.m_actions=[];
  8038. this.m_actionResultHandler={};
  8039. this.m_referencedObjectPaths={};
  8040. this.m_flags=0 ;
  8041. this.m_traceInfos={};
  8042. this.m_pendingProcessEventHandlers=[];
  8043. this.m_pendingEventHandlerActions={};
  8044. this.m_responseTraceIds={};
  8045. this.m_responseTraceMessages=[];
  8046. }
  8047. Object.defineProperty(ClientRequest.prototype, "flags", {
  8048. get: function () {
  8049. return this.m_flags;
  8050. },
  8051. enumerable: true,
  8052. configurable: true
  8053. });
  8054. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  8055. get: function () {
  8056. return this.m_traceInfos;
  8057. },
  8058. enumerable: true,
  8059. configurable: true
  8060. });
  8061. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  8062. get: function () {
  8063. return this.m_responseTraceMessages;
  8064. },
  8065. enumerable: true,
  8066. configurable: true
  8067. });
  8068. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  8069. get: function () {
  8070. return this.m_responseTraceIds;
  8071. },
  8072. enumerable: true,
  8073. configurable: true
  8074. });
  8075. ClientRequest.prototype._setResponseTraceIds=function (value) {
  8076. if (value) {
  8077. for (var i=0; i < value.length; i++) {
  8078. var traceId=value[i];
  8079. this.m_responseTraceIds[traceId]=traceId;
  8080. var message=this.m_traceInfos[traceId];
  8081. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  8082. this.m_responseTraceMessages.push(message);
  8083. }
  8084. }
  8085. }
  8086. };
  8087. ClientRequest.prototype.addAction=function (action) {
  8088. if (action.isWriteOperation) {
  8089. this.m_flags=this.m_flags | 1 ;
  8090. }
  8091. this.m_actions.push(action);
  8092. };
  8093. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  8094. get: function () {
  8095. return this.m_actions.length > 0;
  8096. },
  8097. enumerable: true,
  8098. configurable: true
  8099. });
  8100. ClientRequest.prototype.addTrace=function (actionId, message) {
  8101. this.m_traceInfos[actionId]=message;
  8102. };
  8103. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  8104. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  8105. return;
  8106. }
  8107. if (!objectPath.isValid) {
  8108. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  8109. }
  8110. while (objectPath) {
  8111. if (objectPath.isWriteOperation) {
  8112. this.m_flags=this.m_flags | 1 ;
  8113. }
  8114. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  8115. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  8116. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  8117. }
  8118. objectPath=objectPath.parentObjectPath;
  8119. }
  8120. };
  8121. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  8122. if (objectPaths) {
  8123. for (var i=0; i < objectPaths.length; i++) {
  8124. this.addReferencedObjectPath(objectPaths[i]);
  8125. }
  8126. }
  8127. };
  8128. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  8129. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  8130. };
  8131. ClientRequest.prototype.buildRequestMessageBody=function () {
  8132. var objectPaths={};
  8133. for (var i in this.m_referencedObjectPaths) {
  8134. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  8135. }
  8136. var actions=[];
  8137. for (var index=0; index < this.m_actions.length; index++) {
  8138. actions.push(this.m_actions[index].actionInfo);
  8139. }
  8140. var ret={
  8141. Actions: actions,
  8142. ObjectPaths: objectPaths
  8143. };
  8144. return ret;
  8145. };
  8146. ClientRequest.prototype.processResponse=function (msg) {
  8147. if (msg && msg.Results) {
  8148. for (var i=0; i < msg.Results.length; i++) {
  8149. var actionResult=msg.Results[i];
  8150. var handler=this.m_actionResultHandler[actionResult.ActionId];
  8151. if (handler) {
  8152. handler._handleResult(actionResult.Value);
  8153. }
  8154. }
  8155. }
  8156. };
  8157. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  8158. for (var i in this.m_referencedObjectPaths) {
  8159. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  8160. this.m_referencedObjectPaths[i].isValid=false;
  8161. }
  8162. }
  8163. };
  8164. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  8165. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  8166. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  8167. this.m_pendingProcessEventHandlers.push(eventHandlers);
  8168. }
  8169. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  8170. };
  8171. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  8172. get: function () {
  8173. return this.m_pendingProcessEventHandlers;
  8174. },
  8175. enumerable: true,
  8176. configurable: true
  8177. });
  8178. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  8179. return this.m_pendingEventHandlerActions[eventHandlers._id];
  8180. };
  8181. return ClientRequest;
  8182. })();
  8183. OfficeExtension.ClientRequest=ClientRequest;
  8184. })(OfficeExtension || (OfficeExtension={}));
  8185. var OfficeExtension;
  8186. (function (OfficeExtension) {
  8187. var _requestExecutorFactory;
  8188. function _setRequestExecutorFactory(reqExecFactory) {
  8189. _requestExecutorFactory=reqExecFactory;
  8190. }
  8191. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  8192. var ClientRequestContext=(function () {
  8193. function ClientRequestContext(url) {
  8194. this.m_requestHeaders={};
  8195. this._onRunFinishedNotifiers=[];
  8196. this.m_nextId=0;
  8197. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  8198. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  8199. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  8200. this.m_url=defaultUrlAndHeaders.url;
  8201. if (defaultUrlAndHeaders.headers) {
  8202. for (var key in defaultUrlAndHeaders.headers) {
  8203. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  8204. }
  8205. }
  8206. }
  8207. else {
  8208. this.m_url=OfficeExtension.Constants.localDocument;
  8209. }
  8210. }
  8211. else if (typeof (url)==="string") {
  8212. this.m_url=url;
  8213. }
  8214. else {
  8215. var requestInfo=url;
  8216. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  8217. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  8218. }
  8219. this.m_url=requestInfo.url;
  8220. if (requestInfo.headers) {
  8221. for (var key in requestInfo.headers) {
  8222. this.m_requestHeaders[key]=requestInfo.headers[key];
  8223. }
  8224. }
  8225. }
  8226. this._processingResult=false;
  8227. this._customData=OfficeExtension.Constants.iterativeExecutor;
  8228. if (_requestExecutorFactory) {
  8229. this._requestExecutor=_requestExecutorFactory();
  8230. }
  8231. else {
  8232. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  8233. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8234. }
  8235. else {
  8236. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  8237. }
  8238. }
  8239. this.sync=this.sync.bind(this);
  8240. }
  8241. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  8242. get: function () {
  8243. return this.m_url;
  8244. },
  8245. enumerable: true,
  8246. configurable: true
  8247. });
  8248. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  8249. get: function () {
  8250. if (this.m_pendingRequest==null) {
  8251. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  8252. }
  8253. return this.m_pendingRequest;
  8254. },
  8255. enumerable: true,
  8256. configurable: true
  8257. });
  8258. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  8259. get: function () {
  8260. if (!this.m_trackedObjects) {
  8261. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  8262. }
  8263. return this.m_trackedObjects;
  8264. },
  8265. enumerable: true,
  8266. configurable: true
  8267. });
  8268. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  8269. get: function () {
  8270. return this.m_requestHeaders;
  8271. },
  8272. enumerable: true,
  8273. configurable: true
  8274. });
  8275. ClientRequestContext.prototype.load=function (clientObj, option) {
  8276. OfficeExtension.Utility.validateContext(this, clientObj);
  8277. var queryOption=ClientRequestContext.parseQueryOption(option);
  8278. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  8279. this._pendingRequest.addActionResultHandler(action, clientObj);
  8280. };
  8281. ClientRequestContext.parseQueryOption=function (option) {
  8282. var queryOption={};
  8283. if (typeof (option)=="string") {
  8284. var select=option;
  8285. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  8286. }
  8287. else if (Array.isArray(option)) {
  8288. queryOption.Select=option;
  8289. }
  8290. else if (typeof (option)=="object") {
  8291. var loadOption=option;
  8292. if (typeof (loadOption.select)=="string") {
  8293. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  8294. }
  8295. else if (Array.isArray(loadOption.select)) {
  8296. queryOption.Select=loadOption.select;
  8297. }
  8298. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  8299. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  8300. }
  8301. if (typeof (loadOption.expand)=="string") {
  8302. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  8303. }
  8304. else if (Array.isArray(loadOption.expand)) {
  8305. queryOption.Expand=loadOption.expand;
  8306. }
  8307. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  8308. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  8309. }
  8310. if (typeof (loadOption.top)=="number") {
  8311. queryOption.Top=loadOption.top;
  8312. }
  8313. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  8314. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  8315. }
  8316. if (typeof (loadOption.skip)=="number") {
  8317. queryOption.Skip=loadOption.skip;
  8318. }
  8319. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  8320. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  8321. }
  8322. }
  8323. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  8324. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  8325. }
  8326. return queryOption;
  8327. };
  8328. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  8329. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  8330. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  8331. }
  8332. var quries={};
  8333. for (var key in options) {
  8334. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  8335. }
  8336. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  8337. this._pendingRequest.addActionResultHandler(action, clientObj);
  8338. };
  8339. ClientRequestContext.prototype.trace=function (message) {
  8340. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  8341. };
  8342. ClientRequestContext.prototype.syncPrivate=function () {
  8343. var _this=this;
  8344. var req=this._pendingRequest;
  8345. this.m_pendingRequest=null;
  8346. if (!req.hasActions) {
  8347. return this.processPendingEventHandlers(req);
  8348. }
  8349. var msgBody=req.buildRequestMessageBody();
  8350. var requestFlags=req.flags;
  8351. var requestExecutor=this._requestExecutor;
  8352. if (!requestExecutor) {
  8353. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8354. }
  8355. var requestExecutorRequestMessage={
  8356. Url: this.m_url,
  8357. Headers: this.m_requestHeaders,
  8358. Body: msgBody
  8359. };
  8360. req.invalidatePendingInvalidObjectPaths();
  8361. var errorFromResponse=null;
  8362. var errorFromProcessEventHandlers=null;
  8363. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  8364. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  8365. return _this.processPendingEventHandlers(req).catch(function (ex) {
  8366. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  8367. OfficeExtension.Utility.log(JSON.stringify(ex));
  8368. errorFromProcessEventHandlers=ex;
  8369. });
  8370. }).then(function () {
  8371. if (errorFromResponse) {
  8372. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  8373. throw errorFromResponse;
  8374. }
  8375. if (errorFromProcessEventHandlers) {
  8376. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  8377. var transformedError=null;
  8378. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  8379. transformedError=errorFromProcessEventHandlers;
  8380. transformedError.traceMessages=req._responseTraceMessages;
  8381. }
  8382. else {
  8383. var message=null;
  8384. if (typeof (errorFromProcessEventHandlers)==="string") {
  8385. message=errorFromProcessEventHandlers;
  8386. }
  8387. else {
  8388. message=errorFromProcessEventHandlers.message;
  8389. }
  8390. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  8391. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  8392. }
  8393. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  8394. }
  8395. throw transformedError;
  8396. }
  8397. });
  8398. };
  8399. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  8400. if (response.Body && response.Body.TraceIds) {
  8401. req._setResponseTraceIds(response.Body.TraceIds);
  8402. }
  8403. var traceMessages=req._responseTraceMessages;
  8404. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  8405. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  8406. }
  8407. else if (response.Body && response.Body.Error) {
  8408. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  8409. errorLocation: response.Body.Error.Location
  8410. });
  8411. }
  8412. this._processingResult=true;
  8413. try {
  8414. req.processResponse(response.Body);
  8415. }
  8416. finally {
  8417. this._processingResult=false;
  8418. }
  8419. return null;
  8420. };
  8421. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  8422. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8423. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  8424. var eventHandlers=req._pendingProcessEventHandlers[i];
  8425. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  8426. }
  8427. return ret;
  8428. };
  8429. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  8430. return function () { return eventHandlers._processRegistration(req); };
  8431. };
  8432. ClientRequestContext.prototype.sync=function (passThroughValue) {
  8433. return this.syncPrivate().then(function () { return passThroughValue; });
  8434. };
  8435. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8436. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8437. if (retryDelay===void 0) { retryDelay=5000; }
  8438. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8439. };
  8440. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8441. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8442. if (retryDelay===void 0) { retryDelay=5000; }
  8443. var ctxRetriever;
  8444. var batch;
  8445. var requestInfo=null;
  8446. var argOffset=0;
  8447. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  8448. requestInfo=receivedRunArgs[0];
  8449. argOffset=1;
  8450. }
  8451. if (receivedRunArgs.length==argOffset+1) {
  8452. ctxRetriever=ctxInitializer;
  8453. batch=receivedRunArgs[argOffset+0];
  8454. }
  8455. else if (receivedRunArgs.length==argOffset+2) {
  8456. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  8457. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  8458. }
  8459. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  8460. var array=receivedRunArgs[argOffset+0];
  8461. if (array.length==0) {
  8462. return ClientRequestContext.createErrorPromise(functionName);
  8463. }
  8464. for (var i=0; i < array.length; i++) {
  8465. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  8466. return ClientRequestContext.createErrorPromise(functionName);
  8467. }
  8468. if (array[i].context !=array[0].context) {
  8469. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  8470. }
  8471. }
  8472. ctxRetriever=function () { return array[0].context; };
  8473. }
  8474. else {
  8475. return ClientRequestContext.createErrorPromise(functionName);
  8476. }
  8477. batch=receivedRunArgs[argOffset+1];
  8478. }
  8479. else {
  8480. return ClientRequestContext.createErrorPromise(functionName);
  8481. }
  8482. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8483. };
  8484. ClientRequestContext.createErrorPromise=function (functionName, code) {
  8485. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  8486. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  8487. };
  8488. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8489. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  8490. resolve();
  8491. });
  8492. var ctx;
  8493. var succeeded=false;
  8494. var resultOrError;
  8495. return starterPromise.then(function () {
  8496. ctx=ctxRetriever(requestInfo);
  8497. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  8498. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  8499. }
  8500. if (ctx._autoCleanup) {
  8501. return new OfficeExtension.Promise(function (resolve, reject) {
  8502. ctx._onRunFinishedNotifiers.push(function () {
  8503. ctx._autoCleanup=true;
  8504. resolve();
  8505. });
  8506. });
  8507. }
  8508. else {
  8509. ctx._autoCleanup=true;
  8510. }
  8511. }).then(function () {
  8512. if (typeof batch !=='function') {
  8513. return ClientRequestContext.createErrorPromise(functionName);
  8514. }
  8515. var batchResult=batch(ctx);
  8516. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  8517. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  8518. }
  8519. return batchResult;
  8520. }).then(function (batchResult) {
  8521. return ctx.sync(batchResult);
  8522. }).then(function (result) {
  8523. succeeded=true;
  8524. resultOrError=result;
  8525. }).catch(function (error) {
  8526. resultOrError=error;
  8527. }).then(function () {
  8528. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  8529. ctx._autoCleanup=false;
  8530. for (var key in itemsToRemove) {
  8531. itemsToRemove[key]._objectPath.isValid=false;
  8532. }
  8533. var cleanupCounter=0;
  8534. attemptCleanup();
  8535. function attemptCleanup() {
  8536. cleanupCounter++;
  8537. for (var key in itemsToRemove) {
  8538. ctx.trackedObjects.remove(itemsToRemove[key]);
  8539. }
  8540. ctx.sync().then(function () {
  8541. if (onCleanupSuccess) {
  8542. onCleanupSuccess(cleanupCounter);
  8543. }
  8544. }).catch(function () {
  8545. if (onCleanupFailure) {
  8546. onCleanupFailure(cleanupCounter);
  8547. }
  8548. if (cleanupCounter < numCleanupAttempts) {
  8549. setTimeout(function () {
  8550. attemptCleanup();
  8551. }, retryDelay);
  8552. }
  8553. });
  8554. }
  8555. }).then(function () {
  8556. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  8557. var func=ctx._onRunFinishedNotifiers.shift();
  8558. func();
  8559. }
  8560. if (succeeded) {
  8561. return resultOrError;
  8562. }
  8563. else {
  8564. throw resultOrError;
  8565. }
  8566. });
  8567. };
  8568. ClientRequestContext.prototype._nextId=function () {
  8569. return++this.m_nextId;
  8570. };
  8571. return ClientRequestContext;
  8572. })();
  8573. OfficeExtension.ClientRequestContext=ClientRequestContext;
  8574. })(OfficeExtension || (OfficeExtension={}));
  8575. var OfficeExtension;
  8576. (function (OfficeExtension) {
  8577. (function (ClientRequestFlags) {
  8578. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  8579. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  8580. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  8581. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  8582. })(OfficeExtension || (OfficeExtension={}));
  8583. var OfficeExtension;
  8584. (function (OfficeExtension) {
  8585. (function (ClientResultProcessingType) {
  8586. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  8587. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  8588. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  8589. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  8590. var ClientResult=(function () {
  8591. function ClientResult(type) {
  8592. this.m_type=type;
  8593. }
  8594. Object.defineProperty(ClientResult.prototype, "value", {
  8595. get: function () {
  8596. if (!this.m_isLoaded) {
  8597. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  8598. }
  8599. return this.m_value;
  8600. },
  8601. enumerable: true,
  8602. configurable: true
  8603. });
  8604. ClientResult.prototype._handleResult=function (value) {
  8605. this.m_isLoaded=true;
  8606. if (typeof (value)==="object" && value && value._IsNull) {
  8607. return;
  8608. }
  8609. if (this.m_type===1 ) {
  8610. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  8611. }
  8612. else {
  8613. this.m_value=value;
  8614. }
  8615. };
  8616. return ClientResult;
  8617. })();
  8618. OfficeExtension.ClientResult=ClientResult;
  8619. })(OfficeExtension || (OfficeExtension={}));
  8620. var OfficeExtension;
  8621. (function (OfficeExtension) {
  8622. var Constants=(function () {
  8623. function Constants() {
  8624. }
  8625. Constants.getItemAt="GetItemAt";
  8626. Constants.id="Id";
  8627. Constants.idPrivate="_Id";
  8628. Constants.index="_Index";
  8629. Constants.items="_Items";
  8630. Constants.iterativeExecutor="IterativeExecutor";
  8631. Constants.localDocument="http://document.localhost/";
  8632. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  8633. Constants.referenceId="_ReferenceId";
  8634. Constants.isTracked="_IsTracked";
  8635. Constants.sourceLibHeader="SdkVersion";
  8636. Constants.requestInfoHeader="Office-RequestInfo";
  8637. return Constants;
  8638. })();
  8639. OfficeExtension.Constants=Constants;
  8640. })(OfficeExtension || (OfficeExtension={}));
  8641. var OfficeExtension;
  8642. (function (OfficeExtension) {
  8643. var EmbedRequestExecutor=(function () {
  8644. function EmbedRequestExecutor() {
  8645. }
  8646. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8647. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  8648. return new OfficeExtension.Promise(function (resolve, reject) {
  8649. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  8650. if (!endpoint) {
  8651. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  8652. return;
  8653. }
  8654. endpoint.invoke("executeMethod", function (status, result) {
  8655. OfficeExtension.Utility.log("Response:");
  8656. OfficeExtension.Utility.log(JSON.stringify(result));
  8657. var response;
  8658. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  8659. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  8660. }
  8661. else {
  8662. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  8663. }
  8664. resolve(response);
  8665. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  8666. });
  8667. };
  8668. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  8669. return {
  8670. ArrayData: msgArray,
  8671. DdaMethod: {
  8672. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  8673. }
  8674. };
  8675. };
  8676. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  8677. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  8678. return EmbedRequestExecutor;
  8679. })();
  8680. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  8681. })(OfficeExtension || (OfficeExtension={}));
  8682. var __extends=this.__extends || function (d, b) {
  8683. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  8684. function __() { this.constructor=d; }
  8685. __.prototype=b.prototype;
  8686. d.prototype=new __();
  8687. };
  8688. var OfficeExtension;
  8689. (function (OfficeExtension) {
  8690. var _Internal;
  8691. (function (_Internal) {
  8692. var RuntimeError=(function (_super) {
  8693. __extends(RuntimeError, _super);
  8694. function RuntimeError(code, message, traceMessages, debugInfo) {
  8695. _super.call(this, message);
  8696. this.name="OfficeExtension.Error";
  8697. this.code=code;
  8698. this.message=message;
  8699. this.traceMessages=traceMessages;
  8700. this.debugInfo=debugInfo;
  8701. }
  8702. RuntimeError.prototype.toString=function () {
  8703. return this.code+': '+this.message;
  8704. };
  8705. return RuntimeError;
  8706. })(Error);
  8707. _Internal.RuntimeError=RuntimeError;
  8708. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8709. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  8710. })(OfficeExtension || (OfficeExtension={}));
  8711. var OfficeExtension;
  8712. (function (OfficeExtension) {
  8713. var ErrorCodes=(function () {
  8714. function ErrorCodes() {
  8715. }
  8716. ErrorCodes.accessDenied="AccessDenied";
  8717. ErrorCodes.generalException="GeneralException";
  8718. ErrorCodes.activityLimitReached="ActivityLimitReached";
  8719. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  8720. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  8721. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  8722. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  8723. ErrorCodes.invalidArgument="InvalidArgument";
  8724. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  8725. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  8726. ErrorCodes.apiNotFound="ApiNotFound";
  8727. ErrorCodes.connectionFailure="ConnectionFailure";
  8728. return ErrorCodes;
  8729. })();
  8730. OfficeExtension.ErrorCodes=ErrorCodes;
  8731. })(OfficeExtension || (OfficeExtension={}));
  8732. var OfficeExtension;
  8733. (function (OfficeExtension) {
  8734. var _Internal;
  8735. (function (_Internal) {
  8736. (function (EventHandlerActionType) {
  8737. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  8738. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  8739. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  8740. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  8741. var EventHandlerActionType=_Internal.EventHandlerActionType;
  8742. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8743. })(OfficeExtension || (OfficeExtension={}));
  8744. var OfficeExtension;
  8745. (function (OfficeExtension) {
  8746. var EventHandlers=(function () {
  8747. function EventHandlers(context, parentObject, name, eventInfo) {
  8748. var _this=this;
  8749. this.m_id=context._nextId();
  8750. this.m_context=context;
  8751. this.m_name=name;
  8752. this.m_handlers=[];
  8753. this.m_registered=false;
  8754. this.m_eventInfo=eventInfo;
  8755. this.m_callback=function (args) {
  8756. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  8757. };
  8758. }
  8759. Object.defineProperty(EventHandlers.prototype, "_registered", {
  8760. get: function () {
  8761. return this.m_registered;
  8762. },
  8763. enumerable: true,
  8764. configurable: true
  8765. });
  8766. Object.defineProperty(EventHandlers.prototype, "_id", {
  8767. get: function () {
  8768. return this.m_id;
  8769. },
  8770. enumerable: true,
  8771. configurable: true
  8772. });
  8773. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  8774. get: function () {
  8775. return this.m_handlers;
  8776. },
  8777. enumerable: true,
  8778. configurable: true
  8779. });
  8780. EventHandlers.prototype.add=function (handler) {
  8781. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8782. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  8783. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  8784. };
  8785. EventHandlers.prototype.remove=function (handler) {
  8786. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8787. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  8788. };
  8789. EventHandlers.prototype.removeAll=function () {
  8790. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8791. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  8792. };
  8793. EventHandlers.prototype._processRegistration=function (req) {
  8794. var _this=this;
  8795. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8796. var actions=req._getPendingEventHandlerActions(this);
  8797. if (!actions) {
  8798. return ret;
  8799. }
  8800. var handlersResult=[];
  8801. for (var i=0; i < this.m_handlers.length; i++) {
  8802. handlersResult.push(this.m_handlers[i]);
  8803. }
  8804. var hasChange=false;
  8805. for (var i=0; i < actions.length; i++) {
  8806. if (req._responseTraceIds[actions[i].id]) {
  8807. hasChange=true;
  8808. switch (actions[i].operation) {
  8809. case 0 :
  8810. handlersResult.push(actions[i].handler);
  8811. break;
  8812. case 1 :
  8813. for (var index=handlersResult.length - 1; index >=0; index--) {
  8814. if (handlersResult[index]===actions[i].handler) {
  8815. handlersResult.splice(index, 1);
  8816. break;
  8817. }
  8818. }
  8819. break;
  8820. case 2 :
  8821. handlersResult=[];
  8822. break;
  8823. }
  8824. }
  8825. }
  8826. if (hasChange) {
  8827. if (!this.m_registered && handlersResult.length > 0) {
  8828. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  8829. }
  8830. else if (this.m_registered && handlersResult.length==0) {
  8831. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  8832. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  8833. }).then(function () { return (_this.m_registered=false); });
  8834. }
  8835. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  8836. }
  8837. return ret;
  8838. };
  8839. EventHandlers.prototype.fireEvent=function (args) {
  8840. var promises=[];
  8841. for (var i=0; i < this.m_handlers.length; i++) {
  8842. var handler=this.m_handlers[i];
  8843. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  8844. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  8845. });
  8846. promises.push(p);
  8847. }
  8848. OfficeExtension.Promise.all(promises);
  8849. };
  8850. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  8851. return function () { return handler(args); };
  8852. };
  8853. return EventHandlers;
  8854. })();
  8855. OfficeExtension.EventHandlers=EventHandlers;
  8856. })(OfficeExtension || (OfficeExtension={}));
  8857. var OfficeExtension;
  8858. (function (OfficeExtension) {
  8859. var EventHandlerResult=(function () {
  8860. function EventHandlerResult(context, handlers, handler) {
  8861. this.m_context=context;
  8862. this.m_allHandlers=handlers;
  8863. this.m_handler=handler;
  8864. }
  8865. EventHandlerResult.prototype.remove=function () {
  8866. if (this.m_allHandlers && this.m_handler) {
  8867. this.m_allHandlers.remove(this.m_handler);
  8868. this.m_allHandlers=null;
  8869. this.m_handler=null;
  8870. }
  8871. };
  8872. return EventHandlerResult;
  8873. })();
  8874. OfficeExtension.EventHandlerResult=EventHandlerResult;
  8875. })(OfficeExtension || (OfficeExtension={}));
  8876. var OfficeExtension;
  8877. (function (OfficeExtension) {
  8878. var HttpRequestExecutor=(function () {
  8879. function HttpRequestExecutor() {
  8880. }
  8881. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8882. var requestMessageText=JSON.stringify(requestMessage.Body);
  8883. OfficeExtension.Utility.log("Request:");
  8884. OfficeExtension.Utility.log(requestMessageText);
  8885. var url=requestMessage.Url;
  8886. if (url.charAt(url.length - 1) !="/") {
  8887. url=url+"/";
  8888. }
  8889. url=url+"ProcessQuery";
  8890. var requestInfo={
  8891. method: "POST",
  8892. url: url,
  8893. headers: {},
  8894. body: requestMessageText
  8895. };
  8896. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  8897. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  8898. requestInfo.headers["CONTENT-TYPE"]="application/json";
  8899. if (requestMessage.Headers) {
  8900. for (var key in requestMessage.Headers) {
  8901. requestInfo.headers[key]=requestMessage.Headers[key];
  8902. }
  8903. }
  8904. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  8905. var response;
  8906. if (responseInfo.statusCode===200) {
  8907. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  8908. }
  8909. else {
  8910. var errorObj=null;
  8911. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  8912. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  8913. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  8914. try {
  8915. errorObj=JSON.parse(errorResponseBody);
  8916. }
  8917. catch (e) {
  8918. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  8919. }
  8920. }
  8921. var errorMessage;
  8922. var errorCode;
  8923. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  8924. errorCode=errorObj.error.code;
  8925. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  8926. }
  8927. else {
  8928. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  8929. }
  8930. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  8931. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  8932. }
  8933. response={
  8934. ErrorCode: errorCode,
  8935. ErrorMessage: errorMessage,
  8936. Headers: responseInfo.headers,
  8937. Body: null
  8938. };
  8939. }
  8940. return response;
  8941. });
  8942. };
  8943. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  8944. return HttpRequestExecutor;
  8945. })();
  8946. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  8947. })(OfficeExtension || (OfficeExtension={}));
  8948. var OfficeExtension;
  8949. (function (OfficeExtension) {
  8950. var HttpUtility=(function () {
  8951. function HttpUtility() {
  8952. }
  8953. HttpUtility.setCustomSendRequestFunc=function (func) {
  8954. HttpUtility.s_customSendRequestFunc=func;
  8955. };
  8956. HttpUtility.xhrSendRequestFunc=function (request) {
  8957. return new OfficeExtension.Promise(function (resolve, reject) {
  8958. var xhr=new XMLHttpRequest();
  8959. xhr.open(request.method, request.url);
  8960. xhr.onload=function () {
  8961. var resp={
  8962. statusCode: xhr.status,
  8963. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  8964. body: xhr.responseText
  8965. };
  8966. resolve(resp);
  8967. };
  8968. xhr.onerror=function () {
  8969. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  8970. };
  8971. if (request.headers) {
  8972. for (var key in request.headers) {
  8973. xhr.setRequestHeader(key, request.headers[key]);
  8974. }
  8975. }
  8976. xhr.send(request.body);
  8977. });
  8978. };
  8979. HttpUtility.sendRequest=function (request) {
  8980. HttpUtility.validateAndNormalizeRequest(request);
  8981. var func;
  8982. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  8983. return func(request);
  8984. };
  8985. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  8986. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  8987. };
  8988. HttpUtility.sendLocalDocumentRequest=function (request) {
  8989. HttpUtility.validateAndNormalizeRequest(request);
  8990. var func;
  8991. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  8992. return func(request);
  8993. };
  8994. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  8995. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  8996. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  8997. return new OfficeExtension.Promise(function (resolve, reject) {
  8998. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  8999. var response;
  9000. if (asyncResult.status=="succeeded") {
  9001. response={
  9002. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  9003. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  9004. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  9005. };
  9006. }
  9007. else {
  9008. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  9009. }
  9010. OfficeExtension.Utility.log(JSON.stringify(response));
  9011. resolve(response);
  9012. });
  9013. });
  9014. };
  9015. HttpUtility.validateAndNormalizeRequest=function (request) {
  9016. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  9017. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  9018. }
  9019. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  9020. request.method="GET";
  9021. }
  9022. request.method=request.method.toUpperCase();
  9023. };
  9024. return HttpUtility;
  9025. })();
  9026. OfficeExtension.HttpUtility=HttpUtility;
  9027. })(OfficeExtension || (OfficeExtension={}));
  9028. var OfficeExtension;
  9029. (function (OfficeExtension) {
  9030. var InstantiateActionResultHandler=(function () {
  9031. function InstantiateActionResultHandler(clientObject) {
  9032. this.m_clientObject=clientObject;
  9033. }
  9034. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  9035. this.m_clientObject._handleIdResult(value);
  9036. };
  9037. return InstantiateActionResultHandler;
  9038. })();
  9039. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  9040. })(OfficeExtension || (OfficeExtension={}));
  9041. var OfficeExtension;
  9042. (function (OfficeExtension) {
  9043. })(OfficeExtension || (OfficeExtension={}));
  9044. var OfficeExtension;
  9045. (function (OfficeExtension) {
  9046. (function (RichApiRequestMessageIndex) {
  9047. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  9048. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  9049. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  9050. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  9051. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  9052. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  9053. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  9054. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  9055. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  9056. (function (RichApiResponseMessageIndex) {
  9057. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  9058. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  9059. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  9060. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  9061. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  9062. ;
  9063. (function (ActionType) {
  9064. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  9065. ActionType[ActionType["Query"]=2]="Query";
  9066. ActionType[ActionType["Method"]=3]="Method";
  9067. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  9068. ActionType[ActionType["Trace"]=5]="Trace";
  9069. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  9070. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  9071. var ActionType=OfficeExtension.ActionType;
  9072. (function (ObjectPathType) {
  9073. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  9074. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  9075. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  9076. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  9077. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  9078. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  9079. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  9080. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  9081. var ObjectPathType=OfficeExtension.ObjectPathType;
  9082. })(OfficeExtension || (OfficeExtension={}));
  9083. var OfficeExtension;
  9084. (function (OfficeExtension) {
  9085. var ObjectPath=(function () {
  9086. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  9087. this.m_objectPathInfo=objectPathInfo;
  9088. this.m_parentObjectPath=parentObjectPath;
  9089. this.m_isWriteOperation=false;
  9090. this.m_isCollection=isCollection;
  9091. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  9092. this.m_isValid=true;
  9093. }
  9094. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  9095. get: function () {
  9096. return this.m_objectPathInfo;
  9097. },
  9098. enumerable: true,
  9099. configurable: true
  9100. });
  9101. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  9102. get: function () {
  9103. return this.m_isWriteOperation;
  9104. },
  9105. set: function (value) {
  9106. this.m_isWriteOperation=value;
  9107. },
  9108. enumerable: true,
  9109. configurable: true
  9110. });
  9111. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  9112. get: function () {
  9113. return this.m_isCollection;
  9114. },
  9115. enumerable: true,
  9116. configurable: true
  9117. });
  9118. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  9119. get: function () {
  9120. return this.m_isInvalidAfterRequest;
  9121. },
  9122. enumerable: true,
  9123. configurable: true
  9124. });
  9125. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  9126. get: function () {
  9127. return this.m_parentObjectPath;
  9128. },
  9129. enumerable: true,
  9130. configurable: true
  9131. });
  9132. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  9133. get: function () {
  9134. return this.m_argumentObjectPaths;
  9135. },
  9136. set: function (value) {
  9137. this.m_argumentObjectPaths=value;
  9138. },
  9139. enumerable: true,
  9140. configurable: true
  9141. });
  9142. Object.defineProperty(ObjectPath.prototype, "isValid", {
  9143. get: function () {
  9144. return this.m_isValid;
  9145. },
  9146. set: function (value) {
  9147. this.m_isValid=value;
  9148. },
  9149. enumerable: true,
  9150. configurable: true
  9151. });
  9152. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  9153. get: function () {
  9154. return this.m_getByIdMethodName;
  9155. },
  9156. set: function (value) {
  9157. this.m_getByIdMethodName=value;
  9158. },
  9159. enumerable: true,
  9160. configurable: true
  9161. });
  9162. ObjectPath.prototype._updateAsNullObject=function () {
  9163. this.m_isInvalidAfterRequest=false;
  9164. this.m_isValid=true;
  9165. this.m_objectPathInfo.ObjectPathType=7 ;
  9166. this.m_objectPathInfo.Name="";
  9167. this.m_objectPathInfo.ArgumentInfo={};
  9168. this.m_parentObjectPath=null;
  9169. this.m_argumentObjectPaths=null;
  9170. };
  9171. ObjectPath.prototype.updateUsingObjectData=function (value) {
  9172. var referenceId=value[OfficeExtension.Constants.referenceId];
  9173. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9174. this.m_isInvalidAfterRequest=false;
  9175. this.m_isValid=true;
  9176. this.m_objectPathInfo.ObjectPathType=6 ;
  9177. this.m_objectPathInfo.Name=referenceId;
  9178. this.m_objectPathInfo.ArgumentInfo={};
  9179. this.m_parentObjectPath=null;
  9180. this.m_argumentObjectPaths=null;
  9181. return;
  9182. }
  9183. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  9184. var getByIdMethodName=this.getByIdMethodName;
  9185. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  9186. var id=value[OfficeExtension.Constants.id];
  9187. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9188. id=value[OfficeExtension.Constants.idPrivate];
  9189. }
  9190. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  9191. this.m_isInvalidAfterRequest=false;
  9192. this.m_isValid=true;
  9193. if (parentIsCollection) {
  9194. this.m_objectPathInfo.ObjectPathType=5 ;
  9195. this.m_objectPathInfo.Name="";
  9196. }
  9197. else {
  9198. this.m_objectPathInfo.ObjectPathType=3 ;
  9199. this.m_objectPathInfo.Name=getByIdMethodName;
  9200. this.m_getByIdMethodName=null;
  9201. }
  9202. this.isWriteOperation=false;
  9203. this.m_objectPathInfo.ArgumentInfo={};
  9204. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  9205. this.m_argumentObjectPaths=null;
  9206. return;
  9207. }
  9208. }
  9209. };
  9210. return ObjectPath;
  9211. })();
  9212. OfficeExtension.ObjectPath=ObjectPath;
  9213. })(OfficeExtension || (OfficeExtension={}));
  9214. var OfficeExtension;
  9215. (function (OfficeExtension) {
  9216. var ObjectPathFactory=(function () {
  9217. function ObjectPathFactory() {
  9218. }
  9219. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  9220. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  9221. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  9222. };
  9223. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  9224. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  9225. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  9226. };
  9227. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  9228. var objectPathInfo={
  9229. Id: context._nextId(),
  9230. ObjectPathType: 4 ,
  9231. Name: propertyName,
  9232. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9233. };
  9234. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9235. };
  9236. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  9237. var objectPathInfo={
  9238. Id: context._nextId(),
  9239. ObjectPathType: 5 ,
  9240. Name: "",
  9241. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9242. ArgumentInfo: {}
  9243. };
  9244. objectPathInfo.ArgumentInfo.Arguments=args;
  9245. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9246. };
  9247. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  9248. var objectPathInfo={
  9249. Id: context._nextId(),
  9250. ObjectPathType: 5 ,
  9251. Name: "",
  9252. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  9253. ArgumentInfo: {}
  9254. };
  9255. objectPathInfo.ArgumentInfo.Arguments=args;
  9256. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  9257. };
  9258. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  9259. var objectPathInfo={
  9260. Id: context._nextId(),
  9261. ObjectPathType: 3 ,
  9262. Name: methodName,
  9263. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9264. ArgumentInfo: {}
  9265. };
  9266. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  9267. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9268. ret.argumentObjectPaths=argumentObjectPaths;
  9269. ret.isWriteOperation=(operationType !=1 );
  9270. ret.getByIdMethodName=getByIdMethodName;
  9271. return ret;
  9272. };
  9273. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  9274. var id=childItem[OfficeExtension.Constants.id];
  9275. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9276. id=childItem[OfficeExtension.Constants.idPrivate];
  9277. }
  9278. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  9279. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  9280. }
  9281. else {
  9282. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  9283. }
  9284. };
  9285. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  9286. var id=childItem[OfficeExtension.Constants.id];
  9287. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9288. id=childItem[OfficeExtension.Constants.idPrivate];
  9289. }
  9290. var objectPathInfo=objectPathInfo={
  9291. Id: context._nextId(),
  9292. ObjectPathType: 5 ,
  9293. Name: "",
  9294. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9295. ArgumentInfo: {}
  9296. };
  9297. objectPathInfo.ArgumentInfo.Arguments=[id];
  9298. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9299. };
  9300. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  9301. var indexFromServer=childItem[OfficeExtension.Constants.index];
  9302. if (indexFromServer) {
  9303. index=indexFromServer;
  9304. }
  9305. var objectPathInfo={
  9306. Id: context._nextId(),
  9307. ObjectPathType: 3 ,
  9308. Name: OfficeExtension.Constants.getItemAt,
  9309. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9310. ArgumentInfo: {}
  9311. };
  9312. objectPathInfo.ArgumentInfo.Arguments=[index];
  9313. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9314. };
  9315. return ObjectPathFactory;
  9316. })();
  9317. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  9318. })(OfficeExtension || (OfficeExtension={}));
  9319. var OfficeExtension;
  9320. (function (OfficeExtension) {
  9321. var OfficeJsRequestExecutor=(function () {
  9322. function OfficeJsRequestExecutor() {
  9323. }
  9324. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  9325. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  9326. return new OfficeExtension.Promise(function (resolve, reject) {
  9327. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  9328. OfficeExtension.Utility.log("Response:");
  9329. OfficeExtension.Utility.log(JSON.stringify(result));
  9330. var response;
  9331. if (result.status=="succeeded") {
  9332. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  9333. }
  9334. else {
  9335. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  9336. }
  9337. resolve(response);
  9338. });
  9339. });
  9340. };
  9341. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  9342. return OfficeJsRequestExecutor;
  9343. })();
  9344. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  9345. })(OfficeExtension || (OfficeExtension={}));
  9346. var OfficeExtension;
  9347. (function (OfficeExtension) {
  9348. var _Internal;
  9349. (function (_Internal) {
  9350. var PromiseImpl;
  9351. (function (PromiseImpl) {
  9352. function Init() {
  9353. (function () {
  9354. "use strict";
  9355. function lib$es6$promise$utils$$objectOrFunction(x) {
  9356. return typeof x==='function' || (typeof x==='object' && x !==null);
  9357. }
  9358. function lib$es6$promise$utils$$isFunction(x) {
  9359. return typeof x==='function';
  9360. }
  9361. function lib$es6$promise$utils$$isMaybeThenable(x) {
  9362. return typeof x==='object' && x !==null;
  9363. }
  9364. var lib$es6$promise$utils$$_isArray;
  9365. if (!Array.isArray) {
  9366. lib$es6$promise$utils$$_isArray=function (x) {
  9367. return Object.prototype.toString.call(x)==='[object Array]';
  9368. };
  9369. }
  9370. else {
  9371. lib$es6$promise$utils$$_isArray=Array.isArray;
  9372. }
  9373. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  9374. var lib$es6$promise$asap$$len=0;
  9375. var lib$es6$promise$asap$$toString={}.toString;
  9376. var lib$es6$promise$asap$$vertxNext;
  9377. var lib$es6$promise$asap$$customSchedulerFn;
  9378. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  9379. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  9380. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  9381. lib$es6$promise$asap$$len+=2;
  9382. if (lib$es6$promise$asap$$len===2) {
  9383. if (lib$es6$promise$asap$$customSchedulerFn) {
  9384. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  9385. }
  9386. else {
  9387. lib$es6$promise$asap$$scheduleFlush();
  9388. }
  9389. }
  9390. };
  9391. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  9392. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  9393. }
  9394. function lib$es6$promise$asap$$setAsap(asapFn) {
  9395. lib$es6$promise$asap$$asap=asapFn;
  9396. }
  9397. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  9398. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  9399. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  9400. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  9401. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  9402. function lib$es6$promise$asap$$useNextTick() {
  9403. var nextTick=process.nextTick;
  9404. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  9405. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  9406. nextTick=setImmediate;
  9407. }
  9408. return function () {
  9409. nextTick(lib$es6$promise$asap$$flush);
  9410. };
  9411. }
  9412. function lib$es6$promise$asap$$useVertxTimer() {
  9413. return function () {
  9414. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  9415. };
  9416. }
  9417. function lib$es6$promise$asap$$useMutationObserver() {
  9418. var iterations=0;
  9419. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  9420. var node=document.createTextNode('');
  9421. observer.observe(node, { characterData: true });
  9422. return function () {
  9423. node.data=(iterations=++iterations % 2);
  9424. };
  9425. }
  9426. function lib$es6$promise$asap$$useMessageChannel() {
  9427. var channel=new MessageChannel();
  9428. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  9429. return function () {
  9430. channel.port2.postMessage(0);
  9431. };
  9432. }
  9433. function lib$es6$promise$asap$$useSetTimeout() {
  9434. return function () {
  9435. setTimeout(lib$es6$promise$asap$$flush, 1);
  9436. };
  9437. }
  9438. var lib$es6$promise$asap$$queue=new Array(1000);
  9439. function lib$es6$promise$asap$$flush() {
  9440. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  9441. var callback=lib$es6$promise$asap$$queue[i];
  9442. var arg=lib$es6$promise$asap$$queue[i+1];
  9443. callback(arg);
  9444. lib$es6$promise$asap$$queue[i]=undefined;
  9445. lib$es6$promise$asap$$queue[i+1]=undefined;
  9446. }
  9447. lib$es6$promise$asap$$len=0;
  9448. }
  9449. function lib$es6$promise$asap$$attemptVertex() {
  9450. try {
  9451. var r=require;
  9452. var vertx=r('vertx');
  9453. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  9454. return lib$es6$promise$asap$$useVertxTimer();
  9455. }
  9456. catch (e) {
  9457. return lib$es6$promise$asap$$useSetTimeout();
  9458. }
  9459. }
  9460. var lib$es6$promise$asap$$scheduleFlush;
  9461. if (lib$es6$promise$asap$$isNode) {
  9462. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  9463. }
  9464. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  9465. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  9466. }
  9467. else if (lib$es6$promise$asap$$isWorker) {
  9468. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  9469. }
  9470. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  9471. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  9472. }
  9473. else {
  9474. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  9475. }
  9476. function lib$es6$promise$$internal$$noop() {
  9477. }
  9478. var lib$es6$promise$$internal$$PENDING=void 0;
  9479. var lib$es6$promise$$internal$$FULFILLED=1;
  9480. var lib$es6$promise$$internal$$REJECTED=2;
  9481. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9482. function lib$es6$promise$$internal$$selfFullfillment() {
  9483. return new TypeError("You cannot resolve a promise with itself");
  9484. }
  9485. function lib$es6$promise$$internal$$cannotReturnOwn() {
  9486. return new TypeError('A promises callback cannot return that same promise.');
  9487. }
  9488. function lib$es6$promise$$internal$$getThen(promise) {
  9489. try {
  9490. return promise.then;
  9491. }
  9492. catch (error) {
  9493. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  9494. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  9495. }
  9496. }
  9497. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  9498. try {
  9499. then.call(value, fulfillmentHandler, rejectionHandler);
  9500. }
  9501. catch (e) {
  9502. return e;
  9503. }
  9504. }
  9505. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  9506. lib$es6$promise$asap$$asap(function (promise) {
  9507. var sealed=false;
  9508. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  9509. if (sealed) {
  9510. return;
  9511. }
  9512. sealed=true;
  9513. if (thenable !==value) {
  9514. lib$es6$promise$$internal$$resolve(promise, value);
  9515. }
  9516. else {
  9517. lib$es6$promise$$internal$$fulfill(promise, value);
  9518. }
  9519. }, function (reason) {
  9520. if (sealed) {
  9521. return;
  9522. }
  9523. sealed=true;
  9524. lib$es6$promise$$internal$$reject(promise, reason);
  9525. }, 'Settle: '+(promise._label || ' unknown promise'));
  9526. if (!sealed && error) {
  9527. sealed=true;
  9528. lib$es6$promise$$internal$$reject(promise, error);
  9529. }
  9530. }, promise);
  9531. }
  9532. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  9533. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  9534. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  9535. }
  9536. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  9537. lib$es6$promise$$internal$$reject(promise, thenable._result);
  9538. }
  9539. else {
  9540. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  9541. lib$es6$promise$$internal$$resolve(promise, value);
  9542. }, function (reason) {
  9543. lib$es6$promise$$internal$$reject(promise, reason);
  9544. });
  9545. }
  9546. }
  9547. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  9548. if (maybeThenable.constructor===promise.constructor) {
  9549. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  9550. }
  9551. else {
  9552. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  9553. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  9554. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  9555. }
  9556. else if (then===undefined) {
  9557. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9558. }
  9559. else if (lib$es6$promise$utils$$isFunction(then)) {
  9560. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  9561. }
  9562. else {
  9563. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9564. }
  9565. }
  9566. }
  9567. function lib$es6$promise$$internal$$resolve(promise, value) {
  9568. if (promise===value) {
  9569. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  9570. }
  9571. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  9572. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  9573. }
  9574. else {
  9575. lib$es6$promise$$internal$$fulfill(promise, value);
  9576. }
  9577. }
  9578. function lib$es6$promise$$internal$$publishRejection(promise) {
  9579. if (promise._onerror) {
  9580. promise._onerror(promise._result);
  9581. }
  9582. lib$es6$promise$$internal$$publish(promise);
  9583. }
  9584. function lib$es6$promise$$internal$$fulfill(promise, value) {
  9585. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9586. return;
  9587. }
  9588. promise._result=value;
  9589. promise._state=lib$es6$promise$$internal$$FULFILLED;
  9590. if (promise._subscribers.length !==0) {
  9591. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  9592. }
  9593. }
  9594. function lib$es6$promise$$internal$$reject(promise, reason) {
  9595. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9596. return;
  9597. }
  9598. promise._state=lib$es6$promise$$internal$$REJECTED;
  9599. promise._result=reason;
  9600. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  9601. }
  9602. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  9603. var subscribers=parent._subscribers;
  9604. var length=subscribers.length;
  9605. parent._onerror=null;
  9606. subscribers[length]=child;
  9607. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  9608. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  9609. if (length===0 && parent._state) {
  9610. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  9611. }
  9612. }
  9613. function lib$es6$promise$$internal$$publish(promise) {
  9614. var subscribers=promise._subscribers;
  9615. var settled=promise._state;
  9616. if (subscribers.length===0) {
  9617. return;
  9618. }
  9619. var child, callback, detail=promise._result;
  9620. for (var i=0; i < subscribers.length; i+=3) {
  9621. child=subscribers[i];
  9622. callback=subscribers[i+settled];
  9623. if (child) {
  9624. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  9625. }
  9626. else {
  9627. callback(detail);
  9628. }
  9629. }
  9630. promise._subscribers.length=0;
  9631. }
  9632. function lib$es6$promise$$internal$$ErrorObject() {
  9633. this.error=null;
  9634. }
  9635. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9636. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  9637. try {
  9638. return callback(detail);
  9639. }
  9640. catch (e) {
  9641. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  9642. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  9643. }
  9644. }
  9645. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  9646. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  9647. if (hasCallback) {
  9648. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  9649. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  9650. failed=true;
  9651. error=value.error;
  9652. value=null;
  9653. }
  9654. else {
  9655. succeeded=true;
  9656. }
  9657. if (promise===value) {
  9658. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  9659. return;
  9660. }
  9661. }
  9662. else {
  9663. value=detail;
  9664. succeeded=true;
  9665. }
  9666. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9667. }
  9668. else if (hasCallback && succeeded) {
  9669. lib$es6$promise$$internal$$resolve(promise, value);
  9670. }
  9671. else if (failed) {
  9672. lib$es6$promise$$internal$$reject(promise, error);
  9673. }
  9674. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  9675. lib$es6$promise$$internal$$fulfill(promise, value);
  9676. }
  9677. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  9678. lib$es6$promise$$internal$$reject(promise, value);
  9679. }
  9680. }
  9681. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  9682. try {
  9683. resolver(function resolvePromise(value) {
  9684. lib$es6$promise$$internal$$resolve(promise, value);
  9685. }, function rejectPromise(reason) {
  9686. lib$es6$promise$$internal$$reject(promise, reason);
  9687. });
  9688. }
  9689. catch (e) {
  9690. lib$es6$promise$$internal$$reject(promise, e);
  9691. }
  9692. }
  9693. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  9694. var enumerator=this;
  9695. enumerator._instanceConstructor=Constructor;
  9696. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  9697. if (enumerator._validateInput(input)) {
  9698. enumerator._input=input;
  9699. enumerator.length=input.length;
  9700. enumerator._remaining=input.length;
  9701. enumerator._init();
  9702. if (enumerator.length===0) {
  9703. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9704. }
  9705. else {
  9706. enumerator.length=enumerator.length || 0;
  9707. enumerator._enumerate();
  9708. if (enumerator._remaining===0) {
  9709. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9710. }
  9711. }
  9712. }
  9713. else {
  9714. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  9715. }
  9716. }
  9717. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  9718. return lib$es6$promise$utils$$isArray(input);
  9719. };
  9720. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  9721. return new _Internal.Error('Array Methods must be provided an Array');
  9722. };
  9723. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  9724. this._result=new Array(this.length);
  9725. };
  9726. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  9727. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  9728. var enumerator=this;
  9729. var length=enumerator.length;
  9730. var promise=enumerator.promise;
  9731. var input=enumerator._input;
  9732. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9733. enumerator._eachEntry(input[i], i);
  9734. }
  9735. };
  9736. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  9737. var enumerator=this;
  9738. var c=enumerator._instanceConstructor;
  9739. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  9740. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  9741. entry._onerror=null;
  9742. enumerator._settledAt(entry._state, i, entry._result);
  9743. }
  9744. else {
  9745. enumerator._willSettleAt(c.resolve(entry), i);
  9746. }
  9747. }
  9748. else {
  9749. enumerator._remaining--;
  9750. enumerator._result[i]=entry;
  9751. }
  9752. };
  9753. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  9754. var enumerator=this;
  9755. var promise=enumerator.promise;
  9756. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  9757. enumerator._remaining--;
  9758. if (state===lib$es6$promise$$internal$$REJECTED) {
  9759. lib$es6$promise$$internal$$reject(promise, value);
  9760. }
  9761. else {
  9762. enumerator._result[i]=value;
  9763. }
  9764. }
  9765. if (enumerator._remaining===0) {
  9766. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  9767. }
  9768. };
  9769. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  9770. var enumerator=this;
  9771. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  9772. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  9773. }, function (reason) {
  9774. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  9775. });
  9776. };
  9777. function lib$es6$promise$promise$all$$all(entries) {
  9778. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  9779. }
  9780. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  9781. function lib$es6$promise$promise$race$$race(entries) {
  9782. var Constructor=this;
  9783. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9784. if (!lib$es6$promise$utils$$isArray(entries)) {
  9785. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  9786. return promise;
  9787. }
  9788. var length=entries.length;
  9789. function onFulfillment(value) {
  9790. lib$es6$promise$$internal$$resolve(promise, value);
  9791. }
  9792. function onRejection(reason) {
  9793. lib$es6$promise$$internal$$reject(promise, reason);
  9794. }
  9795. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9796. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  9797. }
  9798. return promise;
  9799. }
  9800. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  9801. function lib$es6$promise$promise$resolve$$resolve(object) {
  9802. var Constructor=this;
  9803. if (object && typeof object==='object' && object.constructor===Constructor) {
  9804. return object;
  9805. }
  9806. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9807. lib$es6$promise$$internal$$resolve(promise, object);
  9808. return promise;
  9809. }
  9810. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  9811. function lib$es6$promise$promise$reject$$reject(reason) {
  9812. var Constructor=this;
  9813. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9814. lib$es6$promise$$internal$$reject(promise, reason);
  9815. return promise;
  9816. }
  9817. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  9818. var lib$es6$promise$promise$$counter=0;
  9819. function lib$es6$promise$promise$$needsResolver() {
  9820. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  9821. }
  9822. function lib$es6$promise$promise$$needsNew() {
  9823. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  9824. }
  9825. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  9826. function lib$es6$promise$promise$$Promise(resolver) {
  9827. this._id=lib$es6$promise$promise$$counter++;
  9828. this._state=undefined;
  9829. this._result=undefined;
  9830. this._subscribers=[];
  9831. if (lib$es6$promise$$internal$$noop !==resolver) {
  9832. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  9833. lib$es6$promise$promise$$needsResolver();
  9834. }
  9835. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  9836. lib$es6$promise$promise$$needsNew();
  9837. }
  9838. lib$es6$promise$$internal$$initializePromise(this, resolver);
  9839. }
  9840. }
  9841. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  9842. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  9843. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  9844. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  9845. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  9846. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  9847. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  9848. lib$es6$promise$promise$$Promise.prototype={
  9849. constructor: lib$es6$promise$promise$$Promise,
  9850. then: function (onFulfillment, onRejection) {
  9851. var parent=this;
  9852. var state=parent._state;
  9853. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  9854. return this;
  9855. }
  9856. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  9857. var result=parent._result;
  9858. if (state) {
  9859. var callback=arguments[state - 1];
  9860. lib$es6$promise$asap$$asap(function () {
  9861. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  9862. });
  9863. }
  9864. else {
  9865. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  9866. }
  9867. return child;
  9868. },
  9869. 'catch': function (onRejection) {
  9870. return this.then(null, onRejection);
  9871. }
  9872. };
  9873. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  9874. }).call(this);
  9875. }
  9876. PromiseImpl.Init=Init;
  9877. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  9878. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  9879. if (!OfficeExtension["Promise"]) {
  9880. if (typeof (window) !=="undefined" && window.Promise) {
  9881. if (IsEdgeLessThan14()) {
  9882. _Internal.PromiseImpl.Init();
  9883. }
  9884. else {
  9885. OfficeExtension.Promise=window.Promise;
  9886. }
  9887. }
  9888. else {
  9889. _Internal.PromiseImpl.Init();
  9890. }
  9891. }
  9892. })(OfficeExtension || (OfficeExtension={}));
  9893. function IsEdgeLessThan14() {
  9894. var userAgent=window.navigator.userAgent;
  9895. var versionIdx=userAgent.indexOf("Edge/");
  9896. if (versionIdx >=0) {
  9897. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  9898. if (userAgent < "14.14393")
  9899. return true;
  9900. else
  9901. return false;
  9902. }
  9903. return false;
  9904. }
  9905. var OfficeExtension;
  9906. (function (OfficeExtension) {
  9907. (function (OperationType) {
  9908. OperationType[OperationType["Default"]=0]="Default";
  9909. OperationType[OperationType["Read"]=1]="Read";
  9910. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  9911. var OperationType=OfficeExtension.OperationType;
  9912. })(OfficeExtension || (OfficeExtension={}));
  9913. var OfficeExtension;
  9914. (function (OfficeExtension) {
  9915. var TrackedObjects=(function () {
  9916. function TrackedObjects(context) {
  9917. this._autoCleanupList={};
  9918. this.m_context=context;
  9919. }
  9920. TrackedObjects.prototype.add=function (param) {
  9921. var _this=this;
  9922. if (Array.isArray(param)) {
  9923. param.forEach(function (item) { return _this._addCommon(item, true); });
  9924. }
  9925. else {
  9926. this._addCommon(param, true);
  9927. }
  9928. };
  9929. TrackedObjects.prototype._autoAdd=function (object) {
  9930. this._addCommon(object, false);
  9931. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  9932. };
  9933. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  9934. if (object[OfficeExtension.Constants.isTracked]) {
  9935. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9936. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9937. }
  9938. return;
  9939. }
  9940. var referenceId=object[OfficeExtension.Constants.referenceId];
  9941. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  9942. object._KeepReference();
  9943. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  9944. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9945. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9946. }
  9947. object[OfficeExtension.Constants.isTracked]=true;
  9948. }
  9949. };
  9950. TrackedObjects.prototype.remove=function (param) {
  9951. var _this=this;
  9952. if (Array.isArray(param)) {
  9953. param.forEach(function (item) { return _this._removeCommon(item); });
  9954. }
  9955. else {
  9956. this._removeCommon(param);
  9957. }
  9958. };
  9959. TrackedObjects.prototype._removeCommon=function (object) {
  9960. var referenceId=object[OfficeExtension.Constants.referenceId];
  9961. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9962. var rootObject=this.m_context._rootObject;
  9963. if (rootObject._RemoveReference) {
  9964. rootObject._RemoveReference(referenceId);
  9965. }
  9966. delete object[OfficeExtension.Constants.isTracked];
  9967. }
  9968. };
  9969. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  9970. var list=this._autoCleanupList;
  9971. this._autoCleanupList={};
  9972. return list;
  9973. };
  9974. return TrackedObjects;
  9975. })();
  9976. OfficeExtension.TrackedObjects=TrackedObjects;
  9977. })(OfficeExtension || (OfficeExtension={}));
  9978. var OfficeExtension;
  9979. (function (OfficeExtension) {
  9980. var ResourceStrings=(function () {
  9981. function ResourceStrings() {
  9982. }
  9983. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  9984. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  9985. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  9986. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  9987. ResourceStrings.invalidArgument="InvalidArgument";
  9988. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  9989. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  9990. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  9991. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  9992. return ResourceStrings;
  9993. })();
  9994. OfficeExtension.ResourceStrings=ResourceStrings;
  9995. })(OfficeExtension || (OfficeExtension={}));
  9996. var OfficeExtension;
  9997. (function (OfficeExtension) {
  9998. var RichApiMessageUtility=(function () {
  9999. function RichApiMessageUtility() {
  10000. }
  10001. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  10002. var requestMessageText=JSON.stringify(requestMessage.Body);
  10003. OfficeExtension.Utility.log("Request:");
  10004. OfficeExtension.Utility.log(requestMessageText);
  10005. var headers={};
  10006. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  10007. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  10008. return messageSafearray;
  10009. };
  10010. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  10011. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10012. response.Body=JSON.parse(responseBody);
  10013. response.Headers=responseHeaders;
  10014. return response;
  10015. };
  10016. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  10017. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10018. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  10019. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10020. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  10021. }
  10022. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10023. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  10024. }
  10025. response.ErrorMessage=message;
  10026. return response;
  10027. };
  10028. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  10029. var statusCode=500;
  10030. var errorBody={};
  10031. errorBody["error"]={};
  10032. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  10033. errorBody["error"]["message"]=message;
  10034. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10035. statusCode=403;
  10036. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  10037. }
  10038. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10039. statusCode=429;
  10040. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  10041. }
  10042. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  10043. };
  10044. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  10045. var headerArray=[];
  10046. if (headers) {
  10047. for (var headerName in headers) {
  10048. headerArray.push(headerName);
  10049. headerArray.push(headers[headerName]);
  10050. }
  10051. }
  10052. var appPermission=0;
  10053. var solutionId="";
  10054. var instanceId="";
  10055. var marketplaceType="";
  10056. return [
  10057. customData,
  10058. method,
  10059. path,
  10060. headerArray,
  10061. body,
  10062. appPermission,
  10063. requestFlags,
  10064. solutionId,
  10065. instanceId,
  10066. marketplaceType
  10067. ];
  10068. };
  10069. RichApiMessageUtility.getResponseBody=function (result) {
  10070. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  10071. };
  10072. RichApiMessageUtility.getResponseHeaders=function (result) {
  10073. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  10074. };
  10075. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  10076. var ret=data[2 ];
  10077. if (typeof (ret)==="string") {
  10078. return ret;
  10079. }
  10080. var arr=ret;
  10081. return arr.join("");
  10082. };
  10083. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  10084. var arrayHeader=data[1 ];
  10085. if (!arrayHeader) {
  10086. return null;
  10087. }
  10088. var headers={};
  10089. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  10090. headers[arrayHeader[i]]=arrayHeader[i+1];
  10091. }
  10092. return headers;
  10093. };
  10094. RichApiMessageUtility.getResponseStatusCode=function (result) {
  10095. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  10096. };
  10097. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  10098. return data[0 ];
  10099. };
  10100. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  10101. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  10102. return RichApiMessageUtility;
  10103. })();
  10104. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  10105. })(OfficeExtension || (OfficeExtension={}));
  10106. var OfficeExtension;
  10107. (function (OfficeExtension) {
  10108. var Utility=(function () {
  10109. function Utility() {
  10110. }
  10111. Utility.checkArgumentNull=function (value, name) {
  10112. if (Utility.isNullOrUndefined(value)) {
  10113. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  10114. }
  10115. };
  10116. Utility.isNullOrUndefined=function (value) {
  10117. if (value===null) {
  10118. return true;
  10119. }
  10120. if (typeof (value)==="undefined") {
  10121. return true;
  10122. }
  10123. return false;
  10124. };
  10125. Utility.isUndefined=function (value) {
  10126. if (typeof (value)==="undefined") {
  10127. return true;
  10128. }
  10129. return false;
  10130. };
  10131. Utility.isNullOrEmptyString=function (value) {
  10132. if (value===null) {
  10133. return true;
  10134. }
  10135. if (typeof (value)==="undefined") {
  10136. return true;
  10137. }
  10138. if (value.length==0) {
  10139. return true;
  10140. }
  10141. return false;
  10142. };
  10143. Utility.isPlainJsonObject=function (value) {
  10144. if (Utility.isNullOrUndefined(value)) {
  10145. return false;
  10146. }
  10147. if (typeof (value) !=="object") {
  10148. return false;
  10149. }
  10150. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  10151. };
  10152. Utility.trim=function (str) {
  10153. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  10154. };
  10155. Utility.caseInsensitiveCompareString=function (str1, str2) {
  10156. if (Utility.isNullOrUndefined(str1)) {
  10157. return Utility.isNullOrUndefined(str2);
  10158. }
  10159. else {
  10160. if (Utility.isNullOrUndefined(str2)) {
  10161. return false;
  10162. }
  10163. else {
  10164. return str1.toUpperCase()==str2.toUpperCase();
  10165. }
  10166. }
  10167. };
  10168. Utility.adjustToDateTime=function (value) {
  10169. if (Utility.isNullOrUndefined(value)) {
  10170. return null;
  10171. }
  10172. if (typeof (value)==="string") {
  10173. return new Date(value);
  10174. }
  10175. if (Array.isArray(value)) {
  10176. var arr=value;
  10177. for (var i=0; i < arr.length; i++) {
  10178. arr[i]=Utility.adjustToDateTime(arr[i]);
  10179. }
  10180. return arr;
  10181. }
  10182. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  10183. };
  10184. Utility.isReadonlyRestRequest=function (method) {
  10185. return Utility.caseInsensitiveCompareString(method, "GET");
  10186. };
  10187. Utility.setMethodArguments=function (context, argumentInfo, args) {
  10188. if (Utility.isNullOrUndefined(args)) {
  10189. return null;
  10190. }
  10191. var referencedObjectPaths=new Array();
  10192. var referencedObjectPathIds=new Array();
  10193. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  10194. argumentInfo.Arguments=args;
  10195. if (hasOne) {
  10196. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  10197. return referencedObjectPaths;
  10198. }
  10199. return null;
  10200. };
  10201. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  10202. var hasOne=false;
  10203. for (var i=0; i < args.length; i++) {
  10204. if (args[i] instanceof OfficeExtension.ClientObject) {
  10205. var clientObject=args[i];
  10206. Utility.validateContext(context, clientObject);
  10207. args[i]=clientObject._objectPath.objectPathInfo.Id;
  10208. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  10209. referencedObjectPaths.push(clientObject._objectPath);
  10210. hasOne=true;
  10211. }
  10212. else if (Array.isArray(args[i])) {
  10213. var childArrayObjectPathIds=new Array();
  10214. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  10215. if (childArrayHasOne) {
  10216. referencedObjectPathIds.push(childArrayObjectPathIds);
  10217. hasOne=true;
  10218. }
  10219. else {
  10220. referencedObjectPathIds.push(0);
  10221. }
  10222. }
  10223. else {
  10224. referencedObjectPathIds.push(0);
  10225. }
  10226. }
  10227. return hasOne;
  10228. };
  10229. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  10230. if (clientObject && clientObject._objectPath && value) {
  10231. clientObject._objectPath.updateUsingObjectData(value);
  10232. }
  10233. };
  10234. Utility.validateObjectPath=function (clientObject) {
  10235. var objectPath=clientObject._objectPath;
  10236. while (objectPath) {
  10237. if (!objectPath.isValid) {
  10238. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10239. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10240. }
  10241. objectPath=objectPath.parentObjectPath;
  10242. }
  10243. };
  10244. Utility.validateReferencedObjectPaths=function (objectPaths) {
  10245. if (objectPaths) {
  10246. for (var i=0; i < objectPaths.length; i++) {
  10247. var objectPath=objectPaths[i];
  10248. while (objectPath) {
  10249. if (!objectPath.isValid) {
  10250. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10251. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10252. }
  10253. objectPath=objectPath.parentObjectPath;
  10254. }
  10255. }
  10256. }
  10257. };
  10258. Utility.validateContext=function (context, obj) {
  10259. if (obj && obj.context !==context) {
  10260. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  10261. }
  10262. };
  10263. Utility.log=function (message) {
  10264. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  10265. console.log(message);
  10266. }
  10267. };
  10268. Utility.load=function (clientObj, option) {
  10269. clientObj.context.load(clientObj, option);
  10270. };
  10271. Utility._parseSelectExpand=function (select) {
  10272. var args=[];
  10273. if (!Utility.isNullOrEmptyString(select)) {
  10274. var propertyNames=select.split(",");
  10275. for (var i=0; i < propertyNames.length; i++) {
  10276. var propertyName=propertyNames[i];
  10277. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  10278. if (propertyName.length > 0) {
  10279. args.push(propertyName);
  10280. }
  10281. }
  10282. }
  10283. return args;
  10284. function sanitizeForAnyItemsSlash(propertyName) {
  10285. var propertyNameLower=propertyName.toLowerCase();
  10286. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  10287. return '*';
  10288. }
  10289. var itemsSlashLength=6;
  10290. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  10291. propertyName=propertyName.substr(itemsSlashLength);
  10292. }
  10293. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  10294. }
  10295. };
  10296. Utility.throwError=function (resourceId, arg, errorLocation) {
  10297. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  10298. };
  10299. Utility.createRuntimeError=function (code, message, location) {
  10300. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  10301. };
  10302. Utility.createInvalidArgumentException=function (name, errorLocation) {
  10303. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  10304. };
  10305. Utility._getResourceString=function (resourceId, arg) {
  10306. var ret=resourceId;
  10307. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  10308. var stringName="L_"+resourceId;
  10309. var stringValue=window.Strings.OfficeOM[stringName];
  10310. if (stringValue) {
  10311. ret=stringValue;
  10312. }
  10313. }
  10314. if (!Utility.isNullOrUndefined(arg)) {
  10315. if (Array.isArray(arg)) {
  10316. var arrArg=arg;
  10317. ret=Utility._formatString(ret, arrArg);
  10318. }
  10319. else {
  10320. ret=ret.replace("{0}", arg);
  10321. }
  10322. }
  10323. return ret;
  10324. };
  10325. Utility._formatString=function (format, arrArg) {
  10326. return format.replace(/\{\d\}/g, function (v) {
  10327. var position=parseInt(v.substr(1, v.length - 2));
  10328. if (position < arrArg.length) {
  10329. return arrArg[position];
  10330. }
  10331. else {
  10332. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  10333. }
  10334. return "";
  10335. });
  10336. };
  10337. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  10338. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  10339. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  10340. }
  10341. };
  10342. Utility.getObjectPathExpression=function (objectPath) {
  10343. var ret="";
  10344. while (objectPath) {
  10345. switch (objectPath.objectPathInfo.ObjectPathType) {
  10346. case 1 :
  10347. ret=ret;
  10348. break;
  10349. case 2 :
  10350. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  10351. break;
  10352. case 3 :
  10353. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  10354. break;
  10355. case 4 :
  10356. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  10357. break;
  10358. case 5 :
  10359. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  10360. break;
  10361. case 6 :
  10362. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  10363. break;
  10364. }
  10365. objectPath=objectPath.parentObjectPath;
  10366. }
  10367. return ret;
  10368. };
  10369. Utility._createPromiseFromResult=function (value) {
  10370. return new OfficeExtension.Promise(function (resolve, reject) {
  10371. resolve(value);
  10372. });
  10373. };
  10374. Utility._createTimeoutPromise=function (timeout) {
  10375. return new OfficeExtension.Promise(function (resolve, reject) {
  10376. setTimeout(function () {
  10377. resolve(null);
  10378. }, timeout);
  10379. });
  10380. };
  10381. Utility.promisify=function (action) {
  10382. return new OfficeExtension.Promise(function (resolve, reject) {
  10383. var callback=function (result) {
  10384. if (result.status=="failed") {
  10385. reject(result.error);
  10386. }
  10387. else {
  10388. resolve(result.value);
  10389. }
  10390. };
  10391. action(callback);
  10392. });
  10393. };
  10394. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  10395. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  10396. };
  10397. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  10398. for (var i=0; i < propertyNames.length - 1; i+=2) {
  10399. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  10400. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  10401. }
  10402. }
  10403. };
  10404. Utility.normalizeName=function (name) {
  10405. return name.substr(0, 1).toLowerCase()+name.substr(1);
  10406. };
  10407. Utility._isLocalDocumentUrl=function (url) {
  10408. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  10409. };
  10410. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  10411. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  10412. var urlLower=url.toLowerCase().trim();
  10413. for (var i=0; i < localDocumentPrefixes.length; i++) {
  10414. if (urlLower===localDocumentPrefixes[i]) {
  10415. return localDocumentPrefixes[i].length;
  10416. }
  10417. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  10418. return localDocumentPrefixes[i].length+1;
  10419. }
  10420. }
  10421. return 0;
  10422. };
  10423. Utility._validateLocalDocumentRequest=function (request) {
  10424. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  10425. if (index <=0) {
  10426. throw Utility.createInvalidArgumentException("request");
  10427. }
  10428. var path=request.url.substr(index);
  10429. var pathLower=path.toLowerCase();
  10430. if (pathLower==="_api") {
  10431. path="";
  10432. }
  10433. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  10434. path=path.substr("_api/".length);
  10435. }
  10436. return {
  10437. method: request.method,
  10438. url: path,
  10439. headers: request.headers,
  10440. body: request.body
  10441. };
  10442. };
  10443. Utility._buildRequestMessageSafeArray=function (request) {
  10444. var requestFlags=0 ;
  10445. if (!Utility.isReadonlyRestRequest(request.method)) {
  10446. requestFlags=1 ;
  10447. }
  10448. var requestInfo="";
  10449. if (request.headers) {
  10450. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  10451. if (!Utility.isNullOrEmptyString(requestInfo)) {
  10452. var parts=requestInfo.split("&");
  10453. for (var i=0; i < parts.length; i++) {
  10454. var keyvalue=parts[i].split("=");
  10455. if (keyvalue[0]=="flags") {
  10456. var flags=parseInt(keyvalue[1]);
  10457. requestFlags=flags;
  10458. break;
  10459. }
  10460. }
  10461. }
  10462. }
  10463. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  10464. };
  10465. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  10466. var responseHeaders={};
  10467. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  10468. var regex=new RegExp("\r?\n");
  10469. var entries=allResponseHeaders.split(regex);
  10470. for (var i=0; i < entries.length; i++) {
  10471. var entry=entries[i];
  10472. if (entry !=null) {
  10473. var index=entry.indexOf(':');
  10474. if (index > 0) {
  10475. var key=entry.substr(0, index);
  10476. var value=entry.substr(index+1);
  10477. key=Utility.trim(key);
  10478. value=Utility.trim(value);
  10479. responseHeaders[key.toUpperCase()]=value;
  10480. }
  10481. }
  10482. }
  10483. }
  10484. return responseHeaders;
  10485. };
  10486. Utility._logEnabled=false;
  10487. Utility.s_underscoreCharCode="_".charCodeAt(0);
  10488. return Utility;
  10489. })();
  10490. OfficeExtension.Utility=Utility;
  10491. })(OfficeExtension || (OfficeExtension={}));
  10492. var __extends=(this && this.__extends) || function (d, b) {
  10493. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10494. function __() { this.constructor=d; }
  10495. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  10496. };
  10497. var Excel;
  10498. (function (Excel) {
  10499. function lowerCaseFirst(str) {
  10500. return str[0].toLowerCase()+str.slice(1);
  10501. }
  10502. var iconSets=["ThreeArrows",
  10503. "ThreeArrowsGray",
  10504. "ThreeFlags",
  10505. "ThreeTrafficLights1",
  10506. "ThreeTrafficLights2",
  10507. "ThreeSigns",
  10508. "ThreeSymbols",
  10509. "ThreeSymbols2",
  10510. "FourArrows",
  10511. "FourArrowsGray",
  10512. "FourRedToBlack",
  10513. "FourRating",
  10514. "FourTrafficLights",
  10515. "FiveArrows",
  10516. "FiveArrowsGray",
  10517. "FiveRating",
  10518. "FiveQuarters",
  10519. "ThreeStars",
  10520. "ThreeTriangles",
  10521. "FiveBoxes"];
  10522. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  10523. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  10524. ["RedFlag", "YellowFlag", "GreenFlag"],
  10525. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10526. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  10527. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  10528. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  10529. ["RedCross", "YellowExclamation", "GreenCheck"],
  10530. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10531. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10532. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  10533. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10534. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10535. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10536. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10537. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10538. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  10539. ["SilverStar", "HalfGoldStar", "GoldStar"],
  10540. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  10541. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  10542. Excel.icons={};
  10543. iconSets.map(function (title, i) {
  10544. var camelTitle=lowerCaseFirst(title);
  10545. Excel.icons[camelTitle]=[];
  10546. iconNames[i].map(function (iconName, j) {
  10547. iconName=lowerCaseFirst(iconName);
  10548. var obj={ set: title, index: j };
  10549. Excel.icons[camelTitle].push(obj);
  10550. Excel.icons[camelTitle][iconName]=obj;
  10551. });
  10552. });
  10553. function setRangePropertiesInBulk(range, propertyName, values) {
  10554. var maxCellCount=1500;
  10555. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  10556. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  10557. range._ValidateArraySize(values.length, values[0].length);
  10558. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  10559. var rowCount=maxRowCount;
  10560. if (startRowIndex+rowCount > values.length) {
  10561. rowCount=values.length - startRowIndex;
  10562. }
  10563. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  10564. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  10565. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  10566. }
  10567. return true;
  10568. }
  10569. return false;
  10570. }
  10571. function isExcel1_3OrAbove() {
  10572. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  10573. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  10574. }
  10575. else {
  10576. return true;
  10577. }
  10578. }
  10579. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  10580. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  10581. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  10582. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  10583. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  10584. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  10585. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  10586. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  10587. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  10588. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  10589. var _isUndefined=OfficeExtension.Utility.isUndefined;
  10590. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  10591. var _load=OfficeExtension.Utility.load;
  10592. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  10593. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  10594. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  10595. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  10596. var Application=(function (_super) {
  10597. __extends(Application, _super);
  10598. function Application() {
  10599. _super.apply(this, arguments);
  10600. }
  10601. Object.defineProperty(Application.prototype, "calculationMode", {
  10602. get: function () {
  10603. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  10604. return this.m_calculationMode;
  10605. },
  10606. enumerable: true,
  10607. configurable: true
  10608. });
  10609. Application.prototype.calculate=function (calculationType) {
  10610. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  10611. };
  10612. Application.prototype._handleResult=function (value) {
  10613. _super.prototype._handleResult.call(this, value);
  10614. if (_isNullOrUndefined(value))
  10615. return;
  10616. var obj=value;
  10617. _fixObjectPathIfNecessary(this, obj);
  10618. if (!_isUndefined(obj["CalculationMode"])) {
  10619. this.m_calculationMode=obj["CalculationMode"];
  10620. }
  10621. };
  10622. Application.prototype.load=function (option) {
  10623. _load(this, option);
  10624. return this;
  10625. };
  10626. Application.prototype.toJSON=function () {
  10627. return {
  10628. "calculationMode": this.m_calculationMode
  10629. };
  10630. };
  10631. return Application;
  10632. }(OfficeExtension.ClientObject));
  10633. Excel.Application=Application;
  10634. var Workbook=(function (_super) {
  10635. __extends(Workbook, _super);
  10636. function Workbook() {
  10637. _super.apply(this, arguments);
  10638. }
  10639. Object.defineProperty(Workbook.prototype, "application", {
  10640. get: function () {
  10641. if (!this.m_application) {
  10642. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  10643. }
  10644. return this.m_application;
  10645. },
  10646. enumerable: true,
  10647. configurable: true
  10648. });
  10649. Object.defineProperty(Workbook.prototype, "bindings", {
  10650. get: function () {
  10651. if (!this.m_bindings) {
  10652. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  10653. }
  10654. return this.m_bindings;
  10655. },
  10656. enumerable: true,
  10657. configurable: true
  10658. });
  10659. Object.defineProperty(Workbook.prototype, "functions", {
  10660. get: function () {
  10661. if (!this.m_functions) {
  10662. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  10663. }
  10664. return this.m_functions;
  10665. },
  10666. enumerable: true,
  10667. configurable: true
  10668. });
  10669. Object.defineProperty(Workbook.prototype, "names", {
  10670. get: function () {
  10671. if (!this.m_names) {
  10672. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  10673. }
  10674. return this.m_names;
  10675. },
  10676. enumerable: true,
  10677. configurable: true
  10678. });
  10679. Object.defineProperty(Workbook.prototype, "pivotTables", {
  10680. get: function () {
  10681. if (!this.m_pivotTables) {
  10682. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10683. }
  10684. return this.m_pivotTables;
  10685. },
  10686. enumerable: true,
  10687. configurable: true
  10688. });
  10689. Object.defineProperty(Workbook.prototype, "tables", {
  10690. get: function () {
  10691. if (!this.m_tables) {
  10692. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10693. }
  10694. return this.m_tables;
  10695. },
  10696. enumerable: true,
  10697. configurable: true
  10698. });
  10699. Object.defineProperty(Workbook.prototype, "worksheets", {
  10700. get: function () {
  10701. if (!this.m_worksheets) {
  10702. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  10703. }
  10704. return this.m_worksheets;
  10705. },
  10706. enumerable: true,
  10707. configurable: true
  10708. });
  10709. Object.defineProperty(Workbook.prototype, "_V1Api", {
  10710. get: function () {
  10711. if (!this.m__V1Api) {
  10712. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  10713. }
  10714. return this.m__V1Api;
  10715. },
  10716. enumerable: true,
  10717. configurable: true
  10718. });
  10719. Workbook.prototype.getSelectedRange=function () {
  10720. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  10721. };
  10722. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  10723. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10724. var ret=new OfficeExtension.ClientResult();
  10725. _addActionResultHandler(this, action, ret);
  10726. return ret;
  10727. };
  10728. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  10729. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10730. var ret=new OfficeExtension.ClientResult();
  10731. _addActionResultHandler(this, action, ret);
  10732. return ret;
  10733. };
  10734. Workbook.prototype._GetReferenceCount=function () {
  10735. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  10736. var ret=new OfficeExtension.ClientResult();
  10737. _addActionResultHandler(this, action, ret);
  10738. return ret;
  10739. };
  10740. Workbook.prototype._RemoveAllReferences=function () {
  10741. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  10742. };
  10743. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  10744. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10745. };
  10746. Workbook.prototype._handleResult=function (value) {
  10747. _super.prototype._handleResult.call(this, value);
  10748. if (_isNullOrUndefined(value))
  10749. return;
  10750. var obj=value;
  10751. _fixObjectPathIfNecessary(this, obj);
  10752. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  10753. };
  10754. Workbook.prototype.load=function (option) {
  10755. _load(this, option);
  10756. return this;
  10757. };
  10758. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  10759. get: function () {
  10760. var _this=this;
  10761. if (!this.m_selectionChanged) {
  10762. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  10763. registerFunc: function (handlerCallback) {
  10764. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  10765. },
  10766. unregisterFunc: function (handlerCallback) {
  10767. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  10768. },
  10769. eventArgsTransformFunc: function (args) {
  10770. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  10771. }
  10772. });
  10773. }
  10774. return this.m_selectionChanged;
  10775. },
  10776. enumerable: true,
  10777. configurable: true
  10778. });
  10779. Workbook.prototype.toJSON=function () {
  10780. return {};
  10781. };
  10782. return Workbook;
  10783. }(OfficeExtension.ClientObject));
  10784. Excel.Workbook=Workbook;
  10785. var Worksheet=(function (_super) {
  10786. __extends(Worksheet, _super);
  10787. function Worksheet() {
  10788. _super.apply(this, arguments);
  10789. }
  10790. Object.defineProperty(Worksheet.prototype, "charts", {
  10791. get: function () {
  10792. if (!this.m_charts) {
  10793. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  10794. }
  10795. return this.m_charts;
  10796. },
  10797. enumerable: true,
  10798. configurable: true
  10799. });
  10800. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  10801. get: function () {
  10802. if (!this.m_pivotTables) {
  10803. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10804. }
  10805. return this.m_pivotTables;
  10806. },
  10807. enumerable: true,
  10808. configurable: true
  10809. });
  10810. Object.defineProperty(Worksheet.prototype, "protection", {
  10811. get: function () {
  10812. if (!this.m_protection) {
  10813. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  10814. }
  10815. return this.m_protection;
  10816. },
  10817. enumerable: true,
  10818. configurable: true
  10819. });
  10820. Object.defineProperty(Worksheet.prototype, "tables", {
  10821. get: function () {
  10822. if (!this.m_tables) {
  10823. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10824. }
  10825. return this.m_tables;
  10826. },
  10827. enumerable: true,
  10828. configurable: true
  10829. });
  10830. Object.defineProperty(Worksheet.prototype, "id", {
  10831. get: function () {
  10832. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  10833. return this.m_id;
  10834. },
  10835. enumerable: true,
  10836. configurable: true
  10837. });
  10838. Object.defineProperty(Worksheet.prototype, "name", {
  10839. get: function () {
  10840. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  10841. return this.m_name;
  10842. },
  10843. set: function (value) {
  10844. this.m_name=value;
  10845. _createSetPropertyAction(this.context, this, "Name", value);
  10846. },
  10847. enumerable: true,
  10848. configurable: true
  10849. });
  10850. Object.defineProperty(Worksheet.prototype, "position", {
  10851. get: function () {
  10852. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  10853. return this.m_position;
  10854. },
  10855. set: function (value) {
  10856. this.m_position=value;
  10857. _createSetPropertyAction(this.context, this, "Position", value);
  10858. },
  10859. enumerable: true,
  10860. configurable: true
  10861. });
  10862. Object.defineProperty(Worksheet.prototype, "visibility", {
  10863. get: function () {
  10864. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  10865. return this.m_visibility;
  10866. },
  10867. set: function (value) {
  10868. this.m_visibility=value;
  10869. _createSetPropertyAction(this.context, this, "Visibility", value);
  10870. },
  10871. enumerable: true,
  10872. configurable: true
  10873. });
  10874. Worksheet.prototype.activate=function () {
  10875. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  10876. };
  10877. Worksheet.prototype.delete=function () {
  10878. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  10879. };
  10880. Worksheet.prototype.getCell=function (row, column) {
  10881. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  10882. };
  10883. Worksheet.prototype.getRange=function (address) {
  10884. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  10885. };
  10886. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  10887. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  10888. };
  10889. Worksheet.prototype._handleResult=function (value) {
  10890. _super.prototype._handleResult.call(this, value);
  10891. if (_isNullOrUndefined(value))
  10892. return;
  10893. var obj=value;
  10894. _fixObjectPathIfNecessary(this, obj);
  10895. if (!_isUndefined(obj["Id"])) {
  10896. this.m_id=obj["Id"];
  10897. }
  10898. if (!_isUndefined(obj["Name"])) {
  10899. this.m_name=obj["Name"];
  10900. }
  10901. if (!_isUndefined(obj["Position"])) {
  10902. this.m_position=obj["Position"];
  10903. }
  10904. if (!_isUndefined(obj["Visibility"])) {
  10905. this.m_visibility=obj["Visibility"];
  10906. }
  10907. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  10908. };
  10909. Worksheet.prototype.load=function (option) {
  10910. _load(this, option);
  10911. return this;
  10912. };
  10913. Worksheet.prototype._handleIdResult=function (value) {
  10914. _super.prototype._handleIdResult.call(this, value);
  10915. if (_isNullOrUndefined(value)) {
  10916. return;
  10917. }
  10918. if (!_isUndefined(value["Id"])) {
  10919. this.m_id=value["Id"];
  10920. }
  10921. };
  10922. Worksheet.prototype.toJSON=function () {
  10923. return {
  10924. "id": this.m_id,
  10925. "name": this.m_name,
  10926. "position": this.m_position,
  10927. "protection": this.m_protection,
  10928. "visibility": this.m_visibility
  10929. };
  10930. };
  10931. return Worksheet;
  10932. }(OfficeExtension.ClientObject));
  10933. Excel.Worksheet=Worksheet;
  10934. var WorksheetCollection=(function (_super) {
  10935. __extends(WorksheetCollection, _super);
  10936. function WorksheetCollection() {
  10937. _super.apply(this, arguments);
  10938. }
  10939. Object.defineProperty(WorksheetCollection.prototype, "items", {
  10940. get: function () {
  10941. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  10942. return this.m__items;
  10943. },
  10944. enumerable: true,
  10945. configurable: true
  10946. });
  10947. WorksheetCollection.prototype.add=function (name) {
  10948. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  10949. };
  10950. WorksheetCollection.prototype.getActiveWorksheet=function () {
  10951. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  10952. };
  10953. WorksheetCollection.prototype.getItem=function (key) {
  10954. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  10955. };
  10956. WorksheetCollection.prototype._handleResult=function (value) {
  10957. _super.prototype._handleResult.call(this, value);
  10958. if (_isNullOrUndefined(value))
  10959. return;
  10960. var obj=value;
  10961. _fixObjectPathIfNecessary(this, obj);
  10962. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  10963. this.m__items=[];
  10964. var _data=obj[OfficeExtension.Constants.items];
  10965. for (var i=0; i < _data.length; i++) {
  10966. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  10967. _item._handleResult(_data[i]);
  10968. this.m__items.push(_item);
  10969. }
  10970. }
  10971. };
  10972. WorksheetCollection.prototype.load=function (option) {
  10973. _load(this, option);
  10974. return this;
  10975. };
  10976. WorksheetCollection.prototype.toJSON=function () {
  10977. return {};
  10978. };
  10979. return WorksheetCollection;
  10980. }(OfficeExtension.ClientObject));
  10981. Excel.WorksheetCollection=WorksheetCollection;
  10982. var WorksheetProtection=(function (_super) {
  10983. __extends(WorksheetProtection, _super);
  10984. function WorksheetProtection() {
  10985. _super.apply(this, arguments);
  10986. }
  10987. Object.defineProperty(WorksheetProtection.prototype, "options", {
  10988. get: function () {
  10989. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  10990. return this.m_options;
  10991. },
  10992. enumerable: true,
  10993. configurable: true
  10994. });
  10995. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  10996. get: function () {
  10997. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  10998. return this.m_protected;
  10999. },
  11000. enumerable: true,
  11001. configurable: true
  11002. });
  11003. WorksheetProtection.prototype.protect=function (options) {
  11004. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  11005. };
  11006. WorksheetProtection.prototype.unprotect=function () {
  11007. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  11008. };
  11009. WorksheetProtection.prototype._handleResult=function (value) {
  11010. _super.prototype._handleResult.call(this, value);
  11011. if (_isNullOrUndefined(value))
  11012. return;
  11013. var obj=value;
  11014. _fixObjectPathIfNecessary(this, obj);
  11015. if (!_isUndefined(obj["Options"])) {
  11016. this.m_options=obj["Options"];
  11017. }
  11018. if (!_isUndefined(obj["Protected"])) {
  11019. this.m_protected=obj["Protected"];
  11020. }
  11021. };
  11022. WorksheetProtection.prototype.load=function (option) {
  11023. _load(this, option);
  11024. return this;
  11025. };
  11026. WorksheetProtection.prototype.toJSON=function () {
  11027. return {
  11028. "options": this.m_options,
  11029. "protected": this.m_protected
  11030. };
  11031. };
  11032. return WorksheetProtection;
  11033. }(OfficeExtension.ClientObject));
  11034. Excel.WorksheetProtection=WorksheetProtection;
  11035. var Range=(function (_super) {
  11036. __extends(Range, _super);
  11037. function Range() {
  11038. _super.apply(this, arguments);
  11039. }
  11040. Range.prototype._ensureInteger=function (num, methodName) {
  11041. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  11042. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  11043. }
  11044. };
  11045. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  11046. if (count==null) {
  11047. count=1;
  11048. }
  11049. this._ensureInteger(count, functionName);
  11050. var startRange;
  11051. var rowOffset=0;
  11052. var columnOffset=0;
  11053. if (count > 0) {
  11054. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  11055. }
  11056. else {
  11057. startRange=referenceRange;
  11058. rowOffset=rowDirection;
  11059. columnOffset=columnDirection;
  11060. }
  11061. if (Math.abs(count)==1) {
  11062. return startRange;
  11063. }
  11064. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  11065. };
  11066. Object.defineProperty(Range.prototype, "format", {
  11067. get: function () {
  11068. if (!this.m_format) {
  11069. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  11070. }
  11071. return this.m_format;
  11072. },
  11073. enumerable: true,
  11074. configurable: true
  11075. });
  11076. Object.defineProperty(Range.prototype, "sort", {
  11077. get: function () {
  11078. if (!this.m_sort) {
  11079. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  11080. }
  11081. return this.m_sort;
  11082. },
  11083. enumerable: true,
  11084. configurable: true
  11085. });
  11086. Object.defineProperty(Range.prototype, "worksheet", {
  11087. get: function () {
  11088. if (!this.m_worksheet) {
  11089. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  11090. }
  11091. return this.m_worksheet;
  11092. },
  11093. enumerable: true,
  11094. configurable: true
  11095. });
  11096. Object.defineProperty(Range.prototype, "address", {
  11097. get: function () {
  11098. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  11099. return this.m_address;
  11100. },
  11101. enumerable: true,
  11102. configurable: true
  11103. });
  11104. Object.defineProperty(Range.prototype, "addressLocal", {
  11105. get: function () {
  11106. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  11107. return this.m_addressLocal;
  11108. },
  11109. enumerable: true,
  11110. configurable: true
  11111. });
  11112. Object.defineProperty(Range.prototype, "cellCount", {
  11113. get: function () {
  11114. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  11115. return this.m_cellCount;
  11116. },
  11117. enumerable: true,
  11118. configurable: true
  11119. });
  11120. Object.defineProperty(Range.prototype, "columnCount", {
  11121. get: function () {
  11122. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  11123. return this.m_columnCount;
  11124. },
  11125. enumerable: true,
  11126. configurable: true
  11127. });
  11128. Object.defineProperty(Range.prototype, "columnHidden", {
  11129. get: function () {
  11130. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  11131. return this.m_columnHidden;
  11132. },
  11133. set: function (value) {
  11134. this.m_columnHidden=value;
  11135. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  11136. },
  11137. enumerable: true,
  11138. configurable: true
  11139. });
  11140. Object.defineProperty(Range.prototype, "columnIndex", {
  11141. get: function () {
  11142. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  11143. return this.m_columnIndex;
  11144. },
  11145. enumerable: true,
  11146. configurable: true
  11147. });
  11148. Object.defineProperty(Range.prototype, "formulas", {
  11149. get: function () {
  11150. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  11151. return this.m_formulas;
  11152. },
  11153. set: function (value) {
  11154. this.m_formulas=value;
  11155. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  11156. return;
  11157. }
  11158. this.m_formulas=value;
  11159. _createSetPropertyAction(this.context, this, "Formulas", value);
  11160. },
  11161. enumerable: true,
  11162. configurable: true
  11163. });
  11164. Object.defineProperty(Range.prototype, "formulasLocal", {
  11165. get: function () {
  11166. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  11167. return this.m_formulasLocal;
  11168. },
  11169. set: function (value) {
  11170. this.m_formulasLocal=value;
  11171. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  11172. return;
  11173. }
  11174. this.m_formulasLocal=value;
  11175. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11176. },
  11177. enumerable: true,
  11178. configurable: true
  11179. });
  11180. Object.defineProperty(Range.prototype, "formulasR1C1", {
  11181. get: function () {
  11182. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  11183. return this.m_formulasR1C1;
  11184. },
  11185. set: function (value) {
  11186. this.m_formulasR1C1=value;
  11187. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  11188. return;
  11189. }
  11190. this.m_formulasR1C1=value;
  11191. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11192. },
  11193. enumerable: true,
  11194. configurable: true
  11195. });
  11196. Object.defineProperty(Range.prototype, "hidden", {
  11197. get: function () {
  11198. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  11199. return this.m_hidden;
  11200. },
  11201. enumerable: true,
  11202. configurable: true
  11203. });
  11204. Object.defineProperty(Range.prototype, "numberFormat", {
  11205. get: function () {
  11206. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  11207. return this.m_numberFormat;
  11208. },
  11209. set: function (value) {
  11210. this.m_numberFormat=value;
  11211. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  11212. return;
  11213. }
  11214. this.m_numberFormat=value;
  11215. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11216. },
  11217. enumerable: true,
  11218. configurable: true
  11219. });
  11220. Object.defineProperty(Range.prototype, "rowCount", {
  11221. get: function () {
  11222. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  11223. return this.m_rowCount;
  11224. },
  11225. enumerable: true,
  11226. configurable: true
  11227. });
  11228. Object.defineProperty(Range.prototype, "rowHidden", {
  11229. get: function () {
  11230. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  11231. return this.m_rowHidden;
  11232. },
  11233. set: function (value) {
  11234. this.m_rowHidden=value;
  11235. _createSetPropertyAction(this.context, this, "RowHidden", value);
  11236. },
  11237. enumerable: true,
  11238. configurable: true
  11239. });
  11240. Object.defineProperty(Range.prototype, "rowIndex", {
  11241. get: function () {
  11242. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  11243. return this.m_rowIndex;
  11244. },
  11245. enumerable: true,
  11246. configurable: true
  11247. });
  11248. Object.defineProperty(Range.prototype, "text", {
  11249. get: function () {
  11250. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  11251. return this.m_text;
  11252. },
  11253. enumerable: true,
  11254. configurable: true
  11255. });
  11256. Object.defineProperty(Range.prototype, "valueTypes", {
  11257. get: function () {
  11258. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  11259. return this.m_valueTypes;
  11260. },
  11261. enumerable: true,
  11262. configurable: true
  11263. });
  11264. Object.defineProperty(Range.prototype, "values", {
  11265. get: function () {
  11266. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  11267. return this.m_values;
  11268. },
  11269. set: function (value) {
  11270. this.m_values=value;
  11271. if (setRangePropertiesInBulk(this, "Values", value)) {
  11272. return;
  11273. }
  11274. this.m_values=value;
  11275. _createSetPropertyAction(this.context, this, "Values", value);
  11276. },
  11277. enumerable: true,
  11278. configurable: true
  11279. });
  11280. Object.defineProperty(Range.prototype, "_ReferenceId", {
  11281. get: function () {
  11282. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  11283. return this.m__ReferenceId;
  11284. },
  11285. enumerable: true,
  11286. configurable: true
  11287. });
  11288. Range.prototype.clear=function (applyTo) {
  11289. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  11290. };
  11291. Range.prototype.delete=function (shift) {
  11292. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  11293. };
  11294. Range.prototype.getBoundingRect=function (anotherRange) {
  11295. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11296. };
  11297. Range.prototype.getCell=function (row, column) {
  11298. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  11299. };
  11300. Range.prototype.getColumn=function (column) {
  11301. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  11302. };
  11303. Range.prototype.getColumnsAfter=function (count) {
  11304. if (!isExcel1_3OrAbove()) {
  11305. if (count==null) {
  11306. count=1;
  11307. }
  11308. this._ensureInteger(count, "RowsAbove");
  11309. if (count==0) {
  11310. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11311. }
  11312. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  11313. }
  11314. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  11315. };
  11316. Range.prototype.getColumnsBefore=function (count) {
  11317. if (!isExcel1_3OrAbove()) {
  11318. if (count==null) {
  11319. count=1;
  11320. }
  11321. this._ensureInteger(count, "RowsAbove");
  11322. if (count==0) {
  11323. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11324. }
  11325. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  11326. }
  11327. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  11328. };
  11329. Range.prototype.getEntireColumn=function () {
  11330. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11331. };
  11332. Range.prototype.getEntireRow=function () {
  11333. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11334. };
  11335. Range.prototype.getIntersection=function (anotherRange) {
  11336. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11337. };
  11338. Range.prototype.getLastCell=function () {
  11339. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  11340. };
  11341. Range.prototype.getLastColumn=function () {
  11342. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11343. };
  11344. Range.prototype.getLastRow=function () {
  11345. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11346. };
  11347. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  11348. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  11349. };
  11350. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  11351. if (!isExcel1_3OrAbove()) {
  11352. this._ensureInteger(deltaRows, "getResizedRange");
  11353. this._ensureInteger(deltaColumns, "getResizedRange");
  11354. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  11355. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  11356. }
  11357. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  11358. };
  11359. Range.prototype.getRow=function (row) {
  11360. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  11361. };
  11362. Range.prototype.getRowsAbove=function (count) {
  11363. if (!isExcel1_3OrAbove()) {
  11364. if (count==null) {
  11365. count=1;
  11366. }
  11367. this._ensureInteger(count, "RowsAbove");
  11368. if (count==0) {
  11369. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11370. }
  11371. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  11372. }
  11373. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  11374. };
  11375. Range.prototype.getRowsBelow=function (count) {
  11376. if (!isExcel1_3OrAbove()) {
  11377. if (count==null) {
  11378. count=1;
  11379. }
  11380. this._ensureInteger(count, "RowsAbove");
  11381. if (count==0) {
  11382. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11383. }
  11384. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  11385. }
  11386. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  11387. };
  11388. Range.prototype.getUsedRange=function (valuesOnly) {
  11389. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  11390. };
  11391. Range.prototype.getVisibleView=function () {
  11392. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  11393. };
  11394. Range.prototype.insert=function (shift) {
  11395. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  11396. };
  11397. Range.prototype.merge=function (across) {
  11398. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  11399. };
  11400. Range.prototype.select=function () {
  11401. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  11402. };
  11403. Range.prototype.unmerge=function () {
  11404. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  11405. };
  11406. Range.prototype._KeepReference=function () {
  11407. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  11408. };
  11409. Range.prototype._ValidateArraySize=function (rows, columns) {
  11410. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  11411. };
  11412. Range.prototype._handleResult=function (value) {
  11413. _super.prototype._handleResult.call(this, value);
  11414. if (_isNullOrUndefined(value))
  11415. return;
  11416. var obj=value;
  11417. _fixObjectPathIfNecessary(this, obj);
  11418. if (!_isUndefined(obj["Address"])) {
  11419. this.m_address=obj["Address"];
  11420. }
  11421. if (!_isUndefined(obj["AddressLocal"])) {
  11422. this.m_addressLocal=obj["AddressLocal"];
  11423. }
  11424. if (!_isUndefined(obj["CellCount"])) {
  11425. this.m_cellCount=obj["CellCount"];
  11426. }
  11427. if (!_isUndefined(obj["ColumnCount"])) {
  11428. this.m_columnCount=obj["ColumnCount"];
  11429. }
  11430. if (!_isUndefined(obj["ColumnHidden"])) {
  11431. this.m_columnHidden=obj["ColumnHidden"];
  11432. }
  11433. if (!_isUndefined(obj["ColumnIndex"])) {
  11434. this.m_columnIndex=obj["ColumnIndex"];
  11435. }
  11436. if (!_isUndefined(obj["Formulas"])) {
  11437. this.m_formulas=obj["Formulas"];
  11438. }
  11439. if (!_isUndefined(obj["FormulasLocal"])) {
  11440. this.m_formulasLocal=obj["FormulasLocal"];
  11441. }
  11442. if (!_isUndefined(obj["FormulasR1C1"])) {
  11443. this.m_formulasR1C1=obj["FormulasR1C1"];
  11444. }
  11445. if (!_isUndefined(obj["Hidden"])) {
  11446. this.m_hidden=obj["Hidden"];
  11447. }
  11448. if (!_isUndefined(obj["NumberFormat"])) {
  11449. this.m_numberFormat=obj["NumberFormat"];
  11450. }
  11451. if (!_isUndefined(obj["RowCount"])) {
  11452. this.m_rowCount=obj["RowCount"];
  11453. }
  11454. if (!_isUndefined(obj["RowHidden"])) {
  11455. this.m_rowHidden=obj["RowHidden"];
  11456. }
  11457. if (!_isUndefined(obj["RowIndex"])) {
  11458. this.m_rowIndex=obj["RowIndex"];
  11459. }
  11460. if (!_isUndefined(obj["Text"])) {
  11461. this.m_text=obj["Text"];
  11462. }
  11463. if (!_isUndefined(obj["ValueTypes"])) {
  11464. this.m_valueTypes=obj["ValueTypes"];
  11465. }
  11466. if (!_isUndefined(obj["Values"])) {
  11467. this.m_values=obj["Values"];
  11468. }
  11469. if (!_isUndefined(obj["_ReferenceId"])) {
  11470. this.m__ReferenceId=obj["_ReferenceId"];
  11471. }
  11472. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  11473. };
  11474. Range.prototype.load=function (option) {
  11475. _load(this, option);
  11476. return this;
  11477. };
  11478. Range.prototype._handleIdResult=function (value) {
  11479. _super.prototype._handleIdResult.call(this, value);
  11480. if (_isNullOrUndefined(value)) {
  11481. return;
  11482. }
  11483. if (!_isUndefined(value["_ReferenceId"])) {
  11484. this.m__ReferenceId=value["_ReferenceId"];
  11485. }
  11486. };
  11487. Range.prototype.track=function () {
  11488. this.context.trackedObjects.add(this);
  11489. return this;
  11490. };
  11491. Range.prototype.untrack=function () {
  11492. this.context.trackedObjects.remove(this);
  11493. return this;
  11494. };
  11495. Range.prototype.toJSON=function () {
  11496. return {
  11497. "address": this.m_address,
  11498. "addressLocal": this.m_addressLocal,
  11499. "cellCount": this.m_cellCount,
  11500. "columnCount": this.m_columnCount,
  11501. "columnHidden": this.m_columnHidden,
  11502. "columnIndex": this.m_columnIndex,
  11503. "format": this.m_format,
  11504. "formulas": this.m_formulas,
  11505. "formulasLocal": this.m_formulasLocal,
  11506. "formulasR1C1": this.m_formulasR1C1,
  11507. "hidden": this.m_hidden,
  11508. "numberFormat": this.m_numberFormat,
  11509. "rowCount": this.m_rowCount,
  11510. "rowHidden": this.m_rowHidden,
  11511. "rowIndex": this.m_rowIndex,
  11512. "text": this.m_text,
  11513. "values": this.m_values,
  11514. "valueTypes": this.m_valueTypes
  11515. };
  11516. };
  11517. return Range;
  11518. }(OfficeExtension.ClientObject));
  11519. Excel.Range=Range;
  11520. var RangeView=(function (_super) {
  11521. __extends(RangeView, _super);
  11522. function RangeView() {
  11523. _super.apply(this, arguments);
  11524. }
  11525. Object.defineProperty(RangeView.prototype, "rows", {
  11526. get: function () {
  11527. if (!this.m_rows) {
  11528. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  11529. }
  11530. return this.m_rows;
  11531. },
  11532. enumerable: true,
  11533. configurable: true
  11534. });
  11535. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  11536. get: function () {
  11537. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  11538. return this.m_cellAddresses;
  11539. },
  11540. enumerable: true,
  11541. configurable: true
  11542. });
  11543. Object.defineProperty(RangeView.prototype, "columnCount", {
  11544. get: function () {
  11545. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  11546. return this.m_columnCount;
  11547. },
  11548. enumerable: true,
  11549. configurable: true
  11550. });
  11551. Object.defineProperty(RangeView.prototype, "formulas", {
  11552. get: function () {
  11553. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  11554. return this.m_formulas;
  11555. },
  11556. set: function (value) {
  11557. this.m_formulas=value;
  11558. _createSetPropertyAction(this.context, this, "Formulas", value);
  11559. },
  11560. enumerable: true,
  11561. configurable: true
  11562. });
  11563. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  11564. get: function () {
  11565. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  11566. return this.m_formulasLocal;
  11567. },
  11568. set: function (value) {
  11569. this.m_formulasLocal=value;
  11570. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11571. },
  11572. enumerable: true,
  11573. configurable: true
  11574. });
  11575. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  11576. get: function () {
  11577. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  11578. return this.m_formulasR1C1;
  11579. },
  11580. set: function (value) {
  11581. this.m_formulasR1C1=value;
  11582. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11583. },
  11584. enumerable: true,
  11585. configurable: true
  11586. });
  11587. Object.defineProperty(RangeView.prototype, "index", {
  11588. get: function () {
  11589. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  11590. return this.m_index;
  11591. },
  11592. enumerable: true,
  11593. configurable: true
  11594. });
  11595. Object.defineProperty(RangeView.prototype, "numberFormat", {
  11596. get: function () {
  11597. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  11598. return this.m_numberFormat;
  11599. },
  11600. set: function (value) {
  11601. this.m_numberFormat=value;
  11602. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11603. },
  11604. enumerable: true,
  11605. configurable: true
  11606. });
  11607. Object.defineProperty(RangeView.prototype, "rowCount", {
  11608. get: function () {
  11609. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  11610. return this.m_rowCount;
  11611. },
  11612. enumerable: true,
  11613. configurable: true
  11614. });
  11615. Object.defineProperty(RangeView.prototype, "text", {
  11616. get: function () {
  11617. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  11618. return this.m_text;
  11619. },
  11620. enumerable: true,
  11621. configurable: true
  11622. });
  11623. Object.defineProperty(RangeView.prototype, "valueTypes", {
  11624. get: function () {
  11625. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  11626. return this.m_valueTypes;
  11627. },
  11628. enumerable: true,
  11629. configurable: true
  11630. });
  11631. Object.defineProperty(RangeView.prototype, "values", {
  11632. get: function () {
  11633. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  11634. return this.m_values;
  11635. },
  11636. set: function (value) {
  11637. this.m_values=value;
  11638. _createSetPropertyAction(this.context, this, "Values", value);
  11639. },
  11640. enumerable: true,
  11641. configurable: true
  11642. });
  11643. RangeView.prototype.getRange=function () {
  11644. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11645. };
  11646. RangeView.prototype._handleResult=function (value) {
  11647. _super.prototype._handleResult.call(this, value);
  11648. if (_isNullOrUndefined(value))
  11649. return;
  11650. var obj=value;
  11651. _fixObjectPathIfNecessary(this, obj);
  11652. if (!_isUndefined(obj["CellAddresses"])) {
  11653. this.m_cellAddresses=obj["CellAddresses"];
  11654. }
  11655. if (!_isUndefined(obj["ColumnCount"])) {
  11656. this.m_columnCount=obj["ColumnCount"];
  11657. }
  11658. if (!_isUndefined(obj["Formulas"])) {
  11659. this.m_formulas=obj["Formulas"];
  11660. }
  11661. if (!_isUndefined(obj["FormulasLocal"])) {
  11662. this.m_formulasLocal=obj["FormulasLocal"];
  11663. }
  11664. if (!_isUndefined(obj["FormulasR1C1"])) {
  11665. this.m_formulasR1C1=obj["FormulasR1C1"];
  11666. }
  11667. if (!_isUndefined(obj["Index"])) {
  11668. this.m_index=obj["Index"];
  11669. }
  11670. if (!_isUndefined(obj["NumberFormat"])) {
  11671. this.m_numberFormat=obj["NumberFormat"];
  11672. }
  11673. if (!_isUndefined(obj["RowCount"])) {
  11674. this.m_rowCount=obj["RowCount"];
  11675. }
  11676. if (!_isUndefined(obj["Text"])) {
  11677. this.m_text=obj["Text"];
  11678. }
  11679. if (!_isUndefined(obj["ValueTypes"])) {
  11680. this.m_valueTypes=obj["ValueTypes"];
  11681. }
  11682. if (!_isUndefined(obj["Values"])) {
  11683. this.m_values=obj["Values"];
  11684. }
  11685. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  11686. };
  11687. RangeView.prototype.load=function (option) {
  11688. _load(this, option);
  11689. return this;
  11690. };
  11691. RangeView.prototype.toJSON=function () {
  11692. return {
  11693. "cellAddresses": this.m_cellAddresses,
  11694. "columnCount": this.m_columnCount,
  11695. "formulas": this.m_formulas,
  11696. "formulasLocal": this.m_formulasLocal,
  11697. "formulasR1C1": this.m_formulasR1C1,
  11698. "index": this.m_index,
  11699. "numberFormat": this.m_numberFormat,
  11700. "rowCount": this.m_rowCount,
  11701. "text": this.m_text,
  11702. "values": this.m_values,
  11703. "valueTypes": this.m_valueTypes
  11704. };
  11705. };
  11706. return RangeView;
  11707. }(OfficeExtension.ClientObject));
  11708. Excel.RangeView=RangeView;
  11709. var RangeViewCollection=(function (_super) {
  11710. __extends(RangeViewCollection, _super);
  11711. function RangeViewCollection() {
  11712. _super.apply(this, arguments);
  11713. }
  11714. Object.defineProperty(RangeViewCollection.prototype, "items", {
  11715. get: function () {
  11716. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  11717. return this.m__items;
  11718. },
  11719. enumerable: true,
  11720. configurable: true
  11721. });
  11722. RangeViewCollection.prototype.getItemAt=function (index) {
  11723. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11724. };
  11725. RangeViewCollection.prototype._handleResult=function (value) {
  11726. _super.prototype._handleResult.call(this, value);
  11727. if (_isNullOrUndefined(value))
  11728. return;
  11729. var obj=value;
  11730. _fixObjectPathIfNecessary(this, obj);
  11731. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11732. this.m__items=[];
  11733. var _data=obj[OfficeExtension.Constants.items];
  11734. for (var i=0; i < _data.length; i++) {
  11735. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  11736. _item._handleResult(_data[i]);
  11737. this.m__items.push(_item);
  11738. }
  11739. }
  11740. };
  11741. RangeViewCollection.prototype.load=function (option) {
  11742. _load(this, option);
  11743. return this;
  11744. };
  11745. RangeViewCollection.prototype.toJSON=function () {
  11746. return {};
  11747. };
  11748. return RangeViewCollection;
  11749. }(OfficeExtension.ClientObject));
  11750. Excel.RangeViewCollection=RangeViewCollection;
  11751. var Setting=(function (_super) {
  11752. __extends(Setting, _super);
  11753. function Setting() {
  11754. _super.apply(this, arguments);
  11755. }
  11756. Object.defineProperty(Setting.prototype, "value", {
  11757. get: function () {
  11758. return JSON.parse(this._Value);
  11759. },
  11760. set: function (value) {
  11761. this._Value=JSON.stringify(value);
  11762. },
  11763. enumerable: true,
  11764. configurable: true
  11765. });
  11766. Object.defineProperty(Setting.prototype, "key", {
  11767. get: function () {
  11768. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  11769. return this.m_key;
  11770. },
  11771. enumerable: true,
  11772. configurable: true
  11773. });
  11774. Object.defineProperty(Setting.prototype, "_Value", {
  11775. get: function () {
  11776. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  11777. return this.m__Value;
  11778. },
  11779. set: function (value) {
  11780. this.m__Value=value;
  11781. _createSetPropertyAction(this.context, this, "_Value", value);
  11782. },
  11783. enumerable: true,
  11784. configurable: true
  11785. });
  11786. Setting.prototype.delete=function () {
  11787. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11788. };
  11789. Setting.prototype._handleResult=function (value) {
  11790. _super.prototype._handleResult.call(this, value);
  11791. if (_isNullOrUndefined(value))
  11792. return;
  11793. var obj=value;
  11794. _fixObjectPathIfNecessary(this, obj);
  11795. if (!_isUndefined(obj["Key"])) {
  11796. this.m_key=obj["Key"];
  11797. }
  11798. if (!_isUndefined(obj["_Value"])) {
  11799. this.m__Value=obj["_Value"];
  11800. }
  11801. };
  11802. Setting.prototype.load=function (option) {
  11803. _load(this, option);
  11804. return this;
  11805. };
  11806. Setting.prototype.toJSON=function () {
  11807. return {
  11808. "key": this.m_key
  11809. };
  11810. };
  11811. return Setting;
  11812. }(OfficeExtension.ClientObject));
  11813. Excel.Setting=Setting;
  11814. var NamedItemCollection=(function (_super) {
  11815. __extends(NamedItemCollection, _super);
  11816. function NamedItemCollection() {
  11817. _super.apply(this, arguments);
  11818. }
  11819. Object.defineProperty(NamedItemCollection.prototype, "items", {
  11820. get: function () {
  11821. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  11822. return this.m__items;
  11823. },
  11824. enumerable: true,
  11825. configurable: true
  11826. });
  11827. NamedItemCollection.prototype.getItem=function (name) {
  11828. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  11829. };
  11830. NamedItemCollection.prototype._handleResult=function (value) {
  11831. _super.prototype._handleResult.call(this, value);
  11832. if (_isNullOrUndefined(value))
  11833. return;
  11834. var obj=value;
  11835. _fixObjectPathIfNecessary(this, obj);
  11836. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11837. this.m__items=[];
  11838. var _data=obj[OfficeExtension.Constants.items];
  11839. for (var i=0; i < _data.length; i++) {
  11840. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11841. _item._handleResult(_data[i]);
  11842. this.m__items.push(_item);
  11843. }
  11844. }
  11845. };
  11846. NamedItemCollection.prototype.load=function (option) {
  11847. _load(this, option);
  11848. return this;
  11849. };
  11850. NamedItemCollection.prototype.toJSON=function () {
  11851. return {};
  11852. };
  11853. return NamedItemCollection;
  11854. }(OfficeExtension.ClientObject));
  11855. Excel.NamedItemCollection=NamedItemCollection;
  11856. var NamedItem=(function (_super) {
  11857. __extends(NamedItem, _super);
  11858. function NamedItem() {
  11859. _super.apply(this, arguments);
  11860. }
  11861. Object.defineProperty(NamedItem.prototype, "name", {
  11862. get: function () {
  11863. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  11864. return this.m_name;
  11865. },
  11866. enumerable: true,
  11867. configurable: true
  11868. });
  11869. Object.defineProperty(NamedItem.prototype, "type", {
  11870. get: function () {
  11871. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  11872. return this.m_type;
  11873. },
  11874. enumerable: true,
  11875. configurable: true
  11876. });
  11877. Object.defineProperty(NamedItem.prototype, "value", {
  11878. get: function () {
  11879. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  11880. return this.m_value;
  11881. },
  11882. enumerable: true,
  11883. configurable: true
  11884. });
  11885. Object.defineProperty(NamedItem.prototype, "visible", {
  11886. get: function () {
  11887. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  11888. return this.m_visible;
  11889. },
  11890. set: function (value) {
  11891. this.m_visible=value;
  11892. _createSetPropertyAction(this.context, this, "Visible", value);
  11893. },
  11894. enumerable: true,
  11895. configurable: true
  11896. });
  11897. Object.defineProperty(NamedItem.prototype, "_Id", {
  11898. get: function () {
  11899. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  11900. return this.m__Id;
  11901. },
  11902. enumerable: true,
  11903. configurable: true
  11904. });
  11905. NamedItem.prototype.getRange=function () {
  11906. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11907. };
  11908. NamedItem.prototype._handleResult=function (value) {
  11909. _super.prototype._handleResult.call(this, value);
  11910. if (_isNullOrUndefined(value))
  11911. return;
  11912. var obj=value;
  11913. _fixObjectPathIfNecessary(this, obj);
  11914. if (!_isUndefined(obj["Name"])) {
  11915. this.m_name=obj["Name"];
  11916. }
  11917. if (!_isUndefined(obj["Type"])) {
  11918. this.m_type=obj["Type"];
  11919. }
  11920. if (!_isUndefined(obj["Value"])) {
  11921. this.m_value=obj["Value"];
  11922. }
  11923. if (!_isUndefined(obj["Visible"])) {
  11924. this.m_visible=obj["Visible"];
  11925. }
  11926. if (!_isUndefined(obj["_Id"])) {
  11927. this.m__Id=obj["_Id"];
  11928. }
  11929. };
  11930. NamedItem.prototype.load=function (option) {
  11931. _load(this, option);
  11932. return this;
  11933. };
  11934. NamedItem.prototype._handleIdResult=function (value) {
  11935. _super.prototype._handleIdResult.call(this, value);
  11936. if (_isNullOrUndefined(value)) {
  11937. return;
  11938. }
  11939. if (!_isUndefined(value["_Id"])) {
  11940. this.m__Id=value["_Id"];
  11941. }
  11942. };
  11943. NamedItem.prototype.toJSON=function () {
  11944. return {
  11945. "name": this.m_name,
  11946. "type": this.m_type,
  11947. "value": this.m_value,
  11948. "visible": this.m_visible
  11949. };
  11950. };
  11951. return NamedItem;
  11952. }(OfficeExtension.ClientObject));
  11953. Excel.NamedItem=NamedItem;
  11954. var Binding=(function (_super) {
  11955. __extends(Binding, _super);
  11956. function Binding() {
  11957. _super.apply(this, arguments);
  11958. }
  11959. Object.defineProperty(Binding.prototype, "id", {
  11960. get: function () {
  11961. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  11962. return this.m_id;
  11963. },
  11964. enumerable: true,
  11965. configurable: true
  11966. });
  11967. Object.defineProperty(Binding.prototype, "type", {
  11968. get: function () {
  11969. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  11970. return this.m_type;
  11971. },
  11972. enumerable: true,
  11973. configurable: true
  11974. });
  11975. Binding.prototype.delete=function () {
  11976. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11977. };
  11978. Binding.prototype.getRange=function () {
  11979. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  11980. };
  11981. Binding.prototype.getTable=function () {
  11982. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  11983. };
  11984. Binding.prototype.getText=function () {
  11985. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  11986. var ret=new OfficeExtension.ClientResult();
  11987. _addActionResultHandler(this, action, ret);
  11988. return ret;
  11989. };
  11990. Binding.prototype._handleResult=function (value) {
  11991. _super.prototype._handleResult.call(this, value);
  11992. if (_isNullOrUndefined(value))
  11993. return;
  11994. var obj=value;
  11995. _fixObjectPathIfNecessary(this, obj);
  11996. if (!_isUndefined(obj["Id"])) {
  11997. this.m_id=obj["Id"];
  11998. }
  11999. if (!_isUndefined(obj["Type"])) {
  12000. this.m_type=obj["Type"];
  12001. }
  12002. };
  12003. Binding.prototype.load=function (option) {
  12004. _load(this, option);
  12005. return this;
  12006. };
  12007. Binding.prototype._handleIdResult=function (value) {
  12008. _super.prototype._handleIdResult.call(this, value);
  12009. if (_isNullOrUndefined(value)) {
  12010. return;
  12011. }
  12012. if (!_isUndefined(value["Id"])) {
  12013. this.m_id=value["Id"];
  12014. }
  12015. };
  12016. Object.defineProperty(Binding.prototype, "onDataChanged", {
  12017. get: function () {
  12018. var _this=this;
  12019. if (!this.m_dataChanged) {
  12020. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  12021. registerFunc: function (handlerCallback) {
  12022. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12023. .then(function (officeBinding) {
  12024. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  12025. });
  12026. },
  12027. unregisterFunc: function (handlerCallback) {
  12028. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12029. .then(function (officeBinding) {
  12030. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  12031. });
  12032. },
  12033. eventArgsTransformFunc: function (args) {
  12034. var evt={
  12035. binding: _this
  12036. };
  12037. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12038. }
  12039. });
  12040. }
  12041. return this.m_dataChanged;
  12042. },
  12043. enumerable: true,
  12044. configurable: true
  12045. });
  12046. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  12047. get: function () {
  12048. var _this=this;
  12049. if (!this.m_selectionChanged) {
  12050. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  12051. registerFunc: function (handlerCallback) {
  12052. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12053. .then(function (officeBinding) {
  12054. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  12055. });
  12056. },
  12057. unregisterFunc: function (handlerCallback) {
  12058. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12059. .then(function (officeBinding) {
  12060. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  12061. });
  12062. },
  12063. eventArgsTransformFunc: function (args) {
  12064. var evt={
  12065. binding: _this,
  12066. columnCount: args.columnCount,
  12067. rowCount: args.rowCount,
  12068. startColumn: args.startColumn,
  12069. startRow: args.startRow
  12070. };
  12071. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12072. }
  12073. });
  12074. }
  12075. return this.m_selectionChanged;
  12076. },
  12077. enumerable: true,
  12078. configurable: true
  12079. });
  12080. Binding.prototype.toJSON=function () {
  12081. return {
  12082. "id": this.m_id,
  12083. "type": this.m_type
  12084. };
  12085. };
  12086. return Binding;
  12087. }(OfficeExtension.ClientObject));
  12088. Excel.Binding=Binding;
  12089. var BindingCollection=(function (_super) {
  12090. __extends(BindingCollection, _super);
  12091. function BindingCollection() {
  12092. _super.apply(this, arguments);
  12093. }
  12094. Object.defineProperty(BindingCollection.prototype, "items", {
  12095. get: function () {
  12096. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  12097. return this.m__items;
  12098. },
  12099. enumerable: true,
  12100. configurable: true
  12101. });
  12102. Object.defineProperty(BindingCollection.prototype, "count", {
  12103. get: function () {
  12104. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  12105. return this.m_count;
  12106. },
  12107. enumerable: true,
  12108. configurable: true
  12109. });
  12110. BindingCollection.prototype.add=function (range, bindingType, id) {
  12111. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  12112. };
  12113. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  12114. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  12115. };
  12116. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  12117. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  12118. };
  12119. BindingCollection.prototype.getItem=function (id) {
  12120. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  12121. };
  12122. BindingCollection.prototype.getItemAt=function (index) {
  12123. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12124. };
  12125. BindingCollection.prototype._handleResult=function (value) {
  12126. _super.prototype._handleResult.call(this, value);
  12127. if (_isNullOrUndefined(value))
  12128. return;
  12129. var obj=value;
  12130. _fixObjectPathIfNecessary(this, obj);
  12131. if (!_isUndefined(obj["Count"])) {
  12132. this.m_count=obj["Count"];
  12133. }
  12134. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12135. this.m__items=[];
  12136. var _data=obj[OfficeExtension.Constants.items];
  12137. for (var i=0; i < _data.length; i++) {
  12138. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12139. _item._handleResult(_data[i]);
  12140. this.m__items.push(_item);
  12141. }
  12142. }
  12143. };
  12144. BindingCollection.prototype.load=function (option) {
  12145. _load(this, option);
  12146. return this;
  12147. };
  12148. BindingCollection.prototype.toJSON=function () {
  12149. return {
  12150. "count": this.m_count
  12151. };
  12152. };
  12153. return BindingCollection;
  12154. }(OfficeExtension.ClientObject));
  12155. Excel.BindingCollection=BindingCollection;
  12156. var TableCollection=(function (_super) {
  12157. __extends(TableCollection, _super);
  12158. function TableCollection() {
  12159. _super.apply(this, arguments);
  12160. }
  12161. Object.defineProperty(TableCollection.prototype, "items", {
  12162. get: function () {
  12163. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  12164. return this.m__items;
  12165. },
  12166. enumerable: true,
  12167. configurable: true
  12168. });
  12169. Object.defineProperty(TableCollection.prototype, "count", {
  12170. get: function () {
  12171. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  12172. return this.m_count;
  12173. },
  12174. enumerable: true,
  12175. configurable: true
  12176. });
  12177. TableCollection.prototype.add=function (address, hasHeaders) {
  12178. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  12179. };
  12180. TableCollection.prototype.getItem=function (key) {
  12181. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12182. };
  12183. TableCollection.prototype.getItemAt=function (index) {
  12184. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12185. };
  12186. TableCollection.prototype._handleResult=function (value) {
  12187. _super.prototype._handleResult.call(this, value);
  12188. if (_isNullOrUndefined(value))
  12189. return;
  12190. var obj=value;
  12191. _fixObjectPathIfNecessary(this, obj);
  12192. if (!_isUndefined(obj["Count"])) {
  12193. this.m_count=obj["Count"];
  12194. }
  12195. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12196. this.m__items=[];
  12197. var _data=obj[OfficeExtension.Constants.items];
  12198. for (var i=0; i < _data.length; i++) {
  12199. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12200. _item._handleResult(_data[i]);
  12201. this.m__items.push(_item);
  12202. }
  12203. }
  12204. };
  12205. TableCollection.prototype.load=function (option) {
  12206. _load(this, option);
  12207. return this;
  12208. };
  12209. TableCollection.prototype.toJSON=function () {
  12210. return {
  12211. "count": this.m_count
  12212. };
  12213. };
  12214. return TableCollection;
  12215. }(OfficeExtension.ClientObject));
  12216. Excel.TableCollection=TableCollection;
  12217. var Table=(function (_super) {
  12218. __extends(Table, _super);
  12219. function Table() {
  12220. _super.apply(this, arguments);
  12221. }
  12222. Object.defineProperty(Table.prototype, "columns", {
  12223. get: function () {
  12224. if (!this.m_columns) {
  12225. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  12226. }
  12227. return this.m_columns;
  12228. },
  12229. enumerable: true,
  12230. configurable: true
  12231. });
  12232. Object.defineProperty(Table.prototype, "rows", {
  12233. get: function () {
  12234. if (!this.m_rows) {
  12235. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  12236. }
  12237. return this.m_rows;
  12238. },
  12239. enumerable: true,
  12240. configurable: true
  12241. });
  12242. Object.defineProperty(Table.prototype, "sort", {
  12243. get: function () {
  12244. if (!this.m_sort) {
  12245. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12246. }
  12247. return this.m_sort;
  12248. },
  12249. enumerable: true,
  12250. configurable: true
  12251. });
  12252. Object.defineProperty(Table.prototype, "worksheet", {
  12253. get: function () {
  12254. if (!this.m_worksheet) {
  12255. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12256. }
  12257. return this.m_worksheet;
  12258. },
  12259. enumerable: true,
  12260. configurable: true
  12261. });
  12262. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  12263. get: function () {
  12264. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  12265. return this.m_highlightFirstColumn;
  12266. },
  12267. set: function (value) {
  12268. this.m_highlightFirstColumn=value;
  12269. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  12270. },
  12271. enumerable: true,
  12272. configurable: true
  12273. });
  12274. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  12275. get: function () {
  12276. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  12277. return this.m_highlightLastColumn;
  12278. },
  12279. set: function (value) {
  12280. this.m_highlightLastColumn=value;
  12281. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  12282. },
  12283. enumerable: true,
  12284. configurable: true
  12285. });
  12286. Object.defineProperty(Table.prototype, "id", {
  12287. get: function () {
  12288. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  12289. return this.m_id;
  12290. },
  12291. enumerable: true,
  12292. configurable: true
  12293. });
  12294. Object.defineProperty(Table.prototype, "name", {
  12295. get: function () {
  12296. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  12297. return this.m_name;
  12298. },
  12299. set: function (value) {
  12300. this.m_name=value;
  12301. _createSetPropertyAction(this.context, this, "Name", value);
  12302. },
  12303. enumerable: true,
  12304. configurable: true
  12305. });
  12306. Object.defineProperty(Table.prototype, "showBandedColumns", {
  12307. get: function () {
  12308. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  12309. return this.m_showBandedColumns;
  12310. },
  12311. set: function (value) {
  12312. this.m_showBandedColumns=value;
  12313. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  12314. },
  12315. enumerable: true,
  12316. configurable: true
  12317. });
  12318. Object.defineProperty(Table.prototype, "showBandedRows", {
  12319. get: function () {
  12320. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  12321. return this.m_showBandedRows;
  12322. },
  12323. set: function (value) {
  12324. this.m_showBandedRows=value;
  12325. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  12326. },
  12327. enumerable: true,
  12328. configurable: true
  12329. });
  12330. Object.defineProperty(Table.prototype, "showFilterButton", {
  12331. get: function () {
  12332. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  12333. return this.m_showFilterButton;
  12334. },
  12335. set: function (value) {
  12336. this.m_showFilterButton=value;
  12337. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  12338. },
  12339. enumerable: true,
  12340. configurable: true
  12341. });
  12342. Object.defineProperty(Table.prototype, "showHeaders", {
  12343. get: function () {
  12344. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  12345. return this.m_showHeaders;
  12346. },
  12347. set: function (value) {
  12348. this.m_showHeaders=value;
  12349. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  12350. },
  12351. enumerable: true,
  12352. configurable: true
  12353. });
  12354. Object.defineProperty(Table.prototype, "showTotals", {
  12355. get: function () {
  12356. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  12357. return this.m_showTotals;
  12358. },
  12359. set: function (value) {
  12360. this.m_showTotals=value;
  12361. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  12362. },
  12363. enumerable: true,
  12364. configurable: true
  12365. });
  12366. Object.defineProperty(Table.prototype, "style", {
  12367. get: function () {
  12368. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  12369. return this.m_style;
  12370. },
  12371. set: function (value) {
  12372. this.m_style=value;
  12373. _createSetPropertyAction(this.context, this, "Style", value);
  12374. },
  12375. enumerable: true,
  12376. configurable: true
  12377. });
  12378. Table.prototype.clearFilters=function () {
  12379. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  12380. };
  12381. Table.prototype.convertToRange=function () {
  12382. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  12383. };
  12384. Table.prototype.delete=function () {
  12385. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12386. };
  12387. Table.prototype.getDataBodyRange=function () {
  12388. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12389. };
  12390. Table.prototype.getHeaderRowRange=function () {
  12391. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12392. };
  12393. Table.prototype.getRange=function () {
  12394. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12395. };
  12396. Table.prototype.getTotalRowRange=function () {
  12397. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12398. };
  12399. Table.prototype.reapplyFilters=function () {
  12400. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  12401. };
  12402. Table.prototype._handleResult=function (value) {
  12403. _super.prototype._handleResult.call(this, value);
  12404. if (_isNullOrUndefined(value))
  12405. return;
  12406. var obj=value;
  12407. _fixObjectPathIfNecessary(this, obj);
  12408. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  12409. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  12410. }
  12411. if (!_isUndefined(obj["HighlightLastColumn"])) {
  12412. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  12413. }
  12414. if (!_isUndefined(obj["Id"])) {
  12415. this.m_id=obj["Id"];
  12416. }
  12417. if (!_isUndefined(obj["Name"])) {
  12418. this.m_name=obj["Name"];
  12419. }
  12420. if (!_isUndefined(obj["ShowBandedColumns"])) {
  12421. this.m_showBandedColumns=obj["ShowBandedColumns"];
  12422. }
  12423. if (!_isUndefined(obj["ShowBandedRows"])) {
  12424. this.m_showBandedRows=obj["ShowBandedRows"];
  12425. }
  12426. if (!_isUndefined(obj["ShowFilterButton"])) {
  12427. this.m_showFilterButton=obj["ShowFilterButton"];
  12428. }
  12429. if (!_isUndefined(obj["ShowHeaders"])) {
  12430. this.m_showHeaders=obj["ShowHeaders"];
  12431. }
  12432. if (!_isUndefined(obj["ShowTotals"])) {
  12433. this.m_showTotals=obj["ShowTotals"];
  12434. }
  12435. if (!_isUndefined(obj["Style"])) {
  12436. this.m_style=obj["Style"];
  12437. }
  12438. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  12439. };
  12440. Table.prototype.load=function (option) {
  12441. _load(this, option);
  12442. return this;
  12443. };
  12444. Table.prototype._handleIdResult=function (value) {
  12445. _super.prototype._handleIdResult.call(this, value);
  12446. if (_isNullOrUndefined(value)) {
  12447. return;
  12448. }
  12449. if (!_isUndefined(value["Id"])) {
  12450. this.m_id=value["Id"];
  12451. }
  12452. };
  12453. Table.prototype.toJSON=function () {
  12454. return {
  12455. "highlightFirstColumn": this.m_highlightFirstColumn,
  12456. "highlightLastColumn": this.m_highlightLastColumn,
  12457. "id": this.m_id,
  12458. "name": this.m_name,
  12459. "showBandedColumns": this.m_showBandedColumns,
  12460. "showBandedRows": this.m_showBandedRows,
  12461. "showFilterButton": this.m_showFilterButton,
  12462. "showHeaders": this.m_showHeaders,
  12463. "showTotals": this.m_showTotals,
  12464. "style": this.m_style
  12465. };
  12466. };
  12467. return Table;
  12468. }(OfficeExtension.ClientObject));
  12469. Excel.Table=Table;
  12470. var TableColumnCollection=(function (_super) {
  12471. __extends(TableColumnCollection, _super);
  12472. function TableColumnCollection() {
  12473. _super.apply(this, arguments);
  12474. }
  12475. Object.defineProperty(TableColumnCollection.prototype, "items", {
  12476. get: function () {
  12477. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  12478. return this.m__items;
  12479. },
  12480. enumerable: true,
  12481. configurable: true
  12482. });
  12483. Object.defineProperty(TableColumnCollection.prototype, "count", {
  12484. get: function () {
  12485. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  12486. return this.m_count;
  12487. },
  12488. enumerable: true,
  12489. configurable: true
  12490. });
  12491. TableColumnCollection.prototype.add=function (index, values) {
  12492. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12493. };
  12494. TableColumnCollection.prototype.getItem=function (key) {
  12495. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12496. };
  12497. TableColumnCollection.prototype.getItemAt=function (index) {
  12498. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12499. };
  12500. TableColumnCollection.prototype._handleResult=function (value) {
  12501. _super.prototype._handleResult.call(this, value);
  12502. if (_isNullOrUndefined(value))
  12503. return;
  12504. var obj=value;
  12505. _fixObjectPathIfNecessary(this, obj);
  12506. if (!_isUndefined(obj["Count"])) {
  12507. this.m_count=obj["Count"];
  12508. }
  12509. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12510. this.m__items=[];
  12511. var _data=obj[OfficeExtension.Constants.items];
  12512. for (var i=0; i < _data.length; i++) {
  12513. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12514. _item._handleResult(_data[i]);
  12515. this.m__items.push(_item);
  12516. }
  12517. }
  12518. };
  12519. TableColumnCollection.prototype.load=function (option) {
  12520. _load(this, option);
  12521. return this;
  12522. };
  12523. TableColumnCollection.prototype.toJSON=function () {
  12524. return {
  12525. "count": this.m_count
  12526. };
  12527. };
  12528. return TableColumnCollection;
  12529. }(OfficeExtension.ClientObject));
  12530. Excel.TableColumnCollection=TableColumnCollection;
  12531. var TableColumn=(function (_super) {
  12532. __extends(TableColumn, _super);
  12533. function TableColumn() {
  12534. _super.apply(this, arguments);
  12535. }
  12536. Object.defineProperty(TableColumn.prototype, "filter", {
  12537. get: function () {
  12538. if (!this.m_filter) {
  12539. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  12540. }
  12541. return this.m_filter;
  12542. },
  12543. enumerable: true,
  12544. configurable: true
  12545. });
  12546. Object.defineProperty(TableColumn.prototype, "id", {
  12547. get: function () {
  12548. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  12549. return this.m_id;
  12550. },
  12551. enumerable: true,
  12552. configurable: true
  12553. });
  12554. Object.defineProperty(TableColumn.prototype, "index", {
  12555. get: function () {
  12556. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  12557. return this.m_index;
  12558. },
  12559. enumerable: true,
  12560. configurable: true
  12561. });
  12562. Object.defineProperty(TableColumn.prototype, "name", {
  12563. get: function () {
  12564. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  12565. return this.m_name;
  12566. },
  12567. enumerable: true,
  12568. configurable: true
  12569. });
  12570. Object.defineProperty(TableColumn.prototype, "values", {
  12571. get: function () {
  12572. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  12573. return this.m_values;
  12574. },
  12575. set: function (value) {
  12576. this.m_values=value;
  12577. _createSetPropertyAction(this.context, this, "Values", value);
  12578. },
  12579. enumerable: true,
  12580. configurable: true
  12581. });
  12582. TableColumn.prototype.delete=function () {
  12583. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12584. };
  12585. TableColumn.prototype.getDataBodyRange=function () {
  12586. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12587. };
  12588. TableColumn.prototype.getHeaderRowRange=function () {
  12589. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12590. };
  12591. TableColumn.prototype.getRange=function () {
  12592. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12593. };
  12594. TableColumn.prototype.getTotalRowRange=function () {
  12595. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12596. };
  12597. TableColumn.prototype._handleResult=function (value) {
  12598. _super.prototype._handleResult.call(this, value);
  12599. if (_isNullOrUndefined(value))
  12600. return;
  12601. var obj=value;
  12602. _fixObjectPathIfNecessary(this, obj);
  12603. if (!_isUndefined(obj["Id"])) {
  12604. this.m_id=obj["Id"];
  12605. }
  12606. if (!_isUndefined(obj["Index"])) {
  12607. this.m_index=obj["Index"];
  12608. }
  12609. if (!_isUndefined(obj["Name"])) {
  12610. this.m_name=obj["Name"];
  12611. }
  12612. if (!_isUndefined(obj["Values"])) {
  12613. this.m_values=obj["Values"];
  12614. }
  12615. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  12616. };
  12617. TableColumn.prototype.load=function (option) {
  12618. _load(this, option);
  12619. return this;
  12620. };
  12621. TableColumn.prototype._handleIdResult=function (value) {
  12622. _super.prototype._handleIdResult.call(this, value);
  12623. if (_isNullOrUndefined(value)) {
  12624. return;
  12625. }
  12626. if (!_isUndefined(value["Id"])) {
  12627. this.m_id=value["Id"];
  12628. }
  12629. };
  12630. TableColumn.prototype.toJSON=function () {
  12631. return {
  12632. "id": this.m_id,
  12633. "index": this.m_index,
  12634. "name": this.m_name,
  12635. "values": this.m_values
  12636. };
  12637. };
  12638. return TableColumn;
  12639. }(OfficeExtension.ClientObject));
  12640. Excel.TableColumn=TableColumn;
  12641. var TableRowCollection=(function (_super) {
  12642. __extends(TableRowCollection, _super);
  12643. function TableRowCollection() {
  12644. _super.apply(this, arguments);
  12645. }
  12646. Object.defineProperty(TableRowCollection.prototype, "items", {
  12647. get: function () {
  12648. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  12649. return this.m__items;
  12650. },
  12651. enumerable: true,
  12652. configurable: true
  12653. });
  12654. Object.defineProperty(TableRowCollection.prototype, "count", {
  12655. get: function () {
  12656. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  12657. return this.m_count;
  12658. },
  12659. enumerable: true,
  12660. configurable: true
  12661. });
  12662. TableRowCollection.prototype.add=function (index, values) {
  12663. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12664. };
  12665. TableRowCollection.prototype.getItemAt=function (index) {
  12666. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12667. };
  12668. TableRowCollection.prototype._handleResult=function (value) {
  12669. _super.prototype._handleResult.call(this, value);
  12670. if (_isNullOrUndefined(value))
  12671. return;
  12672. var obj=value;
  12673. _fixObjectPathIfNecessary(this, obj);
  12674. if (!_isUndefined(obj["Count"])) {
  12675. this.m_count=obj["Count"];
  12676. }
  12677. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12678. this.m__items=[];
  12679. var _data=obj[OfficeExtension.Constants.items];
  12680. for (var i=0; i < _data.length; i++) {
  12681. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  12682. _item._handleResult(_data[i]);
  12683. this.m__items.push(_item);
  12684. }
  12685. }
  12686. };
  12687. TableRowCollection.prototype.load=function (option) {
  12688. _load(this, option);
  12689. return this;
  12690. };
  12691. TableRowCollection.prototype.toJSON=function () {
  12692. return {
  12693. "count": this.m_count
  12694. };
  12695. };
  12696. return TableRowCollection;
  12697. }(OfficeExtension.ClientObject));
  12698. Excel.TableRowCollection=TableRowCollection;
  12699. var TableRow=(function (_super) {
  12700. __extends(TableRow, _super);
  12701. function TableRow() {
  12702. _super.apply(this, arguments);
  12703. }
  12704. Object.defineProperty(TableRow.prototype, "index", {
  12705. get: function () {
  12706. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  12707. return this.m_index;
  12708. },
  12709. enumerable: true,
  12710. configurable: true
  12711. });
  12712. Object.defineProperty(TableRow.prototype, "values", {
  12713. get: function () {
  12714. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  12715. return this.m_values;
  12716. },
  12717. set: function (value) {
  12718. this.m_values=value;
  12719. _createSetPropertyAction(this.context, this, "Values", value);
  12720. },
  12721. enumerable: true,
  12722. configurable: true
  12723. });
  12724. TableRow.prototype.delete=function () {
  12725. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12726. };
  12727. TableRow.prototype.getRange=function () {
  12728. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12729. };
  12730. TableRow.prototype._handleResult=function (value) {
  12731. _super.prototype._handleResult.call(this, value);
  12732. if (_isNullOrUndefined(value))
  12733. return;
  12734. var obj=value;
  12735. _fixObjectPathIfNecessary(this, obj);
  12736. if (!_isUndefined(obj["Index"])) {
  12737. this.m_index=obj["Index"];
  12738. }
  12739. if (!_isUndefined(obj["Values"])) {
  12740. this.m_values=obj["Values"];
  12741. }
  12742. };
  12743. TableRow.prototype.load=function (option) {
  12744. _load(this, option);
  12745. return this;
  12746. };
  12747. TableRow.prototype.toJSON=function () {
  12748. return {
  12749. "index": this.m_index,
  12750. "values": this.m_values
  12751. };
  12752. };
  12753. return TableRow;
  12754. }(OfficeExtension.ClientObject));
  12755. Excel.TableRow=TableRow;
  12756. var RangeFormat=(function (_super) {
  12757. __extends(RangeFormat, _super);
  12758. function RangeFormat() {
  12759. _super.apply(this, arguments);
  12760. }
  12761. Object.defineProperty(RangeFormat.prototype, "borders", {
  12762. get: function () {
  12763. if (!this.m_borders) {
  12764. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  12765. }
  12766. return this.m_borders;
  12767. },
  12768. enumerable: true,
  12769. configurable: true
  12770. });
  12771. Object.defineProperty(RangeFormat.prototype, "fill", {
  12772. get: function () {
  12773. if (!this.m_fill) {
  12774. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  12775. }
  12776. return this.m_fill;
  12777. },
  12778. enumerable: true,
  12779. configurable: true
  12780. });
  12781. Object.defineProperty(RangeFormat.prototype, "font", {
  12782. get: function () {
  12783. if (!this.m_font) {
  12784. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  12785. }
  12786. return this.m_font;
  12787. },
  12788. enumerable: true,
  12789. configurable: true
  12790. });
  12791. Object.defineProperty(RangeFormat.prototype, "protection", {
  12792. get: function () {
  12793. if (!this.m_protection) {
  12794. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12795. }
  12796. return this.m_protection;
  12797. },
  12798. enumerable: true,
  12799. configurable: true
  12800. });
  12801. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  12802. get: function () {
  12803. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  12804. return this.m_columnWidth;
  12805. },
  12806. set: function (value) {
  12807. this.m_columnWidth=value;
  12808. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  12809. },
  12810. enumerable: true,
  12811. configurable: true
  12812. });
  12813. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  12814. get: function () {
  12815. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  12816. return this.m_horizontalAlignment;
  12817. },
  12818. set: function (value) {
  12819. this.m_horizontalAlignment=value;
  12820. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  12821. },
  12822. enumerable: true,
  12823. configurable: true
  12824. });
  12825. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  12826. get: function () {
  12827. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  12828. return this.m_rowHeight;
  12829. },
  12830. set: function (value) {
  12831. this.m_rowHeight=value;
  12832. _createSetPropertyAction(this.context, this, "RowHeight", value);
  12833. },
  12834. enumerable: true,
  12835. configurable: true
  12836. });
  12837. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  12838. get: function () {
  12839. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  12840. return this.m_verticalAlignment;
  12841. },
  12842. set: function (value) {
  12843. this.m_verticalAlignment=value;
  12844. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  12845. },
  12846. enumerable: true,
  12847. configurable: true
  12848. });
  12849. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  12850. get: function () {
  12851. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  12852. return this.m_wrapText;
  12853. },
  12854. set: function (value) {
  12855. this.m_wrapText=value;
  12856. _createSetPropertyAction(this.context, this, "WrapText", value);
  12857. },
  12858. enumerable: true,
  12859. configurable: true
  12860. });
  12861. RangeFormat.prototype.autofitColumns=function () {
  12862. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  12863. };
  12864. RangeFormat.prototype.autofitRows=function () {
  12865. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  12866. };
  12867. RangeFormat.prototype._handleResult=function (value) {
  12868. _super.prototype._handleResult.call(this, value);
  12869. if (_isNullOrUndefined(value))
  12870. return;
  12871. var obj=value;
  12872. _fixObjectPathIfNecessary(this, obj);
  12873. if (!_isUndefined(obj["ColumnWidth"])) {
  12874. this.m_columnWidth=obj["ColumnWidth"];
  12875. }
  12876. if (!_isUndefined(obj["HorizontalAlignment"])) {
  12877. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  12878. }
  12879. if (!_isUndefined(obj["RowHeight"])) {
  12880. this.m_rowHeight=obj["RowHeight"];
  12881. }
  12882. if (!_isUndefined(obj["VerticalAlignment"])) {
  12883. this.m_verticalAlignment=obj["VerticalAlignment"];
  12884. }
  12885. if (!_isUndefined(obj["WrapText"])) {
  12886. this.m_wrapText=obj["WrapText"];
  12887. }
  12888. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  12889. };
  12890. RangeFormat.prototype.load=function (option) {
  12891. _load(this, option);
  12892. return this;
  12893. };
  12894. RangeFormat.prototype.toJSON=function () {
  12895. return {
  12896. "columnWidth": this.m_columnWidth,
  12897. "fill": this.m_fill,
  12898. "font": this.m_font,
  12899. "horizontalAlignment": this.m_horizontalAlignment,
  12900. "protection": this.m_protection,
  12901. "rowHeight": this.m_rowHeight,
  12902. "verticalAlignment": this.m_verticalAlignment,
  12903. "wrapText": this.m_wrapText
  12904. };
  12905. };
  12906. return RangeFormat;
  12907. }(OfficeExtension.ClientObject));
  12908. Excel.RangeFormat=RangeFormat;
  12909. var FormatProtection=(function (_super) {
  12910. __extends(FormatProtection, _super);
  12911. function FormatProtection() {
  12912. _super.apply(this, arguments);
  12913. }
  12914. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  12915. get: function () {
  12916. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  12917. return this.m_formulaHidden;
  12918. },
  12919. set: function (value) {
  12920. this.m_formulaHidden=value;
  12921. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  12922. },
  12923. enumerable: true,
  12924. configurable: true
  12925. });
  12926. Object.defineProperty(FormatProtection.prototype, "locked", {
  12927. get: function () {
  12928. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  12929. return this.m_locked;
  12930. },
  12931. set: function (value) {
  12932. this.m_locked=value;
  12933. _createSetPropertyAction(this.context, this, "Locked", value);
  12934. },
  12935. enumerable: true,
  12936. configurable: true
  12937. });
  12938. FormatProtection.prototype._handleResult=function (value) {
  12939. _super.prototype._handleResult.call(this, value);
  12940. if (_isNullOrUndefined(value))
  12941. return;
  12942. var obj=value;
  12943. _fixObjectPathIfNecessary(this, obj);
  12944. if (!_isUndefined(obj["FormulaHidden"])) {
  12945. this.m_formulaHidden=obj["FormulaHidden"];
  12946. }
  12947. if (!_isUndefined(obj["Locked"])) {
  12948. this.m_locked=obj["Locked"];
  12949. }
  12950. };
  12951. FormatProtection.prototype.load=function (option) {
  12952. _load(this, option);
  12953. return this;
  12954. };
  12955. FormatProtection.prototype.toJSON=function () {
  12956. return {
  12957. "formulaHidden": this.m_formulaHidden,
  12958. "locked": this.m_locked
  12959. };
  12960. };
  12961. return FormatProtection;
  12962. }(OfficeExtension.ClientObject));
  12963. Excel.FormatProtection=FormatProtection;
  12964. var RangeFill=(function (_super) {
  12965. __extends(RangeFill, _super);
  12966. function RangeFill() {
  12967. _super.apply(this, arguments);
  12968. }
  12969. Object.defineProperty(RangeFill.prototype, "color", {
  12970. get: function () {
  12971. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  12972. return this.m_color;
  12973. },
  12974. set: function (value) {
  12975. this.m_color=value;
  12976. _createSetPropertyAction(this.context, this, "Color", value);
  12977. },
  12978. enumerable: true,
  12979. configurable: true
  12980. });
  12981. RangeFill.prototype.clear=function () {
  12982. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  12983. };
  12984. RangeFill.prototype._handleResult=function (value) {
  12985. _super.prototype._handleResult.call(this, value);
  12986. if (_isNullOrUndefined(value))
  12987. return;
  12988. var obj=value;
  12989. _fixObjectPathIfNecessary(this, obj);
  12990. if (!_isUndefined(obj["Color"])) {
  12991. this.m_color=obj["Color"];
  12992. }
  12993. };
  12994. RangeFill.prototype.load=function (option) {
  12995. _load(this, option);
  12996. return this;
  12997. };
  12998. RangeFill.prototype.toJSON=function () {
  12999. return {
  13000. "color": this.m_color
  13001. };
  13002. };
  13003. return RangeFill;
  13004. }(OfficeExtension.ClientObject));
  13005. Excel.RangeFill=RangeFill;
  13006. var RangeBorder=(function (_super) {
  13007. __extends(RangeBorder, _super);
  13008. function RangeBorder() {
  13009. _super.apply(this, arguments);
  13010. }
  13011. Object.defineProperty(RangeBorder.prototype, "color", {
  13012. get: function () {
  13013. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  13014. return this.m_color;
  13015. },
  13016. set: function (value) {
  13017. this.m_color=value;
  13018. _createSetPropertyAction(this.context, this, "Color", value);
  13019. },
  13020. enumerable: true,
  13021. configurable: true
  13022. });
  13023. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  13024. get: function () {
  13025. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  13026. return this.m_sideIndex;
  13027. },
  13028. enumerable: true,
  13029. configurable: true
  13030. });
  13031. Object.defineProperty(RangeBorder.prototype, "style", {
  13032. get: function () {
  13033. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  13034. return this.m_style;
  13035. },
  13036. set: function (value) {
  13037. this.m_style=value;
  13038. _createSetPropertyAction(this.context, this, "Style", value);
  13039. },
  13040. enumerable: true,
  13041. configurable: true
  13042. });
  13043. Object.defineProperty(RangeBorder.prototype, "weight", {
  13044. get: function () {
  13045. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  13046. return this.m_weight;
  13047. },
  13048. set: function (value) {
  13049. this.m_weight=value;
  13050. _createSetPropertyAction(this.context, this, "Weight", value);
  13051. },
  13052. enumerable: true,
  13053. configurable: true
  13054. });
  13055. RangeBorder.prototype._handleResult=function (value) {
  13056. _super.prototype._handleResult.call(this, value);
  13057. if (_isNullOrUndefined(value))
  13058. return;
  13059. var obj=value;
  13060. _fixObjectPathIfNecessary(this, obj);
  13061. if (!_isUndefined(obj["Color"])) {
  13062. this.m_color=obj["Color"];
  13063. }
  13064. if (!_isUndefined(obj["SideIndex"])) {
  13065. this.m_sideIndex=obj["SideIndex"];
  13066. }
  13067. if (!_isUndefined(obj["Style"])) {
  13068. this.m_style=obj["Style"];
  13069. }
  13070. if (!_isUndefined(obj["Weight"])) {
  13071. this.m_weight=obj["Weight"];
  13072. }
  13073. };
  13074. RangeBorder.prototype.load=function (option) {
  13075. _load(this, option);
  13076. return this;
  13077. };
  13078. RangeBorder.prototype.toJSON=function () {
  13079. return {
  13080. "color": this.m_color,
  13081. "sideIndex": this.m_sideIndex,
  13082. "style": this.m_style,
  13083. "weight": this.m_weight
  13084. };
  13085. };
  13086. return RangeBorder;
  13087. }(OfficeExtension.ClientObject));
  13088. Excel.RangeBorder=RangeBorder;
  13089. var RangeBorderCollection=(function (_super) {
  13090. __extends(RangeBorderCollection, _super);
  13091. function RangeBorderCollection() {
  13092. _super.apply(this, arguments);
  13093. }
  13094. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  13095. get: function () {
  13096. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  13097. return this.m__items;
  13098. },
  13099. enumerable: true,
  13100. configurable: true
  13101. });
  13102. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  13103. get: function () {
  13104. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  13105. return this.m_count;
  13106. },
  13107. enumerable: true,
  13108. configurable: true
  13109. });
  13110. RangeBorderCollection.prototype.getItem=function (index) {
  13111. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  13112. };
  13113. RangeBorderCollection.prototype.getItemAt=function (index) {
  13114. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13115. };
  13116. RangeBorderCollection.prototype._handleResult=function (value) {
  13117. _super.prototype._handleResult.call(this, value);
  13118. if (_isNullOrUndefined(value))
  13119. return;
  13120. var obj=value;
  13121. _fixObjectPathIfNecessary(this, obj);
  13122. if (!_isUndefined(obj["Count"])) {
  13123. this.m_count=obj["Count"];
  13124. }
  13125. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13126. this.m__items=[];
  13127. var _data=obj[OfficeExtension.Constants.items];
  13128. for (var i=0; i < _data.length; i++) {
  13129. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13130. _item._handleResult(_data[i]);
  13131. this.m__items.push(_item);
  13132. }
  13133. }
  13134. };
  13135. RangeBorderCollection.prototype.load=function (option) {
  13136. _load(this, option);
  13137. return this;
  13138. };
  13139. RangeBorderCollection.prototype.toJSON=function () {
  13140. return {
  13141. "count": this.m_count
  13142. };
  13143. };
  13144. return RangeBorderCollection;
  13145. }(OfficeExtension.ClientObject));
  13146. Excel.RangeBorderCollection=RangeBorderCollection;
  13147. var RangeFont=(function (_super) {
  13148. __extends(RangeFont, _super);
  13149. function RangeFont() {
  13150. _super.apply(this, arguments);
  13151. }
  13152. Object.defineProperty(RangeFont.prototype, "bold", {
  13153. get: function () {
  13154. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  13155. return this.m_bold;
  13156. },
  13157. set: function (value) {
  13158. this.m_bold=value;
  13159. _createSetPropertyAction(this.context, this, "Bold", value);
  13160. },
  13161. enumerable: true,
  13162. configurable: true
  13163. });
  13164. Object.defineProperty(RangeFont.prototype, "color", {
  13165. get: function () {
  13166. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  13167. return this.m_color;
  13168. },
  13169. set: function (value) {
  13170. this.m_color=value;
  13171. _createSetPropertyAction(this.context, this, "Color", value);
  13172. },
  13173. enumerable: true,
  13174. configurable: true
  13175. });
  13176. Object.defineProperty(RangeFont.prototype, "italic", {
  13177. get: function () {
  13178. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  13179. return this.m_italic;
  13180. },
  13181. set: function (value) {
  13182. this.m_italic=value;
  13183. _createSetPropertyAction(this.context, this, "Italic", value);
  13184. },
  13185. enumerable: true,
  13186. configurable: true
  13187. });
  13188. Object.defineProperty(RangeFont.prototype, "name", {
  13189. get: function () {
  13190. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  13191. return this.m_name;
  13192. },
  13193. set: function (value) {
  13194. this.m_name=value;
  13195. _createSetPropertyAction(this.context, this, "Name", value);
  13196. },
  13197. enumerable: true,
  13198. configurable: true
  13199. });
  13200. Object.defineProperty(RangeFont.prototype, "size", {
  13201. get: function () {
  13202. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  13203. return this.m_size;
  13204. },
  13205. set: function (value) {
  13206. this.m_size=value;
  13207. _createSetPropertyAction(this.context, this, "Size", value);
  13208. },
  13209. enumerable: true,
  13210. configurable: true
  13211. });
  13212. Object.defineProperty(RangeFont.prototype, "underline", {
  13213. get: function () {
  13214. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  13215. return this.m_underline;
  13216. },
  13217. set: function (value) {
  13218. this.m_underline=value;
  13219. _createSetPropertyAction(this.context, this, "Underline", value);
  13220. },
  13221. enumerable: true,
  13222. configurable: true
  13223. });
  13224. RangeFont.prototype._handleResult=function (value) {
  13225. _super.prototype._handleResult.call(this, value);
  13226. if (_isNullOrUndefined(value))
  13227. return;
  13228. var obj=value;
  13229. _fixObjectPathIfNecessary(this, obj);
  13230. if (!_isUndefined(obj["Bold"])) {
  13231. this.m_bold=obj["Bold"];
  13232. }
  13233. if (!_isUndefined(obj["Color"])) {
  13234. this.m_color=obj["Color"];
  13235. }
  13236. if (!_isUndefined(obj["Italic"])) {
  13237. this.m_italic=obj["Italic"];
  13238. }
  13239. if (!_isUndefined(obj["Name"])) {
  13240. this.m_name=obj["Name"];
  13241. }
  13242. if (!_isUndefined(obj["Size"])) {
  13243. this.m_size=obj["Size"];
  13244. }
  13245. if (!_isUndefined(obj["Underline"])) {
  13246. this.m_underline=obj["Underline"];
  13247. }
  13248. };
  13249. RangeFont.prototype.load=function (option) {
  13250. _load(this, option);
  13251. return this;
  13252. };
  13253. RangeFont.prototype.toJSON=function () {
  13254. return {
  13255. "bold": this.m_bold,
  13256. "color": this.m_color,
  13257. "italic": this.m_italic,
  13258. "name": this.m_name,
  13259. "size": this.m_size,
  13260. "underline": this.m_underline
  13261. };
  13262. };
  13263. return RangeFont;
  13264. }(OfficeExtension.ClientObject));
  13265. Excel.RangeFont=RangeFont;
  13266. var ChartCollection=(function (_super) {
  13267. __extends(ChartCollection, _super);
  13268. function ChartCollection() {
  13269. _super.apply(this, arguments);
  13270. }
  13271. Object.defineProperty(ChartCollection.prototype, "items", {
  13272. get: function () {
  13273. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  13274. return this.m__items;
  13275. },
  13276. enumerable: true,
  13277. configurable: true
  13278. });
  13279. Object.defineProperty(ChartCollection.prototype, "count", {
  13280. get: function () {
  13281. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  13282. return this.m_count;
  13283. },
  13284. enumerable: true,
  13285. configurable: true
  13286. });
  13287. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  13288. if (!(sourceData instanceof Range)) {
  13289. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  13290. }
  13291. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  13292. };
  13293. ChartCollection.prototype.getItem=function (name) {
  13294. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  13295. };
  13296. ChartCollection.prototype.getItemAt=function (index) {
  13297. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13298. };
  13299. ChartCollection.prototype._GetItem=function (key) {
  13300. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  13301. };
  13302. ChartCollection.prototype._handleResult=function (value) {
  13303. _super.prototype._handleResult.call(this, value);
  13304. if (_isNullOrUndefined(value))
  13305. return;
  13306. var obj=value;
  13307. _fixObjectPathIfNecessary(this, obj);
  13308. if (!_isUndefined(obj["Count"])) {
  13309. this.m_count=obj["Count"];
  13310. }
  13311. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13312. this.m__items=[];
  13313. var _data=obj[OfficeExtension.Constants.items];
  13314. for (var i=0; i < _data.length; i++) {
  13315. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13316. _item._handleResult(_data[i]);
  13317. this.m__items.push(_item);
  13318. }
  13319. }
  13320. };
  13321. ChartCollection.prototype.load=function (option) {
  13322. _load(this, option);
  13323. return this;
  13324. };
  13325. ChartCollection.prototype.toJSON=function () {
  13326. return {
  13327. "count": this.m_count
  13328. };
  13329. };
  13330. return ChartCollection;
  13331. }(OfficeExtension.ClientObject));
  13332. Excel.ChartCollection=ChartCollection;
  13333. var Chart=(function (_super) {
  13334. __extends(Chart, _super);
  13335. function Chart() {
  13336. _super.apply(this, arguments);
  13337. }
  13338. Object.defineProperty(Chart.prototype, "axes", {
  13339. get: function () {
  13340. if (!this.m_axes) {
  13341. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  13342. }
  13343. return this.m_axes;
  13344. },
  13345. enumerable: true,
  13346. configurable: true
  13347. });
  13348. Object.defineProperty(Chart.prototype, "dataLabels", {
  13349. get: function () {
  13350. if (!this.m_dataLabels) {
  13351. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  13352. }
  13353. return this.m_dataLabels;
  13354. },
  13355. enumerable: true,
  13356. configurable: true
  13357. });
  13358. Object.defineProperty(Chart.prototype, "format", {
  13359. get: function () {
  13360. if (!this.m_format) {
  13361. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13362. }
  13363. return this.m_format;
  13364. },
  13365. enumerable: true,
  13366. configurable: true
  13367. });
  13368. Object.defineProperty(Chart.prototype, "legend", {
  13369. get: function () {
  13370. if (!this.m_legend) {
  13371. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  13372. }
  13373. return this.m_legend;
  13374. },
  13375. enumerable: true,
  13376. configurable: true
  13377. });
  13378. Object.defineProperty(Chart.prototype, "series", {
  13379. get: function () {
  13380. if (!this.m_series) {
  13381. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  13382. }
  13383. return this.m_series;
  13384. },
  13385. enumerable: true,
  13386. configurable: true
  13387. });
  13388. Object.defineProperty(Chart.prototype, "title", {
  13389. get: function () {
  13390. if (!this.m_title) {
  13391. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13392. }
  13393. return this.m_title;
  13394. },
  13395. enumerable: true,
  13396. configurable: true
  13397. });
  13398. Object.defineProperty(Chart.prototype, "worksheet", {
  13399. get: function () {
  13400. if (!this.m_worksheet) {
  13401. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  13402. }
  13403. return this.m_worksheet;
  13404. },
  13405. enumerable: true,
  13406. configurable: true
  13407. });
  13408. Object.defineProperty(Chart.prototype, "height", {
  13409. get: function () {
  13410. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  13411. return this.m_height;
  13412. },
  13413. set: function (value) {
  13414. this.m_height=value;
  13415. _createSetPropertyAction(this.context, this, "Height", value);
  13416. },
  13417. enumerable: true,
  13418. configurable: true
  13419. });
  13420. Object.defineProperty(Chart.prototype, "left", {
  13421. get: function () {
  13422. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  13423. return this.m_left;
  13424. },
  13425. set: function (value) {
  13426. this.m_left=value;
  13427. _createSetPropertyAction(this.context, this, "Left", value);
  13428. },
  13429. enumerable: true,
  13430. configurable: true
  13431. });
  13432. Object.defineProperty(Chart.prototype, "name", {
  13433. get: function () {
  13434. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  13435. return this.m_name;
  13436. },
  13437. set: function (value) {
  13438. this.m_name=value;
  13439. _createSetPropertyAction(this.context, this, "Name", value);
  13440. },
  13441. enumerable: true,
  13442. configurable: true
  13443. });
  13444. Object.defineProperty(Chart.prototype, "top", {
  13445. get: function () {
  13446. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  13447. return this.m_top;
  13448. },
  13449. set: function (value) {
  13450. this.m_top=value;
  13451. _createSetPropertyAction(this.context, this, "Top", value);
  13452. },
  13453. enumerable: true,
  13454. configurable: true
  13455. });
  13456. Object.defineProperty(Chart.prototype, "width", {
  13457. get: function () {
  13458. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  13459. return this.m_width;
  13460. },
  13461. set: function (value) {
  13462. this.m_width=value;
  13463. _createSetPropertyAction(this.context, this, "Width", value);
  13464. },
  13465. enumerable: true,
  13466. configurable: true
  13467. });
  13468. Chart.prototype.delete=function () {
  13469. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13470. };
  13471. Chart.prototype.getImage=function (width, height, fittingMode) {
  13472. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  13473. var ret=new OfficeExtension.ClientResult();
  13474. _addActionResultHandler(this, action, ret);
  13475. return ret;
  13476. };
  13477. Chart.prototype.setData=function (sourceData, seriesBy) {
  13478. if (!(sourceData instanceof Range)) {
  13479. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  13480. }
  13481. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  13482. };
  13483. Chart.prototype.setPosition=function (startCell, endCell) {
  13484. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  13485. };
  13486. Chart.prototype._handleResult=function (value) {
  13487. _super.prototype._handleResult.call(this, value);
  13488. if (_isNullOrUndefined(value))
  13489. return;
  13490. var obj=value;
  13491. _fixObjectPathIfNecessary(this, obj);
  13492. if (!_isUndefined(obj["Height"])) {
  13493. this.m_height=obj["Height"];
  13494. }
  13495. if (!_isUndefined(obj["Left"])) {
  13496. this.m_left=obj["Left"];
  13497. }
  13498. if (!_isUndefined(obj["Name"])) {
  13499. this.m_name=obj["Name"];
  13500. }
  13501. if (!_isUndefined(obj["Top"])) {
  13502. this.m_top=obj["Top"];
  13503. }
  13504. if (!_isUndefined(obj["Width"])) {
  13505. this.m_width=obj["Width"];
  13506. }
  13507. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  13508. };
  13509. Chart.prototype.load=function (option) {
  13510. _load(this, option);
  13511. return this;
  13512. };
  13513. Chart.prototype.toJSON=function () {
  13514. return {
  13515. "axes": this.m_axes,
  13516. "dataLabels": this.m_dataLabels,
  13517. "format": this.m_format,
  13518. "height": this.m_height,
  13519. "left": this.m_left,
  13520. "legend": this.m_legend,
  13521. "name": this.m_name,
  13522. "title": this.m_title,
  13523. "top": this.m_top,
  13524. "width": this.m_width
  13525. };
  13526. };
  13527. return Chart;
  13528. }(OfficeExtension.ClientObject));
  13529. Excel.Chart=Chart;
  13530. var ChartAreaFormat=(function (_super) {
  13531. __extends(ChartAreaFormat, _super);
  13532. function ChartAreaFormat() {
  13533. _super.apply(this, arguments);
  13534. }
  13535. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  13536. get: function () {
  13537. if (!this.m_fill) {
  13538. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13539. }
  13540. return this.m_fill;
  13541. },
  13542. enumerable: true,
  13543. configurable: true
  13544. });
  13545. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  13546. get: function () {
  13547. if (!this.m_font) {
  13548. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13549. }
  13550. return this.m_font;
  13551. },
  13552. enumerable: true,
  13553. configurable: true
  13554. });
  13555. ChartAreaFormat.prototype._handleResult=function (value) {
  13556. _super.prototype._handleResult.call(this, value);
  13557. if (_isNullOrUndefined(value))
  13558. return;
  13559. var obj=value;
  13560. _fixObjectPathIfNecessary(this, obj);
  13561. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  13562. };
  13563. ChartAreaFormat.prototype.load=function (option) {
  13564. _load(this, option);
  13565. return this;
  13566. };
  13567. ChartAreaFormat.prototype.toJSON=function () {
  13568. return {
  13569. "fill": this.m_fill,
  13570. "font": this.m_font
  13571. };
  13572. };
  13573. return ChartAreaFormat;
  13574. }(OfficeExtension.ClientObject));
  13575. Excel.ChartAreaFormat=ChartAreaFormat;
  13576. var ChartSeriesCollection=(function (_super) {
  13577. __extends(ChartSeriesCollection, _super);
  13578. function ChartSeriesCollection() {
  13579. _super.apply(this, arguments);
  13580. }
  13581. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  13582. get: function () {
  13583. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  13584. return this.m__items;
  13585. },
  13586. enumerable: true,
  13587. configurable: true
  13588. });
  13589. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  13590. get: function () {
  13591. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  13592. return this.m_count;
  13593. },
  13594. enumerable: true,
  13595. configurable: true
  13596. });
  13597. ChartSeriesCollection.prototype.getItemAt=function (index) {
  13598. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13599. };
  13600. ChartSeriesCollection.prototype._handleResult=function (value) {
  13601. _super.prototype._handleResult.call(this, value);
  13602. if (_isNullOrUndefined(value))
  13603. return;
  13604. var obj=value;
  13605. _fixObjectPathIfNecessary(this, obj);
  13606. if (!_isUndefined(obj["Count"])) {
  13607. this.m_count=obj["Count"];
  13608. }
  13609. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13610. this.m__items=[];
  13611. var _data=obj[OfficeExtension.Constants.items];
  13612. for (var i=0; i < _data.length; i++) {
  13613. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13614. _item._handleResult(_data[i]);
  13615. this.m__items.push(_item);
  13616. }
  13617. }
  13618. };
  13619. ChartSeriesCollection.prototype.load=function (option) {
  13620. _load(this, option);
  13621. return this;
  13622. };
  13623. ChartSeriesCollection.prototype.toJSON=function () {
  13624. return {
  13625. "count": this.m_count
  13626. };
  13627. };
  13628. return ChartSeriesCollection;
  13629. }(OfficeExtension.ClientObject));
  13630. Excel.ChartSeriesCollection=ChartSeriesCollection;
  13631. var ChartSeries=(function (_super) {
  13632. __extends(ChartSeries, _super);
  13633. function ChartSeries() {
  13634. _super.apply(this, arguments);
  13635. }
  13636. Object.defineProperty(ChartSeries.prototype, "format", {
  13637. get: function () {
  13638. if (!this.m_format) {
  13639. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13640. }
  13641. return this.m_format;
  13642. },
  13643. enumerable: true,
  13644. configurable: true
  13645. });
  13646. Object.defineProperty(ChartSeries.prototype, "points", {
  13647. get: function () {
  13648. if (!this.m_points) {
  13649. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  13650. }
  13651. return this.m_points;
  13652. },
  13653. enumerable: true,
  13654. configurable: true
  13655. });
  13656. Object.defineProperty(ChartSeries.prototype, "name", {
  13657. get: function () {
  13658. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  13659. return this.m_name;
  13660. },
  13661. set: function (value) {
  13662. this.m_name=value;
  13663. _createSetPropertyAction(this.context, this, "Name", value);
  13664. },
  13665. enumerable: true,
  13666. configurable: true
  13667. });
  13668. ChartSeries.prototype._handleResult=function (value) {
  13669. _super.prototype._handleResult.call(this, value);
  13670. if (_isNullOrUndefined(value))
  13671. return;
  13672. var obj=value;
  13673. _fixObjectPathIfNecessary(this, obj);
  13674. if (!_isUndefined(obj["Name"])) {
  13675. this.m_name=obj["Name"];
  13676. }
  13677. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  13678. };
  13679. ChartSeries.prototype.load=function (option) {
  13680. _load(this, option);
  13681. return this;
  13682. };
  13683. ChartSeries.prototype.toJSON=function () {
  13684. return {
  13685. "format": this.m_format,
  13686. "name": this.m_name
  13687. };
  13688. };
  13689. return ChartSeries;
  13690. }(OfficeExtension.ClientObject));
  13691. Excel.ChartSeries=ChartSeries;
  13692. var ChartSeriesFormat=(function (_super) {
  13693. __extends(ChartSeriesFormat, _super);
  13694. function ChartSeriesFormat() {
  13695. _super.apply(this, arguments);
  13696. }
  13697. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  13698. get: function () {
  13699. if (!this.m_fill) {
  13700. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13701. }
  13702. return this.m_fill;
  13703. },
  13704. enumerable: true,
  13705. configurable: true
  13706. });
  13707. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  13708. get: function () {
  13709. if (!this.m_line) {
  13710. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  13711. }
  13712. return this.m_line;
  13713. },
  13714. enumerable: true,
  13715. configurable: true
  13716. });
  13717. ChartSeriesFormat.prototype._handleResult=function (value) {
  13718. _super.prototype._handleResult.call(this, value);
  13719. if (_isNullOrUndefined(value))
  13720. return;
  13721. var obj=value;
  13722. _fixObjectPathIfNecessary(this, obj);
  13723. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  13724. };
  13725. ChartSeriesFormat.prototype.load=function (option) {
  13726. _load(this, option);
  13727. return this;
  13728. };
  13729. ChartSeriesFormat.prototype.toJSON=function () {
  13730. return {
  13731. "fill": this.m_fill,
  13732. "line": this.m_line
  13733. };
  13734. };
  13735. return ChartSeriesFormat;
  13736. }(OfficeExtension.ClientObject));
  13737. Excel.ChartSeriesFormat=ChartSeriesFormat;
  13738. var ChartPointsCollection=(function (_super) {
  13739. __extends(ChartPointsCollection, _super);
  13740. function ChartPointsCollection() {
  13741. _super.apply(this, arguments);
  13742. }
  13743. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  13744. get: function () {
  13745. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  13746. return this.m__items;
  13747. },
  13748. enumerable: true,
  13749. configurable: true
  13750. });
  13751. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  13752. get: function () {
  13753. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  13754. return this.m_count;
  13755. },
  13756. enumerable: true,
  13757. configurable: true
  13758. });
  13759. ChartPointsCollection.prototype.getItemAt=function (index) {
  13760. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13761. };
  13762. ChartPointsCollection.prototype._handleResult=function (value) {
  13763. _super.prototype._handleResult.call(this, value);
  13764. if (_isNullOrUndefined(value))
  13765. return;
  13766. var obj=value;
  13767. _fixObjectPathIfNecessary(this, obj);
  13768. if (!_isUndefined(obj["Count"])) {
  13769. this.m_count=obj["Count"];
  13770. }
  13771. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13772. this.m__items=[];
  13773. var _data=obj[OfficeExtension.Constants.items];
  13774. for (var i=0; i < _data.length; i++) {
  13775. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13776. _item._handleResult(_data[i]);
  13777. this.m__items.push(_item);
  13778. }
  13779. }
  13780. };
  13781. ChartPointsCollection.prototype.load=function (option) {
  13782. _load(this, option);
  13783. return this;
  13784. };
  13785. ChartPointsCollection.prototype.toJSON=function () {
  13786. return {
  13787. "count": this.m_count
  13788. };
  13789. };
  13790. return ChartPointsCollection;
  13791. }(OfficeExtension.ClientObject));
  13792. Excel.ChartPointsCollection=ChartPointsCollection;
  13793. var ChartPoint=(function (_super) {
  13794. __extends(ChartPoint, _super);
  13795. function ChartPoint() {
  13796. _super.apply(this, arguments);
  13797. }
  13798. Object.defineProperty(ChartPoint.prototype, "format", {
  13799. get: function () {
  13800. if (!this.m_format) {
  13801. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13802. }
  13803. return this.m_format;
  13804. },
  13805. enumerable: true,
  13806. configurable: true
  13807. });
  13808. Object.defineProperty(ChartPoint.prototype, "value", {
  13809. get: function () {
  13810. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  13811. return this.m_value;
  13812. },
  13813. enumerable: true,
  13814. configurable: true
  13815. });
  13816. ChartPoint.prototype._handleResult=function (value) {
  13817. _super.prototype._handleResult.call(this, value);
  13818. if (_isNullOrUndefined(value))
  13819. return;
  13820. var obj=value;
  13821. _fixObjectPathIfNecessary(this, obj);
  13822. if (!_isUndefined(obj["Value"])) {
  13823. this.m_value=obj["Value"];
  13824. }
  13825. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  13826. };
  13827. ChartPoint.prototype.load=function (option) {
  13828. _load(this, option);
  13829. return this;
  13830. };
  13831. ChartPoint.prototype.toJSON=function () {
  13832. return {
  13833. "format": this.m_format,
  13834. "value": this.m_value
  13835. };
  13836. };
  13837. return ChartPoint;
  13838. }(OfficeExtension.ClientObject));
  13839. Excel.ChartPoint=ChartPoint;
  13840. var ChartPointFormat=(function (_super) {
  13841. __extends(ChartPointFormat, _super);
  13842. function ChartPointFormat() {
  13843. _super.apply(this, arguments);
  13844. }
  13845. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  13846. get: function () {
  13847. if (!this.m_fill) {
  13848. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13849. }
  13850. return this.m_fill;
  13851. },
  13852. enumerable: true,
  13853. configurable: true
  13854. });
  13855. ChartPointFormat.prototype._handleResult=function (value) {
  13856. _super.prototype._handleResult.call(this, value);
  13857. if (_isNullOrUndefined(value))
  13858. return;
  13859. var obj=value;
  13860. _fixObjectPathIfNecessary(this, obj);
  13861. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  13862. };
  13863. ChartPointFormat.prototype.load=function (option) {
  13864. _load(this, option);
  13865. return this;
  13866. };
  13867. ChartPointFormat.prototype.toJSON=function () {
  13868. return {
  13869. "fill": this.m_fill
  13870. };
  13871. };
  13872. return ChartPointFormat;
  13873. }(OfficeExtension.ClientObject));
  13874. Excel.ChartPointFormat=ChartPointFormat;
  13875. var ChartAxes=(function (_super) {
  13876. __extends(ChartAxes, _super);
  13877. function ChartAxes() {
  13878. _super.apply(this, arguments);
  13879. }
  13880. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  13881. get: function () {
  13882. if (!this.m_categoryAxis) {
  13883. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  13884. }
  13885. return this.m_categoryAxis;
  13886. },
  13887. enumerable: true,
  13888. configurable: true
  13889. });
  13890. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  13891. get: function () {
  13892. if (!this.m_seriesAxis) {
  13893. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  13894. }
  13895. return this.m_seriesAxis;
  13896. },
  13897. enumerable: true,
  13898. configurable: true
  13899. });
  13900. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  13901. get: function () {
  13902. if (!this.m_valueAxis) {
  13903. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  13904. }
  13905. return this.m_valueAxis;
  13906. },
  13907. enumerable: true,
  13908. configurable: true
  13909. });
  13910. ChartAxes.prototype._handleResult=function (value) {
  13911. _super.prototype._handleResult.call(this, value);
  13912. if (_isNullOrUndefined(value))
  13913. return;
  13914. var obj=value;
  13915. _fixObjectPathIfNecessary(this, obj);
  13916. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  13917. };
  13918. ChartAxes.prototype.load=function (option) {
  13919. _load(this, option);
  13920. return this;
  13921. };
  13922. ChartAxes.prototype.toJSON=function () {
  13923. return {
  13924. "categoryAxis": this.m_categoryAxis,
  13925. "seriesAxis": this.m_seriesAxis,
  13926. "valueAxis": this.m_valueAxis
  13927. };
  13928. };
  13929. return ChartAxes;
  13930. }(OfficeExtension.ClientObject));
  13931. Excel.ChartAxes=ChartAxes;
  13932. var ChartAxis=(function (_super) {
  13933. __extends(ChartAxis, _super);
  13934. function ChartAxis() {
  13935. _super.apply(this, arguments);
  13936. }
  13937. Object.defineProperty(ChartAxis.prototype, "format", {
  13938. get: function () {
  13939. if (!this.m_format) {
  13940. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13941. }
  13942. return this.m_format;
  13943. },
  13944. enumerable: true,
  13945. configurable: true
  13946. });
  13947. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  13948. get: function () {
  13949. if (!this.m_majorGridlines) {
  13950. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  13951. }
  13952. return this.m_majorGridlines;
  13953. },
  13954. enumerable: true,
  13955. configurable: true
  13956. });
  13957. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  13958. get: function () {
  13959. if (!this.m_minorGridlines) {
  13960. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  13961. }
  13962. return this.m_minorGridlines;
  13963. },
  13964. enumerable: true,
  13965. configurable: true
  13966. });
  13967. Object.defineProperty(ChartAxis.prototype, "title", {
  13968. get: function () {
  13969. if (!this.m_title) {
  13970. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13971. }
  13972. return this.m_title;
  13973. },
  13974. enumerable: true,
  13975. configurable: true
  13976. });
  13977. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  13978. get: function () {
  13979. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  13980. return this.m_majorUnit;
  13981. },
  13982. set: function (value) {
  13983. this.m_majorUnit=value;
  13984. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  13985. },
  13986. enumerable: true,
  13987. configurable: true
  13988. });
  13989. Object.defineProperty(ChartAxis.prototype, "maximum", {
  13990. get: function () {
  13991. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  13992. return this.m_maximum;
  13993. },
  13994. set: function (value) {
  13995. this.m_maximum=value;
  13996. _createSetPropertyAction(this.context, this, "Maximum", value);
  13997. },
  13998. enumerable: true,
  13999. configurable: true
  14000. });
  14001. Object.defineProperty(ChartAxis.prototype, "minimum", {
  14002. get: function () {
  14003. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  14004. return this.m_minimum;
  14005. },
  14006. set: function (value) {
  14007. this.m_minimum=value;
  14008. _createSetPropertyAction(this.context, this, "Minimum", value);
  14009. },
  14010. enumerable: true,
  14011. configurable: true
  14012. });
  14013. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  14014. get: function () {
  14015. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  14016. return this.m_minorUnit;
  14017. },
  14018. set: function (value) {
  14019. this.m_minorUnit=value;
  14020. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  14021. },
  14022. enumerable: true,
  14023. configurable: true
  14024. });
  14025. ChartAxis.prototype._handleResult=function (value) {
  14026. _super.prototype._handleResult.call(this, value);
  14027. if (_isNullOrUndefined(value))
  14028. return;
  14029. var obj=value;
  14030. _fixObjectPathIfNecessary(this, obj);
  14031. if (!_isUndefined(obj["MajorUnit"])) {
  14032. this.m_majorUnit=obj["MajorUnit"];
  14033. }
  14034. if (!_isUndefined(obj["Maximum"])) {
  14035. this.m_maximum=obj["Maximum"];
  14036. }
  14037. if (!_isUndefined(obj["Minimum"])) {
  14038. this.m_minimum=obj["Minimum"];
  14039. }
  14040. if (!_isUndefined(obj["MinorUnit"])) {
  14041. this.m_minorUnit=obj["MinorUnit"];
  14042. }
  14043. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  14044. };
  14045. ChartAxis.prototype.load=function (option) {
  14046. _load(this, option);
  14047. return this;
  14048. };
  14049. ChartAxis.prototype.toJSON=function () {
  14050. return {
  14051. "format": this.m_format,
  14052. "majorGridlines": this.m_majorGridlines,
  14053. "majorUnit": this.m_majorUnit,
  14054. "maximum": this.m_maximum,
  14055. "minimum": this.m_minimum,
  14056. "minorGridlines": this.m_minorGridlines,
  14057. "minorUnit": this.m_minorUnit,
  14058. "title": this.m_title
  14059. };
  14060. };
  14061. return ChartAxis;
  14062. }(OfficeExtension.ClientObject));
  14063. Excel.ChartAxis=ChartAxis;
  14064. var ChartAxisFormat=(function (_super) {
  14065. __extends(ChartAxisFormat, _super);
  14066. function ChartAxisFormat() {
  14067. _super.apply(this, arguments);
  14068. }
  14069. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  14070. get: function () {
  14071. if (!this.m_font) {
  14072. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14073. }
  14074. return this.m_font;
  14075. },
  14076. enumerable: true,
  14077. configurable: true
  14078. });
  14079. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  14080. get: function () {
  14081. if (!this.m_line) {
  14082. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14083. }
  14084. return this.m_line;
  14085. },
  14086. enumerable: true,
  14087. configurable: true
  14088. });
  14089. ChartAxisFormat.prototype._handleResult=function (value) {
  14090. _super.prototype._handleResult.call(this, value);
  14091. if (_isNullOrUndefined(value))
  14092. return;
  14093. var obj=value;
  14094. _fixObjectPathIfNecessary(this, obj);
  14095. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  14096. };
  14097. ChartAxisFormat.prototype.load=function (option) {
  14098. _load(this, option);
  14099. return this;
  14100. };
  14101. ChartAxisFormat.prototype.toJSON=function () {
  14102. return {
  14103. "font": this.m_font,
  14104. "line": this.m_line
  14105. };
  14106. };
  14107. return ChartAxisFormat;
  14108. }(OfficeExtension.ClientObject));
  14109. Excel.ChartAxisFormat=ChartAxisFormat;
  14110. var ChartAxisTitle=(function (_super) {
  14111. __extends(ChartAxisTitle, _super);
  14112. function ChartAxisTitle() {
  14113. _super.apply(this, arguments);
  14114. }
  14115. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  14116. get: function () {
  14117. if (!this.m_format) {
  14118. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14119. }
  14120. return this.m_format;
  14121. },
  14122. enumerable: true,
  14123. configurable: true
  14124. });
  14125. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  14126. get: function () {
  14127. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  14128. return this.m_text;
  14129. },
  14130. set: function (value) {
  14131. this.m_text=value;
  14132. _createSetPropertyAction(this.context, this, "Text", value);
  14133. },
  14134. enumerable: true,
  14135. configurable: true
  14136. });
  14137. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  14138. get: function () {
  14139. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  14140. return this.m_visible;
  14141. },
  14142. set: function (value) {
  14143. this.m_visible=value;
  14144. _createSetPropertyAction(this.context, this, "Visible", value);
  14145. },
  14146. enumerable: true,
  14147. configurable: true
  14148. });
  14149. ChartAxisTitle.prototype._handleResult=function (value) {
  14150. _super.prototype._handleResult.call(this, value);
  14151. if (_isNullOrUndefined(value))
  14152. return;
  14153. var obj=value;
  14154. _fixObjectPathIfNecessary(this, obj);
  14155. if (!_isUndefined(obj["Text"])) {
  14156. this.m_text=obj["Text"];
  14157. }
  14158. if (!_isUndefined(obj["Visible"])) {
  14159. this.m_visible=obj["Visible"];
  14160. }
  14161. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14162. };
  14163. ChartAxisTitle.prototype.load=function (option) {
  14164. _load(this, option);
  14165. return this;
  14166. };
  14167. ChartAxisTitle.prototype.toJSON=function () {
  14168. return {
  14169. "format": this.m_format,
  14170. "text": this.m_text,
  14171. "visible": this.m_visible
  14172. };
  14173. };
  14174. return ChartAxisTitle;
  14175. }(OfficeExtension.ClientObject));
  14176. Excel.ChartAxisTitle=ChartAxisTitle;
  14177. var ChartAxisTitleFormat=(function (_super) {
  14178. __extends(ChartAxisTitleFormat, _super);
  14179. function ChartAxisTitleFormat() {
  14180. _super.apply(this, arguments);
  14181. }
  14182. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  14183. get: function () {
  14184. if (!this.m_font) {
  14185. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14186. }
  14187. return this.m_font;
  14188. },
  14189. enumerable: true,
  14190. configurable: true
  14191. });
  14192. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  14193. _super.prototype._handleResult.call(this, value);
  14194. if (_isNullOrUndefined(value))
  14195. return;
  14196. var obj=value;
  14197. _fixObjectPathIfNecessary(this, obj);
  14198. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  14199. };
  14200. ChartAxisTitleFormat.prototype.load=function (option) {
  14201. _load(this, option);
  14202. return this;
  14203. };
  14204. ChartAxisTitleFormat.prototype.toJSON=function () {
  14205. return {
  14206. "font": this.m_font
  14207. };
  14208. };
  14209. return ChartAxisTitleFormat;
  14210. }(OfficeExtension.ClientObject));
  14211. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  14212. var ChartDataLabels=(function (_super) {
  14213. __extends(ChartDataLabels, _super);
  14214. function ChartDataLabels() {
  14215. _super.apply(this, arguments);
  14216. }
  14217. Object.defineProperty(ChartDataLabels.prototype, "format", {
  14218. get: function () {
  14219. if (!this.m_format) {
  14220. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14221. }
  14222. return this.m_format;
  14223. },
  14224. enumerable: true,
  14225. configurable: true
  14226. });
  14227. Object.defineProperty(ChartDataLabels.prototype, "position", {
  14228. get: function () {
  14229. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  14230. return this.m_position;
  14231. },
  14232. set: function (value) {
  14233. this.m_position=value;
  14234. _createSetPropertyAction(this.context, this, "Position", value);
  14235. },
  14236. enumerable: true,
  14237. configurable: true
  14238. });
  14239. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  14240. get: function () {
  14241. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  14242. return this.m_separator;
  14243. },
  14244. set: function (value) {
  14245. this.m_separator=value;
  14246. _createSetPropertyAction(this.context, this, "Separator", value);
  14247. },
  14248. enumerable: true,
  14249. configurable: true
  14250. });
  14251. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  14252. get: function () {
  14253. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  14254. return this.m_showBubbleSize;
  14255. },
  14256. set: function (value) {
  14257. this.m_showBubbleSize=value;
  14258. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  14259. },
  14260. enumerable: true,
  14261. configurable: true
  14262. });
  14263. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  14264. get: function () {
  14265. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  14266. return this.m_showCategoryName;
  14267. },
  14268. set: function (value) {
  14269. this.m_showCategoryName=value;
  14270. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  14271. },
  14272. enumerable: true,
  14273. configurable: true
  14274. });
  14275. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  14276. get: function () {
  14277. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  14278. return this.m_showLegendKey;
  14279. },
  14280. set: function (value) {
  14281. this.m_showLegendKey=value;
  14282. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  14283. },
  14284. enumerable: true,
  14285. configurable: true
  14286. });
  14287. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  14288. get: function () {
  14289. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  14290. return this.m_showPercentage;
  14291. },
  14292. set: function (value) {
  14293. this.m_showPercentage=value;
  14294. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  14295. },
  14296. enumerable: true,
  14297. configurable: true
  14298. });
  14299. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  14300. get: function () {
  14301. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  14302. return this.m_showSeriesName;
  14303. },
  14304. set: function (value) {
  14305. this.m_showSeriesName=value;
  14306. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  14307. },
  14308. enumerable: true,
  14309. configurable: true
  14310. });
  14311. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  14312. get: function () {
  14313. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  14314. return this.m_showValue;
  14315. },
  14316. set: function (value) {
  14317. this.m_showValue=value;
  14318. _createSetPropertyAction(this.context, this, "ShowValue", value);
  14319. },
  14320. enumerable: true,
  14321. configurable: true
  14322. });
  14323. ChartDataLabels.prototype._handleResult=function (value) {
  14324. _super.prototype._handleResult.call(this, value);
  14325. if (_isNullOrUndefined(value))
  14326. return;
  14327. var obj=value;
  14328. _fixObjectPathIfNecessary(this, obj);
  14329. if (!_isUndefined(obj["Position"])) {
  14330. this.m_position=obj["Position"];
  14331. }
  14332. if (!_isUndefined(obj["Separator"])) {
  14333. this.m_separator=obj["Separator"];
  14334. }
  14335. if (!_isUndefined(obj["ShowBubbleSize"])) {
  14336. this.m_showBubbleSize=obj["ShowBubbleSize"];
  14337. }
  14338. if (!_isUndefined(obj["ShowCategoryName"])) {
  14339. this.m_showCategoryName=obj["ShowCategoryName"];
  14340. }
  14341. if (!_isUndefined(obj["ShowLegendKey"])) {
  14342. this.m_showLegendKey=obj["ShowLegendKey"];
  14343. }
  14344. if (!_isUndefined(obj["ShowPercentage"])) {
  14345. this.m_showPercentage=obj["ShowPercentage"];
  14346. }
  14347. if (!_isUndefined(obj["ShowSeriesName"])) {
  14348. this.m_showSeriesName=obj["ShowSeriesName"];
  14349. }
  14350. if (!_isUndefined(obj["ShowValue"])) {
  14351. this.m_showValue=obj["ShowValue"];
  14352. }
  14353. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14354. };
  14355. ChartDataLabels.prototype.load=function (option) {
  14356. _load(this, option);
  14357. return this;
  14358. };
  14359. ChartDataLabels.prototype.toJSON=function () {
  14360. return {
  14361. "format": this.m_format,
  14362. "position": this.m_position,
  14363. "separator": this.m_separator,
  14364. "showBubbleSize": this.m_showBubbleSize,
  14365. "showCategoryName": this.m_showCategoryName,
  14366. "showLegendKey": this.m_showLegendKey,
  14367. "showPercentage": this.m_showPercentage,
  14368. "showSeriesName": this.m_showSeriesName,
  14369. "showValue": this.m_showValue
  14370. };
  14371. };
  14372. return ChartDataLabels;
  14373. }(OfficeExtension.ClientObject));
  14374. Excel.ChartDataLabels=ChartDataLabels;
  14375. var ChartDataLabelFormat=(function (_super) {
  14376. __extends(ChartDataLabelFormat, _super);
  14377. function ChartDataLabelFormat() {
  14378. _super.apply(this, arguments);
  14379. }
  14380. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  14381. get: function () {
  14382. if (!this.m_fill) {
  14383. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14384. }
  14385. return this.m_fill;
  14386. },
  14387. enumerable: true,
  14388. configurable: true
  14389. });
  14390. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  14391. get: function () {
  14392. if (!this.m_font) {
  14393. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14394. }
  14395. return this.m_font;
  14396. },
  14397. enumerable: true,
  14398. configurable: true
  14399. });
  14400. ChartDataLabelFormat.prototype._handleResult=function (value) {
  14401. _super.prototype._handleResult.call(this, value);
  14402. if (_isNullOrUndefined(value))
  14403. return;
  14404. var obj=value;
  14405. _fixObjectPathIfNecessary(this, obj);
  14406. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14407. };
  14408. ChartDataLabelFormat.prototype.load=function (option) {
  14409. _load(this, option);
  14410. return this;
  14411. };
  14412. ChartDataLabelFormat.prototype.toJSON=function () {
  14413. return {
  14414. "fill": this.m_fill,
  14415. "font": this.m_font
  14416. };
  14417. };
  14418. return ChartDataLabelFormat;
  14419. }(OfficeExtension.ClientObject));
  14420. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  14421. var ChartGridlines=(function (_super) {
  14422. __extends(ChartGridlines, _super);
  14423. function ChartGridlines() {
  14424. _super.apply(this, arguments);
  14425. }
  14426. Object.defineProperty(ChartGridlines.prototype, "format", {
  14427. get: function () {
  14428. if (!this.m_format) {
  14429. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14430. }
  14431. return this.m_format;
  14432. },
  14433. enumerable: true,
  14434. configurable: true
  14435. });
  14436. Object.defineProperty(ChartGridlines.prototype, "visible", {
  14437. get: function () {
  14438. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  14439. return this.m_visible;
  14440. },
  14441. set: function (value) {
  14442. this.m_visible=value;
  14443. _createSetPropertyAction(this.context, this, "Visible", value);
  14444. },
  14445. enumerable: true,
  14446. configurable: true
  14447. });
  14448. ChartGridlines.prototype._handleResult=function (value) {
  14449. _super.prototype._handleResult.call(this, value);
  14450. if (_isNullOrUndefined(value))
  14451. return;
  14452. var obj=value;
  14453. _fixObjectPathIfNecessary(this, obj);
  14454. if (!_isUndefined(obj["Visible"])) {
  14455. this.m_visible=obj["Visible"];
  14456. }
  14457. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14458. };
  14459. ChartGridlines.prototype.load=function (option) {
  14460. _load(this, option);
  14461. return this;
  14462. };
  14463. ChartGridlines.prototype.toJSON=function () {
  14464. return {
  14465. "format": this.m_format,
  14466. "visible": this.m_visible
  14467. };
  14468. };
  14469. return ChartGridlines;
  14470. }(OfficeExtension.ClientObject));
  14471. Excel.ChartGridlines=ChartGridlines;
  14472. var ChartGridlinesFormat=(function (_super) {
  14473. __extends(ChartGridlinesFormat, _super);
  14474. function ChartGridlinesFormat() {
  14475. _super.apply(this, arguments);
  14476. }
  14477. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  14478. get: function () {
  14479. if (!this.m_line) {
  14480. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14481. }
  14482. return this.m_line;
  14483. },
  14484. enumerable: true,
  14485. configurable: true
  14486. });
  14487. ChartGridlinesFormat.prototype._handleResult=function (value) {
  14488. _super.prototype._handleResult.call(this, value);
  14489. if (_isNullOrUndefined(value))
  14490. return;
  14491. var obj=value;
  14492. _fixObjectPathIfNecessary(this, obj);
  14493. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  14494. };
  14495. ChartGridlinesFormat.prototype.load=function (option) {
  14496. _load(this, option);
  14497. return this;
  14498. };
  14499. ChartGridlinesFormat.prototype.toJSON=function () {
  14500. return {
  14501. "line": this.m_line
  14502. };
  14503. };
  14504. return ChartGridlinesFormat;
  14505. }(OfficeExtension.ClientObject));
  14506. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  14507. var ChartLegend=(function (_super) {
  14508. __extends(ChartLegend, _super);
  14509. function ChartLegend() {
  14510. _super.apply(this, arguments);
  14511. }
  14512. Object.defineProperty(ChartLegend.prototype, "format", {
  14513. get: function () {
  14514. if (!this.m_format) {
  14515. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14516. }
  14517. return this.m_format;
  14518. },
  14519. enumerable: true,
  14520. configurable: true
  14521. });
  14522. Object.defineProperty(ChartLegend.prototype, "overlay", {
  14523. get: function () {
  14524. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  14525. return this.m_overlay;
  14526. },
  14527. set: function (value) {
  14528. this.m_overlay=value;
  14529. _createSetPropertyAction(this.context, this, "Overlay", value);
  14530. },
  14531. enumerable: true,
  14532. configurable: true
  14533. });
  14534. Object.defineProperty(ChartLegend.prototype, "position", {
  14535. get: function () {
  14536. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  14537. return this.m_position;
  14538. },
  14539. set: function (value) {
  14540. this.m_position=value;
  14541. _createSetPropertyAction(this.context, this, "Position", value);
  14542. },
  14543. enumerable: true,
  14544. configurable: true
  14545. });
  14546. Object.defineProperty(ChartLegend.prototype, "visible", {
  14547. get: function () {
  14548. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  14549. return this.m_visible;
  14550. },
  14551. set: function (value) {
  14552. this.m_visible=value;
  14553. _createSetPropertyAction(this.context, this, "Visible", value);
  14554. },
  14555. enumerable: true,
  14556. configurable: true
  14557. });
  14558. ChartLegend.prototype._handleResult=function (value) {
  14559. _super.prototype._handleResult.call(this, value);
  14560. if (_isNullOrUndefined(value))
  14561. return;
  14562. var obj=value;
  14563. _fixObjectPathIfNecessary(this, obj);
  14564. if (!_isUndefined(obj["Overlay"])) {
  14565. this.m_overlay=obj["Overlay"];
  14566. }
  14567. if (!_isUndefined(obj["Position"])) {
  14568. this.m_position=obj["Position"];
  14569. }
  14570. if (!_isUndefined(obj["Visible"])) {
  14571. this.m_visible=obj["Visible"];
  14572. }
  14573. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14574. };
  14575. ChartLegend.prototype.load=function (option) {
  14576. _load(this, option);
  14577. return this;
  14578. };
  14579. ChartLegend.prototype.toJSON=function () {
  14580. return {
  14581. "format": this.m_format,
  14582. "overlay": this.m_overlay,
  14583. "position": this.m_position,
  14584. "visible": this.m_visible
  14585. };
  14586. };
  14587. return ChartLegend;
  14588. }(OfficeExtension.ClientObject));
  14589. Excel.ChartLegend=ChartLegend;
  14590. var ChartLegendFormat=(function (_super) {
  14591. __extends(ChartLegendFormat, _super);
  14592. function ChartLegendFormat() {
  14593. _super.apply(this, arguments);
  14594. }
  14595. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  14596. get: function () {
  14597. if (!this.m_fill) {
  14598. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14599. }
  14600. return this.m_fill;
  14601. },
  14602. enumerable: true,
  14603. configurable: true
  14604. });
  14605. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  14606. get: function () {
  14607. if (!this.m_font) {
  14608. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14609. }
  14610. return this.m_font;
  14611. },
  14612. enumerable: true,
  14613. configurable: true
  14614. });
  14615. ChartLegendFormat.prototype._handleResult=function (value) {
  14616. _super.prototype._handleResult.call(this, value);
  14617. if (_isNullOrUndefined(value))
  14618. return;
  14619. var obj=value;
  14620. _fixObjectPathIfNecessary(this, obj);
  14621. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14622. };
  14623. ChartLegendFormat.prototype.load=function (option) {
  14624. _load(this, option);
  14625. return this;
  14626. };
  14627. ChartLegendFormat.prototype.toJSON=function () {
  14628. return {
  14629. "fill": this.m_fill,
  14630. "font": this.m_font
  14631. };
  14632. };
  14633. return ChartLegendFormat;
  14634. }(OfficeExtension.ClientObject));
  14635. Excel.ChartLegendFormat=ChartLegendFormat;
  14636. var ChartTitle=(function (_super) {
  14637. __extends(ChartTitle, _super);
  14638. function ChartTitle() {
  14639. _super.apply(this, arguments);
  14640. }
  14641. Object.defineProperty(ChartTitle.prototype, "format", {
  14642. get: function () {
  14643. if (!this.m_format) {
  14644. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14645. }
  14646. return this.m_format;
  14647. },
  14648. enumerable: true,
  14649. configurable: true
  14650. });
  14651. Object.defineProperty(ChartTitle.prototype, "overlay", {
  14652. get: function () {
  14653. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  14654. return this.m_overlay;
  14655. },
  14656. set: function (value) {
  14657. this.m_overlay=value;
  14658. _createSetPropertyAction(this.context, this, "Overlay", value);
  14659. },
  14660. enumerable: true,
  14661. configurable: true
  14662. });
  14663. Object.defineProperty(ChartTitle.prototype, "text", {
  14664. get: function () {
  14665. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  14666. return this.m_text;
  14667. },
  14668. set: function (value) {
  14669. this.m_text=value;
  14670. _createSetPropertyAction(this.context, this, "Text", value);
  14671. },
  14672. enumerable: true,
  14673. configurable: true
  14674. });
  14675. Object.defineProperty(ChartTitle.prototype, "visible", {
  14676. get: function () {
  14677. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  14678. return this.m_visible;
  14679. },
  14680. set: function (value) {
  14681. this.m_visible=value;
  14682. _createSetPropertyAction(this.context, this, "Visible", value);
  14683. },
  14684. enumerable: true,
  14685. configurable: true
  14686. });
  14687. ChartTitle.prototype._handleResult=function (value) {
  14688. _super.prototype._handleResult.call(this, value);
  14689. if (_isNullOrUndefined(value))
  14690. return;
  14691. var obj=value;
  14692. _fixObjectPathIfNecessary(this, obj);
  14693. if (!_isUndefined(obj["Overlay"])) {
  14694. this.m_overlay=obj["Overlay"];
  14695. }
  14696. if (!_isUndefined(obj["Text"])) {
  14697. this.m_text=obj["Text"];
  14698. }
  14699. if (!_isUndefined(obj["Visible"])) {
  14700. this.m_visible=obj["Visible"];
  14701. }
  14702. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14703. };
  14704. ChartTitle.prototype.load=function (option) {
  14705. _load(this, option);
  14706. return this;
  14707. };
  14708. ChartTitle.prototype.toJSON=function () {
  14709. return {
  14710. "format": this.m_format,
  14711. "overlay": this.m_overlay,
  14712. "text": this.m_text,
  14713. "visible": this.m_visible
  14714. };
  14715. };
  14716. return ChartTitle;
  14717. }(OfficeExtension.ClientObject));
  14718. Excel.ChartTitle=ChartTitle;
  14719. var ChartTitleFormat=(function (_super) {
  14720. __extends(ChartTitleFormat, _super);
  14721. function ChartTitleFormat() {
  14722. _super.apply(this, arguments);
  14723. }
  14724. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  14725. get: function () {
  14726. if (!this.m_fill) {
  14727. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14728. }
  14729. return this.m_fill;
  14730. },
  14731. enumerable: true,
  14732. configurable: true
  14733. });
  14734. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  14735. get: function () {
  14736. if (!this.m_font) {
  14737. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14738. }
  14739. return this.m_font;
  14740. },
  14741. enumerable: true,
  14742. configurable: true
  14743. });
  14744. ChartTitleFormat.prototype._handleResult=function (value) {
  14745. _super.prototype._handleResult.call(this, value);
  14746. if (_isNullOrUndefined(value))
  14747. return;
  14748. var obj=value;
  14749. _fixObjectPathIfNecessary(this, obj);
  14750. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14751. };
  14752. ChartTitleFormat.prototype.load=function (option) {
  14753. _load(this, option);
  14754. return this;
  14755. };
  14756. ChartTitleFormat.prototype.toJSON=function () {
  14757. return {
  14758. "fill": this.m_fill,
  14759. "font": this.m_font
  14760. };
  14761. };
  14762. return ChartTitleFormat;
  14763. }(OfficeExtension.ClientObject));
  14764. Excel.ChartTitleFormat=ChartTitleFormat;
  14765. var ChartFill=(function (_super) {
  14766. __extends(ChartFill, _super);
  14767. function ChartFill() {
  14768. _super.apply(this, arguments);
  14769. }
  14770. ChartFill.prototype.load=function (option) {
  14771. _load(this, option);
  14772. return this;
  14773. };
  14774. ChartFill.prototype.clear=function () {
  14775. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14776. };
  14777. ChartFill.prototype.setSolidColor=function (color) {
  14778. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  14779. };
  14780. ChartFill.prototype._handleResult=function (value) {
  14781. _super.prototype._handleResult.call(this, value);
  14782. if (_isNullOrUndefined(value))
  14783. return;
  14784. var obj=value;
  14785. _fixObjectPathIfNecessary(this, obj);
  14786. };
  14787. ChartFill.prototype.toJSON=function () {
  14788. return {};
  14789. };
  14790. return ChartFill;
  14791. }(OfficeExtension.ClientObject));
  14792. Excel.ChartFill=ChartFill;
  14793. var ChartLineFormat=(function (_super) {
  14794. __extends(ChartLineFormat, _super);
  14795. function ChartLineFormat() {
  14796. _super.apply(this, arguments);
  14797. }
  14798. Object.defineProperty(ChartLineFormat.prototype, "color", {
  14799. get: function () {
  14800. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  14801. return this.m_color;
  14802. },
  14803. set: function (value) {
  14804. this.m_color=value;
  14805. _createSetPropertyAction(this.context, this, "Color", value);
  14806. },
  14807. enumerable: true,
  14808. configurable: true
  14809. });
  14810. ChartLineFormat.prototype.clear=function () {
  14811. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14812. };
  14813. ChartLineFormat.prototype._handleResult=function (value) {
  14814. _super.prototype._handleResult.call(this, value);
  14815. if (_isNullOrUndefined(value))
  14816. return;
  14817. var obj=value;
  14818. _fixObjectPathIfNecessary(this, obj);
  14819. if (!_isUndefined(obj["Color"])) {
  14820. this.m_color=obj["Color"];
  14821. }
  14822. };
  14823. ChartLineFormat.prototype.load=function (option) {
  14824. _load(this, option);
  14825. return this;
  14826. };
  14827. ChartLineFormat.prototype.toJSON=function () {
  14828. return {
  14829. "color": this.m_color
  14830. };
  14831. };
  14832. return ChartLineFormat;
  14833. }(OfficeExtension.ClientObject));
  14834. Excel.ChartLineFormat=ChartLineFormat;
  14835. var ChartFont=(function (_super) {
  14836. __extends(ChartFont, _super);
  14837. function ChartFont() {
  14838. _super.apply(this, arguments);
  14839. }
  14840. Object.defineProperty(ChartFont.prototype, "bold", {
  14841. get: function () {
  14842. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  14843. return this.m_bold;
  14844. },
  14845. set: function (value) {
  14846. this.m_bold=value;
  14847. _createSetPropertyAction(this.context, this, "Bold", value);
  14848. },
  14849. enumerable: true,
  14850. configurable: true
  14851. });
  14852. Object.defineProperty(ChartFont.prototype, "color", {
  14853. get: function () {
  14854. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  14855. return this.m_color;
  14856. },
  14857. set: function (value) {
  14858. this.m_color=value;
  14859. _createSetPropertyAction(this.context, this, "Color", value);
  14860. },
  14861. enumerable: true,
  14862. configurable: true
  14863. });
  14864. Object.defineProperty(ChartFont.prototype, "italic", {
  14865. get: function () {
  14866. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  14867. return this.m_italic;
  14868. },
  14869. set: function (value) {
  14870. this.m_italic=value;
  14871. _createSetPropertyAction(this.context, this, "Italic", value);
  14872. },
  14873. enumerable: true,
  14874. configurable: true
  14875. });
  14876. Object.defineProperty(ChartFont.prototype, "name", {
  14877. get: function () {
  14878. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  14879. return this.m_name;
  14880. },
  14881. set: function (value) {
  14882. this.m_name=value;
  14883. _createSetPropertyAction(this.context, this, "Name", value);
  14884. },
  14885. enumerable: true,
  14886. configurable: true
  14887. });
  14888. Object.defineProperty(ChartFont.prototype, "size", {
  14889. get: function () {
  14890. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  14891. return this.m_size;
  14892. },
  14893. set: function (value) {
  14894. this.m_size=value;
  14895. _createSetPropertyAction(this.context, this, "Size", value);
  14896. },
  14897. enumerable: true,
  14898. configurable: true
  14899. });
  14900. Object.defineProperty(ChartFont.prototype, "underline", {
  14901. get: function () {
  14902. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  14903. return this.m_underline;
  14904. },
  14905. set: function (value) {
  14906. this.m_underline=value;
  14907. _createSetPropertyAction(this.context, this, "Underline", value);
  14908. },
  14909. enumerable: true,
  14910. configurable: true
  14911. });
  14912. ChartFont.prototype._handleResult=function (value) {
  14913. _super.prototype._handleResult.call(this, value);
  14914. if (_isNullOrUndefined(value))
  14915. return;
  14916. var obj=value;
  14917. _fixObjectPathIfNecessary(this, obj);
  14918. if (!_isUndefined(obj["Bold"])) {
  14919. this.m_bold=obj["Bold"];
  14920. }
  14921. if (!_isUndefined(obj["Color"])) {
  14922. this.m_color=obj["Color"];
  14923. }
  14924. if (!_isUndefined(obj["Italic"])) {
  14925. this.m_italic=obj["Italic"];
  14926. }
  14927. if (!_isUndefined(obj["Name"])) {
  14928. this.m_name=obj["Name"];
  14929. }
  14930. if (!_isUndefined(obj["Size"])) {
  14931. this.m_size=obj["Size"];
  14932. }
  14933. if (!_isUndefined(obj["Underline"])) {
  14934. this.m_underline=obj["Underline"];
  14935. }
  14936. };
  14937. ChartFont.prototype.load=function (option) {
  14938. _load(this, option);
  14939. return this;
  14940. };
  14941. ChartFont.prototype.toJSON=function () {
  14942. return {
  14943. "bold": this.m_bold,
  14944. "color": this.m_color,
  14945. "italic": this.m_italic,
  14946. "name": this.m_name,
  14947. "size": this.m_size,
  14948. "underline": this.m_underline
  14949. };
  14950. };
  14951. return ChartFont;
  14952. }(OfficeExtension.ClientObject));
  14953. Excel.ChartFont=ChartFont;
  14954. var RangeSort=(function (_super) {
  14955. __extends(RangeSort, _super);
  14956. function RangeSort() {
  14957. _super.apply(this, arguments);
  14958. }
  14959. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  14960. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  14961. };
  14962. RangeSort.prototype._handleResult=function (value) {
  14963. _super.prototype._handleResult.call(this, value);
  14964. if (_isNullOrUndefined(value))
  14965. return;
  14966. var obj=value;
  14967. _fixObjectPathIfNecessary(this, obj);
  14968. };
  14969. RangeSort.prototype.toJSON=function () {
  14970. return {};
  14971. };
  14972. return RangeSort;
  14973. }(OfficeExtension.ClientObject));
  14974. Excel.RangeSort=RangeSort;
  14975. var TableSort=(function (_super) {
  14976. __extends(TableSort, _super);
  14977. function TableSort() {
  14978. _super.apply(this, arguments);
  14979. }
  14980. Object.defineProperty(TableSort.prototype, "fields", {
  14981. get: function () {
  14982. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  14983. return this.m_fields;
  14984. },
  14985. enumerable: true,
  14986. configurable: true
  14987. });
  14988. Object.defineProperty(TableSort.prototype, "matchCase", {
  14989. get: function () {
  14990. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  14991. return this.m_matchCase;
  14992. },
  14993. enumerable: true,
  14994. configurable: true
  14995. });
  14996. Object.defineProperty(TableSort.prototype, "method", {
  14997. get: function () {
  14998. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  14999. return this.m_method;
  15000. },
  15001. enumerable: true,
  15002. configurable: true
  15003. });
  15004. TableSort.prototype.apply=function (fields, matchCase, method) {
  15005. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  15006. };
  15007. TableSort.prototype.clear=function () {
  15008. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15009. };
  15010. TableSort.prototype.reapply=function () {
  15011. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  15012. };
  15013. TableSort.prototype._handleResult=function (value) {
  15014. _super.prototype._handleResult.call(this, value);
  15015. if (_isNullOrUndefined(value))
  15016. return;
  15017. var obj=value;
  15018. _fixObjectPathIfNecessary(this, obj);
  15019. if (!_isUndefined(obj["Fields"])) {
  15020. this.m_fields=obj["Fields"];
  15021. }
  15022. if (!_isUndefined(obj["MatchCase"])) {
  15023. this.m_matchCase=obj["MatchCase"];
  15024. }
  15025. if (!_isUndefined(obj["Method"])) {
  15026. this.m_method=obj["Method"];
  15027. }
  15028. };
  15029. TableSort.prototype.load=function (option) {
  15030. _load(this, option);
  15031. return this;
  15032. };
  15033. TableSort.prototype.toJSON=function () {
  15034. return {
  15035. "fields": this.m_fields,
  15036. "matchCase": this.m_matchCase,
  15037. "method": this.m_method
  15038. };
  15039. };
  15040. return TableSort;
  15041. }(OfficeExtension.ClientObject));
  15042. Excel.TableSort=TableSort;
  15043. var Filter=(function (_super) {
  15044. __extends(Filter, _super);
  15045. function Filter() {
  15046. _super.apply(this, arguments);
  15047. }
  15048. Object.defineProperty(Filter.prototype, "criteria", {
  15049. get: function () {
  15050. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  15051. return this.m_criteria;
  15052. },
  15053. enumerable: true,
  15054. configurable: true
  15055. });
  15056. Filter.prototype.apply=function (criteria) {
  15057. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  15058. };
  15059. Filter.prototype.applyBottomItemsFilter=function (count) {
  15060. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15061. };
  15062. Filter.prototype.applyBottomPercentFilter=function (percent) {
  15063. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15064. };
  15065. Filter.prototype.applyCellColorFilter=function (color) {
  15066. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  15067. };
  15068. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  15069. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  15070. };
  15071. Filter.prototype.applyDynamicFilter=function (criteria) {
  15072. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  15073. };
  15074. Filter.prototype.applyFontColorFilter=function (color) {
  15075. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  15076. };
  15077. Filter.prototype.applyIconFilter=function (icon) {
  15078. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  15079. };
  15080. Filter.prototype.applyTopItemsFilter=function (count) {
  15081. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15082. };
  15083. Filter.prototype.applyTopPercentFilter=function (percent) {
  15084. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15085. };
  15086. Filter.prototype.applyValuesFilter=function (values) {
  15087. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  15088. };
  15089. Filter.prototype.clear=function () {
  15090. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15091. };
  15092. Filter.prototype._handleResult=function (value) {
  15093. _super.prototype._handleResult.call(this, value);
  15094. if (_isNullOrUndefined(value))
  15095. return;
  15096. var obj=value;
  15097. _fixObjectPathIfNecessary(this, obj);
  15098. if (!_isUndefined(obj["Criteria"])) {
  15099. this.m_criteria=obj["Criteria"];
  15100. }
  15101. };
  15102. Filter.prototype.load=function (option) {
  15103. _load(this, option);
  15104. return this;
  15105. };
  15106. Filter.prototype.toJSON=function () {
  15107. return {
  15108. "criteria": this.m_criteria
  15109. };
  15110. };
  15111. return Filter;
  15112. }(OfficeExtension.ClientObject));
  15113. Excel.Filter=Filter;
  15114. var _V1Api=(function (_super) {
  15115. __extends(_V1Api, _super);
  15116. function _V1Api() {
  15117. _super.apply(this, arguments);
  15118. }
  15119. _V1Api.prototype.bindingAddColumns=function (input) {
  15120. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  15121. var ret=new OfficeExtension.ClientResult();
  15122. _addActionResultHandler(this, action, ret);
  15123. return ret;
  15124. };
  15125. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  15126. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  15127. var ret=new OfficeExtension.ClientResult();
  15128. _addActionResultHandler(this, action, ret);
  15129. return ret;
  15130. };
  15131. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  15132. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  15133. var ret=new OfficeExtension.ClientResult();
  15134. _addActionResultHandler(this, action, ret);
  15135. return ret;
  15136. };
  15137. _V1Api.prototype.bindingAddFromSelection=function (input) {
  15138. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  15139. var ret=new OfficeExtension.ClientResult();
  15140. _addActionResultHandler(this, action, ret);
  15141. return ret;
  15142. };
  15143. _V1Api.prototype.bindingAddRows=function (input) {
  15144. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  15145. var ret=new OfficeExtension.ClientResult();
  15146. _addActionResultHandler(this, action, ret);
  15147. return ret;
  15148. };
  15149. _V1Api.prototype.bindingClearFormats=function (input) {
  15150. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  15151. var ret=new OfficeExtension.ClientResult();
  15152. _addActionResultHandler(this, action, ret);
  15153. return ret;
  15154. };
  15155. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  15156. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  15157. var ret=new OfficeExtension.ClientResult();
  15158. _addActionResultHandler(this, action, ret);
  15159. return ret;
  15160. };
  15161. _V1Api.prototype.bindingGetAll=function () {
  15162. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  15163. var ret=new OfficeExtension.ClientResult();
  15164. _addActionResultHandler(this, action, ret);
  15165. return ret;
  15166. };
  15167. _V1Api.prototype.bindingGetById=function (input) {
  15168. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  15169. var ret=new OfficeExtension.ClientResult();
  15170. _addActionResultHandler(this, action, ret);
  15171. return ret;
  15172. };
  15173. _V1Api.prototype.bindingGetData=function (input) {
  15174. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  15175. var ret=new OfficeExtension.ClientResult();
  15176. _addActionResultHandler(this, action, ret);
  15177. return ret;
  15178. };
  15179. _V1Api.prototype.bindingReleaseById=function (input) {
  15180. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  15181. var ret=new OfficeExtension.ClientResult();
  15182. _addActionResultHandler(this, action, ret);
  15183. return ret;
  15184. };
  15185. _V1Api.prototype.bindingSetData=function (input) {
  15186. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  15187. var ret=new OfficeExtension.ClientResult();
  15188. _addActionResultHandler(this, action, ret);
  15189. return ret;
  15190. };
  15191. _V1Api.prototype.bindingSetFormats=function (input) {
  15192. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  15193. var ret=new OfficeExtension.ClientResult();
  15194. _addActionResultHandler(this, action, ret);
  15195. return ret;
  15196. };
  15197. _V1Api.prototype.bindingSetTableOptions=function (input) {
  15198. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  15199. var ret=new OfficeExtension.ClientResult();
  15200. _addActionResultHandler(this, action, ret);
  15201. return ret;
  15202. };
  15203. _V1Api.prototype.getSelectedData=function (input) {
  15204. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  15205. var ret=new OfficeExtension.ClientResult();
  15206. _addActionResultHandler(this, action, ret);
  15207. return ret;
  15208. };
  15209. _V1Api.prototype.gotoById=function (input) {
  15210. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  15211. var ret=new OfficeExtension.ClientResult();
  15212. _addActionResultHandler(this, action, ret);
  15213. return ret;
  15214. };
  15215. _V1Api.prototype.setSelectedData=function (input) {
  15216. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  15217. var ret=new OfficeExtension.ClientResult();
  15218. _addActionResultHandler(this, action, ret);
  15219. return ret;
  15220. };
  15221. _V1Api.prototype._handleResult=function (value) {
  15222. _super.prototype._handleResult.call(this, value);
  15223. if (_isNullOrUndefined(value))
  15224. return;
  15225. var obj=value;
  15226. _fixObjectPathIfNecessary(this, obj);
  15227. };
  15228. _V1Api.prototype.toJSON=function () {
  15229. return {};
  15230. };
  15231. return _V1Api;
  15232. }(OfficeExtension.ClientObject));
  15233. Excel._V1Api=_V1Api;
  15234. var PivotTableCollection=(function (_super) {
  15235. __extends(PivotTableCollection, _super);
  15236. function PivotTableCollection() {
  15237. _super.apply(this, arguments);
  15238. }
  15239. Object.defineProperty(PivotTableCollection.prototype, "items", {
  15240. get: function () {
  15241. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  15242. return this.m__items;
  15243. },
  15244. enumerable: true,
  15245. configurable: true
  15246. });
  15247. PivotTableCollection.prototype.getItem=function (name) {
  15248. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  15249. };
  15250. PivotTableCollection.prototype.refreshAll=function () {
  15251. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  15252. };
  15253. PivotTableCollection.prototype._handleResult=function (value) {
  15254. _super.prototype._handleResult.call(this, value);
  15255. if (_isNullOrUndefined(value))
  15256. return;
  15257. var obj=value;
  15258. _fixObjectPathIfNecessary(this, obj);
  15259. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15260. this.m__items=[];
  15261. var _data=obj[OfficeExtension.Constants.items];
  15262. for (var i=0; i < _data.length; i++) {
  15263. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15264. _item._handleResult(_data[i]);
  15265. this.m__items.push(_item);
  15266. }
  15267. }
  15268. };
  15269. PivotTableCollection.prototype.load=function (option) {
  15270. _load(this, option);
  15271. return this;
  15272. };
  15273. PivotTableCollection.prototype.toJSON=function () {
  15274. return {};
  15275. };
  15276. return PivotTableCollection;
  15277. }(OfficeExtension.ClientObject));
  15278. Excel.PivotTableCollection=PivotTableCollection;
  15279. var PivotTable=(function (_super) {
  15280. __extends(PivotTable, _super);
  15281. function PivotTable() {
  15282. _super.apply(this, arguments);
  15283. }
  15284. Object.defineProperty(PivotTable.prototype, "worksheet", {
  15285. get: function () {
  15286. if (!this.m_worksheet) {
  15287. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15288. }
  15289. return this.m_worksheet;
  15290. },
  15291. enumerable: true,
  15292. configurable: true
  15293. });
  15294. Object.defineProperty(PivotTable.prototype, "name", {
  15295. get: function () {
  15296. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  15297. return this.m_name;
  15298. },
  15299. set: function (value) {
  15300. this.m_name=value;
  15301. _createSetPropertyAction(this.context, this, "Name", value);
  15302. },
  15303. enumerable: true,
  15304. configurable: true
  15305. });
  15306. PivotTable.prototype.refresh=function () {
  15307. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  15308. };
  15309. PivotTable.prototype._handleResult=function (value) {
  15310. _super.prototype._handleResult.call(this, value);
  15311. if (_isNullOrUndefined(value))
  15312. return;
  15313. var obj=value;
  15314. _fixObjectPathIfNecessary(this, obj);
  15315. if (!_isUndefined(obj["Name"])) {
  15316. this.m_name=obj["Name"];
  15317. }
  15318. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  15319. };
  15320. PivotTable.prototype.load=function (option) {
  15321. _load(this, option);
  15322. return this;
  15323. };
  15324. PivotTable.prototype.toJSON=function () {
  15325. return {
  15326. "name": this.m_name
  15327. };
  15328. };
  15329. return PivotTable;
  15330. }(OfficeExtension.ClientObject));
  15331. Excel.PivotTable=PivotTable;
  15332. var BindingType;
  15333. (function (BindingType) {
  15334. BindingType.range="Range";
  15335. BindingType.table="Table";
  15336. BindingType.text="Text";
  15337. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  15338. var BorderIndex;
  15339. (function (BorderIndex) {
  15340. BorderIndex.edgeTop="EdgeTop";
  15341. BorderIndex.edgeBottom="EdgeBottom";
  15342. BorderIndex.edgeLeft="EdgeLeft";
  15343. BorderIndex.edgeRight="EdgeRight";
  15344. BorderIndex.insideVertical="InsideVertical";
  15345. BorderIndex.insideHorizontal="InsideHorizontal";
  15346. BorderIndex.diagonalDown="DiagonalDown";
  15347. BorderIndex.diagonalUp="DiagonalUp";
  15348. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  15349. var BorderLineStyle;
  15350. (function (BorderLineStyle) {
  15351. BorderLineStyle.none="None";
  15352. BorderLineStyle.continuous="Continuous";
  15353. BorderLineStyle.dash="Dash";
  15354. BorderLineStyle.dashDot="DashDot";
  15355. BorderLineStyle.dashDotDot="DashDotDot";
  15356. BorderLineStyle.dot="Dot";
  15357. BorderLineStyle.double="Double";
  15358. BorderLineStyle.slantDashDot="SlantDashDot";
  15359. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  15360. var BorderWeight;
  15361. (function (BorderWeight) {
  15362. BorderWeight.hairline="Hairline";
  15363. BorderWeight.thin="Thin";
  15364. BorderWeight.medium="Medium";
  15365. BorderWeight.thick="Thick";
  15366. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  15367. var CalculationMode;
  15368. (function (CalculationMode) {
  15369. CalculationMode.automatic="Automatic";
  15370. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  15371. CalculationMode.manual="Manual";
  15372. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  15373. var CalculationType;
  15374. (function (CalculationType) {
  15375. CalculationType.recalculate="Recalculate";
  15376. CalculationType.full="Full";
  15377. CalculationType.fullRebuild="FullRebuild";
  15378. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  15379. var ClearApplyTo;
  15380. (function (ClearApplyTo) {
  15381. ClearApplyTo.all="All";
  15382. ClearApplyTo.formats="Formats";
  15383. ClearApplyTo.contents="Contents";
  15384. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  15385. var ChartDataLabelPosition;
  15386. (function (ChartDataLabelPosition) {
  15387. ChartDataLabelPosition.invalid="Invalid";
  15388. ChartDataLabelPosition.none="None";
  15389. ChartDataLabelPosition.center="Center";
  15390. ChartDataLabelPosition.insideEnd="InsideEnd";
  15391. ChartDataLabelPosition.insideBase="InsideBase";
  15392. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  15393. ChartDataLabelPosition.left="Left";
  15394. ChartDataLabelPosition.right="Right";
  15395. ChartDataLabelPosition.top="Top";
  15396. ChartDataLabelPosition.bottom="Bottom";
  15397. ChartDataLabelPosition.bestFit="BestFit";
  15398. ChartDataLabelPosition.callout="Callout";
  15399. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  15400. var ChartLegendPosition;
  15401. (function (ChartLegendPosition) {
  15402. ChartLegendPosition.invalid="Invalid";
  15403. ChartLegendPosition.top="Top";
  15404. ChartLegendPosition.bottom="Bottom";
  15405. ChartLegendPosition.left="Left";
  15406. ChartLegendPosition.right="Right";
  15407. ChartLegendPosition.corner="Corner";
  15408. ChartLegendPosition.custom="Custom";
  15409. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  15410. var ChartSeriesBy;
  15411. (function (ChartSeriesBy) {
  15412. ChartSeriesBy.auto="Auto";
  15413. ChartSeriesBy.columns="Columns";
  15414. ChartSeriesBy.rows="Rows";
  15415. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  15416. var ChartType;
  15417. (function (ChartType) {
  15418. ChartType.invalid="Invalid";
  15419. ChartType.columnClustered="ColumnClustered";
  15420. ChartType.columnStacked="ColumnStacked";
  15421. ChartType.columnStacked100="ColumnStacked100";
  15422. ChartType._3DColumnClustered="3DColumnClustered";
  15423. ChartType._3DColumnStacked="3DColumnStacked";
  15424. ChartType._3DColumnStacked100="3DColumnStacked100";
  15425. ChartType.barClustered="BarClustered";
  15426. ChartType.barStacked="BarStacked";
  15427. ChartType.barStacked100="BarStacked100";
  15428. ChartType._3DBarClustered="3DBarClustered";
  15429. ChartType._3DBarStacked="3DBarStacked";
  15430. ChartType._3DBarStacked100="3DBarStacked100";
  15431. ChartType.lineStacked="LineStacked";
  15432. ChartType.lineStacked100="LineStacked100";
  15433. ChartType.lineMarkers="LineMarkers";
  15434. ChartType.lineMarkersStacked="LineMarkersStacked";
  15435. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  15436. ChartType.pieOfPie="PieOfPie";
  15437. ChartType.pieExploded="PieExploded";
  15438. ChartType._3DPieExploded="3DPieExploded";
  15439. ChartType.barOfPie="BarOfPie";
  15440. ChartType.xyscatterSmooth="XYScatterSmooth";
  15441. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  15442. ChartType.xyscatterLines="XYScatterLines";
  15443. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  15444. ChartType.areaStacked="AreaStacked";
  15445. ChartType.areaStacked100="AreaStacked100";
  15446. ChartType._3DAreaStacked="3DAreaStacked";
  15447. ChartType._3DAreaStacked100="3DAreaStacked100";
  15448. ChartType.doughnutExploded="DoughnutExploded";
  15449. ChartType.radarMarkers="RadarMarkers";
  15450. ChartType.radarFilled="RadarFilled";
  15451. ChartType.surface="Surface";
  15452. ChartType.surfaceWireframe="SurfaceWireframe";
  15453. ChartType.surfaceTopView="SurfaceTopView";
  15454. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  15455. ChartType.bubble="Bubble";
  15456. ChartType.bubble3DEffect="Bubble3DEffect";
  15457. ChartType.stockHLC="StockHLC";
  15458. ChartType.stockOHLC="StockOHLC";
  15459. ChartType.stockVHLC="StockVHLC";
  15460. ChartType.stockVOHLC="StockVOHLC";
  15461. ChartType.cylinderColClustered="CylinderColClustered";
  15462. ChartType.cylinderColStacked="CylinderColStacked";
  15463. ChartType.cylinderColStacked100="CylinderColStacked100";
  15464. ChartType.cylinderBarClustered="CylinderBarClustered";
  15465. ChartType.cylinderBarStacked="CylinderBarStacked";
  15466. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  15467. ChartType.cylinderCol="CylinderCol";
  15468. ChartType.coneColClustered="ConeColClustered";
  15469. ChartType.coneColStacked="ConeColStacked";
  15470. ChartType.coneColStacked100="ConeColStacked100";
  15471. ChartType.coneBarClustered="ConeBarClustered";
  15472. ChartType.coneBarStacked="ConeBarStacked";
  15473. ChartType.coneBarStacked100="ConeBarStacked100";
  15474. ChartType.coneCol="ConeCol";
  15475. ChartType.pyramidColClustered="PyramidColClustered";
  15476. ChartType.pyramidColStacked="PyramidColStacked";
  15477. ChartType.pyramidColStacked100="PyramidColStacked100";
  15478. ChartType.pyramidBarClustered="PyramidBarClustered";
  15479. ChartType.pyramidBarStacked="PyramidBarStacked";
  15480. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  15481. ChartType.pyramidCol="PyramidCol";
  15482. ChartType._3DColumn="3DColumn";
  15483. ChartType.line="Line";
  15484. ChartType._3DLine="3DLine";
  15485. ChartType._3DPie="3DPie";
  15486. ChartType.pie="Pie";
  15487. ChartType.xyscatter="XYScatter";
  15488. ChartType._3DArea="3DArea";
  15489. ChartType.area="Area";
  15490. ChartType.doughnut="Doughnut";
  15491. ChartType.radar="Radar";
  15492. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  15493. var ChartUnderlineStyle;
  15494. (function (ChartUnderlineStyle) {
  15495. ChartUnderlineStyle.none="None";
  15496. ChartUnderlineStyle.single="Single";
  15497. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  15498. var DeleteShiftDirection;
  15499. (function (DeleteShiftDirection) {
  15500. DeleteShiftDirection.up="Up";
  15501. DeleteShiftDirection.left="Left";
  15502. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  15503. var DynamicFilterCriteria;
  15504. (function (DynamicFilterCriteria) {
  15505. DynamicFilterCriteria.unknown="Unknown";
  15506. DynamicFilterCriteria.aboveAverage="AboveAverage";
  15507. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  15508. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  15509. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  15510. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  15511. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  15512. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  15513. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  15514. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  15515. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  15516. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  15517. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  15518. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  15519. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  15520. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  15521. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  15522. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  15523. DynamicFilterCriteria.belowAverage="BelowAverage";
  15524. DynamicFilterCriteria.lastMonth="LastMonth";
  15525. DynamicFilterCriteria.lastQuarter="LastQuarter";
  15526. DynamicFilterCriteria.lastWeek="LastWeek";
  15527. DynamicFilterCriteria.lastYear="LastYear";
  15528. DynamicFilterCriteria.nextMonth="NextMonth";
  15529. DynamicFilterCriteria.nextQuarter="NextQuarter";
  15530. DynamicFilterCriteria.nextWeek="NextWeek";
  15531. DynamicFilterCriteria.nextYear="NextYear";
  15532. DynamicFilterCriteria.thisMonth="ThisMonth";
  15533. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  15534. DynamicFilterCriteria.thisWeek="ThisWeek";
  15535. DynamicFilterCriteria.thisYear="ThisYear";
  15536. DynamicFilterCriteria.today="Today";
  15537. DynamicFilterCriteria.tomorrow="Tomorrow";
  15538. DynamicFilterCriteria.yearToDate="YearToDate";
  15539. DynamicFilterCriteria.yesterday="Yesterday";
  15540. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  15541. var FilterDatetimeSpecificity;
  15542. (function (FilterDatetimeSpecificity) {
  15543. FilterDatetimeSpecificity.year="Year";
  15544. FilterDatetimeSpecificity.month="Month";
  15545. FilterDatetimeSpecificity.day="Day";
  15546. FilterDatetimeSpecificity.hour="Hour";
  15547. FilterDatetimeSpecificity.minute="Minute";
  15548. FilterDatetimeSpecificity.second="Second";
  15549. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  15550. var FilterOn;
  15551. (function (FilterOn) {
  15552. FilterOn.bottomItems="BottomItems";
  15553. FilterOn.bottomPercent="BottomPercent";
  15554. FilterOn.cellColor="CellColor";
  15555. FilterOn.dynamic="Dynamic";
  15556. FilterOn.fontColor="FontColor";
  15557. FilterOn.values="Values";
  15558. FilterOn.topItems="TopItems";
  15559. FilterOn.topPercent="TopPercent";
  15560. FilterOn.icon="Icon";
  15561. FilterOn.custom="Custom";
  15562. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  15563. var FilterOperator;
  15564. (function (FilterOperator) {
  15565. FilterOperator.and="And";
  15566. FilterOperator.or="Or";
  15567. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  15568. var HorizontalAlignment;
  15569. (function (HorizontalAlignment) {
  15570. HorizontalAlignment.general="General";
  15571. HorizontalAlignment.left="Left";
  15572. HorizontalAlignment.center="Center";
  15573. HorizontalAlignment.right="Right";
  15574. HorizontalAlignment.fill="Fill";
  15575. HorizontalAlignment.justify="Justify";
  15576. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  15577. HorizontalAlignment.distributed="Distributed";
  15578. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  15579. var IconSet;
  15580. (function (IconSet) {
  15581. IconSet.invalid="Invalid";
  15582. IconSet.threeArrows="ThreeArrows";
  15583. IconSet.threeArrowsGray="ThreeArrowsGray";
  15584. IconSet.threeFlags="ThreeFlags";
  15585. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  15586. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  15587. IconSet.threeSigns="ThreeSigns";
  15588. IconSet.threeSymbols="ThreeSymbols";
  15589. IconSet.threeSymbols2="ThreeSymbols2";
  15590. IconSet.fourArrows="FourArrows";
  15591. IconSet.fourArrowsGray="FourArrowsGray";
  15592. IconSet.fourRedToBlack="FourRedToBlack";
  15593. IconSet.fourRating="FourRating";
  15594. IconSet.fourTrafficLights="FourTrafficLights";
  15595. IconSet.fiveArrows="FiveArrows";
  15596. IconSet.fiveArrowsGray="FiveArrowsGray";
  15597. IconSet.fiveRating="FiveRating";
  15598. IconSet.fiveQuarters="FiveQuarters";
  15599. IconSet.threeStars="ThreeStars";
  15600. IconSet.threeTriangles="ThreeTriangles";
  15601. IconSet.fiveBoxes="FiveBoxes";
  15602. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  15603. var ImageFittingMode;
  15604. (function (ImageFittingMode) {
  15605. ImageFittingMode.fit="Fit";
  15606. ImageFittingMode.fitAndCenter="FitAndCenter";
  15607. ImageFittingMode.fill="Fill";
  15608. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  15609. var InsertShiftDirection;
  15610. (function (InsertShiftDirection) {
  15611. InsertShiftDirection.down="Down";
  15612. InsertShiftDirection.right="Right";
  15613. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  15614. var NamedItemType;
  15615. (function (NamedItemType) {
  15616. NamedItemType.string="String";
  15617. NamedItemType.integer="Integer";
  15618. NamedItemType.double="Double";
  15619. NamedItemType.boolean="Boolean";
  15620. NamedItemType.range="Range";
  15621. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  15622. var RangeUnderlineStyle;
  15623. (function (RangeUnderlineStyle) {
  15624. RangeUnderlineStyle.none="None";
  15625. RangeUnderlineStyle.single="Single";
  15626. RangeUnderlineStyle.double="Double";
  15627. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  15628. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  15629. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  15630. var SheetVisibility;
  15631. (function (SheetVisibility) {
  15632. SheetVisibility.visible="Visible";
  15633. SheetVisibility.hidden="Hidden";
  15634. SheetVisibility.veryHidden="VeryHidden";
  15635. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  15636. var RangeValueType;
  15637. (function (RangeValueType) {
  15638. RangeValueType.unknown="Unknown";
  15639. RangeValueType.empty="Empty";
  15640. RangeValueType.string="String";
  15641. RangeValueType.integer="Integer";
  15642. RangeValueType.double="Double";
  15643. RangeValueType.boolean="Boolean";
  15644. RangeValueType.error="Error";
  15645. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  15646. var SortOrientation;
  15647. (function (SortOrientation) {
  15648. SortOrientation.rows="Rows";
  15649. SortOrientation.columns="Columns";
  15650. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  15651. var SortOn;
  15652. (function (SortOn) {
  15653. SortOn.value="Value";
  15654. SortOn.cellColor="CellColor";
  15655. SortOn.fontColor="FontColor";
  15656. SortOn.icon="Icon";
  15657. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  15658. var SortDataOption;
  15659. (function (SortDataOption) {
  15660. SortDataOption.normal="Normal";
  15661. SortDataOption.textAsNumber="TextAsNumber";
  15662. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  15663. var SortMethod;
  15664. (function (SortMethod) {
  15665. SortMethod.pinYin="PinYin";
  15666. SortMethod.strokeCount="StrokeCount";
  15667. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  15668. var VerticalAlignment;
  15669. (function (VerticalAlignment) {
  15670. VerticalAlignment.top="Top";
  15671. VerticalAlignment.center="Center";
  15672. VerticalAlignment.bottom="Bottom";
  15673. VerticalAlignment.justify="Justify";
  15674. VerticalAlignment.distributed="Distributed";
  15675. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  15676. var FunctionResult=(function (_super) {
  15677. __extends(FunctionResult, _super);
  15678. function FunctionResult() {
  15679. _super.apply(this, arguments);
  15680. }
  15681. Object.defineProperty(FunctionResult.prototype, "error", {
  15682. get: function () {
  15683. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  15684. return this.m_error;
  15685. },
  15686. enumerable: true,
  15687. configurable: true
  15688. });
  15689. Object.defineProperty(FunctionResult.prototype, "value", {
  15690. get: function () {
  15691. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  15692. return this.m_value;
  15693. },
  15694. enumerable: true,
  15695. configurable: true
  15696. });
  15697. FunctionResult.prototype._handleResult=function (value) {
  15698. _super.prototype._handleResult.call(this, value);
  15699. if (_isNullOrUndefined(value))
  15700. return;
  15701. var obj=value;
  15702. _fixObjectPathIfNecessary(this, obj);
  15703. if (!_isUndefined(obj["Error"])) {
  15704. this.m_error=obj["Error"];
  15705. }
  15706. if (!_isUndefined(obj["Value"])) {
  15707. this.m_value=obj["Value"];
  15708. }
  15709. };
  15710. FunctionResult.prototype.load=function (option) {
  15711. _load(this, option);
  15712. return this;
  15713. };
  15714. FunctionResult.prototype.toJSON=function () {
  15715. return {
  15716. "error": this.m_error,
  15717. "value": this.m_value
  15718. };
  15719. };
  15720. return FunctionResult;
  15721. }(OfficeExtension.ClientObject));
  15722. Excel.FunctionResult=FunctionResult;
  15723. var Functions=(function (_super) {
  15724. __extends(Functions, _super);
  15725. function Functions() {
  15726. _super.apply(this, arguments);
  15727. }
  15728. Functions.prototype.abs=function (number) {
  15729. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  15730. };
  15731. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  15732. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  15733. };
  15734. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  15735. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  15736. };
  15737. Functions.prototype.acos=function (number) {
  15738. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15739. };
  15740. Functions.prototype.acosh=function (number) {
  15741. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15742. };
  15743. Functions.prototype.acot=function (number) {
  15744. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15745. };
  15746. Functions.prototype.acoth=function (number) {
  15747. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15748. };
  15749. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15750. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15751. };
  15752. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15753. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15754. };
  15755. Functions.prototype.and=function () {
  15756. var values=[];
  15757. for (var _i=0; _i < arguments.length; _i++) {
  15758. values[_i - 0]=arguments[_i];
  15759. }
  15760. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  15761. };
  15762. Functions.prototype.arabic=function (text) {
  15763. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  15764. };
  15765. Functions.prototype.areas=function (reference) {
  15766. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  15767. };
  15768. Functions.prototype.asc=function (text) {
  15769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  15770. };
  15771. Functions.prototype.asin=function (number) {
  15772. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  15773. };
  15774. Functions.prototype.asinh=function (number) {
  15775. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15776. };
  15777. Functions.prototype.atan=function (number) {
  15778. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  15779. };
  15780. Functions.prototype.atan2=function (xNum, yNum) {
  15781. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  15782. };
  15783. Functions.prototype.atanh=function (number) {
  15784. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15785. };
  15786. Functions.prototype.aveDev=function () {
  15787. var values=[];
  15788. for (var _i=0; _i < arguments.length; _i++) {
  15789. values[_i - 0]=arguments[_i];
  15790. }
  15791. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  15792. };
  15793. Functions.prototype.average=function () {
  15794. var values=[];
  15795. for (var _i=0; _i < arguments.length; _i++) {
  15796. values[_i - 0]=arguments[_i];
  15797. }
  15798. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  15799. };
  15800. Functions.prototype.averageA=function () {
  15801. var values=[];
  15802. for (var _i=0; _i < arguments.length; _i++) {
  15803. values[_i - 0]=arguments[_i];
  15804. }
  15805. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15806. };
  15807. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  15808. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  15809. };
  15810. Functions.prototype.averageIfs=function (averageRange) {
  15811. var values=[];
  15812. for (var _i=1; _i < arguments.length; _i++) {
  15813. values[_i - 1]=arguments[_i];
  15814. }
  15815. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  15816. };
  15817. Functions.prototype.bahtText=function (number) {
  15818. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  15819. };
  15820. Functions.prototype.base=function (number, radix, minLength) {
  15821. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  15822. };
  15823. Functions.prototype.besselI=function (x, n) {
  15824. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15825. };
  15826. Functions.prototype.besselJ=function (x, n) {
  15827. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15828. };
  15829. Functions.prototype.besselK=function (x, n) {
  15830. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15831. };
  15832. Functions.prototype.besselY=function (x, n) {
  15833. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15834. };
  15835. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  15836. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  15837. };
  15838. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  15839. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  15840. };
  15841. Functions.prototype.bin2Dec=function (number) {
  15842. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  15843. };
  15844. Functions.prototype.bin2Hex=function (number, places) {
  15845. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15846. };
  15847. Functions.prototype.bin2Oct=function (number, places) {
  15848. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15849. };
  15850. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  15851. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  15852. };
  15853. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  15854. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  15855. };
  15856. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  15857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  15858. };
  15859. Functions.prototype.bitand=function (number1, number2) {
  15860. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15861. };
  15862. Functions.prototype.bitlshift=function (number, shiftAmount) {
  15863. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15864. };
  15865. Functions.prototype.bitor=function (number1, number2) {
  15866. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15867. };
  15868. Functions.prototype.bitrshift=function (number, shiftAmount) {
  15869. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15870. };
  15871. Functions.prototype.bitxor=function (number1, number2) {
  15872. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15873. };
  15874. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  15875. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  15876. };
  15877. Functions.prototype.ceiling_Precise=function (number, significance) {
  15878. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15879. };
  15880. Functions.prototype.char=function (number) {
  15881. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  15882. };
  15883. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  15884. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  15885. };
  15886. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  15887. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  15888. };
  15889. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  15890. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15891. };
  15892. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  15893. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15894. };
  15895. Functions.prototype.choose=function (indexNum) {
  15896. var values=[];
  15897. for (var _i=1; _i < arguments.length; _i++) {
  15898. values[_i - 1]=arguments[_i];
  15899. }
  15900. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  15901. };
  15902. Functions.prototype.clean=function (text) {
  15903. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  15904. };
  15905. Functions.prototype.code=function (text) {
  15906. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  15907. };
  15908. Functions.prototype.columns=function (array) {
  15909. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  15910. };
  15911. Functions.prototype.combin=function (number, numberChosen) {
  15912. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15913. };
  15914. Functions.prototype.combina=function (number, numberChosen) {
  15915. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15916. };
  15917. Functions.prototype.complex=function (realNum, iNum, suffix) {
  15918. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  15919. };
  15920. Functions.prototype.concatenate=function () {
  15921. var values=[];
  15922. for (var _i=0; _i < arguments.length; _i++) {
  15923. values[_i - 0]=arguments[_i];
  15924. }
  15925. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  15926. };
  15927. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  15928. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15929. };
  15930. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  15931. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15932. };
  15933. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  15934. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  15935. };
  15936. Functions.prototype.cos=function (number) {
  15937. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15938. };
  15939. Functions.prototype.cosh=function (number) {
  15940. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15941. };
  15942. Functions.prototype.cot=function (number) {
  15943. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15944. };
  15945. Functions.prototype.coth=function (number) {
  15946. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15947. };
  15948. Functions.prototype.count=function () {
  15949. var values=[];
  15950. for (var _i=0; _i < arguments.length; _i++) {
  15951. values[_i - 0]=arguments[_i];
  15952. }
  15953. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  15954. };
  15955. Functions.prototype.countA=function () {
  15956. var values=[];
  15957. for (var _i=0; _i < arguments.length; _i++) {
  15958. values[_i - 0]=arguments[_i];
  15959. }
  15960. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15961. };
  15962. Functions.prototype.countBlank=function (range) {
  15963. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  15964. };
  15965. Functions.prototype.countIf=function (range, criteria) {
  15966. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  15967. };
  15968. Functions.prototype.countIfs=function () {
  15969. var values=[];
  15970. for (var _i=0; _i < arguments.length; _i++) {
  15971. values[_i - 0]=arguments[_i];
  15972. }
  15973. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  15974. };
  15975. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  15976. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15977. };
  15978. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  15979. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15980. };
  15981. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  15982. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15983. };
  15984. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  15985. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15986. };
  15987. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  15988. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15989. };
  15990. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  15991. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  15992. };
  15993. Functions.prototype.csc=function (number) {
  15994. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  15995. };
  15996. Functions.prototype.csch=function (number) {
  15997. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  15998. };
  15999. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16000. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16001. };
  16002. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16003. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16004. };
  16005. Functions.prototype.daverage=function (database, field, criteria) {
  16006. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16007. };
  16008. Functions.prototype.dcount=function (database, field, criteria) {
  16009. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16010. };
  16011. Functions.prototype.dcountA=function (database, field, criteria) {
  16012. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16013. };
  16014. Functions.prototype.dget=function (database, field, criteria) {
  16015. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16016. };
  16017. Functions.prototype.dmax=function (database, field, criteria) {
  16018. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16019. };
  16020. Functions.prototype.dmin=function (database, field, criteria) {
  16021. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16022. };
  16023. Functions.prototype.dproduct=function (database, field, criteria) {
  16024. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16025. };
  16026. Functions.prototype.dstDev=function (database, field, criteria) {
  16027. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16028. };
  16029. Functions.prototype.dstDevP=function (database, field, criteria) {
  16030. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16031. };
  16032. Functions.prototype.dsum=function (database, field, criteria) {
  16033. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16034. };
  16035. Functions.prototype.dvar=function (database, field, criteria) {
  16036. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16037. };
  16038. Functions.prototype.dvarP=function (database, field, criteria) {
  16039. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16040. };
  16041. Functions.prototype.date=function (year, month, day) {
  16042. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  16043. };
  16044. Functions.prototype.datevalue=function (dateText) {
  16045. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  16046. };
  16047. Functions.prototype.day=function (serialNumber) {
  16048. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16049. };
  16050. Functions.prototype.days=function (endDate, startDate) {
  16051. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  16052. };
  16053. Functions.prototype.days360=function (startDate, endDate, method) {
  16054. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  16055. };
  16056. Functions.prototype.db=function (cost, salvage, life, period, month) {
  16057. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  16058. };
  16059. Functions.prototype.dbcs=function (text) {
  16060. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  16061. };
  16062. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  16063. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  16064. };
  16065. Functions.prototype.dec2Bin=function (number, places) {
  16066. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16067. };
  16068. Functions.prototype.dec2Hex=function (number, places) {
  16069. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16070. };
  16071. Functions.prototype.dec2Oct=function (number, places) {
  16072. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16073. };
  16074. Functions.prototype.decimal=function (number, radix) {
  16075. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  16076. };
  16077. Functions.prototype.degrees=function (angle) {
  16078. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16079. };
  16080. Functions.prototype.delta=function (number1, number2) {
  16081. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  16082. };
  16083. Functions.prototype.devSq=function () {
  16084. var values=[];
  16085. for (var _i=0; _i < arguments.length; _i++) {
  16086. values[_i - 0]=arguments[_i];
  16087. }
  16088. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16089. };
  16090. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  16091. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16092. };
  16093. Functions.prototype.dollar=function (number, decimals) {
  16094. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16095. };
  16096. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  16097. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  16098. };
  16099. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  16100. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  16101. };
  16102. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16103. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16104. };
  16105. Functions.prototype.ecma_Ceiling=function (number, significance) {
  16106. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16107. };
  16108. Functions.prototype.edate=function (startDate, months) {
  16109. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16110. };
  16111. Functions.prototype.effect=function (nominalRate, npery) {
  16112. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  16113. };
  16114. Functions.prototype.eoMonth=function (startDate, months) {
  16115. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16116. };
  16117. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  16118. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  16119. };
  16120. Functions.prototype.erfC=function (x) {
  16121. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  16122. };
  16123. Functions.prototype.erfC_Precise=function (X) {
  16124. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16125. };
  16126. Functions.prototype.erf_Precise=function (X) {
  16127. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16128. };
  16129. Functions.prototype.error_Type=function (errorVal) {
  16130. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  16131. };
  16132. Functions.prototype.even=function (number) {
  16133. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  16134. };
  16135. Functions.prototype.exact=function (text1, text2) {
  16136. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  16137. };
  16138. Functions.prototype.exp=function (number) {
  16139. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  16140. };
  16141. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  16142. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  16143. };
  16144. Functions.prototype.fvschedule=function (principal, schedule) {
  16145. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  16146. };
  16147. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  16148. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  16149. };
  16150. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  16151. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  16152. };
  16153. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  16154. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16155. };
  16156. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  16157. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16158. };
  16159. Functions.prototype.fact=function (number) {
  16160. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  16161. };
  16162. Functions.prototype.factDouble=function (number) {
  16163. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  16164. };
  16165. Functions.prototype.false=function () {
  16166. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  16167. };
  16168. Functions.prototype.find=function (findText, withinText, startNum) {
  16169. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16170. };
  16171. Functions.prototype.findB=function (findText, withinText, startNum) {
  16172. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16173. };
  16174. Functions.prototype.fisher=function (x) {
  16175. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  16176. };
  16177. Functions.prototype.fisherInv=function (y) {
  16178. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  16179. };
  16180. Functions.prototype.fixed=function (number, decimals, noCommas) {
  16181. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  16182. };
  16183. Functions.prototype.floor_Math=function (number, significance, mode) {
  16184. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  16185. };
  16186. Functions.prototype.floor_Precise=function (number, significance) {
  16187. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16188. };
  16189. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  16190. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  16191. };
  16192. Functions.prototype.gamma=function (x) {
  16193. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  16194. };
  16195. Functions.prototype.gammaLn=function (x) {
  16196. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  16197. };
  16198. Functions.prototype.gammaLn_Precise=function (x) {
  16199. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  16200. };
  16201. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  16202. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16203. };
  16204. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  16205. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  16206. };
  16207. Functions.prototype.gauss=function (x) {
  16208. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  16209. };
  16210. Functions.prototype.gcd=function () {
  16211. var values=[];
  16212. for (var _i=0; _i < arguments.length; _i++) {
  16213. values[_i - 0]=arguments[_i];
  16214. }
  16215. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  16216. };
  16217. Functions.prototype.geStep=function (number, step) {
  16218. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  16219. };
  16220. Functions.prototype.geoMean=function () {
  16221. var values=[];
  16222. for (var _i=0; _i < arguments.length; _i++) {
  16223. values[_i - 0]=arguments[_i];
  16224. }
  16225. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16226. };
  16227. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  16228. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  16229. };
  16230. Functions.prototype.harMean=function () {
  16231. var values=[];
  16232. for (var _i=0; _i < arguments.length; _i++) {
  16233. values[_i - 0]=arguments[_i];
  16234. }
  16235. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16236. };
  16237. Functions.prototype.hex2Bin=function (number, places) {
  16238. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16239. };
  16240. Functions.prototype.hex2Dec=function (number) {
  16241. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16242. };
  16243. Functions.prototype.hex2Oct=function (number, places) {
  16244. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16245. };
  16246. Functions.prototype.hour=function (serialNumber) {
  16247. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16248. };
  16249. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  16250. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  16251. };
  16252. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  16253. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  16254. };
  16255. Functions.prototype.iso_Ceiling=function (number, significance) {
  16256. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16257. };
  16258. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  16259. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  16260. };
  16261. Functions.prototype.imAbs=function (inumber) {
  16262. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16263. };
  16264. Functions.prototype.imArgument=function (inumber) {
  16265. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16266. };
  16267. Functions.prototype.imConjugate=function (inumber) {
  16268. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16269. };
  16270. Functions.prototype.imCos=function (inumber) {
  16271. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16272. };
  16273. Functions.prototype.imCosh=function (inumber) {
  16274. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16275. };
  16276. Functions.prototype.imCot=function (inumber) {
  16277. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16278. };
  16279. Functions.prototype.imCsc=function (inumber) {
  16280. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16281. };
  16282. Functions.prototype.imCsch=function (inumber) {
  16283. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16284. };
  16285. Functions.prototype.imDiv=function (inumber1, inumber2) {
  16286. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16287. };
  16288. Functions.prototype.imExp=function (inumber) {
  16289. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16290. };
  16291. Functions.prototype.imLn=function (inumber) {
  16292. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16293. };
  16294. Functions.prototype.imLog10=function (inumber) {
  16295. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16296. };
  16297. Functions.prototype.imLog2=function (inumber) {
  16298. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16299. };
  16300. Functions.prototype.imPower=function (inumber, number) {
  16301. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  16302. };
  16303. Functions.prototype.imProduct=function () {
  16304. var values=[];
  16305. for (var _i=0; _i < arguments.length; _i++) {
  16306. values[_i - 0]=arguments[_i];
  16307. }
  16308. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  16309. };
  16310. Functions.prototype.imReal=function (inumber) {
  16311. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16312. };
  16313. Functions.prototype.imSec=function (inumber) {
  16314. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16315. };
  16316. Functions.prototype.imSech=function (inumber) {
  16317. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16318. };
  16319. Functions.prototype.imSin=function (inumber) {
  16320. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16321. };
  16322. Functions.prototype.imSinh=function (inumber) {
  16323. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16324. };
  16325. Functions.prototype.imSqrt=function (inumber) {
  16326. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16327. };
  16328. Functions.prototype.imSub=function (inumber1, inumber2) {
  16329. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16330. };
  16331. Functions.prototype.imSum=function () {
  16332. var values=[];
  16333. for (var _i=0; _i < arguments.length; _i++) {
  16334. values[_i - 0]=arguments[_i];
  16335. }
  16336. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16337. };
  16338. Functions.prototype.imTan=function (inumber) {
  16339. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16340. };
  16341. Functions.prototype.imaginary=function (inumber) {
  16342. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16343. };
  16344. Functions.prototype.int=function (number) {
  16345. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  16346. };
  16347. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  16348. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  16349. };
  16350. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  16351. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16352. };
  16353. Functions.prototype.irr=function (values, guess) {
  16354. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  16355. };
  16356. Functions.prototype.isErr=function (value) {
  16357. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  16358. };
  16359. Functions.prototype.isError=function (value) {
  16360. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  16361. };
  16362. Functions.prototype.isEven=function (number) {
  16363. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  16364. };
  16365. Functions.prototype.isFormula=function (reference) {
  16366. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16367. };
  16368. Functions.prototype.isLogical=function (value) {
  16369. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  16370. };
  16371. Functions.prototype.isNA=function (value) {
  16372. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  16373. };
  16374. Functions.prototype.isNonText=function (value) {
  16375. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16376. };
  16377. Functions.prototype.isNumber=function (value) {
  16378. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  16379. };
  16380. Functions.prototype.isOdd=function (number) {
  16381. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16382. };
  16383. Functions.prototype.isText=function (value) {
  16384. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16385. };
  16386. Functions.prototype.isoWeekNum=function (date) {
  16387. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  16388. };
  16389. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  16390. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  16391. };
  16392. Functions.prototype.isref=function (value) {
  16393. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  16394. };
  16395. Functions.prototype.kurt=function () {
  16396. var values=[];
  16397. for (var _i=0; _i < arguments.length; _i++) {
  16398. values[_i - 0]=arguments[_i];
  16399. }
  16400. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  16401. };
  16402. Functions.prototype.large=function (array, k) {
  16403. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16404. };
  16405. Functions.prototype.lcm=function () {
  16406. var values=[];
  16407. for (var _i=0; _i < arguments.length; _i++) {
  16408. values[_i - 0]=arguments[_i];
  16409. }
  16410. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  16411. };
  16412. Functions.prototype.left=function (text, numChars) {
  16413. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16414. };
  16415. Functions.prototype.leftb=function (text, numBytes) {
  16416. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16417. };
  16418. Functions.prototype.len=function (text) {
  16419. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  16420. };
  16421. Functions.prototype.lenb=function (text) {
  16422. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  16423. };
  16424. Functions.prototype.ln=function (number) {
  16425. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  16426. };
  16427. Functions.prototype.log=function (number, base) {
  16428. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  16429. };
  16430. Functions.prototype.log10=function (number) {
  16431. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  16432. };
  16433. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  16434. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16435. };
  16436. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  16437. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16438. };
  16439. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  16440. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  16441. };
  16442. Functions.prototype.lower=function (text) {
  16443. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  16444. };
  16445. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16446. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16447. };
  16448. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  16449. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  16450. };
  16451. Functions.prototype.mround=function (number, multiple) {
  16452. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  16453. };
  16454. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  16455. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  16456. };
  16457. Functions.prototype.max=function () {
  16458. var values=[];
  16459. for (var _i=0; _i < arguments.length; _i++) {
  16460. values[_i - 0]=arguments[_i];
  16461. }
  16462. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  16463. };
  16464. Functions.prototype.maxA=function () {
  16465. var values=[];
  16466. for (var _i=0; _i < arguments.length; _i++) {
  16467. values[_i - 0]=arguments[_i];
  16468. }
  16469. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16470. };
  16471. Functions.prototype.median=function () {
  16472. var values=[];
  16473. for (var _i=0; _i < arguments.length; _i++) {
  16474. values[_i - 0]=arguments[_i];
  16475. }
  16476. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  16477. };
  16478. Functions.prototype.mid=function (text, startNum, numChars) {
  16479. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  16480. };
  16481. Functions.prototype.midb=function (text, startNum, numBytes) {
  16482. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  16483. };
  16484. Functions.prototype.min=function () {
  16485. var values=[];
  16486. for (var _i=0; _i < arguments.length; _i++) {
  16487. values[_i - 0]=arguments[_i];
  16488. }
  16489. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  16490. };
  16491. Functions.prototype.minA=function () {
  16492. var values=[];
  16493. for (var _i=0; _i < arguments.length; _i++) {
  16494. values[_i - 0]=arguments[_i];
  16495. }
  16496. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16497. };
  16498. Functions.prototype.minute=function (serialNumber) {
  16499. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16500. };
  16501. Functions.prototype.mod=function (number, divisor) {
  16502. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  16503. };
  16504. Functions.prototype.month=function (serialNumber) {
  16505. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16506. };
  16507. Functions.prototype.multiNomial=function () {
  16508. var values=[];
  16509. for (var _i=0; _i < arguments.length; _i++) {
  16510. values[_i - 0]=arguments[_i];
  16511. }
  16512. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  16513. };
  16514. Functions.prototype.n=function (value) {
  16515. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  16516. };
  16517. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  16518. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  16519. };
  16520. Functions.prototype.na=function () {
  16521. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  16522. };
  16523. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  16524. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  16525. };
  16526. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  16527. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  16528. };
  16529. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  16530. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  16531. };
  16532. Functions.prototype.nominal=function (effectRate, npery) {
  16533. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  16534. };
  16535. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  16536. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16537. };
  16538. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  16539. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16540. };
  16541. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  16542. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  16543. };
  16544. Functions.prototype.norm_S_Inv=function (probability) {
  16545. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  16546. };
  16547. Functions.prototype.not=function (logical) {
  16548. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  16549. };
  16550. Functions.prototype.now=function () {
  16551. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  16552. };
  16553. Functions.prototype.npv=function (rate) {
  16554. var values=[];
  16555. for (var _i=1; _i < arguments.length; _i++) {
  16556. values[_i - 1]=arguments[_i];
  16557. }
  16558. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  16559. };
  16560. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  16561. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  16562. };
  16563. Functions.prototype.oct2Bin=function (number, places) {
  16564. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16565. };
  16566. Functions.prototype.oct2Dec=function (number) {
  16567. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16568. };
  16569. Functions.prototype.oct2Hex=function (number, places) {
  16570. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16571. };
  16572. Functions.prototype.odd=function (number) {
  16573. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16574. };
  16575. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  16576. 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));
  16577. };
  16578. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  16579. 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));
  16580. };
  16581. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  16582. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  16583. };
  16584. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  16585. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  16586. };
  16587. Functions.prototype.or=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, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  16593. };
  16594. Functions.prototype.pduration=function (rate, pv, fv) {
  16595. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  16596. };
  16597. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  16598. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16599. };
  16600. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  16601. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16602. };
  16603. Functions.prototype.percentile_Exc=function (array, k) {
  16604. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16605. };
  16606. Functions.prototype.percentile_Inc=function (array, k) {
  16607. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16608. };
  16609. Functions.prototype.permut=function (number, numberChosen) {
  16610. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16611. };
  16612. Functions.prototype.permutationa=function (number, numberChosen) {
  16613. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16614. };
  16615. Functions.prototype.phi=function (x) {
  16616. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  16617. };
  16618. Functions.prototype.pi=function () {
  16619. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  16620. };
  16621. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  16622. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  16623. };
  16624. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  16625. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  16626. };
  16627. Functions.prototype.power=function (number, power) {
  16628. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  16629. };
  16630. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  16631. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16632. };
  16633. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  16634. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  16635. };
  16636. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  16637. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  16638. };
  16639. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  16640. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  16641. };
  16642. Functions.prototype.product=function () {
  16643. var values=[];
  16644. for (var _i=0; _i < arguments.length; _i++) {
  16645. values[_i - 0]=arguments[_i];
  16646. }
  16647. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  16648. };
  16649. Functions.prototype.proper=function (text) {
  16650. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16651. };
  16652. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  16653. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  16654. };
  16655. Functions.prototype.quartile_Exc=function (array, quart) {
  16656. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16657. };
  16658. Functions.prototype.quartile_Inc=function (array, quart) {
  16659. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16660. };
  16661. Functions.prototype.quotient=function (numerator, denominator) {
  16662. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  16663. };
  16664. Functions.prototype.radians=function (angle) {
  16665. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16666. };
  16667. Functions.prototype.rand=function () {
  16668. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  16669. };
  16670. Functions.prototype.randBetween=function (bottom, top) {
  16671. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  16672. };
  16673. Functions.prototype.rank_Avg=function (number, ref, order) {
  16674. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16675. };
  16676. Functions.prototype.rank_Eq=function (number, ref, order) {
  16677. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16678. };
  16679. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  16680. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  16681. };
  16682. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  16683. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  16684. };
  16685. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  16686. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  16687. };
  16688. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  16689. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  16690. };
  16691. Functions.prototype.rept=function (text, numberTimes) {
  16692. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  16693. };
  16694. Functions.prototype.right=function (text, numChars) {
  16695. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16696. };
  16697. Functions.prototype.rightb=function (text, numBytes) {
  16698. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16699. };
  16700. Functions.prototype.roman=function (number, form) {
  16701. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  16702. };
  16703. Functions.prototype.round=function (number, numDigits) {
  16704. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16705. };
  16706. Functions.prototype.roundDown=function (number, numDigits) {
  16707. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16708. };
  16709. Functions.prototype.roundUp=function (number, numDigits) {
  16710. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16711. };
  16712. Functions.prototype.rows=function (array) {
  16713. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  16714. };
  16715. Functions.prototype.rri=function (nper, pv, fv) {
  16716. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  16717. };
  16718. Functions.prototype.sec=function (number) {
  16719. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16720. };
  16721. Functions.prototype.sech=function (number) {
  16722. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  16723. };
  16724. Functions.prototype.second=function (serialNumber) {
  16725. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16726. };
  16727. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  16728. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  16729. };
  16730. Functions.prototype.sheet=function (value) {
  16731. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  16732. };
  16733. Functions.prototype.sheets=function (reference) {
  16734. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16735. };
  16736. Functions.prototype.sign=function (number) {
  16737. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  16738. };
  16739. Functions.prototype.sin=function (number) {
  16740. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  16741. };
  16742. Functions.prototype.sinh=function (number) {
  16743. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16744. };
  16745. Functions.prototype.skew=function () {
  16746. var values=[];
  16747. for (var _i=0; _i < arguments.length; _i++) {
  16748. values[_i - 0]=arguments[_i];
  16749. }
  16750. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  16751. };
  16752. Functions.prototype.skew_p=function () {
  16753. var values=[];
  16754. for (var _i=0; _i < arguments.length; _i++) {
  16755. values[_i - 0]=arguments[_i];
  16756. }
  16757. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  16758. };
  16759. Functions.prototype.sln=function (cost, salvage, life) {
  16760. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  16761. };
  16762. Functions.prototype.small=function (array, k) {
  16763. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16764. };
  16765. Functions.prototype.sqrt=function (number) {
  16766. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  16767. };
  16768. Functions.prototype.sqrtPi=function (number) {
  16769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  16770. };
  16771. Functions.prototype.stDevA=function () {
  16772. var values=[];
  16773. for (var _i=0; _i < arguments.length; _i++) {
  16774. values[_i - 0]=arguments[_i];
  16775. }
  16776. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16777. };
  16778. Functions.prototype.stDevPA=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, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16784. };
  16785. Functions.prototype.stDev_P=function () {
  16786. var values=[];
  16787. for (var _i=0; _i < arguments.length; _i++) {
  16788. values[_i - 0]=arguments[_i];
  16789. }
  16790. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16791. };
  16792. Functions.prototype.stDev_S=function () {
  16793. var values=[];
  16794. for (var _i=0; _i < arguments.length; _i++) {
  16795. values[_i - 0]=arguments[_i];
  16796. }
  16797. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16798. };
  16799. Functions.prototype.standardize=function (x, mean, standardDev) {
  16800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  16801. };
  16802. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  16803. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  16804. };
  16805. Functions.prototype.subtotal=function (functionNum) {
  16806. var values=[];
  16807. for (var _i=1; _i < arguments.length; _i++) {
  16808. values[_i - 1]=arguments[_i];
  16809. }
  16810. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  16811. };
  16812. Functions.prototype.sum=function () {
  16813. var values=[];
  16814. for (var _i=0; _i < arguments.length; _i++) {
  16815. values[_i - 0]=arguments[_i];
  16816. }
  16817. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16818. };
  16819. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  16820. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  16821. };
  16822. Functions.prototype.sumIfs=function (sumRange) {
  16823. var values=[];
  16824. for (var _i=1; _i < arguments.length; _i++) {
  16825. values[_i - 1]=arguments[_i];
  16826. }
  16827. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  16828. };
  16829. Functions.prototype.sumSq=function () {
  16830. var values=[];
  16831. for (var _i=0; _i < arguments.length; _i++) {
  16832. values[_i - 0]=arguments[_i];
  16833. }
  16834. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16835. };
  16836. Functions.prototype.syd=function (cost, salvage, life, per) {
  16837. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  16838. };
  16839. Functions.prototype.t=function (value) {
  16840. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  16841. };
  16842. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  16843. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16844. };
  16845. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  16846. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16847. };
  16848. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  16849. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  16850. };
  16851. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  16852. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  16853. };
  16854. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  16855. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16856. };
  16857. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  16858. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16859. };
  16860. Functions.prototype.t_Inv=function (probability, degFreedom) {
  16861. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16862. };
  16863. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  16864. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16865. };
  16866. Functions.prototype.tan=function (number) {
  16867. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  16868. };
  16869. Functions.prototype.tanh=function (number) {
  16870. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16871. };
  16872. Functions.prototype.text=function (value, formatText) {
  16873. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  16874. };
  16875. Functions.prototype.time=function (hour, minute, second) {
  16876. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  16877. };
  16878. Functions.prototype.timevalue=function (timeText) {
  16879. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  16880. };
  16881. Functions.prototype.today=function () {
  16882. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  16883. };
  16884. Functions.prototype.trim=function (text) {
  16885. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  16886. };
  16887. Functions.prototype.trimMean=function (array, percent) {
  16888. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  16889. };
  16890. Functions.prototype.true=function () {
  16891. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  16892. };
  16893. Functions.prototype.trunc=function (number, numDigits) {
  16894. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16895. };
  16896. Functions.prototype.type=function (value) {
  16897. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  16898. };
  16899. Functions.prototype.usdollar=function (number, decimals) {
  16900. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16901. };
  16902. Functions.prototype.unichar=function (number) {
  16903. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  16904. };
  16905. Functions.prototype.unicode=function (text) {
  16906. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  16907. };
  16908. Functions.prototype.upper=function (text) {
  16909. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16910. };
  16911. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  16912. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  16913. };
  16914. Functions.prototype.value=function (text) {
  16915. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  16916. };
  16917. Functions.prototype.varA=function () {
  16918. var values=[];
  16919. for (var _i=0; _i < arguments.length; _i++) {
  16920. values[_i - 0]=arguments[_i];
  16921. }
  16922. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16923. };
  16924. Functions.prototype.varPA=function () {
  16925. var values=[];
  16926. for (var _i=0; _i < arguments.length; _i++) {
  16927. values[_i - 0]=arguments[_i];
  16928. }
  16929. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16930. };
  16931. Functions.prototype.var_P=function () {
  16932. var values=[];
  16933. for (var _i=0; _i < arguments.length; _i++) {
  16934. values[_i - 0]=arguments[_i];
  16935. }
  16936. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16937. };
  16938. Functions.prototype.var_S=function () {
  16939. var values=[];
  16940. for (var _i=0; _i < arguments.length; _i++) {
  16941. values[_i - 0]=arguments[_i];
  16942. }
  16943. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16944. };
  16945. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  16946. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  16947. };
  16948. Functions.prototype.weekNum=function (serialNumber, returnType) {
  16949. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16950. };
  16951. Functions.prototype.weekday=function (serialNumber, returnType) {
  16952. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16953. };
  16954. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  16955. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16956. };
  16957. Functions.prototype.workDay=function (startDate, days, holidays) {
  16958. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  16959. };
  16960. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  16961. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  16962. };
  16963. Functions.prototype.xirr=function (values, dates, guess) {
  16964. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  16965. };
  16966. Functions.prototype.xnpv=function (rate, values, dates) {
  16967. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  16968. };
  16969. Functions.prototype.xor=function () {
  16970. var values=[];
  16971. for (var _i=0; _i < arguments.length; _i++) {
  16972. values[_i - 0]=arguments[_i];
  16973. }
  16974. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  16975. };
  16976. Functions.prototype.year=function (serialNumber) {
  16977. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16978. };
  16979. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  16980. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  16981. };
  16982. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  16983. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  16984. };
  16985. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  16986. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16987. };
  16988. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  16989. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  16990. };
  16991. Functions.prototype.z_Test=function (array, x, sigma) {
  16992. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  16993. };
  16994. Functions.prototype._handleResult=function (value) {
  16995. _super.prototype._handleResult.call(this, value);
  16996. if (_isNullOrUndefined(value))
  16997. return;
  16998. var obj=value;
  16999. _fixObjectPathIfNecessary(this, obj);
  17000. };
  17001. Functions.prototype.toJSON=function () {
  17002. return {};
  17003. };
  17004. return Functions;
  17005. }(OfficeExtension.ClientObject));
  17006. Excel.Functions=Functions;
  17007. var ErrorCodes;
  17008. (function (ErrorCodes) {
  17009. ErrorCodes.accessDenied="AccessDenied";
  17010. ErrorCodes.apiNotFound="ApiNotFound";
  17011. ErrorCodes.generalException="GeneralException";
  17012. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  17013. ErrorCodes.invalidArgument="InvalidArgument";
  17014. ErrorCodes.invalidBinding="InvalidBinding";
  17015. ErrorCodes.invalidOperation="InvalidOperation";
  17016. ErrorCodes.invalidReference="InvalidReference";
  17017. ErrorCodes.invalidSelection="InvalidSelection";
  17018. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  17019. ErrorCodes.itemNotFound="ItemNotFound";
  17020. ErrorCodes.notImplemented="NotImplemented";
  17021. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  17022. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  17023. })(Excel || (Excel={}));
  17024. var Excel;
  17025. (function (Excel) {
  17026. var RequestContext=(function (_super) {
  17027. __extends(RequestContext, _super);
  17028. function RequestContext(url) {
  17029. _super.call(this, url);
  17030. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  17031. this._rootObject=this.m_workbook;
  17032. }
  17033. Object.defineProperty(RequestContext.prototype, "workbook", {
  17034. get: function () {
  17035. return this.m_workbook;
  17036. },
  17037. enumerable: true,
  17038. configurable: true
  17039. });
  17040. return RequestContext;
  17041. }(OfficeExtension.ClientRequestContext));
  17042. Excel.RequestContext=RequestContext;
  17043. function run(arg1, arg2, arg3) {
  17044. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  17045. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  17046. if (requestInfo && requestInfo.headers) {
  17047. for (var name in requestInfo.headers) {
  17048. ret.requestHeaders[name]=requestInfo.headers[name];
  17049. }
  17050. }
  17051. return ret;
  17052. });
  17053. }
  17054. Excel.run=run;
  17055. })(Excel || (Excel={}));
  17056. var Excel;
  17057. (function (Excel) {
  17058. Excel._RedirectV1APIs=false;
  17059. Excel._V1APIMap={
  17060. "GetDataAsync": {
  17061. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  17062. postprocess: getDataCommonPostprocess
  17063. },
  17064. "GetSelectedDataAsync": {
  17065. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  17066. postprocess: getDataCommonPostprocess
  17067. },
  17068. "GoToByIdAsync": {
  17069. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  17070. },
  17071. "AddColumnsAsync": {
  17072. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  17073. },
  17074. "AddFromSelectionAsync": {
  17075. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  17076. postprocess: postprocessBindingDescriptor
  17077. },
  17078. "AddFromNamedItemAsync": {
  17079. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  17080. postprocess: postprocessBindingDescriptor
  17081. },
  17082. "AddFromPromptAsync": {
  17083. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  17084. postprocess: postprocessBindingDescriptor
  17085. },
  17086. "AddRowsAsync": {
  17087. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  17088. },
  17089. "GetByIdAsync": {
  17090. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  17091. postprocess: postprocessBindingDescriptor
  17092. },
  17093. "ReleaseByIdAsync": {
  17094. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  17095. },
  17096. "GetAllAsync": {
  17097. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  17098. postprocess: function (response) {
  17099. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  17100. }
  17101. },
  17102. "DeleteAllDataValuesAsync": {
  17103. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  17104. },
  17105. "SetSelectedDataAsync": {
  17106. preprocess: function (callArgs) {
  17107. var preimage=callArgs["cellFormat"];
  17108. if (window.OSF.DDA.SafeArray) {
  17109. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17110. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17111. }
  17112. }
  17113. else if (window.OSF.DDA.WAC) {
  17114. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17115. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17116. }
  17117. }
  17118. return callArgs;
  17119. },
  17120. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  17121. },
  17122. "SetDataAsync": {
  17123. preprocess: function (callArgs) {
  17124. var preimage=callArgs["cellFormat"];
  17125. if (window.OSF.DDA.SafeArray) {
  17126. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17127. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17128. }
  17129. }
  17130. else if (window.OSF.DDA.WAC) {
  17131. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17132. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17133. }
  17134. }
  17135. return callArgs;
  17136. },
  17137. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  17138. },
  17139. "SetFormatsAsync": {
  17140. preprocess: function (callArgs) {
  17141. var preimage=callArgs["cellFormat"];
  17142. if (window.OSF.DDA.SafeArray) {
  17143. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17144. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17145. }
  17146. }
  17147. else if (window.OSF.DDA.WAC) {
  17148. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17149. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17150. }
  17151. }
  17152. return callArgs;
  17153. },
  17154. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  17155. },
  17156. "SetTableOptionsAsync": {
  17157. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  17158. },
  17159. "ClearFormatsAsync": {
  17160. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  17161. },
  17162. };
  17163. function postprocessBindingDescriptor(response) {
  17164. var bindingDescriptor={
  17165. BindingColumnCount: response.bindingColumnCount,
  17166. BindingId: response.bindingId,
  17167. BindingRowCount: response.bindingRowCount,
  17168. bindingType: response.bindingType,
  17169. HasHeaders: response.hasHeaders
  17170. };
  17171. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  17172. }
  17173. function getDataCommonPostprocess(response, callArgs) {
  17174. var isPlainData=response.headers==null;
  17175. var data;
  17176. if (isPlainData) {
  17177. data=response.rows;
  17178. }
  17179. else {
  17180. data=response;
  17181. }
  17182. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  17183. return data==undefined ? null : data;
  17184. }
  17185. })(Excel || (Excel={}));