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

excel-ios-16.00.debug.js 653KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230
  1. /* Excel iOS-specific API library */
  2. /* Version: 16.0.7524.3000 */
  3. /* Office.js Version: 16.0.7526.1000 */
  4. /*
  5. Copyright (c) Microsoft Corporation. All rights reserved.
  6. */
  7. /*
  8. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  9. */
  10. /*
  11. * @overview es6-promise - a tiny implementation of Promises/A+.
  12. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  13. * @license Licensed under MIT license
  14. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  15. * @version 2.3.0
  16. */
  17. var __extends=(this && this.__extends) || function (d, b) {
  18. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  19. function __() { this.constructor=d; }
  20. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  21. };
  22. var OfficeExt;
  23. (function (OfficeExt) {
  24. var MicrosoftAjaxFactory=(function () {
  25. function MicrosoftAjaxFactory() {
  26. }
  27. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function () {
  28. if (typeof (Sys) !=='undefined' && typeof (Type) !=='undefined' &&
  29. Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" &&
  30. Type.registerNamespace && typeof (Type.registerNamespace)==="function" &&
  31. Type.registerClass && typeof (Type.registerClass)==="function" &&
  32. typeof (Function._validateParams)==="function" &&
  33. Sys.Serialization && Sys.Serialization.JavaScriptSerializer && typeof (Sys.Serialization.JavaScriptSerializer.serialize)==="function") {
  34. return true;
  35. }
  36. else {
  37. return false;
  38. }
  39. };
  40. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) {
  41. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  42. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  43. };
  44. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  45. get: function () {
  46. if (this._msAjaxError==null && this.isMsAjaxLoaded()) {
  47. this._msAjaxError=Error;
  48. }
  49. return this._msAjaxError;
  50. },
  51. set: function (errorClass) {
  52. this._msAjaxError=errorClass;
  53. },
  54. enumerable: true,
  55. configurable: true
  56. });
  57. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  58. get: function () {
  59. if (this._msAjaxString==null && this.isMsAjaxLoaded()) {
  60. this._msAjaxString=String;
  61. }
  62. return this._msAjaxString;
  63. },
  64. set: function (stringClass) {
  65. this._msAjaxString=stringClass;
  66. },
  67. enumerable: true,
  68. configurable: true
  69. });
  70. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  71. get: function () {
  72. if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) {
  73. this._msAjaxDebug=Sys.Debug;
  74. }
  75. return this._msAjaxDebug;
  76. },
  77. set: function (debugClass) {
  78. this._msAjaxDebug=debugClass;
  79. },
  80. enumerable: true,
  81. configurable: true
  82. });
  83. return MicrosoftAjaxFactory;
  84. })();
  85. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory;
  86. })(OfficeExt || (OfficeExt={}));
  87. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory();
  88. var OSF=OSF || {};
  89. var OfficeExt;
  90. (function (OfficeExt) {
  91. var SafeStorage=(function () {
  92. function SafeStorage(_internalStorage) {
  93. this._internalStorage=_internalStorage;
  94. }
  95. SafeStorage.prototype.getItem=function (key) {
  96. try {
  97. return this._internalStorage && this._internalStorage.getItem(key);
  98. }
  99. catch (e) {
  100. return null;
  101. }
  102. };
  103. SafeStorage.prototype.setItem=function (key, data) {
  104. try {
  105. this._internalStorage && this._internalStorage.setItem(key, data);
  106. }
  107. catch (e) {
  108. }
  109. };
  110. SafeStorage.prototype.clear=function () {
  111. try {
  112. this._internalStorage && this._internalStorage.clear();
  113. }
  114. catch (e) {
  115. }
  116. };
  117. SafeStorage.prototype.removeItem=function (key) {
  118. try {
  119. this._internalStorage && this._internalStorage.removeItem(key);
  120. }
  121. catch (e) {
  122. }
  123. };
  124. SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) {
  125. var keyList=[];
  126. try {
  127. var len=this._internalStorage && this._internalStorage.length || 0;
  128. for (var i=0; i < len; i++) {
  129. var key=this._internalStorage.key(i);
  130. if (key.indexOf(keyPrefix)===0) {
  131. keyList.push(key);
  132. }
  133. }
  134. }
  135. catch (e) {
  136. }
  137. return keyList;
  138. };
  139. return SafeStorage;
  140. })();
  141. OfficeExt.SafeStorage=SafeStorage;
  142. })(OfficeExt || (OfficeExt={}));
  143. OSF.XdmFieldName={
  144. ConversationUrl: "ConversationUrl",
  145. AppId: "AppId"
  146. };
  147. OSF.WindowNameItemKeys={
  148. BaseFrameName: "baseFrameName",
  149. HostInfo: "hostInfo",
  150. XdmInfo: "xdmInfo",
  151. SerializerVersion: "serializerVersion",
  152. AppContext: "appContext"
  153. };
  154. OSF.OUtil=(function () {
  155. var _uniqueId=-1;
  156. var _xdmInfoKey='&_xdm_Info=';
  157. var _serializerVersionKey='&_serializer_version=';
  158. var _xdmSessionKeyPrefix='_xdm_';
  159. var _serializerVersionKeyPrefix='_serializer_version=';
  160. var _fragmentSeparator='#';
  161. var _fragmentInfoDelimiter='&';
  162. var _classN="class";
  163. var _loadedScripts={};
  164. var _defaultScriptLoadingTimeout=30000;
  165. var _safeSessionStorage=null;
  166. var _safeLocalStorage=null;
  167. var _rndentropy=new Date().getTime();
  168. function _random() {
  169. var nextrand=0x7fffffff * (Math.random());
  170. nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  171. return nextrand.toString(16);
  172. }
  173. ;
  174. function _getSessionStorage() {
  175. if (!_safeSessionStorage) {
  176. try {
  177. var sessionStorage=window.sessionStorage;
  178. }
  179. catch (ex) {
  180. sessionStorage=null;
  181. }
  182. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage);
  183. }
  184. return _safeSessionStorage;
  185. }
  186. ;
  187. function _reOrderTabbableElements(elements) {
  188. var bucket0=[];
  189. var bucketPositive=[];
  190. var i;
  191. var len=elements.length;
  192. var ele;
  193. for (i=0; i < len; i++) {
  194. ele=elements[i];
  195. if (ele.tabIndex) {
  196. if (ele.tabIndex > 0) {
  197. bucketPositive.push(ele);
  198. }
  199. else if (ele.tabIndex===0) {
  200. bucket0.push(ele);
  201. }
  202. }
  203. else {
  204. bucket0.push(ele);
  205. }
  206. }
  207. bucketPositive=bucketPositive.sort(function (left, right) {
  208. var diff=left.tabIndex - right.tabIndex;
  209. if (diff===0) {
  210. diff=bucketPositive.indexOf(left) - bucketPositive.indexOf(right);
  211. }
  212. return diff;
  213. });
  214. return [].concat(bucketPositive, bucket0);
  215. }
  216. ;
  217. return {
  218. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  219. if (typeof entropy=="string") {
  220. for (var i=0; i < entropy.length; i+=4) {
  221. var temp=0;
  222. for (var j=0; j < 4 && i+j < entropy.length; j++) {
  223. temp=(temp << 8)+entropy.charCodeAt(i+j);
  224. }
  225. _rndentropy ^=temp;
  226. }
  227. }
  228. else if (typeof entropy=="number") {
  229. _rndentropy ^=entropy;
  230. }
  231. else {
  232. _rndentropy ^=0x7fffffff * Math.random();
  233. }
  234. _rndentropy &=0x7fffffff;
  235. },
  236. extend: function OSF_OUtil$extend(child, parent) {
  237. var F=function () { };
  238. F.prototype=parent.prototype;
  239. child.prototype=new F();
  240. child.prototype.constructor=child;
  241. child.uber=parent.prototype;
  242. if (parent.prototype.constructor===Object.prototype.constructor) {
  243. parent.prototype.constructor=parent;
  244. }
  245. },
  246. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  247. if (parent && name && !parent[name]) {
  248. parent[name]={};
  249. }
  250. },
  251. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  252. if (parent && name && parent[name]) {
  253. delete parent[name];
  254. }
  255. },
  256. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  257. if (url && callback) {
  258. var doc=window.document;
  259. var _loadedScriptEntry=_loadedScripts[url];
  260. if (!_loadedScriptEntry) {
  261. var script=doc.createElement("script");
  262. script.type="text/javascript";
  263. _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null };
  264. _loadedScripts[url]=_loadedScriptEntry;
  265. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() {
  266. if (_loadedScriptEntry.timer !=null) {
  267. clearTimeout(_loadedScriptEntry.timer);
  268. delete _loadedScriptEntry.timer;
  269. }
  270. _loadedScriptEntry.loaded=true;
  271. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  272. for (var i=0; i < pendingCallbackCount; i++) {
  273. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  274. currentCallback();
  275. }
  276. };
  277. var onLoadError=function OSF_OUtil_loadScript$onLoadError() {
  278. delete _loadedScripts[url];
  279. if (_loadedScriptEntry.timer !=null) {
  280. clearTimeout(_loadedScriptEntry.timer);
  281. delete _loadedScriptEntry.timer;
  282. }
  283. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  284. for (var i=0; i < pendingCallbackCount; i++) {
  285. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  286. currentCallback();
  287. }
  288. };
  289. if (script.readyState) {
  290. script.onreadystatechange=function () {
  291. if (script.readyState=="loaded" || script.readyState=="complete") {
  292. script.onreadystatechange=null;
  293. onLoadCallback();
  294. }
  295. };
  296. }
  297. else {
  298. script.onload=onLoadCallback;
  299. }
  300. script.onerror=onLoadError;
  301. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  302. _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs);
  303. script.src=url;
  304. doc.getElementsByTagName("head")[0].appendChild(script);
  305. }
  306. else if (_loadedScriptEntry.loaded) {
  307. callback();
  308. }
  309. else {
  310. _loadedScriptEntry.pendingCallbacks.push(callback);
  311. }
  312. }
  313. },
  314. loadCSS: function OSF_OUtil$loadCSS(url) {
  315. if (url) {
  316. var doc=window.document;
  317. var link=doc.createElement("link");
  318. link.type="text/css";
  319. link.rel="stylesheet";
  320. link.href=url;
  321. doc.getElementsByTagName("head")[0].appendChild(link);
  322. }
  323. },
  324. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  325. var parsed=enumObject[str.trim()];
  326. if (typeof (parsed)=='undefined') {
  327. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  328. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  329. }
  330. return parsed;
  331. },
  332. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  333. var obj={ calc: arguments[0] };
  334. return function () {
  335. if (obj.calc) {
  336. obj.val=obj.calc.apply(this, arguments);
  337. delete obj.calc;
  338. }
  339. return obj.val;
  340. };
  341. },
  342. getUniqueId: function OSF_OUtil$getUniqueId() {
  343. _uniqueId=_uniqueId+1;
  344. return _uniqueId.toString();
  345. },
  346. formatString: function OSF_OUtil$formatString() {
  347. var args=arguments;
  348. var source=args[0];
  349. return source.replace(/{(\d+)}/gm, function (match, number) {
  350. var index=parseInt(number, 10)+1;
  351. return args[index]===undefined ? '{'+number+'}' : args[index];
  352. });
  353. },
  354. generateConversationId: function OSF_OUtil$generateConversationId() {
  355. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  356. },
  357. getFrameName: function OSF_OUtil$getFrameName(cacheKey) {
  358. return _xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  359. },
  360. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  361. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue, false);
  362. },
  363. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  364. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion, true);
  365. },
  366. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue, encodeInfo) {
  367. url=url.trim() || '';
  368. var urlParts=url.split(_fragmentSeparator);
  369. var urlWithoutFragment=urlParts.shift();
  370. var fragment=urlParts.join(_fragmentSeparator);
  371. var newFragment;
  372. if (encodeInfo) {
  373. newFragment=[keyName, encodeURIComponent(infoValue), fragment].join('');
  374. }
  375. else {
  376. newFragment=[fragment, keyName, infoValue].join('');
  377. }
  378. return [urlWithoutFragment, _fragmentSeparator, newFragment].join('');
  379. },
  380. parseHostInfoFromWindowName: function OSF_OUtil$parseHostInfoFromWindowName(skipSessionStorage, windowName) {
  381. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.HostInfo);
  382. },
  383. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  384. var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  385. if (!xdmInfoValue) {
  386. xdmInfoValue=OSF.OUtil.parseXdmInfoFromWindowName(skipSessionStorage, window.name);
  387. }
  388. return xdmInfoValue;
  389. },
  390. parseXdmInfoFromWindowName: function OSF_OUtil$parseXdmInfoFromWindowName(skipSessionStorage, windowName) {
  391. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.XdmInfo);
  392. },
  393. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  394. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, false, skipSessionStorage, fragment);
  395. },
  396. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  397. var serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  398. if (isNaN(serializerVersion)) {
  399. serializerVersion=OSF.OUtil.parseSerializerVersionFromWindowName(skipSessionStorage, window.name);
  400. }
  401. return serializerVersion;
  402. },
  403. parseSerializerVersionFromWindowName: function OSF_OUtil$parseSerializerVersionFromWindowName(skipSessionStorage, windowName) {
  404. return parseInt(OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.SerializerVersion));
  405. },
  406. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  407. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, true, skipSessionStorage, fragment));
  408. },
  409. parseInfoFromWindowName: function OSF_OUtil$parseInfoFromWindowName(skipSessionStorage, windowName, infoKey) {
  410. try {
  411. var windowNameObj=JSON.parse(windowName);
  412. var infoValue=windowNameObj !=null ? windowNameObj[infoKey] : null;
  413. var osfSessionStorage=_getSessionStorage();
  414. if (!skipSessionStorage && osfSessionStorage && windowNameObj !=null) {
  415. var sessionKey=windowNameObj[OSF.WindowNameItemKeys.BaseFrameName]+infoKey;
  416. if (infoValue) {
  417. osfSessionStorage.setItem(sessionKey, infoValue);
  418. }
  419. else {
  420. infoValue=osfSessionStorage.getItem(sessionKey);
  421. }
  422. }
  423. return infoValue;
  424. }
  425. catch (Exception) {
  426. return null;
  427. }
  428. },
  429. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, decodeInfo, skipSessionStorage, fragment) {
  430. var fragmentParts=fragment.split(infoKey);
  431. var infoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  432. if (decodeInfo && infoValue !=null) {
  433. if (infoValue.indexOf(_fragmentInfoDelimiter) >=0) {
  434. infoValue=infoValue.split(_fragmentInfoDelimiter)[0];
  435. }
  436. infoValue=decodeURIComponent(infoValue);
  437. }
  438. var osfSessionStorage=_getSessionStorage();
  439. if (!skipSessionStorage && osfSessionStorage) {
  440. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  441. if (sessionKeyStart > -1) {
  442. var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart);
  443. if (sessionKeyEnd==-1) {
  444. sessionKeyEnd=window.name.length;
  445. }
  446. var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd);
  447. if (infoValue) {
  448. osfSessionStorage.setItem(sessionKey, infoValue);
  449. }
  450. else {
  451. infoValue=osfSessionStorage.getItem(sessionKey);
  452. }
  453. }
  454. }
  455. return infoValue;
  456. },
  457. getConversationId: function OSF_OUtil$getConversationId() {
  458. var searchString=window.location.search;
  459. var conversationId=null;
  460. if (searchString) {
  461. var index=searchString.indexOf("&");
  462. conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  463. if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') {
  464. conversationId=conversationId.substring(0, conversationId.length - 1);
  465. if (conversationId) {
  466. conversationId=decodeURIComponent(conversationId);
  467. }
  468. }
  469. }
  470. return conversationId;
  471. },
  472. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  473. var items=strInfo.split("$");
  474. if (typeof items[1]=="undefined") {
  475. items=strInfo.split("|");
  476. }
  477. if (typeof items[1]=="undefined") {
  478. items=strInfo.split("%7C");
  479. }
  480. return items;
  481. },
  482. getXdmFieldValue: function OSF_OUtil$getXdmFieldValue(xdmFieldName, skipSessionStorage) {
  483. var fieldValue='';
  484. var xdmInfoValue=OSF.OUtil.parseXdmInfo(skipSessionStorage);
  485. if (xdmInfoValue) {
  486. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  487. if (items !=undefined && items.length >=3) {
  488. switch (xdmFieldName) {
  489. case OSF.XdmFieldName.ConversationUrl:
  490. fieldValue=items[2];
  491. break;
  492. case OSF.XdmFieldName.AppId:
  493. fieldValue=items[1];
  494. break;
  495. }
  496. }
  497. }
  498. return fieldValue;
  499. },
  500. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  501. var e=Function._validateParams(arguments, [{ name: "params", type: Object, mayBeNull: false },
  502. { name: "expectedProperties", type: Object, mayBeNull: false },
  503. { name: "callback", type: Function, mayBeNull: true }
  504. ]);
  505. if (e)
  506. throw e;
  507. for (var p in expectedProperties) {
  508. e=Function._validateParameter(params[p], expectedProperties[p], p);
  509. if (e)
  510. throw e;
  511. }
  512. },
  513. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  514. if (window.msWriteProfilerMark) {
  515. window.msWriteProfilerMark(text);
  516. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  517. }
  518. },
  519. outputDebug: function OSF_OUtil$outputDebug(text) {
  520. if (typeof (OsfMsAjaxFactory) !=='undefined' && OsfMsAjaxFactory.msAjaxDebug && OsfMsAjaxFactory.msAjaxDebug.trace) {
  521. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  522. }
  523. },
  524. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  525. descriptor=descriptor || {};
  526. for (var nd in attributes) {
  527. var attribute=attributes[nd];
  528. if (descriptor[attribute]==undefined) {
  529. descriptor[attribute]=true;
  530. }
  531. }
  532. Object.defineProperty(obj, prop, descriptor);
  533. return obj;
  534. },
  535. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  536. descriptors=descriptors || {};
  537. for (var prop in descriptors) {
  538. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  539. }
  540. return obj;
  541. },
  542. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  543. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  544. },
  545. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  546. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  547. },
  548. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  549. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  550. },
  551. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  552. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  553. },
  554. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  555. descriptor=descriptor || {};
  556. var props=Object.getOwnPropertyNames(obj);
  557. var propsLength=props.length;
  558. for (var i=0; i < propsLength; i++) {
  559. var prop=props[i];
  560. var desc=Object.getOwnPropertyDescriptor(obj, prop);
  561. if (!desc.get && !desc.set) {
  562. desc.writable=descriptor.writable || false;
  563. }
  564. desc.configurable=descriptor.configurable || false;
  565. desc.enumerable=descriptor.enumerable || true;
  566. Object.defineProperty(obj, prop, desc);
  567. }
  568. return obj;
  569. },
  570. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  571. var ret=[];
  572. if (list) {
  573. for (var item in list) {
  574. ret.push(mapFunction(list[item]));
  575. }
  576. }
  577. return ret;
  578. },
  579. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  580. for (var item in list) {
  581. if (key==item) {
  582. return true;
  583. }
  584. }
  585. return false;
  586. },
  587. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  588. for (var item in list) {
  589. if (value==list[item]) {
  590. return true;
  591. }
  592. }
  593. return false;
  594. },
  595. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  596. var add=list.push ? function (key, value) { list.push(value); } : function (key, value) { list[key]=value; };
  597. for (var key in addenda) {
  598. add(key, addenda[key]);
  599. }
  600. },
  601. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  602. for (var key1 in oldList) {
  603. delete oldList[key1];
  604. }
  605. for (var key2 in newList) {
  606. oldList[key2]=newList[key2];
  607. }
  608. },
  609. isArray: function OSF_OUtil$isArray(obj) {
  610. return Object.prototype.toString.apply(obj)==="[object Array]";
  611. },
  612. isFunction: function OSF_OUtil$isFunction(obj) {
  613. return Object.prototype.toString.apply(obj)==="[object Function]";
  614. },
  615. isDate: function OSF_OUtil$isDate(obj) {
  616. return Object.prototype.toString.apply(obj)==="[object Date]";
  617. },
  618. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  619. if (element.addEventListener) {
  620. element.addEventListener(eventName, listener, false);
  621. }
  622. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) {
  623. element.attachEvent("on"+eventName, listener);
  624. }
  625. else {
  626. element["on"+eventName]=listener;
  627. }
  628. },
  629. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  630. if (element.removeEventListener) {
  631. element.removeEventListener(eventName, listener, false);
  632. }
  633. else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) {
  634. element.detachEvent("on"+eventName, listener);
  635. }
  636. else {
  637. element["on"+eventName]=null;
  638. }
  639. },
  640. getCookieValue: function OSF_OUtil$getCookieValue(cookieName) {
  641. var tmpCookieString=RegExp(cookieName+"[^;]+").exec(document.cookie);
  642. return tmpCookieString.toString().replace(/^[^=]+./, "");
  643. },
  644. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  645. var xmlhttp;
  646. try {
  647. xmlhttp=new XMLHttpRequest();
  648. xmlhttp.onreadystatechange=function () {
  649. if (xmlhttp.readyState==4) {
  650. if (xmlhttp.status==200) {
  651. onSuccess(xmlhttp.responseText);
  652. }
  653. else {
  654. onError(xmlhttp.status);
  655. }
  656. }
  657. };
  658. xmlhttp.open("GET", url, true);
  659. xmlhttp.send();
  660. }
  661. catch (ex) {
  662. onError(ex);
  663. }
  664. },
  665. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError) {
  666. var xmlhttp;
  667. var requestedFileName=oneDriveFileName;
  668. try {
  669. xmlhttp=new XMLHttpRequest();
  670. xmlhttp.onreadystatechange=function () {
  671. if (xmlhttp.readyState==4) {
  672. if (xmlhttp.status==200) {
  673. onSuccess(xmlhttp, requestedFileName);
  674. }
  675. else {
  676. onError(xmlhttp.status);
  677. }
  678. }
  679. };
  680. xmlhttp.open("GET", url, true);
  681. xmlhttp.send();
  682. }
  683. catch (ex) {
  684. onError(ex);
  685. }
  686. },
  687. encodeBase64: function OSF_Outil$encodeBase64(input) {
  688. if (!input)
  689. return input;
  690. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  691. var output=[];
  692. var temp=[];
  693. var index=0;
  694. var c1, c2, c3, a, b, c;
  695. var i;
  696. var length=input.length;
  697. do {
  698. c1=input.charCodeAt(index++);
  699. c2=input.charCodeAt(index++);
  700. c3=input.charCodeAt(index++);
  701. i=0;
  702. a=c1 & 255;
  703. b=c1 >> 8;
  704. c=c2 & 255;
  705. temp[i++]=a >> 2;
  706. temp[i++]=((a & 3) << 4) | (b >> 4);
  707. temp[i++]=((b & 15) << 2) | (c >> 6);
  708. temp[i++]=c & 63;
  709. if (!isNaN(c2)) {
  710. a=c2 >> 8;
  711. b=c3 & 255;
  712. c=c3 >> 8;
  713. temp[i++]=a >> 2;
  714. temp[i++]=((a & 3) << 4) | (b >> 4);
  715. temp[i++]=((b & 15) << 2) | (c >> 6);
  716. temp[i++]=c & 63;
  717. }
  718. if (isNaN(c2)) {
  719. temp[i - 1]=64;
  720. }
  721. else if (isNaN(c3)) {
  722. temp[i - 2]=64;
  723. temp[i - 1]=64;
  724. }
  725. for (var t=0; t < i; t++) {
  726. output.push(codex.charAt(temp[t]));
  727. }
  728. } while (index < length);
  729. return output.join("");
  730. },
  731. getSessionStorage: function OSF_Outil$getSessionStorage() {
  732. return _getSessionStorage();
  733. },
  734. getLocalStorage: function OSF_Outil$getLocalStorage() {
  735. if (!_safeLocalStorage) {
  736. try {
  737. var localStorage=window.localStorage;
  738. }
  739. catch (ex) {
  740. localStorage=null;
  741. }
  742. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage);
  743. }
  744. return _safeLocalStorage;
  745. },
  746. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  747. var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6);
  748. return hex;
  749. },
  750. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  751. element.onclick=function (e) {
  752. handler();
  753. };
  754. element.ontouchend=function (e) {
  755. handler();
  756. e.preventDefault();
  757. };
  758. },
  759. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  760. var e=Function._validateParams(arguments, [{ name: "queryString", type: String, mayBeNull: false },
  761. { name: "paramName", type: String, mayBeNull: false }
  762. ]);
  763. if (e) {
  764. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  765. return "";
  766. }
  767. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i");
  768. if (!queryExp.test(queryString)) {
  769. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  770. return "";
  771. }
  772. return queryExp.exec(queryString)[1];
  773. },
  774. isiOS: function OSF_Outil$isiOS() {
  775. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  776. },
  777. isChrome: function OSF_Outil$isChrome() {
  778. return (window.navigator.userAgent.indexOf("Chrome") > 0) && !OSF.OUtil.isEdge();
  779. },
  780. isEdge: function OSF_Outil$isEdge() {
  781. return window.navigator.userAgent.indexOf("Edge") > 0;
  782. },
  783. isIE: function OSF_Outil$isIE() {
  784. return window.navigator.userAgent.indexOf("Trident") > 0;
  785. },
  786. isFirefox: function OSF_Outil$isFirefox() {
  787. return window.navigator.userAgent.indexOf("Firefox") > 0;
  788. },
  789. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  790. var copyObj=sourceObj.constructor();
  791. for (var property in sourceObj) {
  792. if (sourceObj.hasOwnProperty(property)) {
  793. copyObj[property]=sourceObj[property];
  794. }
  795. }
  796. return copyObj;
  797. },
  798. createObject: function OSF_Outil$createObject(properties) {
  799. var obj=null;
  800. if (properties) {
  801. obj={};
  802. var len=properties.length;
  803. for (var i=0; i < len; i++) {
  804. obj[properties[i].name]=properties[i].value;
  805. }
  806. }
  807. return obj;
  808. },
  809. addClass: function OSF_OUtil$addClass(elmt, val) {
  810. if (!OSF.OUtil.hasClass(elmt, val)) {
  811. var className=elmt.getAttribute(_classN);
  812. if (className) {
  813. elmt.setAttribute(_classN, className+" "+val);
  814. }
  815. else {
  816. elmt.setAttribute(_classN, val);
  817. }
  818. }
  819. },
  820. hasClass: function OSF_OUtil$hasClass(elmt, clsName) {
  821. var className=elmt.getAttribute(_classN);
  822. return className && className.match(new RegExp('(\\s|^)'+clsName+'(\\s|$)'));
  823. },
  824. focusToFirstTabbable: function OSF_OUtil$focusToFirstTabbable(all, backward) {
  825. var next;
  826. var focused=false;
  827. var candidate;
  828. var setFlag=function (e) {
  829. focused=true;
  830. };
  831. var findNextPos=function (allLen, currPos, backward) {
  832. if (currPos < 0 || currPos > allLen) {
  833. return -1;
  834. }
  835. else if (currPos===0 && backward) {
  836. return -1;
  837. }
  838. else if (currPos===allLen - 1 && !backward) {
  839. return -1;
  840. }
  841. if (backward) {
  842. return currPos - 1;
  843. }
  844. else {
  845. return currPos+1;
  846. }
  847. };
  848. all=_reOrderTabbableElements(all);
  849. next=backward ? all.length - 1 : 0;
  850. if (all.length===0) {
  851. return null;
  852. }
  853. while (!focused && next >=0 && next < all.length) {
  854. candidate=all[next];
  855. window.focus();
  856. candidate.addEventListener('focus', setFlag);
  857. candidate.focus();
  858. candidate.removeEventListener('focus', setFlag);
  859. next=findNextPos(all.length, next, backward);
  860. if (!focused && candidate===document.activeElement) {
  861. focused=true;
  862. }
  863. }
  864. if (focused) {
  865. return candidate;
  866. }
  867. else {
  868. return null;
  869. }
  870. },
  871. focusToNextTabbable: function OSF_OUtil$focusToNextTabbable(all, curr, shift) {
  872. var currPos;
  873. var next;
  874. var focused=false;
  875. var candidate;
  876. var setFlag=function (e) {
  877. focused=true;
  878. };
  879. var findCurrPos=function (all, curr) {
  880. var i=0;
  881. for (; i < all.length; i++) {
  882. if (all[i]===curr) {
  883. return i;
  884. }
  885. }
  886. return -1;
  887. };
  888. var findNextPos=function (allLen, currPos, shift) {
  889. if (currPos < 0 || currPos > allLen) {
  890. return -1;
  891. }
  892. else if (currPos===0 && shift) {
  893. return -1;
  894. }
  895. else if (currPos===allLen - 1 && !shift) {
  896. return -1;
  897. }
  898. if (shift) {
  899. return currPos - 1;
  900. }
  901. else {
  902. return currPos+1;
  903. }
  904. };
  905. all=_reOrderTabbableElements(all);
  906. currPos=findCurrPos(all, curr);
  907. next=findNextPos(all.length, currPos, shift);
  908. if (next < 0) {
  909. return null;
  910. }
  911. while (!focused && next >=0 && next < all.length) {
  912. candidate=all[next];
  913. candidate.addEventListener('focus', setFlag);
  914. candidate.focus();
  915. candidate.removeEventListener('focus', setFlag);
  916. next=findNextPos(all.length, next, shift);
  917. if (!focused && candidate===document.activeElement) {
  918. focused=true;
  919. }
  920. }
  921. if (focused) {
  922. return candidate;
  923. }
  924. else {
  925. return null;
  926. }
  927. }
  928. };
  929. })();
  930. OSF.OUtil.Guid=(function () {
  931. var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  932. return {
  933. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  934. var result="";
  935. var tick=(new Date()).getTime();
  936. var index=0;
  937. for (; index < 32 && tick > 0; index++) {
  938. if (index==8 || index==12 || index==16 || index==20) {
  939. result+="-";
  940. }
  941. result+=hexCode[tick % 16];
  942. tick=Math.floor(tick / 16);
  943. }
  944. for (; index < 32; index++) {
  945. if (index==8 || index==12 || index==16 || index==20) {
  946. result+="-";
  947. }
  948. result+=hexCode[Math.floor(Math.random() * 16)];
  949. }
  950. return result;
  951. }
  952. };
  953. })();
  954. window.OSF=OSF;
  955. OSF.OUtil.setNamespace("OSF", window);
  956. OSF.AppName={
  957. Unsupported: 0,
  958. Excel: 1,
  959. Word: 2,
  960. PowerPoint: 4,
  961. Outlook: 8,
  962. ExcelWebApp: 16,
  963. WordWebApp: 32,
  964. OutlookWebApp: 64,
  965. Project: 128,
  966. AccessWebApp: 256,
  967. PowerpointWebApp: 512,
  968. ExcelIOS: 1024,
  969. Sway: 2048,
  970. WordIOS: 4096,
  971. PowerPointIOS: 8192,
  972. Access: 16384,
  973. Lync: 32768,
  974. OutlookIOS: 65536,
  975. OneNoteWebApp: 131072,
  976. OneNote: 262144,
  977. ExcelWinRT: 524288,
  978. WordWinRT: 1048576,
  979. PowerpointWinRT: 2097152,
  980. OutlookAndroid: 4194304,
  981. OneNoteWinRT: 8388608,
  982. ExcelAndroid: 8388609,
  983. VisioWebApp: 8388610
  984. };
  985. OSF.InternalPerfMarker={
  986. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  987. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  988. };
  989. OSF.HostCallPerfMarker={
  990. IssueCall: "Agave.HostCall.IssueCall",
  991. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  992. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  993. };
  994. OSF.AgaveHostAction={
  995. "Select": 0,
  996. "UnSelect": 1,
  997. "CancelDialog": 2,
  998. "InsertAgave": 3,
  999. "CtrlF6In": 4,
  1000. "CtrlF6Exit": 5,
  1001. "CtrlF6ExitShift": 6,
  1002. "SelectWithError": 7,
  1003. "NotifyHostError": 8,
  1004. "RefreshAddinCommands": 9,
  1005. "PageIsReady": 10,
  1006. "TabIn": 11,
  1007. "TabInShift": 12,
  1008. "TabExit": 13,
  1009. "TabExitShift": 14,
  1010. "EscExit": 15,
  1011. "F2Exit": 16,
  1012. "ExitNoFocusable": 17,
  1013. "ExitNoFocusableShift": 18
  1014. };
  1015. OSF.SharedConstants={
  1016. "NotificationConversationIdSuffix": '_ntf'
  1017. };
  1018. OSF.DialogMessageType={
  1019. DialogMessageReceived: 0,
  1020. DialogParentMessageReceived: 1,
  1021. DialogClosed: 12006
  1022. };
  1023. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, clientWindowHeight, clientWindowWidth, addinName, appDomains, dialogRequirementMatrix) {
  1024. this._id=id;
  1025. this._appName=appName;
  1026. this._appVersion=appVersion;
  1027. this._appUILocale=appUILocale;
  1028. this._dataLocale=dataLocale;
  1029. this._docUrl=docUrl;
  1030. this._clientMode=clientMode;
  1031. this._settings=settings;
  1032. this._reason=reason;
  1033. this._osfControlType=osfControlType;
  1034. this._eToken=eToken;
  1035. this._correlationId=correlationId;
  1036. this._appInstanceId=appInstanceId;
  1037. this._touchEnabled=touchEnabled;
  1038. this._commerceAllowed=commerceAllowed;
  1039. this._appMinorVersion=appMinorVersion;
  1040. this._requirementMatrix=requirementMatrix;
  1041. this._hostCustomMessage=hostCustomMessage;
  1042. this._hostFullVersion=hostFullVersion;
  1043. this._isDialog=false;
  1044. this._clientWindowHeight=clientWindowHeight;
  1045. this._clientWindowWidth=clientWindowWidth;
  1046. this._addinName=addinName;
  1047. this._appDomains=appDomains;
  1048. this._dialogRequirementMatrix=dialogRequirementMatrix;
  1049. this.get_id=function get_id() { return this._id; };
  1050. this.get_appName=function get_appName() { return this._appName; };
  1051. this.get_appVersion=function get_appVersion() { return this._appVersion; };
  1052. this.get_appUILocale=function get_appUILocale() { return this._appUILocale; };
  1053. this.get_dataLocale=function get_dataLocale() { return this._dataLocale; };
  1054. this.get_docUrl=function get_docUrl() { return this._docUrl; };
  1055. this.get_clientMode=function get_clientMode() { return this._clientMode; };
  1056. this.get_bindings=function get_bindings() { return this._bindings; };
  1057. this.get_settings=function get_settings() { return this._settings; };
  1058. this.get_reason=function get_reason() { return this._reason; };
  1059. this.get_osfControlType=function get_osfControlType() { return this._osfControlType; };
  1060. this.get_eToken=function get_eToken() { return this._eToken; };
  1061. this.get_correlationId=function get_correlationId() { return this._correlationId; };
  1062. this.get_appInstanceId=function get_appInstanceId() { return this._appInstanceId; };
  1063. this.get_touchEnabled=function get_touchEnabled() { return this._touchEnabled; };
  1064. this.get_commerceAllowed=function get_commerceAllowed() { return this._commerceAllowed; };
  1065. this.get_appMinorVersion=function get_appMinorVersion() { return this._appMinorVersion; };
  1066. this.get_requirementMatrix=function get_requirementMatrix() { return this._requirementMatrix; };
  1067. this.get_dialogRequirementMatrix=function get_dialogRequirementMatrix() { return this._dialogRequirementMatrix; };
  1068. this.get_hostCustomMessage=function get_hostCustomMessage() { return this._hostCustomMessage; };
  1069. this.get_hostFullVersion=function get_hostFullVersion() { return this._hostFullVersion; };
  1070. this.get_isDialog=function get_isDialog() { return this._isDialog; };
  1071. this.get_clientWindowHeight=function get_clientWindowHeight() { return this._clientWindowHeight; };
  1072. this.get_clientWindowWidth=function get_clientWindowWidth() { return this._clientWindowWidth; };
  1073. this.get_addinName=function get_addinName() { return this._addinName; };
  1074. this.get_appDomains=function get_appDomains() { return this._appDomains; };
  1075. };
  1076. OSF.OsfControlType={
  1077. DocumentLevel: 0,
  1078. ContainerLevel: 1
  1079. };
  1080. OSF.ClientMode={
  1081. ReadOnly: 0,
  1082. ReadWrite: 1
  1083. };
  1084. OSF.OUtil.setNamespace("Microsoft", window);
  1085. OSF.OUtil.setNamespace("Office", Microsoft);
  1086. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  1087. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  1088. Microsoft.Office.WebExtension.InitializationReason={
  1089. Inserted: "inserted",
  1090. DocumentOpened: "documentOpened"
  1091. };
  1092. Microsoft.Office.WebExtension.ValueFormat={
  1093. Unformatted: "unformatted",
  1094. Formatted: "formatted"
  1095. };
  1096. Microsoft.Office.WebExtension.FilterType={
  1097. All: "all"
  1098. };
  1099. Microsoft.Office.WebExtension.Parameters={
  1100. BindingType: "bindingType",
  1101. CoercionType: "coercionType",
  1102. ValueFormat: "valueFormat",
  1103. FilterType: "filterType",
  1104. Columns: "columns",
  1105. SampleData: "sampleData",
  1106. GoToType: "goToType",
  1107. SelectionMode: "selectionMode",
  1108. Id: "id",
  1109. PromptText: "promptText",
  1110. ItemName: "itemName",
  1111. FailOnCollision: "failOnCollision",
  1112. StartRow: "startRow",
  1113. StartColumn: "startColumn",
  1114. RowCount: "rowCount",
  1115. ColumnCount: "columnCount",
  1116. Callback: "callback",
  1117. AsyncContext: "asyncContext",
  1118. Data: "data",
  1119. Rows: "rows",
  1120. OverwriteIfStale: "overwriteIfStale",
  1121. FileType: "fileType",
  1122. EventType: "eventType",
  1123. Handler: "handler",
  1124. SliceSize: "sliceSize",
  1125. SliceIndex: "sliceIndex",
  1126. ActiveView: "activeView",
  1127. Status: "status",
  1128. Xml: "xml",
  1129. Namespace: "namespace",
  1130. Prefix: "prefix",
  1131. XPath: "xPath",
  1132. Text: "text",
  1133. ImageLeft: "imageLeft",
  1134. ImageTop: "imageTop",
  1135. ImageWidth: "imageWidth",
  1136. ImageHeight: "imageHeight",
  1137. TaskId: "taskId",
  1138. FieldId: "fieldId",
  1139. FieldValue: "fieldValue",
  1140. ServerUrl: "serverUrl",
  1141. ListName: "listName",
  1142. ResourceId: "resourceId",
  1143. ViewType: "viewType",
  1144. ViewName: "viewName",
  1145. GetRawValue: "getRawValue",
  1146. CellFormat: "cellFormat",
  1147. TableOptions: "tableOptions",
  1148. TaskIndex: "taskIndex",
  1149. ResourceIndex: "resourceIndex",
  1150. CustomFieldId: "customFieldId",
  1151. Url: "url",
  1152. MessageHandler: "messageHandler",
  1153. Width: "width",
  1154. Height: "height",
  1155. RequireHTTPs: "requireHTTPS",
  1156. MessageToParent: "messageToParent",
  1157. DisplayInIframe: "displayInIframe",
  1158. MessageContent: "messageContent"
  1159. };
  1160. OSF.OUtil.setNamespace("DDA", OSF);
  1161. OSF.DDA.DocumentMode={
  1162. ReadOnly: 1,
  1163. ReadWrite: 0
  1164. };
  1165. OSF.DDA.PropertyDescriptors={
  1166. AsyncResultStatus: "AsyncResultStatus"
  1167. };
  1168. OSF.DDA.EventDescriptors={};
  1169. OSF.DDA.ListDescriptors={};
  1170. OSF.DDA.UI={};
  1171. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(id, eventType) {
  1172. if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged ||
  1173. eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged ||
  1174. eventType==Microsoft.Office.WebExtension.EventType.DataNodeDeleted ||
  1175. eventType==Microsoft.Office.WebExtension.EventType.DataNodeInserted ||
  1176. eventType==Microsoft.Office.WebExtension.EventType.DataNodeReplaced) {
  1177. return id+"_"+eventType;
  1178. }
  1179. else {
  1180. return eventType;
  1181. }
  1182. };
  1183. OSF.DDA.MethodDispId={
  1184. dispidMethodMin: 64,
  1185. dispidGetSelectedDataMethod: 64,
  1186. dispidSetSelectedDataMethod: 65,
  1187. dispidAddBindingFromSelectionMethod: 66,
  1188. dispidAddBindingFromPromptMethod: 67,
  1189. dispidGetBindingMethod: 68,
  1190. dispidReleaseBindingMethod: 69,
  1191. dispidGetBindingDataMethod: 70,
  1192. dispidSetBindingDataMethod: 71,
  1193. dispidAddRowsMethod: 72,
  1194. dispidClearAllRowsMethod: 73,
  1195. dispidGetAllBindingsMethod: 74,
  1196. dispidLoadSettingsMethod: 75,
  1197. dispidSaveSettingsMethod: 76,
  1198. dispidGetDocumentCopyMethod: 77,
  1199. dispidAddBindingFromNamedItemMethod: 78,
  1200. dispidAddColumnsMethod: 79,
  1201. dispidGetDocumentCopyChunkMethod: 80,
  1202. dispidReleaseDocumentCopyMethod: 81,
  1203. dispidNavigateToMethod: 82,
  1204. dispidGetActiveViewMethod: 83,
  1205. dispidGetDocumentThemeMethod: 84,
  1206. dispidGetOfficeThemeMethod: 85,
  1207. dispidGetFilePropertiesMethod: 86,
  1208. dispidClearFormatsMethod: 87,
  1209. dispidSetTableOptionsMethod: 88,
  1210. dispidSetFormatsMethod: 89,
  1211. dispidExecuteRichApiRequestMethod: 93,
  1212. dispidAppCommandInvocationCompletedMethod: 94,
  1213. dispidCloseContainerMethod: 97,
  1214. dispidGetSelectedTaskMethod: 110,
  1215. dispidGetSelectedResourceMethod: 111,
  1216. dispidGetTaskMethod: 112,
  1217. dispidGetResourceFieldMethod: 113,
  1218. dispidGetWSSUrlMethod: 114,
  1219. dispidGetTaskFieldMethod: 115,
  1220. dispidGetProjectFieldMethod: 116,
  1221. dispidGetSelectedViewMethod: 117,
  1222. dispidGetTaskByIndexMethod: 118,
  1223. dispidGetResourceByIndexMethod: 119,
  1224. dispidSetTaskFieldMethod: 120,
  1225. dispidSetResourceFieldMethod: 121,
  1226. dispidGetMaxTaskIndexMethod: 122,
  1227. dispidGetMaxResourceIndexMethod: 123,
  1228. dispidCreateTaskMethod: 124,
  1229. dispidAddDataPartMethod: 128,
  1230. dispidGetDataPartByIdMethod: 129,
  1231. dispidGetDataPartsByNamespaceMethod: 130,
  1232. dispidGetDataPartXmlMethod: 131,
  1233. dispidGetDataPartNodesMethod: 132,
  1234. dispidDeleteDataPartMethod: 133,
  1235. dispidGetDataNodeValueMethod: 134,
  1236. dispidGetDataNodeXmlMethod: 135,
  1237. dispidGetDataNodesMethod: 136,
  1238. dispidSetDataNodeValueMethod: 137,
  1239. dispidSetDataNodeXmlMethod: 138,
  1240. dispidAddDataNamespaceMethod: 139,
  1241. dispidGetDataUriByPrefixMethod: 140,
  1242. dispidGetDataPrefixByUriMethod: 141,
  1243. dispidGetDataNodeTextMethod: 142,
  1244. dispidSetDataNodeTextMethod: 143,
  1245. dispidMessageParentMethod: 144,
  1246. dispidSendMessageMethod: 145,
  1247. dispidMethodMax: 145
  1248. };
  1249. OSF.DDA.EventDispId={
  1250. dispidEventMin: 0,
  1251. dispidInitializeEvent: 0,
  1252. dispidSettingsChangedEvent: 1,
  1253. dispidDocumentSelectionChangedEvent: 2,
  1254. dispidBindingSelectionChangedEvent: 3,
  1255. dispidBindingDataChangedEvent: 4,
  1256. dispidDocumentOpenEvent: 5,
  1257. dispidDocumentCloseEvent: 6,
  1258. dispidActiveViewChangedEvent: 7,
  1259. dispidDocumentThemeChangedEvent: 8,
  1260. dispidOfficeThemeChangedEvent: 9,
  1261. dispidDialogMessageReceivedEvent: 10,
  1262. dispidDialogNotificationShownInAddinEvent: 11,
  1263. dispidDialogParentMessageReceivedEvent: 12,
  1264. dispidActivationStatusChangedEvent: 32,
  1265. dispidAppCommandInvokedEvent: 39,
  1266. dispidOlkItemSelectedChangedEvent: 46,
  1267. dispidTaskSelectionChangedEvent: 56,
  1268. dispidResourceSelectionChangedEvent: 57,
  1269. dispidViewSelectionChangedEvent: 58,
  1270. dispidDataNodeAddedEvent: 60,
  1271. dispidDataNodeReplacedEvent: 61,
  1272. dispidDataNodeDeletedEvent: 62,
  1273. dispidEventMax: 63
  1274. };
  1275. OSF.DDA.ErrorCodeManager=(function () {
  1276. var _errorMappings={};
  1277. return {
  1278. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  1279. var errorArgs=_errorMappings[errorCode];
  1280. if (!errorArgs) {
  1281. errorArgs=_errorMappings[this.errorCodes.ooeInternalError];
  1282. }
  1283. else {
  1284. if (!errorArgs.name) {
  1285. errorArgs.name=_errorMappings[this.errorCodes.ooeInternalError].name;
  1286. }
  1287. if (!errorArgs.message) {
  1288. errorArgs.message=_errorMappings[this.errorCodes.ooeInternalError].message;
  1289. }
  1290. }
  1291. return errorArgs;
  1292. },
  1293. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  1294. _errorMappings[errorCode]=errorNameMessage;
  1295. },
  1296. errorCodes: {
  1297. ooeSuccess: 0,
  1298. ooeChunkResult: 1,
  1299. ooeCoercionTypeNotSupported: 1000,
  1300. ooeGetSelectionNotMatchDataType: 1001,
  1301. ooeCoercionTypeNotMatchBinding: 1002,
  1302. ooeInvalidGetRowColumnCounts: 1003,
  1303. ooeSelectionNotSupportCoercionType: 1004,
  1304. ooeInvalidGetStartRowColumn: 1005,
  1305. ooeNonUniformPartialGetNotSupported: 1006,
  1306. ooeGetDataIsTooLarge: 1008,
  1307. ooeFileTypeNotSupported: 1009,
  1308. ooeGetDataParametersConflict: 1010,
  1309. ooeInvalidGetColumns: 1011,
  1310. ooeInvalidGetRows: 1012,
  1311. ooeInvalidReadForBlankRow: 1013,
  1312. ooeUnsupportedDataObject: 2000,
  1313. ooeCannotWriteToSelection: 2001,
  1314. ooeDataNotMatchSelection: 2002,
  1315. ooeOverwriteWorksheetData: 2003,
  1316. ooeDataNotMatchBindingSize: 2004,
  1317. ooeInvalidSetStartRowColumn: 2005,
  1318. ooeInvalidDataFormat: 2006,
  1319. ooeDataNotMatchCoercionType: 2007,
  1320. ooeDataNotMatchBindingType: 2008,
  1321. ooeSetDataIsTooLarge: 2009,
  1322. ooeNonUniformPartialSetNotSupported: 2010,
  1323. ooeInvalidSetColumns: 2011,
  1324. ooeInvalidSetRows: 2012,
  1325. ooeSetDataParametersConflict: 2013,
  1326. ooeCellDataAmountBeyondLimits: 2014,
  1327. ooeSelectionCannotBound: 3000,
  1328. ooeBindingNotExist: 3002,
  1329. ooeBindingToMultipleSelection: 3003,
  1330. ooeInvalidSelectionForBindingType: 3004,
  1331. ooeOperationNotSupportedOnThisBindingType: 3005,
  1332. ooeNamedItemNotFound: 3006,
  1333. ooeMultipleNamedItemFound: 3007,
  1334. ooeInvalidNamedItemForBindingType: 3008,
  1335. ooeUnknownBindingType: 3009,
  1336. ooeOperationNotSupportedOnMatrixData: 3010,
  1337. ooeInvalidColumnsForBinding: 3011,
  1338. ooeSettingNameNotExist: 4000,
  1339. ooeSettingsCannotSave: 4001,
  1340. ooeSettingsAreStale: 4002,
  1341. ooeOperationNotSupported: 5000,
  1342. ooeInternalError: 5001,
  1343. ooeDocumentReadOnly: 5002,
  1344. ooeEventHandlerNotExist: 5003,
  1345. ooeInvalidApiCallInContext: 5004,
  1346. ooeShuttingDown: 5005,
  1347. ooeUnsupportedEnumeration: 5007,
  1348. ooeIndexOutOfRange: 5008,
  1349. ooeBrowserAPINotSupported: 5009,
  1350. ooeInvalidParam: 5010,
  1351. ooeRequestTimeout: 5011,
  1352. ooeTooManyIncompleteRequests: 5100,
  1353. ooeRequestTokenUnavailable: 5101,
  1354. ooeActivityLimitReached: 5102,
  1355. ooeCustomXmlNodeNotFound: 6000,
  1356. ooeCustomXmlError: 6100,
  1357. ooeCustomXmlExceedQuota: 6101,
  1358. ooeCustomXmlOutOfDate: 6102,
  1359. ooeNoCapability: 7000,
  1360. ooeCannotNavTo: 7001,
  1361. ooeSpecifiedIdNotExist: 7002,
  1362. ooeNavOutOfBound: 7004,
  1363. ooeElementMissing: 8000,
  1364. ooeProtectedError: 8001,
  1365. ooeInvalidCellsValue: 8010,
  1366. ooeInvalidTableOptionValue: 8011,
  1367. ooeInvalidFormatValue: 8012,
  1368. ooeRowIndexOutOfRange: 8020,
  1369. ooeColIndexOutOfRange: 8021,
  1370. ooeFormatValueOutOfRange: 8022,
  1371. ooeCellFormatAmountBeyondLimits: 8023,
  1372. ooeMemoryFileLimit: 11000,
  1373. ooeNetworkProblemRetrieveFile: 11001,
  1374. ooeInvalidSliceSize: 11002,
  1375. ooeInvalidCallback: 11101,
  1376. ooeInvalidWidth: 12000,
  1377. ooeInvalidHeight: 12001,
  1378. ooeNavigationError: 12002,
  1379. ooeInvalidScheme: 12003,
  1380. ooeAppDomains: 12004,
  1381. ooeRequireHTTPS: 12005,
  1382. ooeWebDialogClosed: 12006,
  1383. ooeDialogAlreadyOpened: 12007,
  1384. ooeEndUserAllow: 12008,
  1385. ooeEndUserIgnore: 12009,
  1386. ooeNotUILessDialog: 12010,
  1387. ooeCrossZone: 12011
  1388. },
  1389. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1390. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1391. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1392. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1394. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1395. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1396. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1398. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1399. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1400. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1402. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1403. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1404. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1406. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1407. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1408. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1410. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1411. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1412. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1414. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1415. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1416. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1418. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1419. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1420. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1422. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1423. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1424. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1426. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1427. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1428. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1430. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1431. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1432. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1434. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1435. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1436. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1438. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1439. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1440. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1441. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1442. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1443. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1444. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1446. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlExceedQuotaName, message: stringNS.L_CustomXmlExceedQuotaMessage };
  1447. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlOutOfDateName, message: stringNS.L_CustomXmlOutOfDateMessage };
  1448. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1450. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1451. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1452. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1454. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1455. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1456. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1458. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1459. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1460. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1462. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1463. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1464. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1465. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAlreadyOpened };
  1466. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1467. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1468. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NetworkProblem };
  1469. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={ name: stringNS.L_DialogNavigateError, message: stringNS.L_DialogAddressNotTrusted };
  1470. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1471. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1472. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_UserClickIgnore };
  1473. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={ name: stringNS.L_DisplayDialogError, message: stringNS.L_NewWindowCrossZoneErrorString };
  1474. }
  1475. };
  1476. })();
  1477. var OfficeExt;
  1478. (function (OfficeExt) {
  1479. var Requirement;
  1480. (function (Requirement) {
  1481. var RequirementMatrix=(function () {
  1482. function RequirementMatrix(_setMap) {
  1483. this.isSetSupported=function _isSetSupported(name, minVersion) {
  1484. if (name==undefined) {
  1485. return false;
  1486. }
  1487. if (minVersion==undefined) {
  1488. minVersion=0;
  1489. }
  1490. var setSupportArray=this._setMap;
  1491. var sets=setSupportArray._sets;
  1492. if (sets.hasOwnProperty(name.toLowerCase())) {
  1493. var setMaxVersion=sets[name.toLowerCase()];
  1494. return setMaxVersion > 0 && setMaxVersion >=minVersion;
  1495. }
  1496. else {
  1497. return false;
  1498. }
  1499. };
  1500. this._setMap=_setMap;
  1501. this.isSetSupported=this.isSetSupported.bind(this);
  1502. }
  1503. return RequirementMatrix;
  1504. })();
  1505. Requirement.RequirementMatrix=RequirementMatrix;
  1506. var DefaultSetRequirement=(function () {
  1507. function DefaultSetRequirement(setMap) {
  1508. this._addSetMap=function DefaultSetRequirement_addSetMap(addedSet) {
  1509. for (var name in addedSet) {
  1510. this._sets[name]=addedSet[name];
  1511. }
  1512. };
  1513. this._sets=setMap;
  1514. }
  1515. return DefaultSetRequirement;
  1516. })();
  1517. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1518. var DefaultDialogSetRequirement=(function (_super) {
  1519. __extends(DefaultDialogSetRequirement, _super);
  1520. function DefaultDialogSetRequirement() {
  1521. _super.call(this, {
  1522. "dialogapi": 1.1
  1523. });
  1524. }
  1525. return DefaultDialogSetRequirement;
  1526. })(DefaultSetRequirement);
  1527. Requirement.DefaultDialogSetRequirement=DefaultDialogSetRequirement;
  1528. var ExcelClientDefaultSetRequirement=(function (_super) {
  1529. __extends(ExcelClientDefaultSetRequirement, _super);
  1530. function ExcelClientDefaultSetRequirement() {
  1531. _super.call(this, {
  1532. "bindingevents": 1.1,
  1533. "documentevents": 1.1,
  1534. "excelapi": 1.1,
  1535. "matrixbindings": 1.1,
  1536. "matrixcoercion": 1.1,
  1537. "selection": 1.1,
  1538. "settings": 1.1,
  1539. "tablebindings": 1.1,
  1540. "tablecoercion": 1.1,
  1541. "textbindings": 1.1,
  1542. "textcoercion": 1.1
  1543. });
  1544. }
  1545. return ExcelClientDefaultSetRequirement;
  1546. })(DefaultSetRequirement);
  1547. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1548. var ExcelClientV1DefaultSetRequirement=(function (_super) {
  1549. __extends(ExcelClientV1DefaultSetRequirement, _super);
  1550. function ExcelClientV1DefaultSetRequirement() {
  1551. _super.call(this);
  1552. this._addSetMap({
  1553. "imagecoercion": 1.1
  1554. });
  1555. }
  1556. return ExcelClientV1DefaultSetRequirement;
  1557. })(ExcelClientDefaultSetRequirement);
  1558. Requirement.ExcelClientV1DefaultSetRequirement=ExcelClientV1DefaultSetRequirement;
  1559. var OutlookClientDefaultSetRequirement=(function (_super) {
  1560. __extends(OutlookClientDefaultSetRequirement, _super);
  1561. function OutlookClientDefaultSetRequirement() {
  1562. _super.call(this, {
  1563. "mailbox": 1.3
  1564. });
  1565. }
  1566. return OutlookClientDefaultSetRequirement;
  1567. })(DefaultSetRequirement);
  1568. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1569. var WordClientDefaultSetRequirement=(function (_super) {
  1570. __extends(WordClientDefaultSetRequirement, _super);
  1571. function WordClientDefaultSetRequirement() {
  1572. _super.call(this, {
  1573. "bindingevents": 1.1,
  1574. "compressedfile": 1.1,
  1575. "customxmlparts": 1.1,
  1576. "documentevents": 1.1,
  1577. "file": 1.1,
  1578. "htmlcoercion": 1.1,
  1579. "matrixbindings": 1.1,
  1580. "matrixcoercion": 1.1,
  1581. "ooxmlcoercion": 1.1,
  1582. "pdffile": 1.1,
  1583. "selection": 1.1,
  1584. "settings": 1.1,
  1585. "tablebindings": 1.1,
  1586. "tablecoercion": 1.1,
  1587. "textbindings": 1.1,
  1588. "textcoercion": 1.1,
  1589. "textfile": 1.1,
  1590. "wordapi": 1.1
  1591. });
  1592. }
  1593. return WordClientDefaultSetRequirement;
  1594. })(DefaultSetRequirement);
  1595. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1596. var WordClientV1DefaultSetRequirement=(function (_super) {
  1597. __extends(WordClientV1DefaultSetRequirement, _super);
  1598. function WordClientV1DefaultSetRequirement() {
  1599. _super.call(this);
  1600. this._addSetMap({
  1601. "customxmlparts": 1.2,
  1602. "wordapi": 1.2,
  1603. "imagecoercion": 1.1
  1604. });
  1605. }
  1606. return WordClientV1DefaultSetRequirement;
  1607. })(WordClientDefaultSetRequirement);
  1608. Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement;
  1609. var PowerpointClientDefaultSetRequirement=(function (_super) {
  1610. __extends(PowerpointClientDefaultSetRequirement, _super);
  1611. function PowerpointClientDefaultSetRequirement() {
  1612. _super.call(this, {
  1613. "activeview": 1.1,
  1614. "compressedfile": 1.1,
  1615. "documentevents": 1.1,
  1616. "file": 1.1,
  1617. "pdffile": 1.1,
  1618. "selection": 1.1,
  1619. "settings": 1.1,
  1620. "textcoercion": 1.1
  1621. });
  1622. }
  1623. return PowerpointClientDefaultSetRequirement;
  1624. })(DefaultSetRequirement);
  1625. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1626. var PowerpointClientV1DefaultSetRequirement=(function (_super) {
  1627. __extends(PowerpointClientV1DefaultSetRequirement, _super);
  1628. function PowerpointClientV1DefaultSetRequirement() {
  1629. _super.call(this);
  1630. this._addSetMap({
  1631. "imagecoercion": 1.1
  1632. });
  1633. }
  1634. return PowerpointClientV1DefaultSetRequirement;
  1635. })(PowerpointClientDefaultSetRequirement);
  1636. Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement;
  1637. var ProjectClientDefaultSetRequirement=(function (_super) {
  1638. __extends(ProjectClientDefaultSetRequirement, _super);
  1639. function ProjectClientDefaultSetRequirement() {
  1640. _super.call(this, {
  1641. "selection": 1.1,
  1642. "textcoercion": 1.1
  1643. });
  1644. }
  1645. return ProjectClientDefaultSetRequirement;
  1646. })(DefaultSetRequirement);
  1647. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1648. var ExcelWebDefaultSetRequirement=(function (_super) {
  1649. __extends(ExcelWebDefaultSetRequirement, _super);
  1650. function ExcelWebDefaultSetRequirement() {
  1651. _super.call(this, {
  1652. "bindingevents": 1.1,
  1653. "documentevents": 1.1,
  1654. "matrixbindings": 1.1,
  1655. "matrixcoercion": 1.1,
  1656. "selection": 1.1,
  1657. "settings": 1.1,
  1658. "tablebindings": 1.1,
  1659. "tablecoercion": 1.1,
  1660. "textbindings": 1.1,
  1661. "textcoercion": 1.1,
  1662. "file": 1.1
  1663. });
  1664. }
  1665. return ExcelWebDefaultSetRequirement;
  1666. })(DefaultSetRequirement);
  1667. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1668. var WordWebDefaultSetRequirement=(function (_super) {
  1669. __extends(WordWebDefaultSetRequirement, _super);
  1670. function WordWebDefaultSetRequirement() {
  1671. _super.call(this, {
  1672. "compressedfile": 1.1,
  1673. "documentevents": 1.1,
  1674. "file": 1.1,
  1675. "imagecoercion": 1.1,
  1676. "matrixcoercion": 1.1,
  1677. "ooxmlcoercion": 1.1,
  1678. "pdffile": 1.1,
  1679. "selection": 1.1,
  1680. "settings": 1.1,
  1681. "tablecoercion": 1.1,
  1682. "textcoercion": 1.1,
  1683. "textfile": 1.1
  1684. });
  1685. }
  1686. return WordWebDefaultSetRequirement;
  1687. })(DefaultSetRequirement);
  1688. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1689. var PowerpointWebDefaultSetRequirement=(function (_super) {
  1690. __extends(PowerpointWebDefaultSetRequirement, _super);
  1691. function PowerpointWebDefaultSetRequirement() {
  1692. _super.call(this, {
  1693. "activeview": 1.1,
  1694. "settings": 1.1
  1695. });
  1696. }
  1697. return PowerpointWebDefaultSetRequirement;
  1698. })(DefaultSetRequirement);
  1699. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1700. var OutlookWebDefaultSetRequirement=(function (_super) {
  1701. __extends(OutlookWebDefaultSetRequirement, _super);
  1702. function OutlookWebDefaultSetRequirement() {
  1703. _super.call(this, {
  1704. "mailbox": 1.3
  1705. });
  1706. }
  1707. return OutlookWebDefaultSetRequirement;
  1708. })(DefaultSetRequirement);
  1709. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1710. var SwayWebDefaultSetRequirement=(function (_super) {
  1711. __extends(SwayWebDefaultSetRequirement, _super);
  1712. function SwayWebDefaultSetRequirement() {
  1713. _super.call(this, {
  1714. "activeview": 1.1,
  1715. "documentevents": 1.1,
  1716. "selection": 1.1,
  1717. "settings": 1.1,
  1718. "textcoercion": 1.1
  1719. });
  1720. }
  1721. return SwayWebDefaultSetRequirement;
  1722. })(DefaultSetRequirement);
  1723. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1724. var AccessWebDefaultSetRequirement=(function (_super) {
  1725. __extends(AccessWebDefaultSetRequirement, _super);
  1726. function AccessWebDefaultSetRequirement() {
  1727. _super.call(this, {
  1728. "bindingevents": 1.1,
  1729. "partialtablebindings": 1.1,
  1730. "settings": 1.1,
  1731. "tablebindings": 1.1,
  1732. "tablecoercion": 1.1
  1733. });
  1734. }
  1735. return AccessWebDefaultSetRequirement;
  1736. })(DefaultSetRequirement);
  1737. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1738. var ExcelIOSDefaultSetRequirement=(function (_super) {
  1739. __extends(ExcelIOSDefaultSetRequirement, _super);
  1740. function ExcelIOSDefaultSetRequirement() {
  1741. _super.call(this, {
  1742. "bindingevents": 1.1,
  1743. "documentevents": 1.1,
  1744. "matrixbindings": 1.1,
  1745. "matrixcoercion": 1.1,
  1746. "selection": 1.1,
  1747. "settings": 1.1,
  1748. "tablebindings": 1.1,
  1749. "tablecoercion": 1.1,
  1750. "textbindings": 1.1,
  1751. "textcoercion": 1.1
  1752. });
  1753. }
  1754. return ExcelIOSDefaultSetRequirement;
  1755. })(DefaultSetRequirement);
  1756. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1757. var WordIOSDefaultSetRequirement=(function (_super) {
  1758. __extends(WordIOSDefaultSetRequirement, _super);
  1759. function WordIOSDefaultSetRequirement() {
  1760. _super.call(this, {
  1761. "bindingevents": 1.1,
  1762. "compressedfile": 1.1,
  1763. "customxmlparts": 1.1,
  1764. "documentevents": 1.1,
  1765. "file": 1.1,
  1766. "htmlcoercion": 1.1,
  1767. "matrixbindings": 1.1,
  1768. "matrixcoercion": 1.1,
  1769. "ooxmlcoercion": 1.1,
  1770. "pdffile": 1.1,
  1771. "selection": 1.1,
  1772. "settings": 1.1,
  1773. "tablebindings": 1.1,
  1774. "tablecoercion": 1.1,
  1775. "textbindings": 1.1,
  1776. "textcoercion": 1.1,
  1777. "textfile": 1.1
  1778. });
  1779. }
  1780. return WordIOSDefaultSetRequirement;
  1781. })(DefaultSetRequirement);
  1782. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1783. var WordIOSV1DefaultSetRequirement=(function (_super) {
  1784. __extends(WordIOSV1DefaultSetRequirement, _super);
  1785. function WordIOSV1DefaultSetRequirement() {
  1786. _super.call(this);
  1787. this._addSetMap({
  1788. "customxmlparts": 1.2,
  1789. "wordapi": 1.2
  1790. });
  1791. }
  1792. return WordIOSV1DefaultSetRequirement;
  1793. })(WordIOSDefaultSetRequirement);
  1794. Requirement.WordIOSV1DefaultSetRequirement=WordIOSV1DefaultSetRequirement;
  1795. var PowerpointIOSDefaultSetRequirement=(function (_super) {
  1796. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1797. function PowerpointIOSDefaultSetRequirement() {
  1798. _super.call(this, {
  1799. "activeview": 1.1,
  1800. "compressedfile": 1.1,
  1801. "documentevents": 1.1,
  1802. "file": 1.1,
  1803. "pdffile": 1.1,
  1804. "selection": 1.1,
  1805. "settings": 1.1,
  1806. "textcoercion": 1.1
  1807. });
  1808. }
  1809. return PowerpointIOSDefaultSetRequirement;
  1810. })(DefaultSetRequirement);
  1811. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1812. var OutlookIOSDefaultSetRequirement=(function (_super) {
  1813. __extends(OutlookIOSDefaultSetRequirement, _super);
  1814. function OutlookIOSDefaultSetRequirement() {
  1815. _super.call(this, {
  1816. "mailbox": 1.1
  1817. });
  1818. }
  1819. return OutlookIOSDefaultSetRequirement;
  1820. })(DefaultSetRequirement);
  1821. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1822. var RequirementsMatrixFactory=(function () {
  1823. function RequirementsMatrixFactory() {
  1824. }
  1825. RequirementsMatrixFactory.initializeOsfDda=function () {
  1826. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1827. };
  1828. RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) {
  1829. this.initializeDefaultSetMatrix();
  1830. var defaultRequirementMatrix=undefined;
  1831. var clientRequirement=appContext.get_requirementMatrix();
  1832. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1833. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1834. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1835. }
  1836. else {
  1837. var appLocator=RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1838. if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) {
  1839. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1840. }
  1841. else {
  1842. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}));
  1843. }
  1844. }
  1845. return defaultRequirementMatrix;
  1846. };
  1847. RequirementsMatrixFactory.getDefaultDialogRequirementMatrix=function (appContext) {
  1848. var defaultRequirementMatrix=undefined;
  1849. var clientRequirement=appContext.get_dialogRequirementMatrix();
  1850. if (clientRequirement !=undefined && clientRequirement.length > 0 && typeof (JSON) !=="undefined") {
  1851. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1852. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1853. }
  1854. else {
  1855. defaultRequirementMatrix=new RequirementMatrix(new DefaultDialogSetRequirement());
  1856. }
  1857. return defaultRequirementMatrix;
  1858. };
  1859. RequirementsMatrixFactory.getClientFullVersionString=function (appContext) {
  1860. var appMinorVersion=appContext.get_appMinorVersion();
  1861. var appMinorVersionString="";
  1862. var appFullVersion="";
  1863. var appName=appContext.get_appName();
  1864. var isIOSClient=appName==1024 ||
  1865. appName==4096 ||
  1866. appName==8192 ||
  1867. appName==65536;
  1868. if (isIOSClient && appContext.get_appVersion()==1) {
  1869. if (appName==4096 && appMinorVersion >=15) {
  1870. appFullVersion="16.00.01";
  1871. }
  1872. else {
  1873. appFullVersion="16.00";
  1874. }
  1875. }
  1876. else if (appContext.get_appName()==64) {
  1877. appFullVersion=appContext.get_appVersion();
  1878. }
  1879. else {
  1880. if (appMinorVersion < 10) {
  1881. appMinorVersionString="0"+appMinorVersion;
  1882. }
  1883. else {
  1884. appMinorVersionString=""+appMinorVersion;
  1885. }
  1886. appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString;
  1887. }
  1888. return appContext.get_appName()+"-"+appFullVersion;
  1889. };
  1890. RequirementsMatrixFactory.initializeDefaultSetMatrix=function () {
  1891. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement();
  1892. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement();
  1893. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement();
  1894. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601]=new ExcelClientV1DefaultSetRequirement();
  1895. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601]=new WordClientV1DefaultSetRequirement();
  1896. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601]=new PowerpointClientV1DefaultSetRequirement();
  1897. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement();
  1898. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement();
  1899. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement();
  1900. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement();
  1901. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement();
  1902. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement();
  1903. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement();
  1904. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement();
  1905. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement();
  1906. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement();
  1907. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement();
  1908. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001]=new WordIOSV1DefaultSetRequirement();
  1909. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement();
  1910. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement();
  1911. };
  1912. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  1913. RequirementsMatrixFactory.Excel_RCLIENT_1601="1-16.01";
  1914. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  1915. RequirementsMatrixFactory.Word_RCLIENT_1601="2-16.01";
  1916. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  1917. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601="4-16.01";
  1918. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  1919. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  1920. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  1921. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  1922. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  1923. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  1924. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  1925. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  1926. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.00";
  1927. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  1928. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  1929. RequirementsMatrixFactory.Word_IOS_16001="4096-16.00.01";
  1930. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  1931. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  1932. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  1933. return RequirementsMatrixFactory;
  1934. })();
  1935. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory;
  1936. })(Requirement=OfficeExt.Requirement || (OfficeExt.Requirement={}));
  1937. })(OfficeExt || (OfficeExt={}));
  1938. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1939. Microsoft.Office.WebExtension.ApplicationMode={
  1940. WebEditor: "webEditor",
  1941. WebViewer: "webViewer",
  1942. Client: "client"
  1943. };
  1944. Microsoft.Office.WebExtension.DocumentMode={
  1945. ReadOnly: "readOnly",
  1946. ReadWrite: "readWrite"
  1947. };
  1948. OSF.NamespaceManager=(function OSF_NamespaceManager() {
  1949. var _userOffice;
  1950. var _useShortcut=false;
  1951. return {
  1952. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1953. if (!_useShortcut) {
  1954. if (window.Office) {
  1955. _userOffice=window.Office;
  1956. }
  1957. else {
  1958. OSF.OUtil.setNamespace("Office", window);
  1959. }
  1960. window.Office=Microsoft.Office.WebExtension;
  1961. _useShortcut=true;
  1962. }
  1963. },
  1964. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1965. if (_useShortcut) {
  1966. if (_userOffice) {
  1967. window.Office=_userOffice;
  1968. }
  1969. else {
  1970. OSF.OUtil.unsetNamespace("Office", window);
  1971. }
  1972. _useShortcut=false;
  1973. }
  1974. }
  1975. };
  1976. })();
  1977. OSF.NamespaceManager.enableShortcut();
  1978. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1979. if (useShortcut) {
  1980. OSF.NamespaceManager.enableShortcut();
  1981. }
  1982. else {
  1983. OSF.NamespaceManager.disableShortcut();
  1984. }
  1985. };
  1986. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1987. var promise;
  1988. if (str && typeof str=="string") {
  1989. var index=str.indexOf("#");
  1990. if (index !=-1) {
  1991. var op=str.substring(0, index);
  1992. var target=str.substring(index+1);
  1993. switch (op) {
  1994. case "binding":
  1995. case "bindings":
  1996. if (target) {
  1997. promise=new OSF.DDA.BindingPromise(target);
  1998. }
  1999. break;
  2000. }
  2001. }
  2002. }
  2003. if (!promise) {
  2004. if (errorCallback) {
  2005. var callbackType=typeof errorCallback;
  2006. if (callbackType=="function") {
  2007. var callArgs={};
  2008. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  2009. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  2010. }
  2011. else {
  2012. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  2013. }
  2014. }
  2015. }
  2016. else {
  2017. promise.onFail=errorCallback;
  2018. return promise;
  2019. }
  2020. };
  2021. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  2022. OSF.OUtil.defineEnumerableProperties(this, {
  2023. "contentLanguage": {
  2024. value: officeAppContext.get_dataLocale()
  2025. },
  2026. "displayLanguage": {
  2027. value: officeAppContext.get_appUILocale()
  2028. },
  2029. "touchEnabled": {
  2030. value: officeAppContext.get_touchEnabled()
  2031. },
  2032. "commerceAllowed": {
  2033. value: officeAppContext.get_commerceAllowed()
  2034. }
  2035. });
  2036. if (license) {
  2037. OSF.OUtil.defineEnumerableProperty(this, "license", {
  2038. value: license
  2039. });
  2040. }
  2041. if (officeAppContext.ui) {
  2042. OSF.OUtil.defineEnumerableProperty(this, "ui", {
  2043. value: officeAppContext.ui
  2044. });
  2045. }
  2046. if (officeAppContext.get_isDialog()) {
  2047. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(officeAppContext);
  2048. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2049. value: requirements
  2050. });
  2051. }
  2052. else {
  2053. if (document) {
  2054. OSF.OUtil.defineEnumerableProperty(this, "document", {
  2055. value: document
  2056. });
  2057. }
  2058. if (appOM) {
  2059. var displayName=appOM.displayName || "appOM";
  2060. delete appOM.displayName;
  2061. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  2062. value: appOM
  2063. });
  2064. }
  2065. if (getOfficeTheme) {
  2066. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  2067. get: function () {
  2068. return getOfficeTheme();
  2069. }
  2070. });
  2071. }
  2072. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2073. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2074. value: requirements
  2075. });
  2076. }
  2077. };
  2078. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  2079. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  2080. if (settings) {
  2081. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  2082. value: settings
  2083. });
  2084. }
  2085. };
  2086. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  2087. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) { };
  2088. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) {
  2089. var mode;
  2090. switch (officeAppContext.get_clientMode()) {
  2091. case OSF.ClientMode.ReadOnly:
  2092. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2093. break;
  2094. case OSF.ClientMode.ReadWrite:
  2095. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2096. break;
  2097. }
  2098. ;
  2099. if (settings) {
  2100. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  2101. value: settings
  2102. });
  2103. }
  2104. ;
  2105. OSF.OUtil.defineMutableProperties(this, {
  2106. "mode": {
  2107. value: mode
  2108. },
  2109. "url": {
  2110. value: officeAppContext.get_docUrl()
  2111. }
  2112. });
  2113. };
  2114. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  2115. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  2116. if (bindingFacade) {
  2117. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  2118. get: function OSF_DDA_Document$GetBindings() { return bindingFacade; }
  2119. });
  2120. }
  2121. var am=OSF.DDA.AsyncMethodNames;
  2122. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2123. am.GetSelectedDataAsync,
  2124. am.SetSelectedDataAsync
  2125. ]);
  2126. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  2127. };
  2128. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  2129. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  2130. get: function Microsoft_Office_WebExtension$GetContext() {
  2131. var context;
  2132. if (OSF && OSF._OfficeAppFactory) {
  2133. context=OSF._OfficeAppFactory.getContext();
  2134. }
  2135. return context;
  2136. }
  2137. });
  2138. OSF.DDA.License=function OSF_DDA_License(eToken) {
  2139. OSF.OUtil.defineEnumerableProperty(this, "value", {
  2140. value: eToken
  2141. });
  2142. };
  2143. OSF.DDA.ApiMethodCall=function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2144. var requiredCount=requiredParameters.length;
  2145. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () {
  2146. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  2147. });
  2148. this.verifyArguments=function OSF_DDA_ApiMethodCall$VerifyArguments(params, args) {
  2149. for (var name in params) {
  2150. var param=params[name];
  2151. var arg=args[name];
  2152. if (param["enum"]) {
  2153. switch (typeof arg) {
  2154. case "string":
  2155. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  2156. break;
  2157. }
  2158. case "undefined":
  2159. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2160. default:
  2161. throw getInvalidParameterString();
  2162. }
  2163. }
  2164. if (param["types"]) {
  2165. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  2166. throw getInvalidParameterString();
  2167. }
  2168. }
  2169. }
  2170. };
  2171. this.extractRequiredArguments=function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  2172. if (userArgs.length < requiredCount) {
  2173. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2174. }
  2175. var requiredArgs=[];
  2176. var index;
  2177. for (index=0; index < requiredCount; index++) {
  2178. requiredArgs.push(userArgs[index]);
  2179. }
  2180. this.verifyArguments(requiredParameters, requiredArgs);
  2181. var ret={};
  2182. for (index=0; index < requiredCount; index++) {
  2183. var param=requiredParameters[index];
  2184. var arg=requiredArgs[index];
  2185. if (param.verify) {
  2186. var isValid=param.verify(arg, caller, stateInfo);
  2187. if (!isValid) {
  2188. throw getInvalidParameterString();
  2189. }
  2190. }
  2191. ret[param.name]=arg;
  2192. }
  2193. return ret;
  2194. },
  2195. this.fillOptions=function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo) {
  2196. options=options || {};
  2197. for (var optionName in supportedOptions) {
  2198. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  2199. var value=undefined;
  2200. var option=supportedOptions[optionName];
  2201. if (option.calculate && requiredArgs) {
  2202. value=option.calculate(requiredArgs, caller, stateInfo);
  2203. }
  2204. if (!value && option.defaultValue !==undefined) {
  2205. value=option.defaultValue;
  2206. }
  2207. options[optionName]=value;
  2208. }
  2209. }
  2210. return options;
  2211. };
  2212. this.constructCallArgs=function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo) {
  2213. var callArgs={};
  2214. for (var r in required) {
  2215. callArgs[r]=required[r];
  2216. }
  2217. for (var o in options) {
  2218. callArgs[o]=options[o];
  2219. }
  2220. for (var s in privateStateCallbacks) {
  2221. callArgs[s]=privateStateCallbacks[s](caller, stateInfo);
  2222. }
  2223. if (checkCallArgs) {
  2224. callArgs=checkCallArgs(callArgs, caller, stateInfo);
  2225. }
  2226. return callArgs;
  2227. };
  2228. };
  2229. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  2230. OSF.DDA.AsyncResultEnum.Properties={
  2231. Context: "Context",
  2232. Value: "Value",
  2233. Status: "Status",
  2234. Error: "Error"
  2235. };
  2236. Microsoft.Office.WebExtension.AsyncResultStatus={
  2237. Succeeded: "succeeded",
  2238. Failed: "failed"
  2239. };
  2240. OSF.DDA.AsyncResultEnum.ErrorCode={
  2241. Success: 0,
  2242. Failed: 1
  2243. };
  2244. OSF.DDA.AsyncResultEnum.ErrorProperties={
  2245. Name: "Name",
  2246. Message: "Message",
  2247. Code: "Code"
  2248. };
  2249. OSF.DDA.AsyncMethodNames={};
  2250. OSF.DDA.AsyncMethodNames.addNames=function (methodNames) {
  2251. for (var entry in methodNames) {
  2252. var am={};
  2253. OSF.OUtil.defineEnumerableProperties(am, {
  2254. "id": {
  2255. value: entry
  2256. },
  2257. "displayName": {
  2258. value: methodNames[entry]
  2259. }
  2260. });
  2261. OSF.DDA.AsyncMethodNames[entry]=am;
  2262. }
  2263. };
  2264. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  2265. var requiredCount=requiredParameters.length;
  2266. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2267. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2268. if (userArgs.length > requiredCount+2) {
  2269. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2270. }
  2271. var options, parameterCallback;
  2272. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2273. var argument=userArgs[i];
  2274. switch (typeof argument) {
  2275. case "object":
  2276. if (options) {
  2277. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2278. }
  2279. else {
  2280. options=argument;
  2281. }
  2282. break;
  2283. case "function":
  2284. if (parameterCallback) {
  2285. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2286. }
  2287. else {
  2288. parameterCallback=argument;
  2289. }
  2290. break;
  2291. default:
  2292. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2293. break;
  2294. }
  2295. }
  2296. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2297. if (parameterCallback) {
  2298. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  2299. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2300. }
  2301. else {
  2302. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2303. }
  2304. }
  2305. apiMethods.verifyArguments(supportedOptions, options);
  2306. return options;
  2307. }
  2308. ;
  2309. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2310. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2311. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2312. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2313. return callArgs;
  2314. };
  2315. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  2316. var payload;
  2317. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2318. if (onSucceeded) {
  2319. payload=onSucceeded(response, caller, callArgs);
  2320. }
  2321. else {
  2322. payload=response;
  2323. }
  2324. }
  2325. else {
  2326. if (onFailed) {
  2327. payload=onFailed(status, response);
  2328. }
  2329. else {
  2330. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2331. }
  2332. }
  2333. return payload;
  2334. };
  2335. this.getCallArgs=function (suppliedArgs) {
  2336. var options, parameterCallback;
  2337. for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) {
  2338. var argument=suppliedArgs[i];
  2339. switch (typeof argument) {
  2340. case "object":
  2341. options=argument;
  2342. break;
  2343. case "function":
  2344. parameterCallback=argument;
  2345. break;
  2346. }
  2347. }
  2348. options=options || {};
  2349. if (parameterCallback) {
  2350. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2351. }
  2352. return options;
  2353. };
  2354. };
  2355. OSF.DDA.AsyncMethodCallFactory=(function () {
  2356. return {
  2357. manufacture: function (params) {
  2358. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2359. var privateStateCallbacks=params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2360. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  2361. }
  2362. };
  2363. })();
  2364. OSF.DDA.AsyncMethodCalls={};
  2365. OSF.DDA.AsyncMethodCalls.define=function (callDefinition) {
  2366. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  2367. };
  2368. OSF.DDA.Error=function OSF_DDA_Error(name, message, code) {
  2369. OSF.OUtil.defineEnumerableProperties(this, {
  2370. "name": {
  2371. value: name
  2372. },
  2373. "message": {
  2374. value: message
  2375. },
  2376. "code": {
  2377. value: code
  2378. }
  2379. });
  2380. };
  2381. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  2382. OSF.OUtil.defineEnumerableProperties(this, {
  2383. "value": {
  2384. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  2385. },
  2386. "status": {
  2387. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  2388. }
  2389. });
  2390. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  2391. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  2392. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  2393. });
  2394. }
  2395. if (errorArgs) {
  2396. OSF.OUtil.defineEnumerableProperty(this, "error", {
  2397. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  2398. });
  2399. }
  2400. };
  2401. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  2402. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2403. if (callback) {
  2404. var asyncInitArgs={};
  2405. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2406. var errorArgs;
  2407. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2408. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  2409. }
  2410. else {
  2411. errorArgs={};
  2412. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2413. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2414. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  2415. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  2416. }
  2417. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  2418. }
  2419. };
  2420. OSF.DDA.SyncMethodNames={};
  2421. OSF.DDA.SyncMethodNames.addNames=function (methodNames) {
  2422. for (var entry in methodNames) {
  2423. var am={};
  2424. OSF.OUtil.defineEnumerableProperties(am, {
  2425. "id": {
  2426. value: entry
  2427. },
  2428. "displayName": {
  2429. value: methodNames[entry]
  2430. }
  2431. });
  2432. OSF.DDA.SyncMethodNames[entry]=am;
  2433. }
  2434. };
  2435. OSF.DDA.SyncMethodCall=function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2436. var requiredCount=requiredParameters.length;
  2437. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2438. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2439. if (userArgs.length > requiredCount+1) {
  2440. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2441. }
  2442. var options, parameterCallback;
  2443. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  2444. var argument=userArgs[i];
  2445. switch (typeof argument) {
  2446. case "object":
  2447. if (options) {
  2448. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2449. }
  2450. else {
  2451. options=argument;
  2452. }
  2453. break;
  2454. default:
  2455. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2456. break;
  2457. }
  2458. }
  2459. options=apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2460. apiMethods.verifyArguments(supportedOptions, options);
  2461. return options;
  2462. }
  2463. ;
  2464. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2465. var required=apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2466. var options=OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2467. var callArgs=apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2468. return callArgs;
  2469. };
  2470. };
  2471. OSF.DDA.SyncMethodCallFactory=(function () {
  2472. return {
  2473. manufacture: function (params) {
  2474. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2475. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [], supportedOptions, params.privateStateCallbacks, params.checkCallArgs, params.method.displayName);
  2476. }
  2477. };
  2478. })();
  2479. OSF.DDA.SyncMethodCalls={};
  2480. OSF.DDA.SyncMethodCalls.define=function (callDefinition) {
  2481. OSF.DDA.SyncMethodCalls[callDefinition.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition);
  2482. };
  2483. OSF.DDA.ListType=(function () {
  2484. var listTypes={};
  2485. return {
  2486. setListType: function OSF_DDA_ListType$AddListType(t, prop) { listTypes[t]=prop; },
  2487. isListType: function OSF_DDA_ListType$IsListType(t) { return OSF.OUtil.listContainsKey(listTypes, t); },
  2488. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { return listTypes[t]; }
  2489. };
  2490. })();
  2491. OSF.DDA.HostParameterMap=function (specialProcessor, mappings) {
  2492. var toHostMap="toHost";
  2493. var fromHostMap="fromHost";
  2494. var sourceData="sourceData";
  2495. var self="self";
  2496. var dynamicTypes={};
  2497. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  2498. toHost: function (data) {
  2499. if (data !=null && data.rows !==undefined) {
  2500. var tableData={};
  2501. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  2502. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  2503. data=tableData;
  2504. }
  2505. return data;
  2506. },
  2507. fromHost: function (args) {
  2508. return args;
  2509. }
  2510. };
  2511. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2512. function mapValues(preimageSet, mapping) {
  2513. var ret=preimageSet ? {} : undefined;
  2514. for (var entry in preimageSet) {
  2515. var preimage=preimageSet[entry];
  2516. var image;
  2517. if (OSF.DDA.ListType.isListType(entry)) {
  2518. image=[];
  2519. for (var subEntry in preimage) {
  2520. image.push(mapValues(preimage[subEntry], mapping));
  2521. }
  2522. }
  2523. else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  2524. image=dynamicTypes[entry][mapping](preimage);
  2525. }
  2526. else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) {
  2527. image=mapValues(preimage, mapping);
  2528. }
  2529. else {
  2530. var maps=mappings[entry];
  2531. if (maps) {
  2532. var map=maps[mapping];
  2533. if (map) {
  2534. image=map[preimage];
  2535. if (image===undefined) {
  2536. image=preimage;
  2537. }
  2538. }
  2539. }
  2540. else {
  2541. image=preimage;
  2542. }
  2543. }
  2544. ret[entry]=image;
  2545. }
  2546. return ret;
  2547. }
  2548. ;
  2549. function generateArguments(imageSet, parameters) {
  2550. var ret;
  2551. for (var param in parameters) {
  2552. var arg;
  2553. if (specialProcessor.isComplexType(param)) {
  2554. arg=generateArguments(imageSet, mappings[param][toHostMap]);
  2555. }
  2556. else {
  2557. arg=imageSet[param];
  2558. }
  2559. if (arg !=undefined) {
  2560. if (!ret) {
  2561. ret={};
  2562. }
  2563. var index=parameters[param];
  2564. if (index==self) {
  2565. index=param;
  2566. }
  2567. ret[index]=specialProcessor.pack(param, arg);
  2568. }
  2569. }
  2570. return ret;
  2571. }
  2572. ;
  2573. function extractArguments(source, parameters, extracted) {
  2574. if (!extracted) {
  2575. extracted={};
  2576. }
  2577. for (var param in parameters) {
  2578. var index=parameters[param];
  2579. var value;
  2580. if (index==self) {
  2581. value=source;
  2582. }
  2583. else if (index==sourceData) {
  2584. extracted[param]=source.toArray();
  2585. continue;
  2586. }
  2587. else {
  2588. value=source[index];
  2589. }
  2590. if (value===null || value===undefined) {
  2591. extracted[param]=undefined;
  2592. }
  2593. else {
  2594. value=specialProcessor.unpack(param, value);
  2595. var map;
  2596. if (specialProcessor.isComplexType(param)) {
  2597. map=mappings[param][fromHostMap];
  2598. if (specialProcessor.preserveNesting(param)) {
  2599. extracted[param]=extractArguments(value, map);
  2600. }
  2601. else {
  2602. extractArguments(value, map, extracted);
  2603. }
  2604. }
  2605. else {
  2606. if (OSF.DDA.ListType.isListType(param)) {
  2607. map={};
  2608. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2609. map[entryDescriptor]=self;
  2610. var extractedValues=new Array(value.length);
  2611. for (var item in value) {
  2612. extractedValues[item]=extractArguments(value[item], map);
  2613. }
  2614. extracted[param]=extractedValues;
  2615. }
  2616. else {
  2617. extracted[param]=value;
  2618. }
  2619. }
  2620. }
  2621. }
  2622. return extracted;
  2623. }
  2624. ;
  2625. function applyMap(mapName, preimage, mapping) {
  2626. var parameters=mappings[mapName][mapping];
  2627. var image;
  2628. if (mapping=="toHost") {
  2629. var imageSet=mapValues(preimage, mapping);
  2630. image=generateArguments(imageSet, parameters);
  2631. }
  2632. else if (mapping=="fromHost") {
  2633. var argumentSet=extractArguments(preimage, parameters);
  2634. image=mapValues(argumentSet, mapping);
  2635. }
  2636. return image;
  2637. }
  2638. ;
  2639. if (!mappings) {
  2640. mappings={};
  2641. }
  2642. this.addMapping=function (mapName, description) {
  2643. var toHost, fromHost;
  2644. if (description.map) {
  2645. toHost=description.map;
  2646. fromHost={};
  2647. for (var preimage in toHost) {
  2648. var image=toHost[preimage];
  2649. if (image==self) {
  2650. image=preimage;
  2651. }
  2652. fromHost[image]=preimage;
  2653. }
  2654. }
  2655. else {
  2656. toHost=description.toHost;
  2657. fromHost=description.fromHost;
  2658. }
  2659. var pair=mappings[mapName];
  2660. if (pair) {
  2661. var currMap=pair[toHostMap];
  2662. for (var th in currMap)
  2663. toHost[th]=currMap[th];
  2664. currMap=pair[fromHostMap];
  2665. for (var fh in currMap)
  2666. fromHost[fh]=currMap[fh];
  2667. }
  2668. else {
  2669. pair=mappings[mapName]={};
  2670. }
  2671. pair[toHostMap]=toHost;
  2672. pair[fromHostMap]=fromHost;
  2673. };
  2674. this.toHost=function (mapName, preimage) { return applyMap(mapName, preimage, toHostMap); };
  2675. this.fromHost=function (mapName, image) { return applyMap(mapName, image, fromHostMap); };
  2676. this.self=self;
  2677. this.sourceData=sourceData;
  2678. this.addComplexType=function (ct) { specialProcessor.addComplexType(ct); };
  2679. this.getDynamicType=function (dt) { return specialProcessor.getDynamicType(dt); };
  2680. this.setDynamicType=function (dt, handler) { specialProcessor.setDynamicType(dt, handler); };
  2681. this.dynamicTypes=dynamicTypes;
  2682. this.doMapValues=function (preimageSet, mapping) { return mapValues(preimageSet, mapping); };
  2683. };
  2684. OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) {
  2685. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2686. complexTypes.push(ct);
  2687. };
  2688. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2689. return dynamicTypes[dt];
  2690. };
  2691. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2692. dynamicTypes[dt]=handler;
  2693. };
  2694. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2695. return OSF.OUtil.listContainsValue(complexTypes, t);
  2696. };
  2697. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2698. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2699. };
  2700. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2701. var pn=[];
  2702. if (OSF.DDA.PropertyDescriptors)
  2703. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2704. if (OSF.DDA.DataNodeEventProperties) {
  2705. pn=pn.concat([
  2706. OSF.DDA.DataNodeEventProperties.OldNode,
  2707. OSF.DDA.DataNodeEventProperties.NewNode,
  2708. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2709. ]);
  2710. }
  2711. return OSF.OUtil.listContainsValue(pn, p);
  2712. };
  2713. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2714. var value;
  2715. if (this.isDynamicType(param)) {
  2716. value=dynamicTypes[param].toHost(arg);
  2717. }
  2718. else {
  2719. value=arg;
  2720. }
  2721. return value;
  2722. };
  2723. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2724. var value;
  2725. if (this.isDynamicType(param)) {
  2726. value=dynamicTypes[param].fromHost(arg);
  2727. }
  2728. else {
  2729. value=arg;
  2730. }
  2731. return value;
  2732. };
  2733. };
  2734. OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) {
  2735. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2736. var self=parameterMap.self;
  2737. function createObject(properties) {
  2738. var obj=null;
  2739. if (properties) {
  2740. obj={};
  2741. var len=properties.length;
  2742. for (var i=0; i < len; i++) {
  2743. obj[properties[i].name]=properties[i].value;
  2744. }
  2745. }
  2746. return obj;
  2747. }
  2748. parameterMap.define=function define(definition) {
  2749. var args={};
  2750. var toHost=createObject(definition.toHost);
  2751. if (definition.invertible) {
  2752. args.map=toHost;
  2753. }
  2754. else if (definition.canonical) {
  2755. args.toHost=args.fromHost=toHost;
  2756. }
  2757. else {
  2758. args.toHost=toHost;
  2759. args.fromHost=createObject(definition.fromHost);
  2760. }
  2761. parameterMap.addMapping(definition.type, args);
  2762. if (definition.isComplexType)
  2763. parameterMap.addComplexType(definition.type);
  2764. };
  2765. for (var id in initialDefs)
  2766. parameterMap.define(initialDefs[id]);
  2767. return parameterMap;
  2768. };
  2769. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2770. OSF.DDA.DispIdHost.Methods={
  2771. InvokeMethod: "invokeMethod",
  2772. AddEventHandler: "addEventHandler",
  2773. RemoveEventHandler: "removeEventHandler",
  2774. OpenDialog: "openDialog",
  2775. CloseDialog: "closeDialog",
  2776. MessageParent: "messageParent",
  2777. SendMessage: "sendMessage"
  2778. };
  2779. OSF.DDA.DispIdHost.Delegates={
  2780. ExecuteAsync: "executeAsync",
  2781. RegisterEventAsync: "registerEventAsync",
  2782. UnregisterEventAsync: "unregisterEventAsync",
  2783. ParameterMap: "parameterMap",
  2784. OpenDialog: "openDialog",
  2785. CloseDialog: "closeDialog",
  2786. MessageParent: "messageParent",
  2787. SendMessage: "sendMessage"
  2788. };
  2789. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2790. var dispIdMap={};
  2791. var jsom=OSF.DDA.AsyncMethodNames;
  2792. var did=OSF.DDA.MethodDispId;
  2793. var methodMap={
  2794. "GoToByIdAsync": did.dispidNavigateToMethod,
  2795. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2796. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2797. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2798. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2799. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2800. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2801. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2802. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2803. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2804. "GetByIdAsync": did.dispidGetBindingMethod,
  2805. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2806. "GetDataAsync": did.dispidGetBindingDataMethod,
  2807. "SetDataAsync": did.dispidSetBindingDataMethod,
  2808. "AddRowsAsync": did.dispidAddRowsMethod,
  2809. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2810. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2811. "RefreshAsync": did.dispidLoadSettingsMethod,
  2812. "SaveAsync": did.dispidSaveSettingsMethod,
  2813. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2814. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2815. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2816. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2817. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2818. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2819. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2820. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2821. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2822. "CloseContainerAsync": did.dispidCloseContainerMethod,
  2823. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2824. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2825. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2826. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2827. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2828. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2829. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2830. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2831. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2832. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2833. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2834. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2835. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2836. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2837. "GetNodeTextAsync": did.dispidGetDataNodeTextMethod,
  2838. "SetNodeTextAsync": did.dispidSetDataNodeTextMethod,
  2839. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2840. "GetTask": did.dispidGetTaskMethod,
  2841. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2842. "GetTaskField": did.dispidGetTaskFieldMethod,
  2843. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2844. "GetResourceField": did.dispidGetResourceFieldMethod,
  2845. "GetProjectField": did.dispidGetProjectFieldMethod,
  2846. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2847. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2848. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2849. "SetTaskField": did.dispidSetTaskFieldMethod,
  2850. "SetResourceField": did.dispidSetResourceFieldMethod,
  2851. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2852. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod,
  2853. "CreateTask": did.dispidCreateTaskMethod
  2854. };
  2855. for (var method in methodMap) {
  2856. if (jsom[method]) {
  2857. dispIdMap[jsom[method].id]=methodMap[method];
  2858. }
  2859. }
  2860. jsom=OSF.DDA.SyncMethodNames;
  2861. did=OSF.DDA.MethodDispId;
  2862. var asyncMethodMap={
  2863. "MessageParent": did.dispidMessageParentMethod,
  2864. "SendMessage": did.dispidSendMessageMethod
  2865. };
  2866. for (var method in asyncMethodMap) {
  2867. if (jsom[method]) {
  2868. dispIdMap[jsom[method].id]=asyncMethodMap[method];
  2869. }
  2870. }
  2871. jsom=Microsoft.Office.WebExtension.EventType;
  2872. did=OSF.DDA.EventDispId;
  2873. var eventMap={
  2874. "SettingsChanged": did.dispidSettingsChangedEvent,
  2875. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2876. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2877. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2878. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2879. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2880. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2881. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2882. "DialogMessageReceived": did.dispidDialogMessageReceivedEvent,
  2883. "DialogParentMessageReceived": did.dispidDialogParentMessageReceivedEvent,
  2884. "ItemChanged": did.dispidOlkItemSelectedChangedEvent,
  2885. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2886. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2887. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2888. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2889. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2890. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2891. };
  2892. for (var event in eventMap) {
  2893. if (jsom[event]) {
  2894. dispIdMap[jsom[event]]=eventMap[event];
  2895. }
  2896. }
  2897. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2898. if (typeof ex=="number") {
  2899. if (!callArgs) {
  2900. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2901. }
  2902. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2903. }
  2904. else {
  2905. throw ex;
  2906. }
  2907. }
  2908. ;
  2909. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2910. var callArgs;
  2911. try {
  2912. var methodName=method.id;
  2913. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2914. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2915. var dispId=dispIdMap[methodName];
  2916. var delegate=getDelegateMethods(methodName);
  2917. var richApiInExcelMethodSubstitution=null;
  2918. if (window.Excel && window.Office.context.requirements.isSetSupported("RedirectV1Api")) {
  2919. window.Excel._RedirectV1APIs=true;
  2920. }
  2921. if (window.Excel && window.Excel._RedirectV1APIs && (richApiInExcelMethodSubstitution=window.Excel._V1APIMap[methodName])) {
  2922. if (richApiInExcelMethodSubstitution.preprocess) {
  2923. callArgs=richApiInExcelMethodSubstitution.preprocess(callArgs);
  2924. }
  2925. var ctx=new window.Excel.RequestContext();
  2926. var result=richApiInExcelMethodSubstitution.call(ctx, callArgs);
  2927. ctx.sync()
  2928. .then(function () {
  2929. var response=result.value;
  2930. var status=response.status;
  2931. delete response["status"];
  2932. delete response["@odata.type"];
  2933. if (richApiInExcelMethodSubstitution.postprocess) {
  2934. response=richApiInExcelMethodSubstitution.postprocess(response, callArgs);
  2935. }
  2936. if (status !=0) {
  2937. response=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2938. }
  2939. OSF.DDA.issueAsyncResult(callArgs, status, response);
  2940. })["catch"](function (error) {
  2941. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeFailure, null);
  2942. });
  2943. }
  2944. else {
  2945. var hostCallArgs;
  2946. if (parameterMap.toHost) {
  2947. hostCallArgs=parameterMap.toHost(dispId, callArgs);
  2948. }
  2949. else {
  2950. hostCallArgs=callArgs;
  2951. }
  2952. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2953. "dispId": dispId,
  2954. "hostCallArgs": hostCallArgs,
  2955. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { },
  2956. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { },
  2957. "onComplete": function (status, hostResponseArgs) {
  2958. var responseArgs;
  2959. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2960. if (parameterMap.fromHost) {
  2961. responseArgs=parameterMap.fromHost(dispId, hostResponseArgs);
  2962. }
  2963. else {
  2964. responseArgs=hostResponseArgs;
  2965. }
  2966. }
  2967. else {
  2968. responseArgs=hostResponseArgs;
  2969. }
  2970. var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2971. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2972. }
  2973. });
  2974. }
  2975. }
  2976. catch (ex) {
  2977. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2978. }
  2979. };
  2980. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2981. var callArgs;
  2982. var eventType, handler;
  2983. function onEnsureRegistration(status) {
  2984. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2985. var added=eventDispatch.addEventHandler(eventType, handler);
  2986. if (!added) {
  2987. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2988. }
  2989. }
  2990. var error;
  2991. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2992. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2993. }
  2994. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2995. }
  2996. try {
  2997. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2998. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2999. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3000. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3001. if (eventDispatch.getEventHandlerCount(eventType)==0) {
  3002. var dispId=dispIdMap[eventType];
  3003. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3004. invoker({
  3005. "eventType": eventType,
  3006. "dispId": dispId,
  3007. "targetId": caller.id || "",
  3008. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3009. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3010. "onComplete": onEnsureRegistration,
  3011. "onEvent": function handleEvent(hostArgs) {
  3012. var args=parameterMap.fromHost(dispId, hostArgs);
  3013. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  3014. }
  3015. });
  3016. }
  3017. else {
  3018. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  3019. }
  3020. }
  3021. catch (ex) {
  3022. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3023. }
  3024. };
  3025. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  3026. var callArgs;
  3027. var eventType, handler;
  3028. function onEnsureRegistration(status) {
  3029. var error;
  3030. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3031. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3032. }
  3033. OSF.DDA.issueAsyncResult(callArgs, status, error);
  3034. }
  3035. try {
  3036. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  3037. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3038. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3039. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3040. var status, removeSuccess;
  3041. if (handler===null) {
  3042. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  3043. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3044. }
  3045. else {
  3046. removeSuccess=eventDispatch.removeEventHandler(eventType, handler);
  3047. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  3048. }
  3049. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) {
  3050. var dispId=dispIdMap[eventType];
  3051. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3052. invoker({
  3053. "eventType": eventType,
  3054. "dispId": dispId,
  3055. "targetId": caller.id || "",
  3056. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3057. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3058. "onComplete": onEnsureRegistration
  3059. });
  3060. }
  3061. else {
  3062. onEnsureRegistration(status);
  3063. }
  3064. }
  3065. catch (ex) {
  3066. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3067. }
  3068. };
  3069. this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller) {
  3070. var callArgs;
  3071. var targetId;
  3072. var dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3073. var dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3074. function onEnsureRegistration(status) {
  3075. var payload;
  3076. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3077. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3078. }
  3079. else {
  3080. var onSucceedArgs={};
  3081. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id]=targetId;
  3082. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data]=eventDispatch;
  3083. var payload=asyncMethodCall.processResponse(status, onSucceedArgs, caller, callArgs);
  3084. OSF.DialogShownStatus.hasDialogShown=true;
  3085. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3086. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3087. }
  3088. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  3089. }
  3090. try {
  3091. if (dialogMessageEvent==undefined || dialogOtherEvent==undefined) {
  3092. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3093. }
  3094. if (OSF.DDA.AsyncMethodNames.DisplayDialogAsync==null) {
  3095. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3096. return;
  3097. }
  3098. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3099. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3100. var dispId=dispIdMap[dialogMessageEvent];
  3101. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3102. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] !=undefined ?
  3103. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] :
  3104. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3105. targetId=JSON.stringify(callArgs);
  3106. invoker({
  3107. "eventType": dialogMessageEvent,
  3108. "dispId": dispId,
  3109. "targetId": targetId,
  3110. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3111. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3112. "onComplete": onEnsureRegistration,
  3113. "onEvent": function handleEvent(hostArgs) {
  3114. var args=parameterMap.fromHost(dispId, hostArgs);
  3115. var event=OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent, caller, args);
  3116. if (event.type==dialogOtherEvent) {
  3117. var payload=OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3118. var errorArgs={};
  3119. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3120. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  3121. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  3122. event.error=new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]);
  3123. }
  3124. eventDispatch.fireOrQueueEvent(event);
  3125. if (args[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed) {
  3126. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3127. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3128. eventDispatch.clearEventHandlers(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived);
  3129. OSF.DialogShownStatus.hasDialogShown=false;
  3130. }
  3131. }
  3132. });
  3133. }
  3134. catch (ex) {
  3135. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3136. }
  3137. };
  3138. this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller) {
  3139. var callArgs;
  3140. var dialogMessageEvent, dialogOtherEvent;
  3141. var closeStatus=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3142. function closeCallback(status) {
  3143. closeStatus=status;
  3144. OSF.DialogShownStatus.hasDialogShown=false;
  3145. }
  3146. try {
  3147. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3148. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3149. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3150. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3151. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3152. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3153. var dispId=dispIdMap[dialogMessageEvent];
  3154. var delegateMethods=getDelegateMethods(dialogMessageEvent);
  3155. var invoker=delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] !=undefined ?
  3156. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] :
  3157. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3158. invoker({
  3159. "eventType": dialogMessageEvent,
  3160. "dispId": dispId,
  3161. "targetId": targetId,
  3162. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3163. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3164. "onComplete": closeCallback
  3165. });
  3166. }
  3167. catch (ex) {
  3168. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3169. }
  3170. if (closeStatus !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3171. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed, OSF.DDA.AsyncMethodNames.CloseAsync.displayName, closeStatus);
  3172. }
  3173. };
  3174. this[OSF.DDA.DispIdHost.Methods.MessageParent]=function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller) {
  3175. var stateInfo={};
  3176. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3177. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3178. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3179. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3180. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.MessageParent.id];
  3181. return invoker({
  3182. "dispId": dispId,
  3183. "hostCallArgs": callArgs,
  3184. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3185. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3186. });
  3187. };
  3188. this[OSF.DDA.DispIdHost.Methods.SendMessage]=function OSF_DDA_DispIdHost_Facade$SendMessage(suppliedArguments, eventDispatch, caller) {
  3189. var stateInfo={};
  3190. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.SendMessage.id];
  3191. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3192. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.SendMessage.id);
  3193. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.SendMessage];
  3194. var dispId=dispIdMap[OSF.DDA.SyncMethodNames.SendMessage.id];
  3195. return invoker({
  3196. "dispId": dispId,
  3197. "hostCallArgs": callArgs,
  3198. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3199. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3200. });
  3201. };
  3202. };
  3203. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  3204. for (var entry in asyncMethodNames) {
  3205. var method=asyncMethodNames[entry];
  3206. var name=method.displayName;
  3207. if (!target[name]) {
  3208. OSF.OUtil.defineEnumerableProperty(target, name, {
  3209. value: (function (asyncMethod) {
  3210. return function () {
  3211. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3212. invokeMethod(asyncMethod, arguments, target, privateState);
  3213. };
  3214. })(method)
  3215. });
  3216. }
  3217. }
  3218. };
  3219. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  3220. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3221. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3222. if (!target[add]) {
  3223. OSF.OUtil.defineEnumerableProperty(target, add, {
  3224. value: function () {
  3225. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3226. addEventHandler(arguments, eventDispatch, target);
  3227. }
  3228. });
  3229. }
  3230. if (!target[remove]) {
  3231. OSF.OUtil.defineEnumerableProperty(target, remove, {
  3232. value: function () {
  3233. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3234. removeEventHandler(arguments, eventDispatch, target);
  3235. }
  3236. });
  3237. }
  3238. };
  3239. var OfficeExt;
  3240. (function (OfficeExt) {
  3241. var MsAjaxTypeHelper=(function () {
  3242. function MsAjaxTypeHelper() {
  3243. }
  3244. MsAjaxTypeHelper.isInstanceOfType=function (type, instance) {
  3245. if (typeof (instance)==="undefined" || instance===null)
  3246. return false;
  3247. if (instance instanceof type)
  3248. return true;
  3249. var instanceType=instance.constructor;
  3250. if (!instanceType || (typeof (instanceType) !=="function") || !instanceType.__typeName || instanceType.__typeName==='Object') {
  3251. instanceType=Object;
  3252. }
  3253. return !!(instanceType===type) ||
  3254. (instanceType.__typeName && type.__typeName && instanceType.__typeName===type.__typeName);
  3255. };
  3256. return MsAjaxTypeHelper;
  3257. })();
  3258. OfficeExt.MsAjaxTypeHelper=MsAjaxTypeHelper;
  3259. var MsAjaxError=(function () {
  3260. function MsAjaxError() {
  3261. }
  3262. MsAjaxError.create=function (message, errorInfo) {
  3263. var err=new Error(message);
  3264. err.message=message;
  3265. if (errorInfo) {
  3266. for (var v in errorInfo) {
  3267. err[v]=errorInfo[v];
  3268. }
  3269. }
  3270. err.popStackFrame();
  3271. return err;
  3272. };
  3273. MsAjaxError.parameterCount=function (message) {
  3274. var displayMessage="Sys.ParameterCountException: "+(message ? message : "Parameter count mismatch.");
  3275. var err=MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3276. err.popStackFrame();
  3277. return err;
  3278. };
  3279. MsAjaxError.argument=function (paramName, message) {
  3280. var displayMessage="Sys.ArgumentException: "+(message ? message : "Value does not fall within the expected range.");
  3281. if (paramName) {
  3282. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3283. }
  3284. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3285. err.popStackFrame();
  3286. return err;
  3287. };
  3288. MsAjaxError.argumentNull=function (paramName, message) {
  3289. var displayMessage="Sys.ArgumentNullException: "+(message ? message : "Value cannot be null.");
  3290. if (paramName) {
  3291. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3292. }
  3293. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3294. err.popStackFrame();
  3295. return err;
  3296. };
  3297. MsAjaxError.argumentOutOfRange=function (paramName, actualValue, message) {
  3298. var displayMessage="Sys.ArgumentOutOfRangeException: "+(message ? message : "Specified argument was out of the range of valid values.");
  3299. if (paramName) {
  3300. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3301. }
  3302. if (typeof (actualValue) !=="undefined" && actualValue !==null) {
  3303. displayMessage+="\n"+MsAjaxString.format("Actual value was {0}.", actualValue);
  3304. }
  3305. var err=MsAjaxError.create(displayMessage, {
  3306. name: "Sys.ArgumentOutOfRangeException",
  3307. paramName: paramName,
  3308. actualValue: actualValue
  3309. });
  3310. err.popStackFrame();
  3311. return err;
  3312. };
  3313. MsAjaxError.argumentType=function (paramName, actualType, expectedType, message) {
  3314. var displayMessage="Sys.ArgumentTypeException: ";
  3315. if (message) {
  3316. displayMessage+=message;
  3317. }
  3318. else if (actualType && expectedType) {
  3319. displayMessage+=MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3320. }
  3321. else {
  3322. displayMessage+="Object cannot be converted to the required type.";
  3323. }
  3324. if (paramName) {
  3325. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3326. }
  3327. var err=MsAjaxError.create(displayMessage, {
  3328. name: "Sys.ArgumentTypeException",
  3329. paramName: paramName,
  3330. actualType: actualType,
  3331. expectedType: expectedType
  3332. });
  3333. err.popStackFrame();
  3334. return err;
  3335. };
  3336. MsAjaxError.argumentUndefined=function (paramName, message) {
  3337. var displayMessage="Sys.ArgumentUndefinedException: "+(message ? message : "Value cannot be undefined.");
  3338. if (paramName) {
  3339. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3340. }
  3341. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3342. err.popStackFrame();
  3343. return err;
  3344. };
  3345. MsAjaxError.invalidOperation=function (message) {
  3346. var displayMessage="Sys.InvalidOperationException: "+(message ? message : "Operation is not valid due to the current state of the object.");
  3347. var err=MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3348. err.popStackFrame();
  3349. return err;
  3350. };
  3351. return MsAjaxError;
  3352. })();
  3353. OfficeExt.MsAjaxError=MsAjaxError;
  3354. var MsAjaxString=(function () {
  3355. function MsAjaxString() {
  3356. }
  3357. MsAjaxString.format=function (format) {
  3358. var args=[];
  3359. for (var _i=1; _i < arguments.length; _i++) {
  3360. args[_i - 1]=arguments[_i];
  3361. }
  3362. var source=format;
  3363. return source.replace(/{(\d+)}/gm, function (match, number) {
  3364. var index=parseInt(number, 10);
  3365. return args[index]===undefined ? '{'+number+'}' : args[index];
  3366. });
  3367. };
  3368. MsAjaxString.startsWith=function (str, prefix) {
  3369. return (str.substr(0, prefix.length)===prefix);
  3370. };
  3371. return MsAjaxString;
  3372. })();
  3373. OfficeExt.MsAjaxString=MsAjaxString;
  3374. var MsAjaxDebug=(function () {
  3375. function MsAjaxDebug() {
  3376. }
  3377. MsAjaxDebug.trace=function (text) {
  3378. if (typeof Debug !=="undefined" && Debug.writeln)
  3379. Debug.writeln(text);
  3380. if (window.console && window.console.log)
  3381. window.console.log(text);
  3382. if (window.opera && window.opera.postError)
  3383. window.opera.postError(text);
  3384. if (window.debugService && window.debugService.trace)
  3385. window.debugService.trace(text);
  3386. var a=document.getElementById("TraceConsole");
  3387. if (a && a.tagName.toUpperCase()==="TEXTAREA") {
  3388. a.innerHTML+=text+"\n";
  3389. }
  3390. };
  3391. return MsAjaxDebug;
  3392. })();
  3393. OfficeExt.MsAjaxDebug=MsAjaxDebug;
  3394. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3395. var registerTypeInternal=function registerTypeInternal(type, name, isClass) {
  3396. if (type.__typeName===undefined) {
  3397. type.__typeName=name;
  3398. }
  3399. if (type.__class===undefined) {
  3400. type.__class=isClass;
  3401. }
  3402. };
  3403. registerTypeInternal(Function, "Function", true);
  3404. registerTypeInternal(Error, "Error", true);
  3405. registerTypeInternal(Object, "Object", true);
  3406. registerTypeInternal(String, "String", true);
  3407. registerTypeInternal(Boolean, "Boolean", true);
  3408. registerTypeInternal(Date, "Date", true);
  3409. registerTypeInternal(Number, "Number", true);
  3410. registerTypeInternal(RegExp, "RegExp", true);
  3411. registerTypeInternal(Array, "Array", true);
  3412. if (!Function.createCallback) {
  3413. Function.createCallback=function Function$createCallback(method, context) {
  3414. var e=Function._validateParams(arguments, [
  3415. { name: "method", type: Function },
  3416. { name: "context", mayBeNull: true }
  3417. ]);
  3418. if (e)
  3419. throw e;
  3420. return function () {
  3421. var l=arguments.length;
  3422. if (l > 0) {
  3423. var args=[];
  3424. for (var i=0; i < l; i++) {
  3425. args[i]=arguments[i];
  3426. }
  3427. args[l]=context;
  3428. return method.apply(this, args);
  3429. }
  3430. return method.call(this, context);
  3431. };
  3432. };
  3433. }
  3434. if (!Function.createDelegate) {
  3435. Function.createDelegate=function Function$createDelegate(instance, method) {
  3436. var e=Function._validateParams(arguments, [
  3437. { name: "instance", mayBeNull: true },
  3438. { name: "method", type: Function }
  3439. ]);
  3440. if (e)
  3441. throw e;
  3442. return function () {
  3443. return method.apply(instance, arguments);
  3444. };
  3445. };
  3446. }
  3447. if (!Function._validateParams) {
  3448. Function._validateParams=function (params, expectedParams, validateParameterCount) {
  3449. var e, expectedLength=expectedParams.length;
  3450. validateParameterCount=validateParameterCount || (typeof (validateParameterCount)==="undefined");
  3451. e=Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3452. if (e) {
  3453. e.popStackFrame();
  3454. return e;
  3455. }
  3456. for (var i=0, l=params.length; i < l; i++) {
  3457. var expectedParam=expectedParams[Math.min(i, expectedLength - 1)], paramName=expectedParam.name;
  3458. if (expectedParam.parameterArray) {
  3459. paramName+="["+(i - expectedLength+1)+"]";
  3460. }
  3461. else if (!validateParameterCount && (i >=expectedLength)) {
  3462. break;
  3463. }
  3464. e=Function._validateParameter(params[i], expectedParam, paramName);
  3465. if (e) {
  3466. e.popStackFrame();
  3467. return e;
  3468. }
  3469. }
  3470. return null;
  3471. };
  3472. }
  3473. if (!Function._validateParameterCount) {
  3474. Function._validateParameterCount=function (params, expectedParams, validateParameterCount) {
  3475. var i, error, expectedLen=expectedParams.length, actualLen=params.length;
  3476. if (actualLen < expectedLen) {
  3477. var minParams=expectedLen;
  3478. for (i=0; i < expectedLen; i++) {
  3479. var param=expectedParams[i];
  3480. if (param.optional || param.parameterArray) {
  3481. minParams--;
  3482. }
  3483. }
  3484. if (actualLen < minParams) {
  3485. error=true;
  3486. }
  3487. }
  3488. else if (validateParameterCount && (actualLen > expectedLen)) {
  3489. error=true;
  3490. for (i=0; i < expectedLen; i++) {
  3491. if (expectedParams[i].parameterArray) {
  3492. error=false;
  3493. break;
  3494. }
  3495. }
  3496. }
  3497. if (error) {
  3498. var e=MsAjaxError.parameterCount();
  3499. e.popStackFrame();
  3500. return e;
  3501. }
  3502. return null;
  3503. };
  3504. }
  3505. if (!Function._validateParameter) {
  3506. Function._validateParameter=function (param, expectedParam, paramName) {
  3507. var e, expectedType=expectedParam.type, expectedInteger=!!expectedParam.integer, expectedDomElement=!!expectedParam.domElement, mayBeNull=!!expectedParam.mayBeNull;
  3508. e=Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3509. if (e) {
  3510. e.popStackFrame();
  3511. return e;
  3512. }
  3513. var expectedElementType=expectedParam.elementType, elementMayBeNull=!!expectedParam.elementMayBeNull;
  3514. if (expectedType===Array && typeof (param) !=="undefined" && param !==null &&
  3515. (expectedElementType || !elementMayBeNull)) {
  3516. var expectedElementInteger=!!expectedParam.elementInteger, expectedElementDomElement=!!expectedParam.elementDomElement;
  3517. for (var i=0; i < param.length; i++) {
  3518. var elem=param[i];
  3519. e=Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName+"["+i+"]");
  3520. if (e) {
  3521. e.popStackFrame();
  3522. return e;
  3523. }
  3524. }
  3525. }
  3526. return null;
  3527. };
  3528. }
  3529. if (!Function._validateParameterType) {
  3530. Function._validateParameterType=function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3531. var e, i;
  3532. if (typeof (param)==="undefined") {
  3533. if (mayBeNull) {
  3534. return null;
  3535. }
  3536. else {
  3537. e=OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3538. e.popStackFrame();
  3539. return e;
  3540. }
  3541. }
  3542. if (param===null) {
  3543. if (mayBeNull) {
  3544. return null;
  3545. }
  3546. else {
  3547. e=OfficeExt.MsAjaxError.argumentNull(paramName);
  3548. e.popStackFrame();
  3549. return e;
  3550. }
  3551. }
  3552. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3553. e=OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3554. e.popStackFrame();
  3555. return e;
  3556. }
  3557. return null;
  3558. };
  3559. }
  3560. if (!window.Type) {
  3561. window.Type=Function;
  3562. }
  3563. if (!Type.registerNamespace) {
  3564. Type.registerNamespace=function (ns) {
  3565. var namespaceParts=ns.split('.');
  3566. var currentNamespace=window;
  3567. for (var i=0; i < namespaceParts.length; i++) {
  3568. currentNamespace[namespaceParts[i]]=currentNamespace[namespaceParts[i]] || {};
  3569. currentNamespace=currentNamespace[namespaceParts[i]];
  3570. }
  3571. };
  3572. }
  3573. if (!Type.prototype.registerClass) {
  3574. Type.prototype.registerClass=function (cls) { cls={}; };
  3575. }
  3576. if (typeof (Sys)==="undefined") {
  3577. Type.registerNamespace('Sys');
  3578. }
  3579. if (!Error.prototype.popStackFrame) {
  3580. Error.prototype.popStackFrame=function () {
  3581. if (arguments.length !==0)
  3582. throw MsAjaxError.parameterCount();
  3583. if (typeof (this.stack)==="undefined" || this.stack===null ||
  3584. typeof (this.fileName)==="undefined" || this.fileName===null ||
  3585. typeof (this.lineNumber)==="undefined" || this.lineNumber===null) {
  3586. return;
  3587. }
  3588. var stackFrames=this.stack.split("\n");
  3589. var currentFrame=stackFrames[0];
  3590. var pattern=this.fileName+":"+this.lineNumber;
  3591. while (typeof (currentFrame) !=="undefined" &&
  3592. currentFrame !==null &&
  3593. currentFrame.indexOf(pattern)===-1) {
  3594. stackFrames.shift();
  3595. currentFrame=stackFrames[0];
  3596. }
  3597. var nextFrame=stackFrames[1];
  3598. if (typeof (nextFrame)==="undefined" || nextFrame===null) {
  3599. return;
  3600. }
  3601. var nextFrameParts=nextFrame.match(/@(.*):(\d+)$/);
  3602. if (typeof (nextFrameParts)==="undefined" || nextFrameParts===null) {
  3603. return;
  3604. }
  3605. this.fileName=nextFrameParts[1];
  3606. this.lineNumber=parseInt(nextFrameParts[2]);
  3607. stackFrames.shift();
  3608. this.stack=stackFrames.join("\n");
  3609. };
  3610. }
  3611. OsfMsAjaxFactory.msAjaxError=MsAjaxError;
  3612. OsfMsAjaxFactory.msAjaxString=MsAjaxString;
  3613. OsfMsAjaxFactory.msAjaxDebug=MsAjaxDebug;
  3614. }
  3615. })(OfficeExt || (OfficeExt={}));
  3616. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  3617. OSF.DDA.SafeArray.Response={
  3618. Status: 0,
  3619. Payload: 1
  3620. };
  3621. OSF.DDA.SafeArray.UniqueArguments={
  3622. Offset: "offset",
  3623. Run: "run",
  3624. BindingSpecificData: "bindingSpecificData",
  3625. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3626. };
  3627. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  3628. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  3629. var status;
  3630. var statusNumber=ex.number;
  3631. if (statusNumber) {
  3632. switch (statusNumber) {
  3633. case -2146828218:
  3634. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3635. break;
  3636. case -2147467259:
  3637. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3638. break;
  3639. case -2146828283:
  3640. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3641. break;
  3642. case -2147209089:
  3643. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3644. break;
  3645. case -2146827850:
  3646. default:
  3647. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3648. break;
  3649. }
  3650. }
  3651. if (args.onComplete) {
  3652. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3653. }
  3654. };
  3655. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod=function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args) {
  3656. var status;
  3657. var number=ex.number;
  3658. if (number) {
  3659. switch (number) {
  3660. case -2146828218:
  3661. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3662. break;
  3663. case -2146827850:
  3664. default:
  3665. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3666. break;
  3667. }
  3668. }
  3669. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3670. };
  3671. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  3672. function _2DVBArrayToJaggedArray(vbArr) {
  3673. var ret;
  3674. try {
  3675. var rows=vbArr.ubound(1);
  3676. var cols=vbArr.ubound(2);
  3677. vbArr=vbArr.toArray();
  3678. if (rows==1 && cols==1) {
  3679. ret=[vbArr];
  3680. }
  3681. else {
  3682. ret=[];
  3683. for (var row=0; row < rows; row++) {
  3684. var rowArr=[];
  3685. for (var col=0; col < cols; col++) {
  3686. var datum=vbArr[row * cols+col];
  3687. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  3688. rowArr.push(datum);
  3689. }
  3690. }
  3691. if (rowArr.length > 0) {
  3692. ret.push(rowArr);
  3693. }
  3694. }
  3695. }
  3696. }
  3697. catch (ex) {
  3698. }
  3699. return ret;
  3700. }
  3701. var complexTypes=[];
  3702. var dynamicTypes={};
  3703. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  3704. var tableRows=0;
  3705. var tableHeaders=1;
  3706. return {
  3707. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  3708. if (OSF.DDA.TableDataProperties && typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  3709. var tableData=[];
  3710. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  3711. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  3712. data=tableData;
  3713. }
  3714. return data;
  3715. },
  3716. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  3717. var ret;
  3718. if (hostArgs.toArray) {
  3719. var dimensions=hostArgs.dimensions();
  3720. if (dimensions===2) {
  3721. ret=_2DVBArrayToJaggedArray(hostArgs);
  3722. }
  3723. else {
  3724. var array=hostArgs.toArray();
  3725. if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  3726. ret={};
  3727. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  3728. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  3729. }
  3730. else {
  3731. ret=array;
  3732. }
  3733. }
  3734. }
  3735. else {
  3736. ret=hostArgs;
  3737. }
  3738. return ret;
  3739. }
  3740. };
  3741. })();
  3742. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  3743. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  3744. var value;
  3745. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  3746. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  3747. value=toArraySupported ? arg.toArray() : arg || {};
  3748. }
  3749. else if (this.isDynamicType(param)) {
  3750. value=dynamicTypes[param].fromHost(arg);
  3751. }
  3752. else {
  3753. value=arg;
  3754. }
  3755. return value;
  3756. };
  3757. };
  3758. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  3759. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  3760. {
  3761. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3762. toHost: [
  3763. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  3764. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  3765. ]
  3766. },
  3767. {
  3768. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3769. toHost: [
  3770. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  3771. ]
  3772. }
  3773. ]);
  3774. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3775. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3776. fromHost: [
  3777. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  3778. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  3779. ]
  3780. });
  3781. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  3782. function toArray(args) {
  3783. var arrArgs=args;
  3784. if (OSF.OUtil.isArray(args)) {
  3785. var len=arrArgs.length;
  3786. for (var i=0; i < len; i++) {
  3787. arrArgs[i]=toArray(arrArgs[i]);
  3788. }
  3789. }
  3790. else if (OSF.OUtil.isDate(args)) {
  3791. arrArgs=args.getVarDate();
  3792. }
  3793. else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  3794. arrArgs=[];
  3795. for (var index in args) {
  3796. if (!OSF.OUtil.isFunction(args[index])) {
  3797. arrArgs[index]=toArray(args[index]);
  3798. }
  3799. }
  3800. }
  3801. return arrArgs;
  3802. }
  3803. function fromSafeArray(value) {
  3804. var ret=value;
  3805. if (value !=null && value.toArray) {
  3806. var arrayResult=value.toArray();
  3807. ret=new Array(arrayResult.length);
  3808. for (var i=0; i < arrayResult.length; i++) {
  3809. ret[i]=fromSafeArray(arrayResult[i]);
  3810. }
  3811. }
  3812. return ret;
  3813. }
  3814. try {
  3815. if (args.onCalling) {
  3816. args.onCalling();
  3817. }
  3818. var startTime=(new Date()).getTime();
  3819. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs, resultCode) {
  3820. var result=hostResponseArgs.toArray();
  3821. var status=result[OSF.DDA.SafeArray.Response.Status];
  3822. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  3823. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  3824. payload=fromSafeArray(payload);
  3825. if (payload !=null) {
  3826. if (!args._chunkResultData) {
  3827. args._chunkResultData=new Array();
  3828. }
  3829. args._chunkResultData[payload[0]]=payload[1];
  3830. }
  3831. return false;
  3832. }
  3833. if (args.onReceiving) {
  3834. args.onReceiving();
  3835. }
  3836. if (args.onComplete) {
  3837. var payload;
  3838. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3839. if (result.length > 2) {
  3840. payload=[];
  3841. for (var i=1; i < result.length; i++)
  3842. payload[i - 1]=result[i];
  3843. }
  3844. else {
  3845. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3846. }
  3847. if (args._chunkResultData) {
  3848. payload=fromSafeArray(payload);
  3849. if (payload !=null) {
  3850. var expectedChunkCount=payload[payload.length - 1];
  3851. if (args._chunkResultData.length==expectedChunkCount) {
  3852. payload[payload.length - 1]=args._chunkResultData;
  3853. }
  3854. else {
  3855. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3856. }
  3857. }
  3858. }
  3859. }
  3860. else {
  3861. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3862. }
  3863. args.onComplete(status, payload);
  3864. }
  3865. if (OSF.AppTelemetry) {
  3866. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  3867. }
  3868. return true;
  3869. });
  3870. }
  3871. catch (ex) {
  3872. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3873. }
  3874. };
  3875. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  3876. var startTime=(new Date()).getTime();
  3877. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  3878. if (args.onReceiving) {
  3879. args.onReceiving();
  3880. }
  3881. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3882. if (args.onComplete) {
  3883. args.onComplete(status);
  3884. }
  3885. if (OSF.AppTelemetry) {
  3886. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  3887. }
  3888. };
  3889. };
  3890. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  3891. if (args.onCalling) {
  3892. args.onCalling();
  3893. }
  3894. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  3895. try {
  3896. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  3897. if (args.onEvent) {
  3898. args.onEvent(payload);
  3899. }
  3900. if (OSF.AppTelemetry) {
  3901. OSF.AppTelemetry.onEventDone(args.dispId);
  3902. }
  3903. }, callback);
  3904. }
  3905. catch (ex) {
  3906. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3907. }
  3908. };
  3909. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  3910. if (args.onCalling) {
  3911. args.onCalling();
  3912. }
  3913. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  3914. try {
  3915. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  3916. }
  3917. catch (ex) {
  3918. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3919. }
  3920. };
  3921. OSF.ClientMode={
  3922. ReadWrite: 0,
  3923. ReadOnly: 1
  3924. };
  3925. OSF.DDA.RichInitializationReason={
  3926. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3927. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3928. };
  3929. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  3930. this._hostInfo=hostInfo;
  3931. this._webAppState=webAppState;
  3932. this._context=context;
  3933. this._settings=settings;
  3934. this._hostFacade=hostFacade;
  3935. this._initializeSettings=this.initializeSettings;
  3936. };
  3937. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  3938. var settings;
  3939. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  3940. if (osfSessionStorage) {
  3941. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3942. if (storageSettings) {
  3943. serializedSettings=JSON.parse(storageSettings);
  3944. }
  3945. else {
  3946. storageSettings=JSON.stringify(serializedSettings);
  3947. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  3948. }
  3949. }
  3950. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3951. if (refreshSupported) {
  3952. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  3953. }
  3954. else {
  3955. settings=new OSF.DDA.Settings(deserializedSettings);
  3956. }
  3957. return settings;
  3958. };
  3959. OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  3960. };
  3961. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  3962. };
  3963. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  3964. this.prepareApiSurface(appContext);
  3965. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  3966. };
  3967. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  3968. var license=new OSF.DDA.License(appContext.get_eToken());
  3969. var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3970. if (appContext.get_isDialog()) {
  3971. if (OSF.DDA.UI.ChildUI) {
  3972. appContext.ui=new OSF.DDA.UI.ChildUI();
  3973. }
  3974. }
  3975. else {
  3976. if (OSF.DDA.UI.ParentUI) {
  3977. appContext.ui=new OSF.DDA.UI.ParentUI();
  3978. if (OfficeExt.Container) {
  3979. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  3980. }
  3981. }
  3982. }
  3983. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  3984. var getDelegateMethods, parameterMap;
  3985. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  3986. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  3987. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  3988. };
  3989. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { return OSF.DDA.RichInitializationReason[appContext.get_reason()]; };
  3990. OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) {
  3991. var delegateMethods={};
  3992. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3993. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3994. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3995. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.SafeArray.Delegate.openDialog;
  3996. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.SafeArray.Delegate.closeDialog;
  3997. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.SafeArray.Delegate.messageParent;
  3998. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  3999. var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4000. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  4001. };
  4002. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  4003. }
  4004. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  4005. var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  4006. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  4007. };
  4008. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  4009. }
  4010. return delegateMethods;
  4011. };
  4012. var OSF=OSF || {};
  4013. var OSFWebkit;
  4014. (function (OSFWebkit) {
  4015. var WebkitSafeArray=(function () {
  4016. function WebkitSafeArray(data) {
  4017. this.data=data;
  4018. this.safeArrayFlag=this.isSafeArray(data);
  4019. }
  4020. WebkitSafeArray.prototype.dimensions=function () {
  4021. var dimensions=0;
  4022. if (this.safeArrayFlag) {
  4023. dimensions=this.data[0][0];
  4024. }
  4025. else if (this.isArray()) {
  4026. dimensions=2;
  4027. }
  4028. return dimensions;
  4029. };
  4030. WebkitSafeArray.prototype.getItem=function () {
  4031. var array=[];
  4032. var element=null;
  4033. if (this.safeArrayFlag) {
  4034. array=this.toArray();
  4035. }
  4036. else {
  4037. array=this.data;
  4038. }
  4039. element=array;
  4040. for (var i=0; i < arguments.length; i++) {
  4041. element=element[arguments[i]];
  4042. }
  4043. return element;
  4044. };
  4045. WebkitSafeArray.prototype.lbound=function (dimension) {
  4046. return 0;
  4047. };
  4048. WebkitSafeArray.prototype.ubound=function (dimension) {
  4049. var ubound=0;
  4050. if (this.safeArrayFlag) {
  4051. ubound=this.data[0][dimension];
  4052. }
  4053. else if (this.isArray()) {
  4054. if (dimension==1) {
  4055. return this.data.length;
  4056. }
  4057. else if (dimension==2) {
  4058. if (OSF.OUtil.isArray(this.data[0])) {
  4059. return this.data[0].length;
  4060. }
  4061. else if (this.data[0] !=null) {
  4062. return 1;
  4063. }
  4064. }
  4065. }
  4066. return ubound;
  4067. };
  4068. WebkitSafeArray.prototype.toArray=function () {
  4069. if (this.isArray()==false) {
  4070. return this.data;
  4071. }
  4072. var arr=[];
  4073. var startingIndex=this.safeArrayFlag ? 1 : 0;
  4074. for (var i=startingIndex; i < this.data.length; i++) {
  4075. var element=this.data[i];
  4076. if (this.isSafeArray(element)) {
  4077. arr.push(new WebkitSafeArray(element));
  4078. }
  4079. else {
  4080. arr.push(element);
  4081. }
  4082. }
  4083. return arr;
  4084. };
  4085. WebkitSafeArray.prototype.isArray=function () {
  4086. return OSF.OUtil.isArray(this.data);
  4087. };
  4088. WebkitSafeArray.prototype.isSafeArray=function (obj) {
  4089. var isSafeArray=false;
  4090. if (OSF.OUtil.isArray(obj) && OSF.OUtil.isArray(obj[0])) {
  4091. var bounds=obj[0];
  4092. var dimensions=bounds[0];
  4093. if (bounds.length !=dimensions+1) {
  4094. return false;
  4095. }
  4096. var expectedArraySize=1;
  4097. for (var i=1; i < bounds.length; i++) {
  4098. var dimension=bounds[i];
  4099. if (isFinite(dimension)==false) {
  4100. return false;
  4101. }
  4102. expectedArraySize=expectedArraySize * dimension;
  4103. }
  4104. expectedArraySize++;
  4105. isSafeArray=(expectedArraySize==obj.length);
  4106. }
  4107. return isSafeArray;
  4108. };
  4109. return WebkitSafeArray;
  4110. })();
  4111. OSFWebkit.WebkitSafeArray=WebkitSafeArray;
  4112. })(OSFWebkit || (OSFWebkit={}));
  4113. var OSFWebkit;
  4114. (function (OSFWebkit) {
  4115. var ScriptMessaging;
  4116. (function (ScriptMessaging) {
  4117. var scriptMessenger=null;
  4118. function agaveHostCallback(callbackId, params) {
  4119. scriptMessenger.agaveHostCallback(callbackId, params);
  4120. }
  4121. ScriptMessaging.agaveHostCallback=agaveHostCallback;
  4122. function agaveHostEventCallback(callbackId, params) {
  4123. scriptMessenger.agaveHostEventCallback(callbackId, params);
  4124. }
  4125. ScriptMessaging.agaveHostEventCallback=agaveHostEventCallback;
  4126. function GetScriptMessenger() {
  4127. if (scriptMessenger==null) {
  4128. scriptMessenger=new WebkitScriptMessaging("OSF.ScriptMessaging.agaveHostCallback", "OSF.ScriptMessaging.agaveHostEventCallback");
  4129. }
  4130. return scriptMessenger;
  4131. }
  4132. ScriptMessaging.GetScriptMessenger=GetScriptMessenger;
  4133. var EventHandlerCallback=(function () {
  4134. function EventHandlerCallback(id, targetId, handler) {
  4135. this.id=id;
  4136. this.targetId=targetId;
  4137. this.handler=handler;
  4138. }
  4139. return EventHandlerCallback;
  4140. })();
  4141. var WebkitScriptMessaging=(function () {
  4142. function WebkitScriptMessaging(methodCallbackName, eventCallbackName) {
  4143. this.callingIndex=0;
  4144. this.callbackList={};
  4145. this.eventHandlerList={};
  4146. this.asyncMethodCallbackFunctionName=methodCallbackName;
  4147. this.eventCallbackFunctionName=eventCallbackName;
  4148. this.conversationId=WebkitScriptMessaging.getCurrentTimeMS().toString();
  4149. }
  4150. WebkitScriptMessaging.prototype.invokeMethod=function (handlerName, methodId, params, callback) {
  4151. var messagingArgs={};
  4152. this.postWebkitMessage(messagingArgs, handlerName, methodId, params, callback);
  4153. };
  4154. WebkitScriptMessaging.prototype.registerEvent=function (handlerName, methodId, dispId, targetId, handler, callback) {
  4155. var messagingArgs={
  4156. eventCallbackFunction: this.eventCallbackFunctionName
  4157. };
  4158. var hostArgs={
  4159. id: dispId,
  4160. targetId: targetId
  4161. };
  4162. var correlationId=this.postWebkitMessage(messagingArgs, handlerName, methodId, hostArgs, callback);
  4163. this.eventHandlerList[correlationId]=new EventHandlerCallback(dispId, targetId, handler);
  4164. };
  4165. WebkitScriptMessaging.prototype.unregisterEvent=function (handlerName, methodId, dispId, targetId, callback) {
  4166. var hostArgs={
  4167. id: dispId,
  4168. targetId: targetId
  4169. };
  4170. for (var key in this.eventHandlerList) {
  4171. if (this.eventHandlerList.hasOwnProperty(key)) {
  4172. var eventCallback=this.eventHandlerList[key];
  4173. if (eventCallback.id==dispId && eventCallback.targetId==targetId) {
  4174. delete this.eventHandlerList[key];
  4175. }
  4176. }
  4177. }
  4178. this.invokeMethod(handlerName, methodId, hostArgs, callback);
  4179. };
  4180. WebkitScriptMessaging.prototype.agaveHostCallback=function (callbackId, params) {
  4181. var callbackFunction=this.callbackList[callbackId];
  4182. if (callbackFunction) {
  4183. var callbacksDone=callbackFunction(params);
  4184. if (callbacksDone===undefined || callbacksDone===true) {
  4185. delete this.callbackList[callbackId];
  4186. }
  4187. }
  4188. };
  4189. WebkitScriptMessaging.prototype.agaveHostEventCallback=function (callbackId, params) {
  4190. var eventCallback=this.eventHandlerList[callbackId];
  4191. if (eventCallback) {
  4192. eventCallback.handler(params);
  4193. }
  4194. };
  4195. WebkitScriptMessaging.prototype.postWebkitMessage=function (messagingArgs, handlerName, methodId, params, callback) {
  4196. var correlationId=this.generateCorrelationId();
  4197. this.callbackList[correlationId]=callback;
  4198. messagingArgs.methodId=methodId;
  4199. messagingArgs.params=params;
  4200. messagingArgs.callbackId=correlationId;
  4201. messagingArgs.callbackFunction=this.asyncMethodCallbackFunctionName;
  4202. var invokePostMessage=function () {
  4203. window.webkit.messageHandlers[handlerName].postMessage(JSON.stringify(messagingArgs));
  4204. };
  4205. var currentTimestamp=WebkitScriptMessaging.getCurrentTimeMS();
  4206. if (this.lastMessageTimestamp==null || (currentTimestamp - this.lastMessageTimestamp >=WebkitScriptMessaging.MESSAGE_TIME_DELTA)) {
  4207. invokePostMessage();
  4208. this.lastMessageTimestamp=currentTimestamp;
  4209. }
  4210. else {
  4211. this.lastMessageTimestamp+=WebkitScriptMessaging.MESSAGE_TIME_DELTA;
  4212. setTimeout(function () {
  4213. invokePostMessage();
  4214. }, this.lastMessageTimestamp - currentTimestamp);
  4215. }
  4216. return correlationId;
  4217. };
  4218. WebkitScriptMessaging.prototype.generateCorrelationId=function () {
  4219. ++this.callingIndex;
  4220. return this.conversationId+this.callingIndex;
  4221. };
  4222. WebkitScriptMessaging.getCurrentTimeMS=function () {
  4223. return (new Date).getTime();
  4224. };
  4225. WebkitScriptMessaging.MESSAGE_TIME_DELTA=10;
  4226. return WebkitScriptMessaging;
  4227. })();
  4228. ScriptMessaging.WebkitScriptMessaging=WebkitScriptMessaging;
  4229. })(ScriptMessaging=OSFWebkit.ScriptMessaging || (OSFWebkit.ScriptMessaging={}));
  4230. })(OSFWebkit || (OSFWebkit={}));
  4231. OSF.ScriptMessaging=OSFWebkit.ScriptMessaging;
  4232. var OSFWebkit;
  4233. (function (OSFWebkit) {
  4234. OSFWebkit.MessageHandlerName="Agave";
  4235. OSFWebkit.PopupMessageHandlerName="WefPopupHandler";
  4236. (function (AppContextProperties) {
  4237. AppContextProperties[AppContextProperties["Settings"]=0]="Settings";
  4238. AppContextProperties[AppContextProperties["SolutionReferenceId"]=1]="SolutionReferenceId";
  4239. AppContextProperties[AppContextProperties["AppType"]=2]="AppType";
  4240. AppContextProperties[AppContextProperties["MajorVersion"]=3]="MajorVersion";
  4241. AppContextProperties[AppContextProperties["MinorVersion"]=4]="MinorVersion";
  4242. AppContextProperties[AppContextProperties["RevisionVersion"]=5]="RevisionVersion";
  4243. AppContextProperties[AppContextProperties["APIVersionSequence"]=6]="APIVersionSequence";
  4244. AppContextProperties[AppContextProperties["AppCapabilities"]=7]="AppCapabilities";
  4245. AppContextProperties[AppContextProperties["APPUILocale"]=8]="APPUILocale";
  4246. AppContextProperties[AppContextProperties["AppDataLocale"]=9]="AppDataLocale";
  4247. AppContextProperties[AppContextProperties["BindingCount"]=10]="BindingCount";
  4248. AppContextProperties[AppContextProperties["DocumentUrl"]=11]="DocumentUrl";
  4249. AppContextProperties[AppContextProperties["ActivationMode"]=12]="ActivationMode";
  4250. AppContextProperties[AppContextProperties["ControlIntegrationLevel"]=13]="ControlIntegrationLevel";
  4251. AppContextProperties[AppContextProperties["SolutionToken"]=14]="SolutionToken";
  4252. AppContextProperties[AppContextProperties["APISetVersion"]=15]="APISetVersion";
  4253. AppContextProperties[AppContextProperties["CorrelationId"]=16]="CorrelationId";
  4254. AppContextProperties[AppContextProperties["InstanceId"]=17]="InstanceId";
  4255. AppContextProperties[AppContextProperties["TouchEnabled"]=18]="TouchEnabled";
  4256. AppContextProperties[AppContextProperties["CommerceAllowed"]=19]="CommerceAllowed";
  4257. AppContextProperties[AppContextProperties["RequirementMatrix"]=20]="RequirementMatrix";
  4258. AppContextProperties[AppContextProperties["HostCustomMessage"]=21]="HostCustomMessage";
  4259. AppContextProperties[AppContextProperties["HostFullVersion"]=22]="HostFullVersion";
  4260. })(OSFWebkit.AppContextProperties || (OSFWebkit.AppContextProperties={}));
  4261. var AppContextProperties=OSFWebkit.AppContextProperties;
  4262. (function (MethodId) {
  4263. MethodId[MethodId["Execute"]=1]="Execute";
  4264. MethodId[MethodId["RegisterEvent"]=2]="RegisterEvent";
  4265. MethodId[MethodId["UnregisterEvent"]=3]="UnregisterEvent";
  4266. MethodId[MethodId["WriteSettings"]=4]="WriteSettings";
  4267. MethodId[MethodId["GetContext"]=5]="GetContext";
  4268. })(OSFWebkit.MethodId || (OSFWebkit.MethodId={}));
  4269. var MethodId=OSFWebkit.MethodId;
  4270. var WebkitHostController=(function () {
  4271. function WebkitHostController(hostScriptProxy) {
  4272. this.hostScriptProxy=hostScriptProxy;
  4273. }
  4274. WebkitHostController.prototype.execute=function (id, params, callback) {
  4275. var args=params;
  4276. if (args==null) {
  4277. args=[];
  4278. }
  4279. var hostParams={
  4280. id: id,
  4281. apiArgs: args
  4282. };
  4283. var agaveResponseCallback=function (payload) {
  4284. if (callback) {
  4285. var invokeArguments=[];
  4286. if (OSF.OUtil.isArray(payload)) {
  4287. for (var i=0; i < payload.length; i++) {
  4288. var element=payload[i];
  4289. if (OSF.OUtil.isArray(element)) {
  4290. element=new OSFWebkit.WebkitSafeArray(element);
  4291. }
  4292. invokeArguments.unshift(element);
  4293. }
  4294. }
  4295. return callback.apply(null, invokeArguments);
  4296. }
  4297. };
  4298. this.hostScriptProxy.invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.Execute, hostParams, agaveResponseCallback);
  4299. };
  4300. WebkitHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  4301. var agaveEventHandlerCallback=function (payload) {
  4302. var safeArraySource=payload;
  4303. var eventId=0;
  4304. if (OSF.OUtil.isArray(payload) && payload.length >=2) {
  4305. safeArraySource=payload[0];
  4306. eventId=payload[1];
  4307. }
  4308. if (handler) {
  4309. handler(eventId, new OSFWebkit.WebkitSafeArray(safeArraySource));
  4310. }
  4311. };
  4312. var agaveResponseCallback=function (payload) {
  4313. if (callback) {
  4314. return callback(new OSFWebkit.WebkitSafeArray(payload));
  4315. }
  4316. };
  4317. this.hostScriptProxy.registerEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.RegisterEvent, id, targetId, agaveEventHandlerCallback, agaveResponseCallback);
  4318. };
  4319. WebkitHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  4320. var agaveResponseCallback=function (response) {
  4321. return callback(new OSFWebkit.WebkitSafeArray(response));
  4322. };
  4323. this.hostScriptProxy.unregisterEvent(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.UnregisterEvent, id, targetId, agaveResponseCallback);
  4324. };
  4325. WebkitHostController.prototype.messageParent=function (params) {
  4326. var message=params[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  4327. var messageObj={ dialogMessage: { messageType: OSF.DialogMessageType.DialogMessageReceived, messageContent: message } };
  4328. window.opener.postMessage(JSON.stringify(messageObj), window.location.origin);
  4329. };
  4330. WebkitHostController.prototype.openDialog=function (id, targetId, handler, callback) {
  4331. var magicWord="action=displayDialog";
  4332. var fragmentSeparator='#';
  4333. var callArgs=JSON.parse(targetId);
  4334. var callUrl=callArgs.url;
  4335. if (!callUrl) {
  4336. return;
  4337. }
  4338. var urlParts=callUrl.split(fragmentSeparator);
  4339. var seperator="?";
  4340. if (urlParts[0].indexOf("?") > -1) {
  4341. seperator="&";
  4342. }
  4343. var width=screen.width * callArgs.width / 100;
  4344. var height=screen.height * callArgs.height / 100;
  4345. var params="width="+width+", height="+height;
  4346. urlParts[0]=urlParts[0].concat(seperator).concat(magicWord);
  4347. var openUrl=urlParts.join(fragmentSeparator);
  4348. WebkitHostController.popup=window.open(openUrl, "", params);
  4349. function receiveMessage(event) {
  4350. if (event.origin==window.location.origin) {
  4351. try {
  4352. var messageObj=JSON.parse(event.data);
  4353. if (messageObj.dialogMessage) {
  4354. handler(id, [OSF.DialogMessageType.DialogMessageReceived, messageObj.dialogMessage.messageContent]);
  4355. }
  4356. }
  4357. catch (e) {
  4358. OsfMsAjaxFactory.msAjaxDebug.trace("messages received cannot be handlered. Message:"+event.data);
  4359. }
  4360. }
  4361. }
  4362. window.addEventListener("message", receiveMessage);
  4363. var interval;
  4364. function checkWindowClose() {
  4365. try {
  4366. if (WebkitHostController.popup==null || WebkitHostController.popup.closed) {
  4367. window.clearInterval(interval);
  4368. window.removeEventListener("message", receiveMessage);
  4369. handler(id, [OSF.DialogMessageType.DialogClosed]);
  4370. }
  4371. }
  4372. catch (e) {
  4373. OsfMsAjaxFactory.msAjaxDebug.trace("Error happened when popup window closed.");
  4374. }
  4375. }
  4376. interval=window.setInterval(checkWindowClose, 1000);
  4377. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  4378. };
  4379. WebkitHostController.prototype.closeDialog=function (id, targetId, callback) {
  4380. if (WebkitHostController.popup) {
  4381. WebkitHostController.popup.close();
  4382. WebkitHostController.popup=null;
  4383. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  4384. }
  4385. else {
  4386. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  4387. }
  4388. };
  4389. return WebkitHostController;
  4390. })();
  4391. OSFWebkit.WebkitHostController=WebkitHostController;
  4392. })(OSFWebkit || (OSFWebkit={}));
  4393. OSF.Webkit=OSFWebkit;
  4394. OSF.ClientHostController=new OSFWebkit.WebkitHostController(OSF.ScriptMessaging.GetScriptMessenger());
  4395. OSF.DDA.ClientSettingsManager={
  4396. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  4397. return function (args) {
  4398. var status, response;
  4399. var onComplete=function onComplete(status, response) {
  4400. if (args.onReceiving) {
  4401. args.onReceiving();
  4402. }
  4403. if (args.onComplete) {
  4404. args.onComplete(status, response);
  4405. }
  4406. };
  4407. try {
  4408. hostDelegateMethod(args.hostCallArgs, args.onCalling, onComplete);
  4409. }
  4410. catch (ex) {
  4411. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4412. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  4413. onComplete(status, response);
  4414. }
  4415. };
  4416. },
  4417. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onComplete) {
  4418. var keys=[];
  4419. var values=[];
  4420. if (onCalling) {
  4421. onCalling();
  4422. }
  4423. var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper();
  4424. var onReceivedContext=function onReceivedContext(appContext) {
  4425. if (onComplete) {
  4426. onComplete(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, appContext.get_settings());
  4427. }
  4428. };
  4429. initializationHelper.getAppContext(null, onReceivedContext);
  4430. },
  4431. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onComplete) {
  4432. var hostParams={};
  4433. var keys=[];
  4434. var values=[];
  4435. for (var key in serializedSettings) {
  4436. keys.push(key);
  4437. values.push(serializedSettings[key]);
  4438. }
  4439. hostParams["keys"]=keys;
  4440. hostParams["values"]=values;
  4441. if (onCalling) {
  4442. onCalling();
  4443. }
  4444. var onWriteCompleted=function onWriteCompleted(status) {
  4445. if (onComplete) {
  4446. onComplete(status[0], null);
  4447. }
  4448. };
  4449. OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(OSF.Webkit.MessageHandlerName, OSF.Webkit.MethodId.WriteSettings, hostParams, onWriteCompleted);
  4450. }
  4451. };
  4452. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) {
  4453. var serializedSettings=appContext.get_settings();
  4454. var settings=this.deserializeSettings(serializedSettings, refreshSupported);
  4455. return settings;
  4456. };
  4457. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4458. var getInvocationCallback=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(appContext) {
  4459. var returnedContext;
  4460. var appContextProperties=OSF.Webkit.AppContextProperties;
  4461. var appType=appContext[appContextProperties.AppType];
  4462. var hostSettings=appContext[appContextProperties.Settings];
  4463. var serializedSettings={};
  4464. var keys=hostSettings[0];
  4465. var values=hostSettings[1];
  4466. for (var index=0; index < keys.length; index++) {
  4467. serializedSettings[keys[index]]=values[index];
  4468. }
  4469. var id=appContext[appContextProperties.SolutionReferenceId];
  4470. var version=appContext[appContextProperties.MajorVersion];
  4471. var minorVersion=appContext[appContextProperties.MinorVersion];
  4472. var clientMode=appContext[appContextProperties.AppCapabilities];
  4473. var UILocale=appContext[appContextProperties.APPUILocale];
  4474. var dataLocale=appContext[appContextProperties.AppDataLocale];
  4475. var docUrl=appContext[appContextProperties.DocumentUrl];
  4476. var reason=appContext[appContextProperties.ActivationMode];
  4477. var osfControlType=appContext[appContextProperties.ControlIntegrationLevel];
  4478. var eToken=appContext[appContextProperties.SolutionToken];
  4479. eToken=eToken ? eToken.toString() : "";
  4480. var correlationId=appContext[appContextProperties.CorrelationId];
  4481. var appInstanceId=appContext[appContextProperties.InstanceId];
  4482. var touchEnabled=appContext[appContextProperties.TouchEnabled];
  4483. var commerceAllowed=appContext[appContextProperties.CommerceAllowed];
  4484. var requirementMatrix=appContext[appContextProperties.RequirementMatrix];
  4485. var hostCustomMessage=appContext[appContextProperties.HostCustomMessage];
  4486. var hostFullVersion=appContext[appContextProperties.HostFullVersion];
  4487. returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, serializedSettings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, hostCustomMessage, hostFullVersion);
  4488. if (OSF.AppTelemetry) {
  4489. OSF.AppTelemetry.initialize(returnedContext);
  4490. }
  4491. gotAppContext(returnedContext);
  4492. };
  4493. var handler;
  4494. if (this._hostInfo.isDialog) {
  4495. handler=OSF.Webkit.PopupMessageHandlerName;
  4496. }
  4497. else {
  4498. handler=OSF.Webkit.MessageHandlerName;
  4499. }
  4500. OSF.ScriptMessaging.GetScriptMessenger().invokeMethod(handler, OSF.Webkit.MethodId.GetContext, [], getInvocationCallback);
  4501. };
  4502. var OSFLog;
  4503. (function (OSFLog) {
  4504. var BaseUsageData=(function () {
  4505. function BaseUsageData(table) {
  4506. this._table=table;
  4507. this._fields={};
  4508. }
  4509. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  4510. get: function () {
  4511. return this._fields;
  4512. },
  4513. enumerable: true,
  4514. configurable: true
  4515. });
  4516. Object.defineProperty(BaseUsageData.prototype, "Table", {
  4517. get: function () {
  4518. return this._table;
  4519. },
  4520. enumerable: true,
  4521. configurable: true
  4522. });
  4523. BaseUsageData.prototype.SerializeFields=function () {
  4524. };
  4525. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  4526. if (typeof (value) !=="undefined" && value !==null) {
  4527. this._serializedFields[key]=value.toString();
  4528. }
  4529. };
  4530. BaseUsageData.prototype.SerializeRow=function () {
  4531. this._serializedFields={};
  4532. this.SetSerializedField("Table", this._table);
  4533. this.SerializeFields();
  4534. return JSON.stringify(this._serializedFields);
  4535. };
  4536. return BaseUsageData;
  4537. })();
  4538. OSFLog.BaseUsageData=BaseUsageData;
  4539. var AppActivatedUsageData=(function (_super) {
  4540. __extends(AppActivatedUsageData, _super);
  4541. function AppActivatedUsageData() {
  4542. _super.call(this, "AppActivated");
  4543. }
  4544. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  4545. get: function () { return this.Fields["CorrelationId"]; },
  4546. set: function (value) { this.Fields["CorrelationId"]=value; },
  4547. enumerable: true,
  4548. configurable: true
  4549. });
  4550. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  4551. get: function () { return this.Fields["SessionId"]; },
  4552. set: function (value) { this.Fields["SessionId"]=value; },
  4553. enumerable: true,
  4554. configurable: true
  4555. });
  4556. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  4557. get: function () { return this.Fields["AppId"]; },
  4558. set: function (value) { this.Fields["AppId"]=value; },
  4559. enumerable: true,
  4560. configurable: true
  4561. });
  4562. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  4563. get: function () { return this.Fields["AppInstanceId"]; },
  4564. set: function (value) { this.Fields["AppInstanceId"]=value; },
  4565. enumerable: true,
  4566. configurable: true
  4567. });
  4568. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  4569. get: function () { return this.Fields["AppURL"]; },
  4570. set: function (value) { this.Fields["AppURL"]=value; },
  4571. enumerable: true,
  4572. configurable: true
  4573. });
  4574. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  4575. get: function () { return this.Fields["AssetId"]; },
  4576. set: function (value) { this.Fields["AssetId"]=value; },
  4577. enumerable: true,
  4578. configurable: true
  4579. });
  4580. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  4581. get: function () { return this.Fields["Browser"]; },
  4582. set: function (value) { this.Fields["Browser"]=value; },
  4583. enumerable: true,
  4584. configurable: true
  4585. });
  4586. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  4587. get: function () { return this.Fields["UserId"]; },
  4588. set: function (value) { this.Fields["UserId"]=value; },
  4589. enumerable: true,
  4590. configurable: true
  4591. });
  4592. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  4593. get: function () { return this.Fields["Host"]; },
  4594. set: function (value) { this.Fields["Host"]=value; },
  4595. enumerable: true,
  4596. configurable: true
  4597. });
  4598. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  4599. get: function () { return this.Fields["HostVersion"]; },
  4600. set: function (value) { this.Fields["HostVersion"]=value; },
  4601. enumerable: true,
  4602. configurable: true
  4603. });
  4604. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  4605. get: function () { return this.Fields["ClientId"]; },
  4606. set: function (value) { this.Fields["ClientId"]=value; },
  4607. enumerable: true,
  4608. configurable: true
  4609. });
  4610. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  4611. get: function () { return this.Fields["AppSizeWidth"]; },
  4612. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  4613. enumerable: true,
  4614. configurable: true
  4615. });
  4616. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  4617. get: function () { return this.Fields["AppSizeHeight"]; },
  4618. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  4619. enumerable: true,
  4620. configurable: true
  4621. });
  4622. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  4623. get: function () { return this.Fields["Message"]; },
  4624. set: function (value) { this.Fields["Message"]=value; },
  4625. enumerable: true,
  4626. configurable: true
  4627. });
  4628. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  4629. get: function () { return this.Fields["DocUrl"]; },
  4630. set: function (value) { this.Fields["DocUrl"]=value; },
  4631. enumerable: true,
  4632. configurable: true
  4633. });
  4634. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  4635. get: function () { return this.Fields["OfficeJSVersion"]; },
  4636. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  4637. enumerable: true,
  4638. configurable: true
  4639. });
  4640. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  4641. get: function () { return this.Fields["HostJSVersion"]; },
  4642. set: function (value) { this.Fields["HostJSVersion"]=value; },
  4643. enumerable: true,
  4644. configurable: true
  4645. });
  4646. AppActivatedUsageData.prototype.SerializeFields=function () {
  4647. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4648. this.SetSerializedField("SessionId", this.SessionId);
  4649. this.SetSerializedField("AppId", this.AppId);
  4650. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  4651. this.SetSerializedField("AppURL", this.AppURL);
  4652. this.SetSerializedField("AssetId", this.AssetId);
  4653. this.SetSerializedField("Browser", this.Browser);
  4654. this.SetSerializedField("UserId", this.UserId);
  4655. this.SetSerializedField("Host", this.Host);
  4656. this.SetSerializedField("HostVersion", this.HostVersion);
  4657. this.SetSerializedField("ClientId", this.ClientId);
  4658. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  4659. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  4660. this.SetSerializedField("Message", this.Message);
  4661. this.SetSerializedField("DocUrl", this.DocUrl);
  4662. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  4663. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  4664. };
  4665. return AppActivatedUsageData;
  4666. })(BaseUsageData);
  4667. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4668. var ScriptLoadUsageData=(function (_super) {
  4669. __extends(ScriptLoadUsageData, _super);
  4670. function ScriptLoadUsageData() {
  4671. _super.call(this, "ScriptLoad");
  4672. }
  4673. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  4674. get: function () { return this.Fields["CorrelationId"]; },
  4675. set: function (value) { this.Fields["CorrelationId"]=value; },
  4676. enumerable: true,
  4677. configurable: true
  4678. });
  4679. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  4680. get: function () { return this.Fields["SessionId"]; },
  4681. set: function (value) { this.Fields["SessionId"]=value; },
  4682. enumerable: true,
  4683. configurable: true
  4684. });
  4685. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  4686. get: function () { return this.Fields["ScriptId"]; },
  4687. set: function (value) { this.Fields["ScriptId"]=value; },
  4688. enumerable: true,
  4689. configurable: true
  4690. });
  4691. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  4692. get: function () { return this.Fields["StartTime"]; },
  4693. set: function (value) { this.Fields["StartTime"]=value; },
  4694. enumerable: true,
  4695. configurable: true
  4696. });
  4697. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  4698. get: function () { return this.Fields["ResponseTime"]; },
  4699. set: function (value) { this.Fields["ResponseTime"]=value; },
  4700. enumerable: true,
  4701. configurable: true
  4702. });
  4703. ScriptLoadUsageData.prototype.SerializeFields=function () {
  4704. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4705. this.SetSerializedField("SessionId", this.SessionId);
  4706. this.SetSerializedField("ScriptId", this.ScriptId);
  4707. this.SetSerializedField("StartTime", this.StartTime);
  4708. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4709. };
  4710. return ScriptLoadUsageData;
  4711. })(BaseUsageData);
  4712. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4713. var AppClosedUsageData=(function (_super) {
  4714. __extends(AppClosedUsageData, _super);
  4715. function AppClosedUsageData() {
  4716. _super.call(this, "AppClosed");
  4717. }
  4718. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  4719. get: function () { return this.Fields["CorrelationId"]; },
  4720. set: function (value) { this.Fields["CorrelationId"]=value; },
  4721. enumerable: true,
  4722. configurable: true
  4723. });
  4724. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  4725. get: function () { return this.Fields["SessionId"]; },
  4726. set: function (value) { this.Fields["SessionId"]=value; },
  4727. enumerable: true,
  4728. configurable: true
  4729. });
  4730. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  4731. get: function () { return this.Fields["FocusTime"]; },
  4732. set: function (value) { this.Fields["FocusTime"]=value; },
  4733. enumerable: true,
  4734. configurable: true
  4735. });
  4736. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  4737. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  4738. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  4739. enumerable: true,
  4740. configurable: true
  4741. });
  4742. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  4743. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  4744. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  4745. enumerable: true,
  4746. configurable: true
  4747. });
  4748. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  4749. get: function () { return this.Fields["OpenTime"]; },
  4750. set: function (value) { this.Fields["OpenTime"]=value; },
  4751. enumerable: true,
  4752. configurable: true
  4753. });
  4754. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  4755. get: function () { return this.Fields["CloseMethod"]; },
  4756. set: function (value) { this.Fields["CloseMethod"]=value; },
  4757. enumerable: true,
  4758. configurable: true
  4759. });
  4760. AppClosedUsageData.prototype.SerializeFields=function () {
  4761. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4762. this.SetSerializedField("SessionId", this.SessionId);
  4763. this.SetSerializedField("FocusTime", this.FocusTime);
  4764. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  4765. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  4766. this.SetSerializedField("OpenTime", this.OpenTime);
  4767. this.SetSerializedField("CloseMethod", this.CloseMethod);
  4768. };
  4769. return AppClosedUsageData;
  4770. })(BaseUsageData);
  4771. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4772. var APIUsageUsageData=(function (_super) {
  4773. __extends(APIUsageUsageData, _super);
  4774. function APIUsageUsageData() {
  4775. _super.call(this, "APIUsage");
  4776. }
  4777. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  4778. get: function () { return this.Fields["CorrelationId"]; },
  4779. set: function (value) { this.Fields["CorrelationId"]=value; },
  4780. enumerable: true,
  4781. configurable: true
  4782. });
  4783. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  4784. get: function () { return this.Fields["SessionId"]; },
  4785. set: function (value) { this.Fields["SessionId"]=value; },
  4786. enumerable: true,
  4787. configurable: true
  4788. });
  4789. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  4790. get: function () { return this.Fields["APIType"]; },
  4791. set: function (value) { this.Fields["APIType"]=value; },
  4792. enumerable: true,
  4793. configurable: true
  4794. });
  4795. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  4796. get: function () { return this.Fields["APIID"]; },
  4797. set: function (value) { this.Fields["APIID"]=value; },
  4798. enumerable: true,
  4799. configurable: true
  4800. });
  4801. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  4802. get: function () { return this.Fields["Parameters"]; },
  4803. set: function (value) { this.Fields["Parameters"]=value; },
  4804. enumerable: true,
  4805. configurable: true
  4806. });
  4807. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  4808. get: function () { return this.Fields["ResponseTime"]; },
  4809. set: function (value) { this.Fields["ResponseTime"]=value; },
  4810. enumerable: true,
  4811. configurable: true
  4812. });
  4813. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  4814. get: function () { return this.Fields["ErrorType"]; },
  4815. set: function (value) { this.Fields["ErrorType"]=value; },
  4816. enumerable: true,
  4817. configurable: true
  4818. });
  4819. APIUsageUsageData.prototype.SerializeFields=function () {
  4820. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4821. this.SetSerializedField("SessionId", this.SessionId);
  4822. this.SetSerializedField("APIType", this.APIType);
  4823. this.SetSerializedField("APIID", this.APIID);
  4824. this.SetSerializedField("Parameters", this.Parameters);
  4825. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4826. this.SetSerializedField("ErrorType", this.ErrorType);
  4827. };
  4828. return APIUsageUsageData;
  4829. })(BaseUsageData);
  4830. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4831. var AppInitializationUsageData=(function (_super) {
  4832. __extends(AppInitializationUsageData, _super);
  4833. function AppInitializationUsageData() {
  4834. _super.call(this, "AppInitialization");
  4835. }
  4836. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  4837. get: function () { return this.Fields["CorrelationId"]; },
  4838. set: function (value) { this.Fields["CorrelationId"]=value; },
  4839. enumerable: true,
  4840. configurable: true
  4841. });
  4842. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  4843. get: function () { return this.Fields["SessionId"]; },
  4844. set: function (value) { this.Fields["SessionId"]=value; },
  4845. enumerable: true,
  4846. configurable: true
  4847. });
  4848. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  4849. get: function () { return this.Fields["SuccessCode"]; },
  4850. set: function (value) { this.Fields["SuccessCode"]=value; },
  4851. enumerable: true,
  4852. configurable: true
  4853. });
  4854. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  4855. get: function () { return this.Fields["Message"]; },
  4856. set: function (value) { this.Fields["Message"]=value; },
  4857. enumerable: true,
  4858. configurable: true
  4859. });
  4860. AppInitializationUsageData.prototype.SerializeFields=function () {
  4861. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4862. this.SetSerializedField("SessionId", this.SessionId);
  4863. this.SetSerializedField("SuccessCode", this.SuccessCode);
  4864. this.SetSerializedField("Message", this.Message);
  4865. };
  4866. return AppInitializationUsageData;
  4867. })(BaseUsageData);
  4868. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  4869. })(OSFLog || (OSFLog={}));
  4870. var Logger;
  4871. (function (Logger) {
  4872. "use strict";
  4873. (function (TraceLevel) {
  4874. TraceLevel[TraceLevel["info"]=0]="info";
  4875. TraceLevel[TraceLevel["warning"]=1]="warning";
  4876. TraceLevel[TraceLevel["error"]=2]="error";
  4877. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  4878. var TraceLevel=Logger.TraceLevel;
  4879. (function (SendFlag) {
  4880. SendFlag[SendFlag["none"]=0]="none";
  4881. SendFlag[SendFlag["flush"]=1]="flush";
  4882. })(Logger.SendFlag || (Logger.SendFlag={}));
  4883. var SendFlag=Logger.SendFlag;
  4884. function allowUploadingData() {
  4885. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4886. OSF.Logger.ulsEndpoint.loadProxyFrame();
  4887. }
  4888. }
  4889. Logger.allowUploadingData=allowUploadingData;
  4890. function sendLog(traceLevel, message, flag) {
  4891. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4892. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  4893. var logs=JSON.stringify(jsonObj);
  4894. OSF.Logger.ulsEndpoint.writeLog(logs);
  4895. }
  4896. }
  4897. Logger.sendLog=sendLog;
  4898. function creatULSEndpoint() {
  4899. try {
  4900. return new ULSEndpointProxy();
  4901. }
  4902. catch (e) {
  4903. return null;
  4904. }
  4905. }
  4906. var ULSEndpointProxy=(function () {
  4907. function ULSEndpointProxy() {
  4908. var _this=this;
  4909. this.proxyFrame=null;
  4910. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  4911. this.buffer=[];
  4912. this.proxyFrameReady=false;
  4913. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4914. setTimeout(function () {
  4915. _this.loadProxyFrame();
  4916. }, 3000);
  4917. }
  4918. ULSEndpointProxy.prototype.writeLog=function (log) {
  4919. if (this.proxyFrameReady===true) {
  4920. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  4921. }
  4922. else {
  4923. if (this.buffer.length < 128) {
  4924. this.buffer.push(log);
  4925. }
  4926. }
  4927. };
  4928. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  4929. if (this.proxyFrame==null) {
  4930. this.proxyFrame=document.createElement("iframe");
  4931. this.proxyFrame.setAttribute("style", "display:none");
  4932. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  4933. document.head.appendChild(this.proxyFrame);
  4934. }
  4935. };
  4936. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  4937. var _this=this;
  4938. if (e.data==="ProxyFrameReadyToLog") {
  4939. this.proxyFrameReady=true;
  4940. for (var i=0; i < this.buffer.length; i++) {
  4941. this.writeLog(this.buffer[i]);
  4942. }
  4943. this.buffer.length=0;
  4944. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4945. }
  4946. else if (e.data==="ProxyFrameReadyToInit") {
  4947. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  4948. var initStr=JSON.stringify(initJson);
  4949. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  4950. }
  4951. };
  4952. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  4953. return ULSEndpointProxy;
  4954. })();
  4955. if (!OSF.Logger) {
  4956. OSF.Logger=Logger;
  4957. }
  4958. Logger.ulsEndpoint=creatULSEndpoint();
  4959. })(Logger || (Logger={}));
  4960. var OSFAppTelemetry;
  4961. (function (OSFAppTelemetry) {
  4962. "use strict";
  4963. var appInfo;
  4964. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  4965. var osfControlAppCorrelationId="";
  4966. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  4967. ;
  4968. var AppInfo=(function () {
  4969. function AppInfo() {
  4970. }
  4971. return AppInfo;
  4972. })();
  4973. var Event=(function () {
  4974. function Event(name, handler) {
  4975. this.name=name;
  4976. this.handler=handler;
  4977. }
  4978. return Event;
  4979. })();
  4980. var AppStorage=(function () {
  4981. function AppStorage() {
  4982. this.clientIDKey="Office API client";
  4983. this.logIdSetKey="Office App Log Id Set";
  4984. }
  4985. AppStorage.prototype.getClientId=function () {
  4986. var clientId=this.getValue(this.clientIDKey);
  4987. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  4988. clientId=OSF.OUtil.Guid.generateNewGuid();
  4989. this.setValue(this.clientIDKey, clientId);
  4990. }
  4991. return clientId;
  4992. };
  4993. AppStorage.prototype.saveLog=function (logId, log) {
  4994. var logIdSet=this.getValue(this.logIdSetKey);
  4995. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  4996. this.setValue(this.logIdSetKey, logIdSet);
  4997. this.setValue(logId, log);
  4998. };
  4999. AppStorage.prototype.enumerateLog=function (callback, clean) {
  5000. var logIdSet=this.getValue(this.logIdSetKey);
  5001. if (logIdSet) {
  5002. var ids=logIdSet.split(";");
  5003. for (var id in ids) {
  5004. var logId=ids[id];
  5005. var log=this.getValue(logId);
  5006. if (log) {
  5007. if (callback) {
  5008. callback(logId, log);
  5009. }
  5010. if (clean) {
  5011. this.remove(logId);
  5012. }
  5013. }
  5014. }
  5015. if (clean) {
  5016. this.remove(this.logIdSetKey);
  5017. }
  5018. }
  5019. };
  5020. AppStorage.prototype.getValue=function (key) {
  5021. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5022. var value="";
  5023. if (osfLocalStorage) {
  5024. value=osfLocalStorage.getItem(key);
  5025. }
  5026. return value;
  5027. };
  5028. AppStorage.prototype.setValue=function (key, value) {
  5029. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5030. if (osfLocalStorage) {
  5031. osfLocalStorage.setItem(key, value);
  5032. }
  5033. };
  5034. AppStorage.prototype.remove=function (key) {
  5035. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5036. if (osfLocalStorage) {
  5037. try {
  5038. osfLocalStorage.removeItem(key);
  5039. }
  5040. catch (ex) {
  5041. }
  5042. }
  5043. };
  5044. return AppStorage;
  5045. })();
  5046. var AppLogger=(function () {
  5047. function AppLogger() {
  5048. }
  5049. AppLogger.prototype.LogData=function (data) {
  5050. if (!OSF.Logger) {
  5051. return;
  5052. }
  5053. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  5054. };
  5055. AppLogger.prototype.LogRawData=function (log) {
  5056. if (!OSF.Logger) {
  5057. return;
  5058. }
  5059. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  5060. };
  5061. return AppLogger;
  5062. })();
  5063. function initialize(context) {
  5064. if (!OSF.Logger) {
  5065. return;
  5066. }
  5067. if (appInfo) {
  5068. return;
  5069. }
  5070. appInfo=new AppInfo();
  5071. if (context.get_hostFullVersion()) {
  5072. appInfo.hostVersion=context.get_hostFullVersion();
  5073. }
  5074. else {
  5075. appInfo.hostVersion=context.get_appVersion();
  5076. }
  5077. appInfo.appId=context.get_id();
  5078. appInfo.host=context.get_appName();
  5079. appInfo.browser=window.navigator.userAgent;
  5080. appInfo.correlationId=context.get_correlationId();
  5081. appInfo.clientId=(new AppStorage()).getClientId();
  5082. appInfo.appInstanceId=context.get_appInstanceId();
  5083. if (appInfo.appInstanceId) {
  5084. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  5085. }
  5086. appInfo.message=context.get_hostCustomMessage();
  5087. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  5088. appInfo.hostJSVersion="16.0.7526.1000";
  5089. var docUrl=context.get_docUrl();
  5090. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  5091. var url=location.href;
  5092. if (url) {
  5093. url=url.split("?")[0].split("#")[0];
  5094. }
  5095. appInfo.appURL=url;
  5096. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  5097. var xmlContent;
  5098. var parser;
  5099. var xmlDoc;
  5100. appInfo.assetId="";
  5101. appInfo.userId="";
  5102. try {
  5103. xmlContent=decodeURIComponent(token);
  5104. parser=new DOMParser();
  5105. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  5106. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  5107. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  5108. if (cidNode && cidNode.nodeValue) {
  5109. appInfo.userId=cidNode.nodeValue;
  5110. }
  5111. else if (oidNode && oidNode.nodeValue) {
  5112. appInfo.userId=oidNode.nodeValue;
  5113. }
  5114. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  5115. }
  5116. catch (e) {
  5117. }
  5118. finally {
  5119. xmlContent=null;
  5120. xmlDoc=null;
  5121. parser=null;
  5122. }
  5123. })(context.get_eToken(), appInfo);
  5124. (function handleLifecycle() {
  5125. var startTime=new Date();
  5126. var lastFocus=null;
  5127. var focusTime=0;
  5128. var finished=false;
  5129. var adjustFocusTime=function () {
  5130. if (document.hasFocus()) {
  5131. if (lastFocus==null) {
  5132. lastFocus=new Date();
  5133. }
  5134. }
  5135. else if (lastFocus) {
  5136. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5137. lastFocus=null;
  5138. }
  5139. };
  5140. var eventList=[];
  5141. eventList.push(new Event("focus", adjustFocusTime));
  5142. eventList.push(new Event("blur", adjustFocusTime));
  5143. eventList.push(new Event("focusout", adjustFocusTime));
  5144. eventList.push(new Event("focusin", adjustFocusTime));
  5145. var exitFunction=function () {
  5146. for (var i=0; i < eventList.length; i++) {
  5147. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  5148. }
  5149. eventList.length=0;
  5150. if (!finished) {
  5151. if (document.hasFocus() && lastFocus) {
  5152. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5153. lastFocus=null;
  5154. }
  5155. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  5156. finished=true;
  5157. }
  5158. };
  5159. eventList.push(new Event("beforeunload", exitFunction));
  5160. eventList.push(new Event("unload", exitFunction));
  5161. for (var i=0; i < eventList.length; i++) {
  5162. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  5163. }
  5164. adjustFocusTime();
  5165. })();
  5166. OSFAppTelemetry.onAppActivated();
  5167. }
  5168. OSFAppTelemetry.initialize=initialize;
  5169. function onAppActivated() {
  5170. if (!appInfo) {
  5171. return;
  5172. }
  5173. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  5174. var data=new OSFLog.AppActivatedUsageData();
  5175. data.SessionId=sessionId;
  5176. data.AppId=appInfo.appId;
  5177. data.AssetId=appInfo.assetId;
  5178. data.AppURL=appInfo.appURL;
  5179. data.UserId=appInfo.userId;
  5180. data.ClientId=appInfo.clientId;
  5181. data.Browser=appInfo.browser;
  5182. data.Host=appInfo.host;
  5183. data.HostVersion=appInfo.hostVersion;
  5184. data.CorrelationId=appInfo.correlationId;
  5185. data.AppSizeWidth=window.innerWidth;
  5186. data.AppSizeHeight=window.innerHeight;
  5187. data.AppInstanceId=appInfo.appInstanceId;
  5188. data.Message=appInfo.message;
  5189. data.DocUrl=appInfo.docUrl;
  5190. data.OfficeJSVersion=appInfo.officeJSVersion;
  5191. data.HostJSVersion=appInfo.hostJSVersion;
  5192. (new AppLogger()).LogData(data);
  5193. setTimeout(function () {
  5194. if (!OSF.Logger) {
  5195. return;
  5196. }
  5197. OSF.Logger.allowUploadingData();
  5198. }, 100);
  5199. }
  5200. OSFAppTelemetry.onAppActivated=onAppActivated;
  5201. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  5202. var data=new OSFLog.ScriptLoadUsageData();
  5203. data.CorrelationId=appCorrelationId;
  5204. data.SessionId=sessionId;
  5205. data.ScriptId=scriptId;
  5206. data.StartTime=msStartTime;
  5207. data.ResponseTime=msResponseTime;
  5208. (new AppLogger()).LogData(data);
  5209. }
  5210. OSFAppTelemetry.onScriptDone=onScriptDone;
  5211. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  5212. if (!appInfo) {
  5213. return;
  5214. }
  5215. var data=new OSFLog.APIUsageUsageData();
  5216. data.CorrelationId=osfControlAppCorrelationId;
  5217. data.SessionId=sessionId;
  5218. data.APIType=apiType;
  5219. data.APIID=id;
  5220. data.Parameters=parameters;
  5221. data.ResponseTime=msResponseTime;
  5222. data.ErrorType=errorType;
  5223. (new AppLogger()).LogData(data);
  5224. }
  5225. OSFAppTelemetry.onCallDone=onCallDone;
  5226. ;
  5227. function onMethodDone(id, args, msResponseTime, errorType) {
  5228. var parameters=null;
  5229. if (args) {
  5230. if (typeof args=="number") {
  5231. parameters=String(args);
  5232. }
  5233. else if (typeof args==="object") {
  5234. for (var index in args) {
  5235. if (parameters !==null) {
  5236. parameters+=",";
  5237. }
  5238. else {
  5239. parameters="";
  5240. }
  5241. if (typeof args[index]=="number") {
  5242. parameters+=String(args[index]);
  5243. }
  5244. }
  5245. }
  5246. else {
  5247. parameters="";
  5248. }
  5249. }
  5250. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  5251. }
  5252. OSFAppTelemetry.onMethodDone=onMethodDone;
  5253. function onPropertyDone(propertyName, msResponseTime) {
  5254. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  5255. }
  5256. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5257. function onEventDone(id, errorType) {
  5258. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  5259. }
  5260. OSFAppTelemetry.onEventDone=onEventDone;
  5261. function onRegisterDone(register, id, msResponseTime, errorType) {
  5262. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  5263. }
  5264. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5265. function onAppClosed(openTime, focusTime) {
  5266. if (!appInfo) {
  5267. return;
  5268. }
  5269. var data=new OSFLog.AppClosedUsageData();
  5270. data.CorrelationId=osfControlAppCorrelationId;
  5271. data.SessionId=sessionId;
  5272. data.FocusTime=focusTime;
  5273. data.OpenTime=openTime;
  5274. data.AppSizeFinalWidth=window.innerWidth;
  5275. data.AppSizeFinalHeight=window.innerHeight;
  5276. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  5277. }
  5278. OSFAppTelemetry.onAppClosed=onAppClosed;
  5279. function setOsfControlAppCorrelationId(correlationId) {
  5280. osfControlAppCorrelationId=correlationId;
  5281. }
  5282. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5283. function doAppInitializationLogging(isException, message) {
  5284. var data=new OSFLog.AppInitializationUsageData();
  5285. data.CorrelationId=osfControlAppCorrelationId;
  5286. data.SessionId=sessionId;
  5287. data.SuccessCode=isException ? 1 : 0;
  5288. data.Message=message;
  5289. (new AppLogger()).LogData(data);
  5290. }
  5291. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5292. function logAppCommonMessage(message) {
  5293. doAppInitializationLogging(false, message);
  5294. }
  5295. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5296. function logAppException(errorMessage) {
  5297. doAppInitializationLogging(true, errorMessage);
  5298. }
  5299. OSFAppTelemetry.logAppException=logAppException;
  5300. OSF.AppTelemetry=OSFAppTelemetry;
  5301. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5302. Microsoft.Office.WebExtension.EventType={};
  5303. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  5304. this._eventHandlers={};
  5305. this._queuedEventsArgs={};
  5306. for (var entry in eventTypes) {
  5307. var eventType=eventTypes[entry];
  5308. this._eventHandlers[eventType]=[];
  5309. this._queuedEventsArgs[eventType]=[];
  5310. }
  5311. };
  5312. OSF.EventDispatch.prototype={
  5313. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  5314. var events=[];
  5315. for (var eventName in this._eventHandlers)
  5316. events.push(eventName);
  5317. return events;
  5318. },
  5319. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  5320. var isSupported=false;
  5321. for (var eventName in this._eventHandlers) {
  5322. if (event==eventName) {
  5323. isSupported=true;
  5324. break;
  5325. }
  5326. }
  5327. return isSupported;
  5328. },
  5329. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  5330. var handlers=this._eventHandlers[eventType];
  5331. if (handlers && handlers.length > 0) {
  5332. for (var h in handlers) {
  5333. if (handlers[h]===handler)
  5334. return true;
  5335. }
  5336. }
  5337. return false;
  5338. },
  5339. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  5340. if (typeof handler !="function") {
  5341. return false;
  5342. }
  5343. var handlers=this._eventHandlers[eventType];
  5344. if (handlers && !this.hasEventHandler(eventType, handler)) {
  5345. handlers.push(handler);
  5346. return true;
  5347. }
  5348. else {
  5349. return false;
  5350. }
  5351. },
  5352. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  5353. var handlers=this._eventHandlers[eventType];
  5354. var isFirstHandler=handlers.length==0;
  5355. var succeed=this.addEventHandler(eventType, handler);
  5356. if (isFirstHandler && succeed) {
  5357. this.fireQueuedEvent(eventType);
  5358. }
  5359. return succeed;
  5360. },
  5361. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  5362. var handlers=this._eventHandlers[eventType];
  5363. if (handlers && handlers.length > 0) {
  5364. for (var index=0; index < handlers.length; index++) {
  5365. if (handlers[index]===handler) {
  5366. handlers.splice(index, 1);
  5367. return true;
  5368. }
  5369. }
  5370. }
  5371. return false;
  5372. },
  5373. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  5374. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  5375. this._eventHandlers[eventType]=[];
  5376. return true;
  5377. }
  5378. return false;
  5379. },
  5380. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  5381. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  5382. },
  5383. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  5384. if (eventArgs.type==undefined)
  5385. return false;
  5386. var eventType=eventArgs.type;
  5387. if (eventType && this._eventHandlers[eventType]) {
  5388. var eventHandlers=this._eventHandlers[eventType];
  5389. for (var handler in eventHandlers)
  5390. eventHandlers[handler](eventArgs);
  5391. return true;
  5392. }
  5393. else {
  5394. return false;
  5395. }
  5396. },
  5397. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  5398. var eventType=eventArgs.type;
  5399. if (eventType && this._eventHandlers[eventType]) {
  5400. var eventHandlers=this._eventHandlers[eventType];
  5401. var queuedEvents=this._queuedEventsArgs[eventType];
  5402. if (eventHandlers.length==0) {
  5403. queuedEvents.push(eventArgs);
  5404. }
  5405. else {
  5406. this.fireEvent(eventArgs);
  5407. }
  5408. return true;
  5409. }
  5410. else {
  5411. return false;
  5412. }
  5413. },
  5414. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  5415. if (eventType && this._eventHandlers[eventType]) {
  5416. var eventHandlers=this._eventHandlers[eventType];
  5417. var queuedEvents=this._queuedEventsArgs[eventType];
  5418. if (eventHandlers.length > 0) {
  5419. var eventHandler=eventHandlers[0];
  5420. while (queuedEvents.length > 0) {
  5421. var eventArgs=queuedEvents.shift();
  5422. eventHandler(eventArgs);
  5423. }
  5424. return true;
  5425. }
  5426. }
  5427. return false;
  5428. }
  5429. };
  5430. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5431. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  5432. var args;
  5433. switch (eventType) {
  5434. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  5435. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  5436. break;
  5437. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  5438. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  5439. break;
  5440. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  5441. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  5442. break;
  5443. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  5444. args=new OSF.DDA.SettingsChangedEventArgs(target);
  5445. break;
  5446. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  5447. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  5448. break;
  5449. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  5450. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  5451. break;
  5452. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  5453. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  5454. break;
  5455. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  5456. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  5457. break;
  5458. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  5459. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5460. break;
  5461. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  5462. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5463. break;
  5464. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  5465. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5466. break;
  5467. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  5468. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  5469. break;
  5470. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  5471. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  5472. break;
  5473. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  5474. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  5475. break;
  5476. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  5477. args=new OSF.DDA.DialogEventArgs(eventProperties);
  5478. break;
  5479. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  5480. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  5481. break;
  5482. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  5483. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  5484. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  5485. target.initialize(args["initialData"]);
  5486. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  5487. }
  5488. else {
  5489. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5490. }
  5491. break;
  5492. default:
  5493. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5494. }
  5495. return args;
  5496. };
  5497. OSF.DDA.AsyncMethodNames.addNames({
  5498. AddHandlerAsync: "addHandlerAsync",
  5499. RemoveHandlerAsync: "removeHandlerAsync"
  5500. });
  5501. OSF.DDA.AsyncMethodCalls.define({
  5502. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  5503. requiredArguments: [{
  5504. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5505. "enum": Microsoft.Office.WebExtension.EventType,
  5506. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5507. },
  5508. {
  5509. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5510. "types": ["function"]
  5511. }
  5512. ],
  5513. supportedOptions: [],
  5514. privateStateCallbacks: []
  5515. });
  5516. OSF.DDA.AsyncMethodCalls.define({
  5517. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  5518. requiredArguments: [
  5519. {
  5520. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5521. "enum": Microsoft.Office.WebExtension.EventType,
  5522. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5523. }
  5524. ],
  5525. supportedOptions: [
  5526. {
  5527. name: Microsoft.Office.WebExtension.Parameters.Handler,
  5528. value: {
  5529. "types": ["function", "object"],
  5530. "defaultValue": null
  5531. }
  5532. }
  5533. ],
  5534. privateStateCallbacks: []
  5535. });
  5536. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  5537. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  5538. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  5539. });
  5540. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5541. DialogMessageReceived: "dialogMessageReceived",
  5542. DialogEventReceived: "dialogEventReceived"
  5543. });
  5544. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5545. MessageType: "messageType",
  5546. MessageContent: "messageContent"
  5547. });
  5548. OSF.DDA.DialogEventType={};
  5549. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  5550. DialogClosed: "dialogClosed",
  5551. NavigationFailed: "naviationFailed"
  5552. });
  5553. OSF.DDA.AsyncMethodNames.addNames({
  5554. DisplayDialogAsync: "displayDialogAsync",
  5555. CloseAsync: "close"
  5556. });
  5557. OSF.DDA.SyncMethodNames.addNames({
  5558. MessageParent: "messageParent",
  5559. AddMessageHandler: "addEventHandler",
  5560. SendMessage: "sendMessage"
  5561. });
  5562. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  5563. var eventDispatch=new OSF.EventDispatch([
  5564. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  5565. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  5566. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5567. ]);
  5568. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  5569. var target=this;
  5570. if (!target[openDialogName]) {
  5571. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  5572. value: function () {
  5573. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  5574. openDialog(arguments, eventDispatch, target);
  5575. }
  5576. });
  5577. }
  5578. OSF.OUtil.finalizeProperties(this);
  5579. };
  5580. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  5581. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  5582. var target=this;
  5583. if (!target[messageParentName]) {
  5584. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  5585. value: function () {
  5586. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  5587. return messageParent(arguments, target);
  5588. }
  5589. });
  5590. }
  5591. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5592. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  5593. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  5594. }
  5595. OSF.OUtil.finalizeProperties(this);
  5596. };
  5597. OSF.DialogHandler=function OSF_DialogHandler() { };
  5598. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  5599. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  5600. OSF.OUtil.defineEnumerableProperties(this, {
  5601. "type": {
  5602. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  5603. },
  5604. "message": {
  5605. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5606. }
  5607. });
  5608. }
  5609. else {
  5610. OSF.OUtil.defineEnumerableProperties(this, {
  5611. "type": {
  5612. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  5613. },
  5614. "error": {
  5615. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5616. }
  5617. });
  5618. }
  5619. };
  5620. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  5621. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  5622. OSF.OUtil.defineEnumerableProperties(this, {
  5623. "type": {
  5624. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  5625. },
  5626. "message": {
  5627. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5628. }
  5629. });
  5630. }
  5631. else {
  5632. OSF.OUtil.defineEnumerableProperties(this, {
  5633. "type": {
  5634. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  5635. },
  5636. "error": {
  5637. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5638. }
  5639. });
  5640. }
  5641. };
  5642. OSF.DDA.AsyncMethodCalls.define({
  5643. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  5644. requiredArguments: [
  5645. {
  5646. "name": Microsoft.Office.WebExtension.Parameters.Url,
  5647. "types": ["string"]
  5648. }
  5649. ],
  5650. supportedOptions: [
  5651. {
  5652. name: Microsoft.Office.WebExtension.Parameters.Width,
  5653. value: {
  5654. "types": ["number"],
  5655. "defaultValue": 99
  5656. }
  5657. },
  5658. {
  5659. name: Microsoft.Office.WebExtension.Parameters.Height,
  5660. value: {
  5661. "types": ["number"],
  5662. "defaultValue": 99
  5663. }
  5664. },
  5665. {
  5666. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  5667. value: {
  5668. "types": ["boolean"],
  5669. "defaultValue": true
  5670. }
  5671. },
  5672. {
  5673. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  5674. value: {
  5675. "types": ["boolean"],
  5676. "defaultValue": false
  5677. }
  5678. }
  5679. ],
  5680. privateStateCallbacks: [],
  5681. onSucceeded: function (args, caller, callArgs) {
  5682. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  5683. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  5684. var dialog=new OSF.DialogHandler();
  5685. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  5686. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  5687. value: function () {
  5688. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  5689. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  5690. }
  5691. });
  5692. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5693. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  5694. value: function () {
  5695. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  5696. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  5697. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  5698. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  5699. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  5700. }
  5701. });
  5702. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  5703. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  5704. value: function () {
  5705. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  5706. return execute(arguments, eventDispatch, dialog);
  5707. }
  5708. });
  5709. return dialog;
  5710. },
  5711. checkCallArgs: function (callArgs, caller, stateInfo) {
  5712. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  5713. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  5714. }
  5715. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  5716. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  5717. }
  5718. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  5719. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  5720. }
  5721. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  5722. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  5723. }
  5724. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  5725. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  5726. }
  5727. return callArgs;
  5728. }
  5729. });
  5730. OSF.DDA.AsyncMethodCalls.define({
  5731. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  5732. requiredArguments: [],
  5733. supportedOptions: [],
  5734. privateStateCallbacks: []
  5735. });
  5736. OSF.DDA.SyncMethodCalls.define({
  5737. method: OSF.DDA.SyncMethodNames.MessageParent,
  5738. requiredArguments: [
  5739. {
  5740. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  5741. "types": ["string", "number", "boolean"]
  5742. }
  5743. ],
  5744. supportedOptions: []
  5745. });
  5746. OSF.DDA.SyncMethodCalls.define({
  5747. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  5748. requiredArguments: [
  5749. {
  5750. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5751. "enum": Microsoft.Office.WebExtension.EventType,
  5752. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5753. },
  5754. {
  5755. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5756. "types": ["function"]
  5757. }
  5758. ],
  5759. supportedOptions: []
  5760. });
  5761. OSF.DDA.SyncMethodCalls.define({
  5762. method: OSF.DDA.SyncMethodNames.SendMessage,
  5763. requiredArguments: [
  5764. {
  5765. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  5766. "types": ["string"]
  5767. }
  5768. ],
  5769. supportedOptions: [],
  5770. privateStateCallbacks: []
  5771. });
  5772. OSF.DDA.SafeArray.Delegate.openDialog=function OSF_DDA_SafeArray_Delegate$OpenDialog(args) {
  5773. try {
  5774. if (args.onCalling) {
  5775. args.onCalling();
  5776. }
  5777. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  5778. OSF.ClientHostController.openDialog(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  5779. if (args.onEvent) {
  5780. args.onEvent(payload);
  5781. }
  5782. if (OSF.AppTelemetry) {
  5783. OSF.AppTelemetry.onEventDone(args.dispId);
  5784. }
  5785. }, callback);
  5786. }
  5787. catch (ex) {
  5788. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5789. }
  5790. };
  5791. OSF.DDA.SafeArray.Delegate.closeDialog=function OSF_DDA_SafeArray_Delegate$CloseDialog(args) {
  5792. if (args.onCalling) {
  5793. args.onCalling();
  5794. }
  5795. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  5796. try {
  5797. OSF.ClientHostController.closeDialog(args.dispId, args.targetId, callback);
  5798. }
  5799. catch (ex) {
  5800. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5801. }
  5802. };
  5803. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args) {
  5804. try {
  5805. if (args.onCalling) {
  5806. args.onCalling();
  5807. }
  5808. var startTime=(new Date()).getTime();
  5809. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  5810. if (args.onReceiving) {
  5811. args.onReceiving();
  5812. }
  5813. if (OSF.AppTelemetry) {
  5814. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), result);
  5815. }
  5816. return result;
  5817. }
  5818. catch (ex) {
  5819. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex);
  5820. }
  5821. };
  5822. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5823. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  5824. fromHost: [
  5825. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5826. ],
  5827. isComplexType: true
  5828. });
  5829. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5830. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  5831. fromHost: [
  5832. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5833. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5834. ],
  5835. isComplexType: true
  5836. });
  5837. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5838. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  5839. fromHost: [
  5840. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5841. ],
  5842. isComplexType: true
  5843. });
  5844. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5845. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  5846. fromHost: [
  5847. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5848. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5849. ],
  5850. isComplexType: true
  5851. });
  5852. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5853. function fixData(data) {
  5854. if (data==null || data==undefined) {
  5855. return null;
  5856. }
  5857. try {
  5858. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5859. data=[data];
  5860. }
  5861. return data;
  5862. }
  5863. catch (ex) {
  5864. }
  5865. }
  5866. ;
  5867. OSF.OUtil.defineEnumerableProperties(this, {
  5868. "headers": {
  5869. get: function () { return headers; },
  5870. set: function (value) {
  5871. headers=fixData(value);
  5872. }
  5873. },
  5874. "rows": {
  5875. get: function () { return rows; },
  5876. set: function (value) {
  5877. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  5878. [] :
  5879. fixData(value);
  5880. }
  5881. }
  5882. });
  5883. this.headers=headers;
  5884. this.rows=rows;
  5885. };
  5886. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5887. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5888. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5889. };
  5890. Microsoft.Office.WebExtension.CoercionType={
  5891. Text: "text",
  5892. Matrix: "matrix",
  5893. Table: "table"
  5894. };
  5895. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  5896. return {
  5897. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5898. if (OSF.OUtil.isArray(obj)) {
  5899. var dim=0;
  5900. for (var index=0; index < obj.length; index++) {
  5901. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5902. }
  5903. return dim+1;
  5904. }
  5905. else {
  5906. return 0;
  5907. }
  5908. },
  5909. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5910. switch (bindingType) {
  5911. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5912. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  5913. case Microsoft.Office.WebExtension.BindingType.Text:
  5914. default:
  5915. return Microsoft.Office.WebExtension.CoercionType.Text;
  5916. }
  5917. },
  5918. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5919. switch (coercionType) {
  5920. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  5921. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  5922. case Microsoft.Office.WebExtension.CoercionType.Text:
  5923. case Microsoft.Office.WebExtension.CoercionType.Html:
  5924. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5925. default:
  5926. return Microsoft.Office.WebExtension.BindingType.Text;
  5927. }
  5928. },
  5929. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5930. if (data==null || data==undefined)
  5931. return null;
  5932. var sourceType=null;
  5933. var runtimeType=typeof data;
  5934. if (data.rows !==undefined) {
  5935. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  5936. }
  5937. else if (OSF.OUtil.isArray(data)) {
  5938. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  5939. }
  5940. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  5941. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  5942. }
  5943. else {
  5944. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5945. }
  5946. return sourceType;
  5947. },
  5948. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5949. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5950. if (sourceType && sourceType !=destinationType) {
  5951. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5952. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5953. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5954. }
  5955. return data;
  5956. },
  5957. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5958. if (matrix.length==1 && matrix[0].length==1)
  5959. return ""+matrix[0][0];
  5960. var val="";
  5961. for (var i=0; i < matrix.length; i++) {
  5962. val+=matrix[i].join("\t")+"\n";
  5963. }
  5964. return val.substring(0, val.length - 1);
  5965. },
  5966. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5967. var ret=text.split("\n");
  5968. for (var i=0; i < ret.length; i++)
  5969. ret[i]=ret[i].split("\t");
  5970. return ret;
  5971. },
  5972. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5973. var headers="";
  5974. if (table.headers !=null) {
  5975. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  5976. }
  5977. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  5978. if (rows=="") {
  5979. headers=headers.substring(0, headers.length - 1);
  5980. }
  5981. return headers+rows;
  5982. },
  5983. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5984. var matrix=table.rows;
  5985. if (table.headers !=null) {
  5986. matrix.unshift(table.headers);
  5987. }
  5988. return matrix;
  5989. },
  5990. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5991. var value;
  5992. switch (coercionType) {
  5993. case Microsoft.Office.WebExtension.CoercionType.Table:
  5994. value=table;
  5995. break;
  5996. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5997. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  5998. break;
  5999. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  6000. value=null;
  6001. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  6002. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  6003. }
  6004. if (value==null) {
  6005. value=OSF.DDA.DataCoercion._tableToText(table);
  6006. }
  6007. break;
  6008. case Microsoft.Office.WebExtension.CoercionType.Text:
  6009. case Microsoft.Office.WebExtension.CoercionType.Html:
  6010. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6011. default:
  6012. value=OSF.DDA.DataCoercion._tableToText(table);
  6013. break;
  6014. }
  6015. return value;
  6016. },
  6017. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  6018. if (sourceType==undefined) {
  6019. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  6020. }
  6021. var value;
  6022. switch (sourceType) {
  6023. case Microsoft.Office.WebExtension.CoercionType.Table:
  6024. value=data;
  6025. break;
  6026. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  6027. value=new Microsoft.Office.WebExtension.TableData(data);
  6028. break;
  6029. case Microsoft.Office.WebExtension.CoercionType.Text:
  6030. case Microsoft.Office.WebExtension.CoercionType.Html:
  6031. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6032. default:
  6033. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  6034. break;
  6035. }
  6036. return value;
  6037. }
  6038. };
  6039. })();
  6040. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6041. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6042. toHost: [
  6043. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  6044. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  6045. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  6046. ]
  6047. });
  6048. OSF.DDA.AsyncMethodNames.addNames({
  6049. GetSelectedDataAsync: "getSelectedDataAsync",
  6050. SetSelectedDataAsync: "setSelectedDataAsync"
  6051. });
  6052. (function () {
  6053. function processData(dataDescriptor, caller, callArgs) {
  6054. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6055. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6056. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6057. }
  6058. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6059. return data==undefined ? null : data;
  6060. }
  6061. OSF.DDA.AsyncMethodCalls.define({
  6062. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  6063. requiredArguments: [
  6064. {
  6065. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  6066. "enum": Microsoft.Office.WebExtension.CoercionType
  6067. }
  6068. ],
  6069. supportedOptions: [
  6070. {
  6071. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6072. value: {
  6073. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6074. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6075. }
  6076. },
  6077. {
  6078. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6079. value: {
  6080. "enum": Microsoft.Office.WebExtension.FilterType,
  6081. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6082. }
  6083. }
  6084. ],
  6085. privateStateCallbacks: [],
  6086. onSucceeded: processData
  6087. });
  6088. OSF.DDA.AsyncMethodCalls.define({
  6089. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  6090. requiredArguments: [
  6091. {
  6092. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6093. "types": ["string", "object", "number", "boolean"]
  6094. }
  6095. ],
  6096. supportedOptions: [
  6097. {
  6098. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6099. value: {
  6100. "enum": Microsoft.Office.WebExtension.CoercionType,
  6101. "calculate": function (requiredArgs) {
  6102. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  6103. }
  6104. }
  6105. },
  6106. {
  6107. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  6108. value: {
  6109. "types": ["number", "boolean"],
  6110. "defaultValue": false
  6111. }
  6112. },
  6113. {
  6114. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  6115. value: {
  6116. "types": ["number", "boolean"],
  6117. "defaultValue": false
  6118. }
  6119. },
  6120. {
  6121. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  6122. value: {
  6123. "types": ["number", "boolean"],
  6124. "defaultValue": false
  6125. }
  6126. },
  6127. {
  6128. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  6129. value: {
  6130. "types": ["number", "boolean"],
  6131. "defaultValue": false
  6132. }
  6133. }
  6134. ],
  6135. privateStateCallbacks: []
  6136. });
  6137. })();
  6138. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6139. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  6140. fromHost: [
  6141. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6142. ],
  6143. toHost: [
  6144. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  6145. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  6146. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  6147. ]
  6148. });
  6149. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6150. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  6151. toHost: [
  6152. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  6153. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  6154. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  6155. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  6156. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  6157. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 },
  6158. ]
  6159. });
  6160. OSF.DDA.SettingsManager={
  6161. SerializedSettings: "serializedSettings",
  6162. RefreshingSettings: "refreshingSettings",
  6163. DateJSONPrefix: "Date(",
  6164. DataJSONSuffix: ")",
  6165. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  6166. var ret={};
  6167. for (var key in settingsCollection) {
  6168. var value=settingsCollection[key];
  6169. try {
  6170. if (JSON) {
  6171. value=JSON.stringify(value, function dateReplacer(k, v) {
  6172. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  6173. });
  6174. }
  6175. else {
  6176. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  6177. }
  6178. ret[key]=value;
  6179. }
  6180. catch (ex) {
  6181. }
  6182. }
  6183. return ret;
  6184. },
  6185. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  6186. var ret={};
  6187. serializedSettings=serializedSettings || {};
  6188. for (var key in serializedSettings) {
  6189. var value=serializedSettings[key];
  6190. try {
  6191. if (JSON) {
  6192. value=JSON.parse(value, function dateReviver(k, v) {
  6193. var d;
  6194. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  6195. d=new Date(parseInt(v.slice(5, -1)));
  6196. if (d) {
  6197. return d;
  6198. }
  6199. }
  6200. return v;
  6201. });
  6202. }
  6203. else {
  6204. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  6205. }
  6206. ret[key]=value;
  6207. }
  6208. catch (ex) {
  6209. }
  6210. }
  6211. return ret;
  6212. }
  6213. };
  6214. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  6215. settings=settings || {};
  6216. var cacheSessionSettings=function (settings) {
  6217. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  6218. if (osfSessionStorage) {
  6219. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  6220. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  6221. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  6222. }
  6223. };
  6224. OSF.OUtil.defineEnumerableProperties(this, {
  6225. "get": {
  6226. value: function OSF_DDA_Settings$get(name) {
  6227. var e=Function._validateParams(arguments, [
  6228. { name: "name", type: String, mayBeNull: false }
  6229. ]);
  6230. if (e)
  6231. throw e;
  6232. var setting=settings[name];
  6233. return typeof (setting)==='undefined' ? null : setting;
  6234. }
  6235. },
  6236. "set": {
  6237. value: function OSF_DDA_Settings$set(name, value) {
  6238. var e=Function._validateParams(arguments, [
  6239. { name: "name", type: String, mayBeNull: false },
  6240. { name: "value", mayBeNull: true }
  6241. ]);
  6242. if (e)
  6243. throw e;
  6244. settings[name]=value;
  6245. cacheSessionSettings(settings);
  6246. }
  6247. },
  6248. "remove": {
  6249. value: function OSF_DDA_Settings$remove(name) {
  6250. var e=Function._validateParams(arguments, [
  6251. { name: "name", type: String, mayBeNull: false }
  6252. ]);
  6253. if (e)
  6254. throw e;
  6255. delete settings[name];
  6256. cacheSessionSettings(settings);
  6257. }
  6258. }
  6259. });
  6260. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  6261. };
  6262. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  6263. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  6264. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  6265. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  6266. };
  6267. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  6268. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6269. SettingsChanged: "settingsChanged"
  6270. });
  6271. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  6272. OSF.OUtil.defineEnumerableProperties(this, {
  6273. "type": {
  6274. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  6275. },
  6276. "settings": {
  6277. value: settingsInstance
  6278. }
  6279. });
  6280. };
  6281. OSF.DDA.AsyncMethodNames.addNames({
  6282. RefreshAsync: "refreshAsync",
  6283. SaveAsync: "saveAsync"
  6284. });
  6285. OSF.DDA.AsyncMethodCalls.define({
  6286. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6287. requiredArguments: [],
  6288. supportedOptions: [],
  6289. privateStateCallbacks: [
  6290. {
  6291. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6292. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6293. return settingsCollection;
  6294. }
  6295. }
  6296. ],
  6297. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6298. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6299. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6300. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6301. for (var setting in oldSettings) {
  6302. refreshingSettings.remove(setting);
  6303. }
  6304. for (var setting in newSettings) {
  6305. refreshingSettings.set(setting, newSettings[setting]);
  6306. }
  6307. return refreshingSettings;
  6308. }
  6309. });
  6310. OSF.DDA.AsyncMethodCalls.define({
  6311. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6312. requiredArguments: [],
  6313. supportedOptions: [
  6314. {
  6315. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6316. value: {
  6317. "types": ["boolean"],
  6318. "defaultValue": true
  6319. }
  6320. }
  6321. ],
  6322. privateStateCallbacks: [
  6323. {
  6324. name: OSF.DDA.SettingsManager.SerializedSettings,
  6325. value: function serializeSettings(settingsInstance, settingsCollection) {
  6326. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6327. }
  6328. }
  6329. ]
  6330. });
  6331. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6332. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6333. fromHost: [
  6334. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6335. ]
  6336. });
  6337. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6338. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6339. toHost: [
  6340. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  6341. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  6342. ]
  6343. });
  6344. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6345. Microsoft.Office.WebExtension.BindingType={
  6346. Table: "table",
  6347. Text: "text",
  6348. Matrix: "matrix"
  6349. };
  6350. OSF.DDA.BindingProperties={
  6351. Id: "BindingId",
  6352. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6353. };
  6354. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6355. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6356. Subset: "subset",
  6357. BindingProperties: "BindingProperties"
  6358. });
  6359. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6360. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6361. this._id=bindingId;
  6362. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6363. get: function () {
  6364. return errorCallback;
  6365. },
  6366. set: function (onError) {
  6367. var t=typeof onError;
  6368. if (t !="undefined" && t !="function") {
  6369. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6370. }
  6371. errorCallback=onError;
  6372. }
  6373. });
  6374. };
  6375. OSF.DDA.BindingPromise.prototype={
  6376. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6377. if (this.binding) {
  6378. if (onComplete)
  6379. onComplete(this.binding);
  6380. }
  6381. else {
  6382. if (!this._binding) {
  6383. var me=this;
  6384. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6385. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6386. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6387. value: asyncResult.value
  6388. });
  6389. if (onComplete)
  6390. onComplete(me.binding);
  6391. }
  6392. else {
  6393. if (me.onFail)
  6394. me.onFail(asyncResult);
  6395. }
  6396. });
  6397. }
  6398. }
  6399. return this;
  6400. },
  6401. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6402. var args=arguments;
  6403. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6404. return this;
  6405. },
  6406. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6407. var args=arguments;
  6408. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6409. return this;
  6410. },
  6411. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6412. var args=arguments;
  6413. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6414. return this;
  6415. },
  6416. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6417. var args=arguments;
  6418. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6419. return this;
  6420. }
  6421. };
  6422. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6423. this._eventDispatches=[];
  6424. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6425. value: docInstance
  6426. });
  6427. var am=OSF.DDA.AsyncMethodNames;
  6428. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6429. am.AddFromSelectionAsync,
  6430. am.AddFromNamedItemAsync,
  6431. am.GetAllAsync,
  6432. am.GetByIdAsync,
  6433. am.ReleaseByIdAsync
  6434. ]);
  6435. };
  6436. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6437. OSF.OUtil.defineEnumerableProperties(this, {
  6438. "document": { value: docInstance },
  6439. "id": { value: id }
  6440. });
  6441. };
  6442. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6443. OSF.OUtil.defineEnumerableProperties(this, {
  6444. "document": {
  6445. value: docInstance
  6446. },
  6447. "id": {
  6448. value: id
  6449. }
  6450. });
  6451. var am=OSF.DDA.AsyncMethodNames;
  6452. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6453. am.GetDataAsync,
  6454. am.SetDataAsync
  6455. ]);
  6456. var et=Microsoft.Office.WebExtension.EventType;
  6457. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6458. if (!bindingEventDispatches[id]) {
  6459. bindingEventDispatches[id]=new OSF.EventDispatch([
  6460. et.BindingSelectionChanged,
  6461. et.BindingDataChanged
  6462. ]);
  6463. }
  6464. var eventDispatch=bindingEventDispatches[id];
  6465. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6466. };
  6467. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6468. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6469. };
  6470. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6471. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6472. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6473. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6474. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6475. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6476. var binding;
  6477. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6478. case Microsoft.Office.WebExtension.BindingType.Text:
  6479. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6480. break;
  6481. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6482. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6483. break;
  6484. case Microsoft.Office.WebExtension.BindingType.Table:
  6485. var isExcelApp=function () {
  6486. return (OSF.DDA.ExcelDocument)
  6487. && (Microsoft.Office.WebExtension.context.document)
  6488. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6489. };
  6490. var tableBindingObject;
  6491. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6492. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6493. }
  6494. else {
  6495. tableBindingObject=OSF.DDA.TableBinding;
  6496. }
  6497. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6498. break;
  6499. default:
  6500. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6501. }
  6502. return binding;
  6503. };
  6504. OSF.DDA.AsyncMethodNames.addNames({
  6505. AddFromSelectionAsync: "addFromSelectionAsync",
  6506. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6507. GetAllAsync: "getAllAsync",
  6508. GetByIdAsync: "getByIdAsync",
  6509. ReleaseByIdAsync: "releaseByIdAsync",
  6510. GetDataAsync: "getDataAsync",
  6511. SetDataAsync: "setDataAsync"
  6512. });
  6513. (function () {
  6514. function processBinding(bindingDescriptor) {
  6515. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6516. }
  6517. function getObjectId(obj) { return obj.id; }
  6518. function processData(dataDescriptor, caller, callArgs) {
  6519. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6520. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6521. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6522. }
  6523. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6524. return data==undefined ? null : data;
  6525. }
  6526. OSF.DDA.AsyncMethodCalls.define({
  6527. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  6528. requiredArguments: [
  6529. {
  6530. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6531. "enum": Microsoft.Office.WebExtension.BindingType
  6532. }
  6533. ],
  6534. supportedOptions: [{
  6535. name: Microsoft.Office.WebExtension.Parameters.Id,
  6536. value: {
  6537. "types": ["string"],
  6538. "calculate": OSF.DDA.generateBindingId
  6539. }
  6540. },
  6541. {
  6542. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6543. value: {
  6544. "types": ["object"],
  6545. "defaultValue": null
  6546. }
  6547. }
  6548. ],
  6549. privateStateCallbacks: [],
  6550. onSucceeded: processBinding
  6551. });
  6552. OSF.DDA.AsyncMethodCalls.define({
  6553. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  6554. requiredArguments: [{
  6555. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  6556. "types": ["string"]
  6557. },
  6558. {
  6559. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  6560. "enum": Microsoft.Office.WebExtension.BindingType
  6561. }
  6562. ],
  6563. supportedOptions: [{
  6564. name: Microsoft.Office.WebExtension.Parameters.Id,
  6565. value: {
  6566. "types": ["string"],
  6567. "calculate": OSF.DDA.generateBindingId
  6568. }
  6569. },
  6570. {
  6571. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6572. value: {
  6573. "types": ["object"],
  6574. "defaultValue": null
  6575. }
  6576. }
  6577. ],
  6578. privateStateCallbacks: [
  6579. {
  6580. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  6581. value: function () { return true; }
  6582. }
  6583. ],
  6584. onSucceeded: processBinding
  6585. });
  6586. OSF.DDA.AsyncMethodCalls.define({
  6587. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  6588. requiredArguments: [],
  6589. supportedOptions: [],
  6590. privateStateCallbacks: [],
  6591. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  6592. });
  6593. OSF.DDA.AsyncMethodCalls.define({
  6594. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  6595. requiredArguments: [
  6596. {
  6597. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6598. "types": ["string"]
  6599. }
  6600. ],
  6601. supportedOptions: [],
  6602. privateStateCallbacks: [],
  6603. onSucceeded: processBinding
  6604. });
  6605. OSF.DDA.AsyncMethodCalls.define({
  6606. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  6607. requiredArguments: [
  6608. {
  6609. "name": Microsoft.Office.WebExtension.Parameters.Id,
  6610. "types": ["string"]
  6611. }
  6612. ],
  6613. supportedOptions: [],
  6614. privateStateCallbacks: [],
  6615. onSucceeded: function (response, caller, callArgs) {
  6616. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  6617. delete caller._eventDispatches[id];
  6618. }
  6619. });
  6620. OSF.DDA.AsyncMethodCalls.define({
  6621. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  6622. requiredArguments: [],
  6623. supportedOptions: [{
  6624. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6625. value: {
  6626. "enum": Microsoft.Office.WebExtension.CoercionType,
  6627. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  6628. }
  6629. },
  6630. {
  6631. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6632. value: {
  6633. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6634. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6635. }
  6636. },
  6637. {
  6638. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6639. value: {
  6640. "enum": Microsoft.Office.WebExtension.FilterType,
  6641. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6642. }
  6643. },
  6644. {
  6645. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6646. value: {
  6647. "types": ["object", "string"],
  6648. "defaultValue": null
  6649. }
  6650. },
  6651. {
  6652. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6653. value: {
  6654. "types": ["object"],
  6655. "defaultValue": null
  6656. }
  6657. },
  6658. {
  6659. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6660. value: {
  6661. "types": ["number"],
  6662. "defaultValue": 0
  6663. }
  6664. },
  6665. {
  6666. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6667. value: {
  6668. "types": ["number"],
  6669. "defaultValue": 0
  6670. }
  6671. },
  6672. {
  6673. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  6674. value: {
  6675. "types": ["number"],
  6676. "defaultValue": 0
  6677. }
  6678. },
  6679. {
  6680. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  6681. value: {
  6682. "types": ["number"],
  6683. "defaultValue": 0
  6684. }
  6685. }
  6686. ],
  6687. checkCallArgs: function (callArgs, caller, stateInfo) {
  6688. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6689. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  6690. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  6691. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  6692. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6693. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6694. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  6695. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  6696. }
  6697. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6698. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6699. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  6700. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  6701. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  6702. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6703. }
  6704. return callArgs;
  6705. },
  6706. privateStateCallbacks: [
  6707. {
  6708. name: Microsoft.Office.WebExtension.Parameters.Id,
  6709. value: getObjectId
  6710. }
  6711. ],
  6712. onSucceeded: processData
  6713. });
  6714. OSF.DDA.AsyncMethodCalls.define({
  6715. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  6716. requiredArguments: [
  6717. {
  6718. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6719. "types": ["string", "object", "number", "boolean"]
  6720. }
  6721. ],
  6722. supportedOptions: [{
  6723. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6724. value: {
  6725. "enum": Microsoft.Office.WebExtension.CoercionType,
  6726. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  6727. }
  6728. },
  6729. {
  6730. name: Microsoft.Office.WebExtension.Parameters.Rows,
  6731. value: {
  6732. "types": ["object", "string"],
  6733. "defaultValue": null
  6734. }
  6735. },
  6736. {
  6737. name: Microsoft.Office.WebExtension.Parameters.Columns,
  6738. value: {
  6739. "types": ["object"],
  6740. "defaultValue": null
  6741. }
  6742. },
  6743. {
  6744. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  6745. value: {
  6746. "types": ["number"],
  6747. "defaultValue": 0
  6748. }
  6749. },
  6750. {
  6751. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  6752. value: {
  6753. "types": ["number"],
  6754. "defaultValue": 0
  6755. }
  6756. }
  6757. ],
  6758. checkCallArgs: function (callArgs, caller, stateInfo) {
  6759. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  6760. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  6761. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  6762. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  6763. }
  6764. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  6765. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  6766. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  6767. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  6768. }
  6769. return callArgs;
  6770. },
  6771. privateStateCallbacks: [
  6772. {
  6773. name: Microsoft.Office.WebExtension.Parameters.Id,
  6774. value: getObjectId
  6775. }
  6776. ]
  6777. });
  6778. })();
  6779. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6780. RowCount: "BindingRowCount",
  6781. ColumnCount: "BindingColumnCount",
  6782. HasHeaders: "HasHeaders"
  6783. });
  6784. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  6785. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  6786. OSF.OUtil.defineEnumerableProperties(this, {
  6787. "type": {
  6788. value: Microsoft.Office.WebExtension.BindingType.Matrix
  6789. },
  6790. "rowCount": {
  6791. value: rows ? rows : 0
  6792. },
  6793. "columnCount": {
  6794. value: cols ? cols : 0
  6795. }
  6796. });
  6797. };
  6798. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  6799. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6800. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  6801. fromHost: [
  6802. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  6803. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  6804. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  6805. ],
  6806. isComplexType: true
  6807. });
  6808. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6809. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  6810. toHost: [
  6811. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  6812. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  6813. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  6814. ],
  6815. invertible: true
  6816. });
  6817. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6818. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  6819. fromHost: [
  6820. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6821. ],
  6822. toHost: [
  6823. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6824. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  6825. ]
  6826. });
  6827. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6828. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  6829. fromHost: [
  6830. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6831. ],
  6832. toHost: [
  6833. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  6834. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  6835. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  6836. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  6837. ]
  6838. });
  6839. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6840. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  6841. toHost: [
  6842. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6843. ]
  6844. });
  6845. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6846. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  6847. fromHost: [
  6848. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6849. ],
  6850. toHost: [
  6851. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6852. ]
  6853. });
  6854. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6855. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  6856. fromHost: [
  6857. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6858. ]
  6859. });
  6860. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6861. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  6862. fromHost: [
  6863. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6864. ],
  6865. toHost: [
  6866. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6867. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6868. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  6869. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  6870. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  6871. ]
  6872. });
  6873. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6874. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  6875. toHost: [
  6876. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6877. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  6878. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  6879. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  6880. ]
  6881. });
  6882. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6883. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  6884. fromHost: [
  6885. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  6886. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  6887. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  6888. ],
  6889. isComplexType: true
  6890. });
  6891. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6892. type: OSF.DDA.PropertyDescriptors.Subset,
  6893. toHost: [
  6894. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  6895. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  6896. ],
  6897. canonical: true,
  6898. isComplexType: true
  6899. });
  6900. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6901. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  6902. toHost: [
  6903. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  6904. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  6905. ],
  6906. canonical: true,
  6907. isComplexType: true
  6908. });
  6909. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6910. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  6911. toHost: [
  6912. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  6913. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  6914. ],
  6915. canonical: true,
  6916. isComplexType: true
  6917. });
  6918. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6919. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  6920. toHost: [
  6921. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6922. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6923. ]
  6924. });
  6925. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6926. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  6927. toHost: [
  6928. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6929. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6930. ]
  6931. });
  6932. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6933. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  6934. toHost: [
  6935. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6936. ]
  6937. });
  6938. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  6939. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  6940. RowCount: "BindingRowCount",
  6941. ColumnCount: "BindingColumnCount",
  6942. HasHeaders: "HasHeaders"
  6943. });
  6944. OSF.DDA.TableDataProperties={
  6945. TableRows: "TableRows",
  6946. TableHeaders: "TableHeaders"
  6947. };
  6948. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  6949. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  6950. OSF.OUtil.defineEnumerableProperties(this, {
  6951. "type": {
  6952. value: Microsoft.Office.WebExtension.BindingType.Table
  6953. },
  6954. "rowCount": {
  6955. value: rows ? rows : 0
  6956. },
  6957. "columnCount": {
  6958. value: cols ? cols : 0
  6959. },
  6960. "hasHeaders": {
  6961. value: hasHeaders ? hasHeaders : false
  6962. }
  6963. });
  6964. var am=OSF.DDA.AsyncMethodNames;
  6965. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6966. am.AddRowsAsync,
  6967. am.AddColumnsAsync,
  6968. am.DeleteAllDataValuesAsync
  6969. ]);
  6970. };
  6971. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  6972. OSF.DDA.AsyncMethodNames.addNames({
  6973. AddRowsAsync: "addRowsAsync",
  6974. AddColumnsAsync: "addColumnsAsync",
  6975. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  6976. });
  6977. (function () {
  6978. function getObjectId(obj) { return obj.id; }
  6979. OSF.DDA.AsyncMethodCalls.define({
  6980. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  6981. requiredArguments: [
  6982. {
  6983. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6984. "types": ["object"]
  6985. }
  6986. ],
  6987. supportedOptions: [],
  6988. privateStateCallbacks: [
  6989. {
  6990. name: Microsoft.Office.WebExtension.Parameters.Id,
  6991. value: getObjectId
  6992. }
  6993. ]
  6994. });
  6995. OSF.DDA.AsyncMethodCalls.define({
  6996. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  6997. requiredArguments: [
  6998. {
  6999. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7000. "types": ["object"]
  7001. }
  7002. ],
  7003. supportedOptions: [],
  7004. privateStateCallbacks: [
  7005. {
  7006. name: Microsoft.Office.WebExtension.Parameters.Id,
  7007. value: getObjectId
  7008. }
  7009. ]
  7010. });
  7011. OSF.DDA.AsyncMethodCalls.define({
  7012. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  7013. requiredArguments: [],
  7014. supportedOptions: [],
  7015. privateStateCallbacks: [
  7016. {
  7017. name: Microsoft.Office.WebExtension.Parameters.Id,
  7018. value: getObjectId
  7019. }
  7020. ]
  7021. });
  7022. })();
  7023. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  7024. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  7025. OSF.OUtil.defineEnumerableProperty(this, "type", {
  7026. value: Microsoft.Office.WebExtension.BindingType.Text
  7027. });
  7028. };
  7029. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  7030. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  7031. OSF.DDA.AsyncMethodCalls.define({
  7032. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  7033. requiredArguments: [
  7034. {
  7035. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7036. "enum": Microsoft.Office.WebExtension.BindingType
  7037. }
  7038. ],
  7039. supportedOptions: [{
  7040. name: Microsoft.Office.WebExtension.Parameters.Id,
  7041. value: {
  7042. "types": ["string"],
  7043. "calculate": OSF.DDA.generateBindingId
  7044. }
  7045. },
  7046. {
  7047. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  7048. value: {
  7049. "types": ["string"],
  7050. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  7051. }
  7052. },
  7053. {
  7054. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  7055. value: {
  7056. "types": ["object"],
  7057. "defaultValue": null
  7058. }
  7059. }
  7060. ],
  7061. privateStateCallbacks: [],
  7062. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  7063. });
  7064. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7065. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  7066. fromHost: [
  7067. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  7068. ],
  7069. toHost: [
  7070. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7071. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 },
  7072. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: 2 }
  7073. ]
  7074. });
  7075. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  7076. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  7077. OSF.OUtil.defineEnumerableProperties(this, {
  7078. "type": {
  7079. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  7080. },
  7081. "document": {
  7082. value: docInstance
  7083. }
  7084. });
  7085. };
  7086. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  7087. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  7088. BindingSelectionChanged: "bindingSelectionChanged",
  7089. BindingDataChanged: "bindingDataChanged"
  7090. });
  7091. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  7092. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  7093. OSF.OUtil.defineEnumerableProperties(this, {
  7094. "type": {
  7095. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  7096. },
  7097. "binding": {
  7098. value: bindingInstance
  7099. }
  7100. });
  7101. for (var prop in subset) {
  7102. OSF.OUtil.defineEnumerableProperty(this, prop, {
  7103. value: subset[prop]
  7104. });
  7105. }
  7106. };
  7107. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  7108. OSF.OUtil.defineEnumerableProperties(this, {
  7109. "type": {
  7110. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  7111. },
  7112. "binding": {
  7113. value: bindingInstance
  7114. }
  7115. });
  7116. };
  7117. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7118. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  7119. fromHost: [
  7120. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  7121. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  7122. ],
  7123. isComplexType: true
  7124. });
  7125. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7126. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  7127. fromHost: [
  7128. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  7129. ],
  7130. isComplexType: true
  7131. });
  7132. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7133. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  7134. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  7135. });
  7136. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  7137. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7138. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  7139. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  7140. });
  7141. Microsoft.Office.WebExtension.GoToType={
  7142. Binding: "binding",
  7143. NamedItem: "namedItem",
  7144. Slide: "slide",
  7145. Index: "index"
  7146. };
  7147. Microsoft.Office.WebExtension.SelectionMode={
  7148. Default: "default",
  7149. Selected: "selected",
  7150. None: "none"
  7151. };
  7152. Microsoft.Office.WebExtension.Index={
  7153. First: "first",
  7154. Last: "last",
  7155. Next: "next",
  7156. Previous: "previous"
  7157. };
  7158. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  7159. OSF.DDA.AsyncMethodCalls.define({
  7160. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  7161. requiredArguments: [{
  7162. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7163. "types": ["string", "number"]
  7164. },
  7165. {
  7166. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  7167. "enum": Microsoft.Office.WebExtension.GoToType
  7168. }
  7169. ],
  7170. supportedOptions: [
  7171. {
  7172. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7173. value: {
  7174. "enum": Microsoft.Office.WebExtension.SelectionMode,
  7175. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  7176. }
  7177. }
  7178. ]
  7179. });
  7180. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7181. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  7182. toHost: [
  7183. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  7184. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  7185. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  7186. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  7187. ]
  7188. });
  7189. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7190. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7191. toHost: [
  7192. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  7193. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  7194. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  7195. ]
  7196. });
  7197. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7198. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  7199. toHost: [
  7200. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7201. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  7202. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  7203. ]
  7204. });
  7205. OSF.DDA.AsyncMethodNames.addNames({
  7206. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  7207. });
  7208. OSF.DDA.AsyncMethodCalls.define({
  7209. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  7210. requiredArguments: [
  7211. {
  7212. name: Microsoft.Office.WebExtension.Parameters.Data,
  7213. types: ["object"]
  7214. }
  7215. ],
  7216. supportedOptions: []
  7217. });
  7218. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  7219. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7220. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  7221. toHost: [
  7222. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  7223. ],
  7224. fromHost: [
  7225. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  7226. ]
  7227. });
  7228. OSF.DDA.FilePropertiesDescriptor={
  7229. Url: "Url"
  7230. };
  7231. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  7232. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  7233. });
  7234. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  7235. OSF.OUtil.defineEnumerableProperties(this, {
  7236. "url": {
  7237. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  7238. }
  7239. });
  7240. };
  7241. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  7242. OSF.DDA.AsyncMethodCalls.define({
  7243. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  7244. fromHost: [
  7245. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  7246. ],
  7247. requiredArguments: [],
  7248. supportedOptions: [],
  7249. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  7250. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  7251. }
  7252. });
  7253. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7254. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  7255. fromHost: [
  7256. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  7257. ],
  7258. isComplexType: true
  7259. });
  7260. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7261. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  7262. fromHost: [
  7263. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  7264. ]
  7265. });
  7266. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  7267. var am=OSF.DDA.AsyncMethodNames;
  7268. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7269. am.ClearFormatsAsync,
  7270. am.SetTableOptionsAsync,
  7271. am.SetFormatsAsync
  7272. ]);
  7273. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  7274. OSF.OUtil.finalizeProperties(this);
  7275. };
  7276. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  7277. (function () {
  7278. OSF.DDA.AsyncMethodCalls.define({
  7279. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7280. requiredArguments: [
  7281. {
  7282. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7283. "types": ["string", "object", "number", "boolean"]
  7284. }
  7285. ],
  7286. supportedOptions: [{
  7287. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7288. value: {
  7289. "enum": Microsoft.Office.WebExtension.CoercionType,
  7290. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7291. }
  7292. },
  7293. {
  7294. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7295. value: {
  7296. "types": ["object"],
  7297. "defaultValue": []
  7298. }
  7299. },
  7300. {
  7301. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7302. value: {
  7303. "types": ["object"],
  7304. "defaultValue": []
  7305. }
  7306. }
  7307. ],
  7308. privateStateCallbacks: []
  7309. });
  7310. OSF.DDA.AsyncMethodCalls.define({
  7311. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7312. requiredArguments: [
  7313. {
  7314. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7315. "types": ["string", "object", "number", "boolean"]
  7316. }
  7317. ],
  7318. supportedOptions: [{
  7319. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7320. value: {
  7321. "enum": Microsoft.Office.WebExtension.CoercionType,
  7322. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7323. }
  7324. },
  7325. {
  7326. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7327. value: {
  7328. "types": ["object", "string"],
  7329. "defaultValue": null
  7330. }
  7331. },
  7332. {
  7333. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7334. value: {
  7335. "types": ["object"],
  7336. "defaultValue": null
  7337. }
  7338. },
  7339. {
  7340. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7341. value: {
  7342. "types": ["number"],
  7343. "defaultValue": 0
  7344. }
  7345. },
  7346. {
  7347. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7348. value: {
  7349. "types": ["number"],
  7350. "defaultValue": 0
  7351. }
  7352. },
  7353. {
  7354. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7355. value: {
  7356. "types": ["object"],
  7357. "defaultValue": []
  7358. }
  7359. },
  7360. {
  7361. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7362. value: {
  7363. "types": ["object"],
  7364. "defaultValue": []
  7365. }
  7366. }
  7367. ],
  7368. checkCallArgs: function (callArgs, caller, stateInfo) {
  7369. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7370. if (callArgs[Parameters.StartRow]==0 &&
  7371. callArgs[Parameters.StartColumn]==0 &&
  7372. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7373. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7374. delete callArgs[Parameters.StartRow];
  7375. delete callArgs[Parameters.StartColumn];
  7376. delete callArgs[Parameters.CellFormat];
  7377. delete callArgs[Parameters.TableOptions];
  7378. }
  7379. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7380. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7381. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7382. callArgs[Parameters.CellFormat] ||
  7383. callArgs[Parameters.TableOptions])) {
  7384. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7385. }
  7386. return callArgs;
  7387. },
  7388. privateStateCallbacks: [
  7389. {
  7390. name: Microsoft.Office.WebExtension.Parameters.Id,
  7391. value: function (obj) { return obj.id; }
  7392. }
  7393. ]
  7394. });
  7395. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7396. var args=arguments;
  7397. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7398. return this;
  7399. },
  7400. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7401. var args=arguments;
  7402. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7403. return this;
  7404. },
  7405. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7406. var args=arguments;
  7407. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7408. return this;
  7409. };
  7410. })();
  7411. (function () {
  7412. function getObjectId(obj) { return obj.id; }
  7413. OSF.DDA.AsyncMethodNames.addNames({
  7414. ClearFormatsAsync: "clearFormatsAsync",
  7415. SetTableOptionsAsync: "setTableOptionsAsync",
  7416. SetFormatsAsync: "setFormatsAsync"
  7417. });
  7418. OSF.DDA.AsyncMethodCalls.define({
  7419. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7420. requiredArguments: [],
  7421. supportedOptions: [],
  7422. privateStateCallbacks: [
  7423. {
  7424. name: Microsoft.Office.WebExtension.Parameters.Id,
  7425. value: getObjectId
  7426. }
  7427. ]
  7428. });
  7429. OSF.DDA.AsyncMethodCalls.define({
  7430. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7431. requiredArguments: [
  7432. {
  7433. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7434. "defaultValue": []
  7435. }
  7436. ],
  7437. privateStateCallbacks: [
  7438. {
  7439. name: Microsoft.Office.WebExtension.Parameters.Id,
  7440. value: getObjectId
  7441. }
  7442. ]
  7443. });
  7444. OSF.DDA.AsyncMethodCalls.define({
  7445. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7446. requiredArguments: [
  7447. {
  7448. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7449. "defaultValue": []
  7450. }
  7451. ],
  7452. privateStateCallbacks: [
  7453. {
  7454. name: Microsoft.Office.WebExtension.Parameters.Id,
  7455. value: getObjectId
  7456. }
  7457. ]
  7458. });
  7459. })();
  7460. Microsoft.Office.WebExtension.Table={
  7461. All: 0,
  7462. Data: 1,
  7463. Headers: 2
  7464. };
  7465. (function () {
  7466. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7467. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  7468. toHost: [
  7469. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  7470. ]
  7471. });
  7472. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7473. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  7474. toHost: [
  7475. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7476. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 1 },
  7477. ]
  7478. });
  7479. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7480. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  7481. toHost: [
  7482. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7483. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 1 },
  7484. ]
  7485. });
  7486. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7487. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  7488. toHost: [
  7489. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  7490. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  7491. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  7492. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  7493. ]
  7494. });
  7495. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7496. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7497. toHost: [
  7498. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  7499. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  7500. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  7501. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  7502. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  7503. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  7504. ]
  7505. });
  7506. var tableOptionProperties={
  7507. headerRow: 0,
  7508. bandedRows: 1,
  7509. firstColumn: 2,
  7510. lastColumn: 3,
  7511. bandedColumns: 4,
  7512. filterButton: 5,
  7513. style: 6,
  7514. totalRow: 7
  7515. };
  7516. var cellProperties={
  7517. row: 0,
  7518. column: 1
  7519. };
  7520. var formatProperties={
  7521. alignHorizontal: { text: "alignHorizontal", type: 1 },
  7522. alignVertical: { text: "alignVertical", type: 2 },
  7523. backgroundColor: { text: "backgroundColor", type: 101 },
  7524. borderStyle: { text: "borderStyle", type: 201 },
  7525. borderColor: { text: "borderColor", type: 202 },
  7526. borderTopStyle: { text: "borderTopStyle", type: 203 },
  7527. borderTopColor: { text: "borderTopColor", type: 204 },
  7528. borderBottomStyle: { text: "borderBottomStyle", type: 205 },
  7529. borderBottomColor: { text: "borderBottomColor", type: 206 },
  7530. borderLeftStyle: { text: "borderLeftStyle", type: 207 },
  7531. borderLeftColor: { text: "borderLeftColor", type: 208 },
  7532. borderRightStyle: { text: "borderRightStyle", type: 209 },
  7533. borderRightColor: { text: "borderRightColor", type: 210 },
  7534. borderOutlineStyle: { text: "borderOutlineStyle", type: 211 },
  7535. borderOutlineColor: { text: "borderOutlineColor", type: 212 },
  7536. borderInlineStyle: { text: "borderInlineStyle", type: 213 },
  7537. borderInlineColor: { text: "borderInlineColor", type: 214 },
  7538. fontFamily: { text: "fontFamily", type: 301 },
  7539. fontStyle: { text: "fontStyle", type: 302 },
  7540. fontSize: { text: "fontSize", type: 303 },
  7541. fontUnderlineStyle: { text: "fontUnderlineStyle", type: 304 },
  7542. fontColor: { text: "fontColor", type: 305 },
  7543. fontDirection: { text: "fontDirection", type: 306 },
  7544. fontStrikethrough: { text: "fontStrikethrough", type: 307 },
  7545. fontSuperscript: { text: "fontSuperscript", type: 308 },
  7546. fontSubscript: { text: "fontSubscript", type: 309 },
  7547. fontNormal: { text: "fontNormal", type: 310 },
  7548. indentLeft: { text: "indentLeft", type: 401 },
  7549. indentRight: { text: "indentRight", type: 402 },
  7550. numberFormat: { text: "numberFormat", type: 501 },
  7551. width: { text: "width", type: 701 },
  7552. height: { text: "height", type: 702 },
  7553. wrapping: { text: "wrapping", type: 703 }
  7554. };
  7555. var borderStyleSet=[
  7556. { name: "none", value: 0 },
  7557. { name: "thin", value: 1 },
  7558. { name: "medium", value: 2 },
  7559. { name: "dashed", value: 3 },
  7560. { name: "dotted", value: 4 },
  7561. { name: "thick", value: 5 },
  7562. { name: "double", value: 6 },
  7563. { name: "hair", value: 7 },
  7564. { name: "medium dashed", value: 8 },
  7565. { name: "dash dot", value: 9 },
  7566. { name: "medium dash dot", value: 10 },
  7567. { name: "dash dot dot", value: 11 },
  7568. { name: "medium dash dot dot", value: 12 },
  7569. { name: "slant dash dot", value: 13 },
  7570. ];
  7571. var colorSet=[
  7572. { name: "none", value: 0 },
  7573. { name: "black", value: 1 },
  7574. { name: "blue", value: 2 },
  7575. { name: "gray", value: 3 },
  7576. { name: "green", value: 4 },
  7577. { name: "orange", value: 5 },
  7578. { name: "pink", value: 6 },
  7579. { name: "purple", value: 7 },
  7580. { name: "red", value: 8 },
  7581. { name: "teal", value: 9 },
  7582. { name: "turquoise", value: 10 },
  7583. { name: "violet", value: 11 },
  7584. { name: "white", value: 12 },
  7585. { name: "yellow", value: 13 },
  7586. { name: "automatic", value: 14 },
  7587. ];
  7588. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  7589. ns.define({
  7590. type: formatProperties.alignHorizontal.text,
  7591. toHost: [
  7592. { name: "general", value: 0 },
  7593. { name: "left", value: 1 },
  7594. { name: "center", value: 2 },
  7595. { name: "right", value: 3 },
  7596. { name: "fill", value: 4 },
  7597. { name: "justify", value: 5 },
  7598. { name: "center across selection", value: 6 },
  7599. { name: "distributed", value: 7 },
  7600. ] });
  7601. ns.define({
  7602. type: formatProperties.alignVertical.text,
  7603. toHost: [
  7604. { name: "top", value: 0 },
  7605. { name: "center", value: 1 },
  7606. { name: "bottom", value: 2 },
  7607. { name: "justify", value: 3 },
  7608. { name: "distributed", value: 4 },
  7609. ] });
  7610. ns.define({
  7611. type: formatProperties.backgroundColor.text,
  7612. toHost: colorSet
  7613. });
  7614. ns.define({
  7615. type: formatProperties.borderStyle.text,
  7616. toHost: borderStyleSet
  7617. });
  7618. ns.define({
  7619. type: formatProperties.borderColor.text,
  7620. toHost: colorSet
  7621. });
  7622. ns.define({
  7623. type: formatProperties.borderTopStyle.text,
  7624. toHost: borderStyleSet
  7625. });
  7626. ns.define({
  7627. type: formatProperties.borderTopColor.text,
  7628. toHost: colorSet
  7629. });
  7630. ns.define({
  7631. type: formatProperties.borderBottomStyle.text,
  7632. toHost: borderStyleSet
  7633. });
  7634. ns.define({
  7635. type: formatProperties.borderBottomColor.text,
  7636. toHost: colorSet
  7637. });
  7638. ns.define({
  7639. type: formatProperties.borderLeftStyle.text,
  7640. toHost: borderStyleSet
  7641. });
  7642. ns.define({
  7643. type: formatProperties.borderLeftColor.text,
  7644. toHost: colorSet
  7645. });
  7646. ns.define({
  7647. type: formatProperties.borderRightStyle.text,
  7648. toHost: borderStyleSet
  7649. });
  7650. ns.define({
  7651. type: formatProperties.borderRightColor.text,
  7652. toHost: colorSet
  7653. });
  7654. ns.define({
  7655. type: formatProperties.borderOutlineStyle.text,
  7656. toHost: borderStyleSet
  7657. });
  7658. ns.define({
  7659. type: formatProperties.borderOutlineColor.text,
  7660. toHost: colorSet
  7661. });
  7662. ns.define({
  7663. type: formatProperties.borderInlineStyle.text,
  7664. toHost: borderStyleSet
  7665. });
  7666. ns.define({
  7667. type: formatProperties.borderInlineColor.text,
  7668. toHost: colorSet
  7669. });
  7670. ns.define({
  7671. type: formatProperties.fontStyle.text,
  7672. toHost: [
  7673. { name: "regular", value: 0 },
  7674. { name: "italic", value: 1 },
  7675. { name: "bold", value: 2 },
  7676. { name: "bold italic", value: 3 },
  7677. ] });
  7678. ns.define({
  7679. type: formatProperties.fontUnderlineStyle.text,
  7680. toHost: [
  7681. { name: "none", value: 0 },
  7682. { name: "single", value: 1 },
  7683. { name: "double", value: 2 },
  7684. { name: "single accounting", value: 3 },
  7685. { name: "double accounting", value: 4 },
  7686. ] });
  7687. ns.define({
  7688. type: formatProperties.fontColor.text,
  7689. toHost: colorSet
  7690. });
  7691. ns.define({
  7692. type: formatProperties.fontDirection.text,
  7693. toHost: [
  7694. { name: "context", value: 0 },
  7695. { name: "left-to-right", value: 1 },
  7696. { name: "right-to-left", value: 2 },
  7697. ] });
  7698. ns.define({
  7699. type: formatProperties.width.text,
  7700. toHost: [
  7701. { name: "auto fit", value: -1 },
  7702. ] });
  7703. ns.define({
  7704. type: formatProperties.height.text,
  7705. toHost: [
  7706. { name: "auto fit", value: -1 },
  7707. ] });
  7708. ns.define({
  7709. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7710. toHost: [
  7711. { name: "headerRow", value: 0 },
  7712. { name: "bandedRows", value: 1 },
  7713. { name: "firstColumn", value: 2 },
  7714. { name: "lastColumn", value: 3 },
  7715. { name: "bandedColumns", value: 4 },
  7716. { name: "filterButton", value: 5 },
  7717. { name: "style", value: 6 },
  7718. { name: "totalRow", value: 7 }
  7719. ] });
  7720. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  7721. toHost: function (data) {
  7722. for (var entry in data) {
  7723. if (data[entry].format) {
  7724. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  7725. }
  7726. }
  7727. return data;
  7728. },
  7729. fromHost: function (args) {
  7730. return args;
  7731. }
  7732. };
  7733. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.CellFormat, {
  7734. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  7735. var textCells="cells";
  7736. var textFormat="format";
  7737. var posCells=0;
  7738. var posFormat=1;
  7739. var ret=[];
  7740. for (var index in cellFormats) {
  7741. var cfOld=cellFormats[index];
  7742. var cfNew=[];
  7743. if (typeof (cfOld[textCells]) !=='undefined') {
  7744. var cellsOld=cfOld[textCells];
  7745. var cellsNew;
  7746. if (typeof cfOld[textCells]==="object") {
  7747. cellsNew=[];
  7748. for (var entry in cellsOld) {
  7749. if (typeof (cellProperties[entry]) !=='undefined') {
  7750. cellsNew[cellProperties[entry]]=cellsOld[entry];
  7751. }
  7752. }
  7753. }
  7754. else {
  7755. cellsNew=cellsOld;
  7756. }
  7757. cfNew[posCells]=cellsNew;
  7758. }
  7759. if (cfOld[textFormat]) {
  7760. var formatOld=cfOld[textFormat];
  7761. var formatNew=[];
  7762. for (var entry2 in formatOld) {
  7763. if (typeof (formatProperties[entry2]) !=='undefined') {
  7764. formatNew.push([
  7765. formatProperties[entry2].type,
  7766. formatOld[entry2]
  7767. ]);
  7768. }
  7769. }
  7770. cfNew[posFormat]=formatNew;
  7771. }
  7772. ret[index]=cfNew;
  7773. }
  7774. return ret;
  7775. },
  7776. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  7777. return hostArgs;
  7778. }
  7779. });
  7780. ns.setDynamicType(Microsoft.Office.WebExtension.Parameters.TableOptions, {
  7781. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  7782. var ret=[];
  7783. for (var entry in tableOptions) {
  7784. if (typeof (tableOptionProperties[entry]) !=='undefined') {
  7785. ret[tableOptionProperties[entry]]=tableOptions[entry];
  7786. }
  7787. }
  7788. return ret;
  7789. },
  7790. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  7791. return hostArgs;
  7792. }
  7793. });
  7794. })();
  7795. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Image: "image" });
  7796. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  7797. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7798. toHost: [
  7799. { name: Microsoft.Office.WebExtension.CoercionType.Image, value: 8 }
  7800. ]
  7801. });
  7802. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  7803. var bf=new OSF.DDA.BindingFacade(this);
  7804. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  7805. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  7806. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  7807. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  7808. OSF.OUtil.finalizeProperties(this);
  7809. };
  7810. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  7811. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  7812. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  7813. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(appContext, true));
  7814. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  7815. appReady();
  7816. };
  7817. (function () {
  7818. OSF.DDA.AsyncMethodCalls.define({
  7819. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7820. requiredArguments: [
  7821. {
  7822. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7823. "types": ["string", "object", "number", "boolean"]
  7824. }
  7825. ],
  7826. supportedOptions: [{
  7827. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7828. value: {
  7829. "enum": Microsoft.Office.WebExtension.CoercionType,
  7830. "calculate": function (requiredArgs) {
  7831. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  7832. }
  7833. }
  7834. },
  7835. {
  7836. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7837. value: {
  7838. "types": ["number", "object"],
  7839. "defaultValue": []
  7840. }
  7841. },
  7842. {
  7843. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7844. value: {
  7845. "types": ["number", "object"],
  7846. "defaultValue": []
  7847. }
  7848. },
  7849. {
  7850. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  7851. value: {
  7852. "types": ["number", "boolean"],
  7853. "defaultValue": false
  7854. }
  7855. },
  7856. {
  7857. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  7858. value: {
  7859. "types": ["number", "boolean"],
  7860. "defaultValue": false
  7861. }
  7862. }
  7863. ],
  7864. privateStateCallbacks: []
  7865. });
  7866. })();
  7867. var OfficeExtension;
  7868. (function (OfficeExtension) {
  7869. var Action=(function () {
  7870. function Action(actionInfo, isWriteOperation) {
  7871. this.m_actionInfo=actionInfo;
  7872. this.m_isWriteOperation=isWriteOperation;
  7873. }
  7874. Object.defineProperty(Action.prototype, "actionInfo", {
  7875. get: function () {
  7876. return this.m_actionInfo;
  7877. },
  7878. enumerable: true,
  7879. configurable: true
  7880. });
  7881. Object.defineProperty(Action.prototype, "isWriteOperation", {
  7882. get: function () {
  7883. return this.m_isWriteOperation;
  7884. },
  7885. enumerable: true,
  7886. configurable: true
  7887. });
  7888. return Action;
  7889. })();
  7890. OfficeExtension.Action=Action;
  7891. })(OfficeExtension || (OfficeExtension={}));
  7892. var OfficeExtension;
  7893. (function (OfficeExtension) {
  7894. var ActionFactory=(function () {
  7895. function ActionFactory() {
  7896. }
  7897. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  7898. OfficeExtension.Utility.validateObjectPath(parent);
  7899. var actionInfo={
  7900. Id: context._nextId(),
  7901. ActionType: 4 ,
  7902. Name: propertyName,
  7903. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7904. ArgumentInfo: {}
  7905. };
  7906. var args=[value];
  7907. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7908. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7909. var ret=new OfficeExtension.Action(actionInfo, true);
  7910. context._pendingRequest.addAction(ret);
  7911. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7912. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7913. return ret;
  7914. };
  7915. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  7916. OfficeExtension.Utility.validateObjectPath(parent);
  7917. var actionInfo={
  7918. Id: context._nextId(),
  7919. ActionType: 3 ,
  7920. Name: methodName,
  7921. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7922. ArgumentInfo: {}
  7923. };
  7924. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  7925. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  7926. var isWriteOperation=operationType !=1 ;
  7927. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  7928. context._pendingRequest.addAction(ret);
  7929. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7930. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  7931. return ret;
  7932. };
  7933. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  7934. OfficeExtension.Utility.validateObjectPath(parent);
  7935. var actionInfo={
  7936. Id: context._nextId(),
  7937. ActionType: 2 ,
  7938. Name: "",
  7939. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7940. };
  7941. actionInfo.QueryInfo=queryOption;
  7942. var ret=new OfficeExtension.Action(actionInfo, false);
  7943. context._pendingRequest.addAction(ret);
  7944. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7945. return ret;
  7946. };
  7947. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  7948. OfficeExtension.Utility.validateObjectPath(parent);
  7949. var actionInfo={
  7950. Id: context._nextId(),
  7951. ActionType: 6 ,
  7952. Name: "",
  7953. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  7954. RecursiveQueryInfo: query
  7955. };
  7956. var ret=new OfficeExtension.Action(actionInfo, false);
  7957. context._pendingRequest.addAction(ret);
  7958. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  7959. return ret;
  7960. };
  7961. ActionFactory.createInstantiateAction=function (context, obj) {
  7962. OfficeExtension.Utility.validateObjectPath(obj);
  7963. var actionInfo={
  7964. Id: context._nextId(),
  7965. ActionType: 1 ,
  7966. Name: "",
  7967. ObjectPathId: obj._objectPath.objectPathInfo.Id
  7968. };
  7969. var ret=new OfficeExtension.Action(actionInfo, false);
  7970. context._pendingRequest.addAction(ret);
  7971. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  7972. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  7973. return ret;
  7974. };
  7975. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  7976. var actionInfo={
  7977. Id: context._nextId(),
  7978. ActionType: 5 ,
  7979. Name: "Trace",
  7980. ObjectPathId: 0
  7981. };
  7982. var ret=new OfficeExtension.Action(actionInfo, false);
  7983. context._pendingRequest.addAction(ret);
  7984. if (addTraceMessage) {
  7985. context._pendingRequest.addTrace(actionInfo.Id, message);
  7986. }
  7987. return ret;
  7988. };
  7989. return ActionFactory;
  7990. })();
  7991. OfficeExtension.ActionFactory=ActionFactory;
  7992. })(OfficeExtension || (OfficeExtension={}));
  7993. var OfficeExtension;
  7994. (function (OfficeExtension) {
  7995. var ClientObject=(function () {
  7996. function ClientObject(context, objectPath) {
  7997. OfficeExtension.Utility.checkArgumentNull(context, "context");
  7998. this.m_context=context;
  7999. this.m_objectPath=objectPath;
  8000. if (this.m_objectPath) {
  8001. if (!context._processingResult) {
  8002. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  8003. if ((context._autoCleanup) && (this._KeepReference)) {
  8004. context.trackedObjects._autoAdd(this);
  8005. }
  8006. }
  8007. }
  8008. }
  8009. Object.defineProperty(ClientObject.prototype, "context", {
  8010. get: function () {
  8011. return this.m_context;
  8012. },
  8013. enumerable: true,
  8014. configurable: true
  8015. });
  8016. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  8017. get: function () {
  8018. return this.m_objectPath;
  8019. },
  8020. set: function (value) {
  8021. this.m_objectPath=value;
  8022. },
  8023. enumerable: true,
  8024. configurable: true
  8025. });
  8026. Object.defineProperty(ClientObject.prototype, "isNull", {
  8027. get: function () {
  8028. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  8029. return this._isNull;
  8030. },
  8031. enumerable: true,
  8032. configurable: true
  8033. });
  8034. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  8035. get: function () {
  8036. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  8037. return this._isNull;
  8038. },
  8039. enumerable: true,
  8040. configurable: true
  8041. });
  8042. Object.defineProperty(ClientObject.prototype, "_isNull", {
  8043. get: function () {
  8044. return this.m_isNull;
  8045. },
  8046. set: function (value) {
  8047. this.m_isNull=value;
  8048. if (value && this.m_objectPath) {
  8049. this.m_objectPath._updateAsNullObject();
  8050. }
  8051. },
  8052. enumerable: true,
  8053. configurable: true
  8054. });
  8055. ClientObject.prototype._handleResult=function (value) {
  8056. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8057. };
  8058. ClientObject.prototype._handleIdResult=function (value) {
  8059. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  8060. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  8061. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  8062. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  8063. }
  8064. };
  8065. return ClientObject;
  8066. })();
  8067. OfficeExtension.ClientObject=ClientObject;
  8068. })(OfficeExtension || (OfficeExtension={}));
  8069. var OfficeExtension;
  8070. (function (OfficeExtension) {
  8071. var ClientRequest=(function () {
  8072. function ClientRequest(context) {
  8073. this.m_context=context;
  8074. this.m_actions=[];
  8075. this.m_actionResultHandler={};
  8076. this.m_referencedObjectPaths={};
  8077. this.m_flags=0 ;
  8078. this.m_traceInfos={};
  8079. this.m_pendingProcessEventHandlers=[];
  8080. this.m_pendingEventHandlerActions={};
  8081. this.m_responseTraceIds={};
  8082. this.m_responseTraceMessages=[];
  8083. }
  8084. Object.defineProperty(ClientRequest.prototype, "flags", {
  8085. get: function () {
  8086. return this.m_flags;
  8087. },
  8088. enumerable: true,
  8089. configurable: true
  8090. });
  8091. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  8092. get: function () {
  8093. return this.m_traceInfos;
  8094. },
  8095. enumerable: true,
  8096. configurable: true
  8097. });
  8098. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  8099. get: function () {
  8100. return this.m_responseTraceMessages;
  8101. },
  8102. enumerable: true,
  8103. configurable: true
  8104. });
  8105. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  8106. get: function () {
  8107. return this.m_responseTraceIds;
  8108. },
  8109. enumerable: true,
  8110. configurable: true
  8111. });
  8112. ClientRequest.prototype._setResponseTraceIds=function (value) {
  8113. if (value) {
  8114. for (var i=0; i < value.length; i++) {
  8115. var traceId=value[i];
  8116. this.m_responseTraceIds[traceId]=traceId;
  8117. var message=this.m_traceInfos[traceId];
  8118. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  8119. this.m_responseTraceMessages.push(message);
  8120. }
  8121. }
  8122. }
  8123. };
  8124. ClientRequest.prototype.addAction=function (action) {
  8125. if (action.isWriteOperation) {
  8126. this.m_flags=this.m_flags | 1 ;
  8127. }
  8128. this.m_actions.push(action);
  8129. };
  8130. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  8131. get: function () {
  8132. return this.m_actions.length > 0;
  8133. },
  8134. enumerable: true,
  8135. configurable: true
  8136. });
  8137. ClientRequest.prototype.addTrace=function (actionId, message) {
  8138. this.m_traceInfos[actionId]=message;
  8139. };
  8140. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  8141. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  8142. return;
  8143. }
  8144. if (!objectPath.isValid) {
  8145. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  8146. }
  8147. while (objectPath) {
  8148. if (objectPath.isWriteOperation) {
  8149. this.m_flags=this.m_flags | 1 ;
  8150. }
  8151. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  8152. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  8153. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  8154. }
  8155. objectPath=objectPath.parentObjectPath;
  8156. }
  8157. };
  8158. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  8159. if (objectPaths) {
  8160. for (var i=0; i < objectPaths.length; i++) {
  8161. this.addReferencedObjectPath(objectPaths[i]);
  8162. }
  8163. }
  8164. };
  8165. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  8166. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  8167. };
  8168. ClientRequest.prototype.buildRequestMessageBody=function () {
  8169. var objectPaths={};
  8170. for (var i in this.m_referencedObjectPaths) {
  8171. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  8172. }
  8173. var actions=[];
  8174. for (var index=0; index < this.m_actions.length; index++) {
  8175. actions.push(this.m_actions[index].actionInfo);
  8176. }
  8177. var ret={
  8178. Actions: actions,
  8179. ObjectPaths: objectPaths
  8180. };
  8181. return ret;
  8182. };
  8183. ClientRequest.prototype.processResponse=function (msg) {
  8184. if (msg && msg.Results) {
  8185. for (var i=0; i < msg.Results.length; i++) {
  8186. var actionResult=msg.Results[i];
  8187. var handler=this.m_actionResultHandler[actionResult.ActionId];
  8188. if (handler) {
  8189. handler._handleResult(actionResult.Value);
  8190. }
  8191. }
  8192. }
  8193. };
  8194. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  8195. for (var i in this.m_referencedObjectPaths) {
  8196. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  8197. this.m_referencedObjectPaths[i].isValid=false;
  8198. }
  8199. }
  8200. };
  8201. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  8202. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  8203. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  8204. this.m_pendingProcessEventHandlers.push(eventHandlers);
  8205. }
  8206. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  8207. };
  8208. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  8209. get: function () {
  8210. return this.m_pendingProcessEventHandlers;
  8211. },
  8212. enumerable: true,
  8213. configurable: true
  8214. });
  8215. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  8216. return this.m_pendingEventHandlerActions[eventHandlers._id];
  8217. };
  8218. return ClientRequest;
  8219. })();
  8220. OfficeExtension.ClientRequest=ClientRequest;
  8221. })(OfficeExtension || (OfficeExtension={}));
  8222. var OfficeExtension;
  8223. (function (OfficeExtension) {
  8224. var _requestExecutorFactory;
  8225. function _setRequestExecutorFactory(reqExecFactory) {
  8226. _requestExecutorFactory=reqExecFactory;
  8227. }
  8228. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  8229. var ClientRequestContext=(function () {
  8230. function ClientRequestContext(url) {
  8231. this.m_requestHeaders={};
  8232. this._onRunFinishedNotifiers=[];
  8233. this.m_nextId=0;
  8234. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  8235. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  8236. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  8237. this.m_url=defaultUrlAndHeaders.url;
  8238. if (defaultUrlAndHeaders.headers) {
  8239. for (var key in defaultUrlAndHeaders.headers) {
  8240. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  8241. }
  8242. }
  8243. }
  8244. else {
  8245. this.m_url=OfficeExtension.Constants.localDocument;
  8246. }
  8247. }
  8248. else if (typeof (url)==="string") {
  8249. this.m_url=url;
  8250. }
  8251. else {
  8252. var requestInfo=url;
  8253. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  8254. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  8255. }
  8256. this.m_url=requestInfo.url;
  8257. if (requestInfo.headers) {
  8258. for (var key in requestInfo.headers) {
  8259. this.m_requestHeaders[key]=requestInfo.headers[key];
  8260. }
  8261. }
  8262. }
  8263. this._processingResult=false;
  8264. this._customData=OfficeExtension.Constants.iterativeExecutor;
  8265. if (_requestExecutorFactory) {
  8266. this._requestExecutor=_requestExecutorFactory();
  8267. }
  8268. else {
  8269. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  8270. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8271. }
  8272. else {
  8273. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  8274. }
  8275. }
  8276. this.sync=this.sync.bind(this);
  8277. }
  8278. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  8279. get: function () {
  8280. return this.m_url;
  8281. },
  8282. enumerable: true,
  8283. configurable: true
  8284. });
  8285. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  8286. get: function () {
  8287. if (this.m_pendingRequest==null) {
  8288. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  8289. }
  8290. return this.m_pendingRequest;
  8291. },
  8292. enumerable: true,
  8293. configurable: true
  8294. });
  8295. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  8296. get: function () {
  8297. if (!this.m_trackedObjects) {
  8298. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  8299. }
  8300. return this.m_trackedObjects;
  8301. },
  8302. enumerable: true,
  8303. configurable: true
  8304. });
  8305. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  8306. get: function () {
  8307. return this.m_requestHeaders;
  8308. },
  8309. enumerable: true,
  8310. configurable: true
  8311. });
  8312. ClientRequestContext.prototype.load=function (clientObj, option) {
  8313. OfficeExtension.Utility.validateContext(this, clientObj);
  8314. var queryOption=ClientRequestContext.parseQueryOption(option);
  8315. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  8316. this._pendingRequest.addActionResultHandler(action, clientObj);
  8317. };
  8318. ClientRequestContext.parseQueryOption=function (option) {
  8319. var queryOption={};
  8320. if (typeof (option)=="string") {
  8321. var select=option;
  8322. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  8323. }
  8324. else if (Array.isArray(option)) {
  8325. queryOption.Select=option;
  8326. }
  8327. else if (typeof (option)=="object") {
  8328. var loadOption=option;
  8329. if (typeof (loadOption.select)=="string") {
  8330. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  8331. }
  8332. else if (Array.isArray(loadOption.select)) {
  8333. queryOption.Select=loadOption.select;
  8334. }
  8335. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  8336. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  8337. }
  8338. if (typeof (loadOption.expand)=="string") {
  8339. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  8340. }
  8341. else if (Array.isArray(loadOption.expand)) {
  8342. queryOption.Expand=loadOption.expand;
  8343. }
  8344. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  8345. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  8346. }
  8347. if (typeof (loadOption.top)=="number") {
  8348. queryOption.Top=loadOption.top;
  8349. }
  8350. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  8351. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  8352. }
  8353. if (typeof (loadOption.skip)=="number") {
  8354. queryOption.Skip=loadOption.skip;
  8355. }
  8356. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  8357. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  8358. }
  8359. }
  8360. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  8361. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  8362. }
  8363. return queryOption;
  8364. };
  8365. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  8366. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  8367. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  8368. }
  8369. var quries={};
  8370. for (var key in options) {
  8371. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  8372. }
  8373. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  8374. this._pendingRequest.addActionResultHandler(action, clientObj);
  8375. };
  8376. ClientRequestContext.prototype.trace=function (message) {
  8377. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  8378. };
  8379. ClientRequestContext.prototype.syncPrivate=function () {
  8380. var _this=this;
  8381. var req=this._pendingRequest;
  8382. this.m_pendingRequest=null;
  8383. if (!req.hasActions) {
  8384. return this.processPendingEventHandlers(req);
  8385. }
  8386. var msgBody=req.buildRequestMessageBody();
  8387. var requestFlags=req.flags;
  8388. var requestExecutor=this._requestExecutor;
  8389. if (!requestExecutor) {
  8390. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  8391. }
  8392. var requestExecutorRequestMessage={
  8393. Url: this.m_url,
  8394. Headers: this.m_requestHeaders,
  8395. Body: msgBody
  8396. };
  8397. req.invalidatePendingInvalidObjectPaths();
  8398. var errorFromResponse=null;
  8399. var errorFromProcessEventHandlers=null;
  8400. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  8401. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  8402. return _this.processPendingEventHandlers(req).catch(function (ex) {
  8403. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  8404. OfficeExtension.Utility.log(JSON.stringify(ex));
  8405. errorFromProcessEventHandlers=ex;
  8406. });
  8407. }).then(function () {
  8408. if (errorFromResponse) {
  8409. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  8410. throw errorFromResponse;
  8411. }
  8412. if (errorFromProcessEventHandlers) {
  8413. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  8414. var transformedError=null;
  8415. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  8416. transformedError=errorFromProcessEventHandlers;
  8417. transformedError.traceMessages=req._responseTraceMessages;
  8418. }
  8419. else {
  8420. var message=null;
  8421. if (typeof (errorFromProcessEventHandlers)==="string") {
  8422. message=errorFromProcessEventHandlers;
  8423. }
  8424. else {
  8425. message=errorFromProcessEventHandlers.message;
  8426. }
  8427. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  8428. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  8429. }
  8430. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  8431. }
  8432. throw transformedError;
  8433. }
  8434. });
  8435. };
  8436. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  8437. if (response.Body && response.Body.TraceIds) {
  8438. req._setResponseTraceIds(response.Body.TraceIds);
  8439. }
  8440. var traceMessages=req._responseTraceMessages;
  8441. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  8442. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  8443. }
  8444. else if (response.Body && response.Body.Error) {
  8445. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  8446. errorLocation: response.Body.Error.Location
  8447. });
  8448. }
  8449. this._processingResult=true;
  8450. try {
  8451. req.processResponse(response.Body);
  8452. }
  8453. finally {
  8454. this._processingResult=false;
  8455. }
  8456. return null;
  8457. };
  8458. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  8459. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8460. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  8461. var eventHandlers=req._pendingProcessEventHandlers[i];
  8462. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  8463. }
  8464. return ret;
  8465. };
  8466. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  8467. return function () { return eventHandlers._processRegistration(req); };
  8468. };
  8469. ClientRequestContext.prototype.sync=function (passThroughValue) {
  8470. return this.syncPrivate().then(function () { return passThroughValue; });
  8471. };
  8472. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8473. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8474. if (retryDelay===void 0) { retryDelay=5000; }
  8475. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8476. };
  8477. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8478. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  8479. if (retryDelay===void 0) { retryDelay=5000; }
  8480. var ctxRetriever;
  8481. var batch;
  8482. var requestInfo=null;
  8483. var argOffset=0;
  8484. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  8485. requestInfo=receivedRunArgs[0];
  8486. argOffset=1;
  8487. }
  8488. if (receivedRunArgs.length==argOffset+1) {
  8489. ctxRetriever=ctxInitializer;
  8490. batch=receivedRunArgs[argOffset+0];
  8491. }
  8492. else if (receivedRunArgs.length==argOffset+2) {
  8493. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  8494. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  8495. }
  8496. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  8497. var array=receivedRunArgs[argOffset+0];
  8498. if (array.length==0) {
  8499. return ClientRequestContext.createErrorPromise(functionName);
  8500. }
  8501. for (var i=0; i < array.length; i++) {
  8502. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  8503. return ClientRequestContext.createErrorPromise(functionName);
  8504. }
  8505. if (array[i].context !=array[0].context) {
  8506. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  8507. }
  8508. }
  8509. ctxRetriever=function () { return array[0].context; };
  8510. }
  8511. else {
  8512. return ClientRequestContext.createErrorPromise(functionName);
  8513. }
  8514. batch=receivedRunArgs[argOffset+1];
  8515. }
  8516. else {
  8517. return ClientRequestContext.createErrorPromise(functionName);
  8518. }
  8519. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  8520. };
  8521. ClientRequestContext.createErrorPromise=function (functionName, code) {
  8522. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  8523. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  8524. };
  8525. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  8526. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  8527. resolve();
  8528. });
  8529. var ctx;
  8530. var succeeded=false;
  8531. var resultOrError;
  8532. return starterPromise.then(function () {
  8533. ctx=ctxRetriever(requestInfo);
  8534. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  8535. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  8536. }
  8537. if (ctx._autoCleanup) {
  8538. return new OfficeExtension.Promise(function (resolve, reject) {
  8539. ctx._onRunFinishedNotifiers.push(function () {
  8540. ctx._autoCleanup=true;
  8541. resolve();
  8542. });
  8543. });
  8544. }
  8545. else {
  8546. ctx._autoCleanup=true;
  8547. }
  8548. }).then(function () {
  8549. if (typeof batch !=='function') {
  8550. return ClientRequestContext.createErrorPromise(functionName);
  8551. }
  8552. var batchResult=batch(ctx);
  8553. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  8554. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  8555. }
  8556. return batchResult;
  8557. }).then(function (batchResult) {
  8558. return ctx.sync(batchResult);
  8559. }).then(function (result) {
  8560. succeeded=true;
  8561. resultOrError=result;
  8562. }).catch(function (error) {
  8563. resultOrError=error;
  8564. }).then(function () {
  8565. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  8566. ctx._autoCleanup=false;
  8567. for (var key in itemsToRemove) {
  8568. itemsToRemove[key]._objectPath.isValid=false;
  8569. }
  8570. var cleanupCounter=0;
  8571. attemptCleanup();
  8572. function attemptCleanup() {
  8573. cleanupCounter++;
  8574. for (var key in itemsToRemove) {
  8575. ctx.trackedObjects.remove(itemsToRemove[key]);
  8576. }
  8577. ctx.sync().then(function () {
  8578. if (onCleanupSuccess) {
  8579. onCleanupSuccess(cleanupCounter);
  8580. }
  8581. }).catch(function () {
  8582. if (onCleanupFailure) {
  8583. onCleanupFailure(cleanupCounter);
  8584. }
  8585. if (cleanupCounter < numCleanupAttempts) {
  8586. setTimeout(function () {
  8587. attemptCleanup();
  8588. }, retryDelay);
  8589. }
  8590. });
  8591. }
  8592. }).then(function () {
  8593. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  8594. var func=ctx._onRunFinishedNotifiers.shift();
  8595. func();
  8596. }
  8597. if (succeeded) {
  8598. return resultOrError;
  8599. }
  8600. else {
  8601. throw resultOrError;
  8602. }
  8603. });
  8604. };
  8605. ClientRequestContext.prototype._nextId=function () {
  8606. return++this.m_nextId;
  8607. };
  8608. return ClientRequestContext;
  8609. })();
  8610. OfficeExtension.ClientRequestContext=ClientRequestContext;
  8611. })(OfficeExtension || (OfficeExtension={}));
  8612. var OfficeExtension;
  8613. (function (OfficeExtension) {
  8614. (function (ClientRequestFlags) {
  8615. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  8616. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  8617. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  8618. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  8619. })(OfficeExtension || (OfficeExtension={}));
  8620. var OfficeExtension;
  8621. (function (OfficeExtension) {
  8622. (function (ClientResultProcessingType) {
  8623. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  8624. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  8625. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  8626. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  8627. var ClientResult=(function () {
  8628. function ClientResult(type) {
  8629. this.m_type=type;
  8630. }
  8631. Object.defineProperty(ClientResult.prototype, "value", {
  8632. get: function () {
  8633. if (!this.m_isLoaded) {
  8634. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  8635. }
  8636. return this.m_value;
  8637. },
  8638. enumerable: true,
  8639. configurable: true
  8640. });
  8641. ClientResult.prototype._handleResult=function (value) {
  8642. this.m_isLoaded=true;
  8643. if (typeof (value)==="object" && value && value._IsNull) {
  8644. return;
  8645. }
  8646. if (this.m_type===1 ) {
  8647. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  8648. }
  8649. else {
  8650. this.m_value=value;
  8651. }
  8652. };
  8653. return ClientResult;
  8654. })();
  8655. OfficeExtension.ClientResult=ClientResult;
  8656. })(OfficeExtension || (OfficeExtension={}));
  8657. var OfficeExtension;
  8658. (function (OfficeExtension) {
  8659. var Constants=(function () {
  8660. function Constants() {
  8661. }
  8662. Constants.getItemAt="GetItemAt";
  8663. Constants.id="Id";
  8664. Constants.idPrivate="_Id";
  8665. Constants.index="_Index";
  8666. Constants.items="_Items";
  8667. Constants.iterativeExecutor="IterativeExecutor";
  8668. Constants.localDocument="http://document.localhost/";
  8669. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  8670. Constants.referenceId="_ReferenceId";
  8671. Constants.isTracked="_IsTracked";
  8672. Constants.sourceLibHeader="SdkVersion";
  8673. Constants.requestInfoHeader="Office-RequestInfo";
  8674. return Constants;
  8675. })();
  8676. OfficeExtension.Constants=Constants;
  8677. })(OfficeExtension || (OfficeExtension={}));
  8678. var OfficeExtension;
  8679. (function (OfficeExtension) {
  8680. var EmbedRequestExecutor=(function () {
  8681. function EmbedRequestExecutor() {
  8682. }
  8683. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8684. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  8685. return new OfficeExtension.Promise(function (resolve, reject) {
  8686. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  8687. if (!endpoint) {
  8688. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  8689. return;
  8690. }
  8691. endpoint.invoke("executeMethod", function (status, result) {
  8692. OfficeExtension.Utility.log("Response:");
  8693. OfficeExtension.Utility.log(JSON.stringify(result));
  8694. var response;
  8695. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  8696. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  8697. }
  8698. else {
  8699. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  8700. }
  8701. resolve(response);
  8702. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  8703. });
  8704. };
  8705. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  8706. return {
  8707. ArrayData: msgArray,
  8708. DdaMethod: {
  8709. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  8710. }
  8711. };
  8712. };
  8713. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  8714. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  8715. return EmbedRequestExecutor;
  8716. })();
  8717. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  8718. })(OfficeExtension || (OfficeExtension={}));
  8719. var __extends=this.__extends || function (d, b) {
  8720. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  8721. function __() { this.constructor=d; }
  8722. __.prototype=b.prototype;
  8723. d.prototype=new __();
  8724. };
  8725. var OfficeExtension;
  8726. (function (OfficeExtension) {
  8727. var _Internal;
  8728. (function (_Internal) {
  8729. var RuntimeError=(function (_super) {
  8730. __extends(RuntimeError, _super);
  8731. function RuntimeError(code, message, traceMessages, debugInfo) {
  8732. _super.call(this, message);
  8733. this.name="OfficeExtension.Error";
  8734. this.code=code;
  8735. this.message=message;
  8736. this.traceMessages=traceMessages;
  8737. this.debugInfo=debugInfo;
  8738. }
  8739. RuntimeError.prototype.toString=function () {
  8740. return this.code+': '+this.message;
  8741. };
  8742. return RuntimeError;
  8743. })(Error);
  8744. _Internal.RuntimeError=RuntimeError;
  8745. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8746. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  8747. })(OfficeExtension || (OfficeExtension={}));
  8748. var OfficeExtension;
  8749. (function (OfficeExtension) {
  8750. var ErrorCodes=(function () {
  8751. function ErrorCodes() {
  8752. }
  8753. ErrorCodes.accessDenied="AccessDenied";
  8754. ErrorCodes.generalException="GeneralException";
  8755. ErrorCodes.activityLimitReached="ActivityLimitReached";
  8756. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  8757. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  8758. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  8759. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  8760. ErrorCodes.invalidArgument="InvalidArgument";
  8761. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  8762. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  8763. ErrorCodes.apiNotFound="ApiNotFound";
  8764. ErrorCodes.connectionFailure="ConnectionFailure";
  8765. return ErrorCodes;
  8766. })();
  8767. OfficeExtension.ErrorCodes=ErrorCodes;
  8768. })(OfficeExtension || (OfficeExtension={}));
  8769. var OfficeExtension;
  8770. (function (OfficeExtension) {
  8771. var _Internal;
  8772. (function (_Internal) {
  8773. (function (EventHandlerActionType) {
  8774. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  8775. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  8776. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  8777. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  8778. var EventHandlerActionType=_Internal.EventHandlerActionType;
  8779. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  8780. })(OfficeExtension || (OfficeExtension={}));
  8781. var OfficeExtension;
  8782. (function (OfficeExtension) {
  8783. var EventHandlers=(function () {
  8784. function EventHandlers(context, parentObject, name, eventInfo) {
  8785. var _this=this;
  8786. this.m_id=context._nextId();
  8787. this.m_context=context;
  8788. this.m_name=name;
  8789. this.m_handlers=[];
  8790. this.m_registered=false;
  8791. this.m_eventInfo=eventInfo;
  8792. this.m_callback=function (args) {
  8793. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  8794. };
  8795. }
  8796. Object.defineProperty(EventHandlers.prototype, "_registered", {
  8797. get: function () {
  8798. return this.m_registered;
  8799. },
  8800. enumerable: true,
  8801. configurable: true
  8802. });
  8803. Object.defineProperty(EventHandlers.prototype, "_id", {
  8804. get: function () {
  8805. return this.m_id;
  8806. },
  8807. enumerable: true,
  8808. configurable: true
  8809. });
  8810. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  8811. get: function () {
  8812. return this.m_handlers;
  8813. },
  8814. enumerable: true,
  8815. configurable: true
  8816. });
  8817. EventHandlers.prototype.add=function (handler) {
  8818. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8819. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  8820. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  8821. };
  8822. EventHandlers.prototype.remove=function (handler) {
  8823. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8824. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  8825. };
  8826. EventHandlers.prototype.removeAll=function () {
  8827. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  8828. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  8829. };
  8830. EventHandlers.prototype._processRegistration=function (req) {
  8831. var _this=this;
  8832. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  8833. var actions=req._getPendingEventHandlerActions(this);
  8834. if (!actions) {
  8835. return ret;
  8836. }
  8837. var handlersResult=[];
  8838. for (var i=0; i < this.m_handlers.length; i++) {
  8839. handlersResult.push(this.m_handlers[i]);
  8840. }
  8841. var hasChange=false;
  8842. for (var i=0; i < actions.length; i++) {
  8843. if (req._responseTraceIds[actions[i].id]) {
  8844. hasChange=true;
  8845. switch (actions[i].operation) {
  8846. case 0 :
  8847. handlersResult.push(actions[i].handler);
  8848. break;
  8849. case 1 :
  8850. for (var index=handlersResult.length - 1; index >=0; index--) {
  8851. if (handlersResult[index]===actions[i].handler) {
  8852. handlersResult.splice(index, 1);
  8853. break;
  8854. }
  8855. }
  8856. break;
  8857. case 2 :
  8858. handlersResult=[];
  8859. break;
  8860. }
  8861. }
  8862. }
  8863. if (hasChange) {
  8864. if (!this.m_registered && handlersResult.length > 0) {
  8865. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  8866. }
  8867. else if (this.m_registered && handlersResult.length==0) {
  8868. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  8869. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  8870. }).then(function () { return (_this.m_registered=false); });
  8871. }
  8872. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  8873. }
  8874. return ret;
  8875. };
  8876. EventHandlers.prototype.fireEvent=function (args) {
  8877. var promises=[];
  8878. for (var i=0; i < this.m_handlers.length; i++) {
  8879. var handler=this.m_handlers[i];
  8880. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  8881. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  8882. });
  8883. promises.push(p);
  8884. }
  8885. OfficeExtension.Promise.all(promises);
  8886. };
  8887. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  8888. return function () { return handler(args); };
  8889. };
  8890. return EventHandlers;
  8891. })();
  8892. OfficeExtension.EventHandlers=EventHandlers;
  8893. })(OfficeExtension || (OfficeExtension={}));
  8894. var OfficeExtension;
  8895. (function (OfficeExtension) {
  8896. var EventHandlerResult=(function () {
  8897. function EventHandlerResult(context, handlers, handler) {
  8898. this.m_context=context;
  8899. this.m_allHandlers=handlers;
  8900. this.m_handler=handler;
  8901. }
  8902. EventHandlerResult.prototype.remove=function () {
  8903. if (this.m_allHandlers && this.m_handler) {
  8904. this.m_allHandlers.remove(this.m_handler);
  8905. this.m_allHandlers=null;
  8906. this.m_handler=null;
  8907. }
  8908. };
  8909. return EventHandlerResult;
  8910. })();
  8911. OfficeExtension.EventHandlerResult=EventHandlerResult;
  8912. })(OfficeExtension || (OfficeExtension={}));
  8913. var OfficeExtension;
  8914. (function (OfficeExtension) {
  8915. var HttpRequestExecutor=(function () {
  8916. function HttpRequestExecutor() {
  8917. }
  8918. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  8919. var requestMessageText=JSON.stringify(requestMessage.Body);
  8920. OfficeExtension.Utility.log("Request:");
  8921. OfficeExtension.Utility.log(requestMessageText);
  8922. var url=requestMessage.Url;
  8923. if (url.charAt(url.length - 1) !="/") {
  8924. url=url+"/";
  8925. }
  8926. url=url+"ProcessQuery";
  8927. var requestInfo={
  8928. method: "POST",
  8929. url: url,
  8930. headers: {},
  8931. body: requestMessageText
  8932. };
  8933. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  8934. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  8935. requestInfo.headers["CONTENT-TYPE"]="application/json";
  8936. if (requestMessage.Headers) {
  8937. for (var key in requestMessage.Headers) {
  8938. requestInfo.headers[key]=requestMessage.Headers[key];
  8939. }
  8940. }
  8941. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  8942. var response;
  8943. if (responseInfo.statusCode===200) {
  8944. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  8945. }
  8946. else {
  8947. var errorObj=null;
  8948. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  8949. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  8950. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  8951. try {
  8952. errorObj=JSON.parse(errorResponseBody);
  8953. }
  8954. catch (e) {
  8955. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  8956. }
  8957. }
  8958. var errorMessage;
  8959. var errorCode;
  8960. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  8961. errorCode=errorObj.error.code;
  8962. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  8963. }
  8964. else {
  8965. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  8966. }
  8967. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  8968. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  8969. }
  8970. response={
  8971. ErrorCode: errorCode,
  8972. ErrorMessage: errorMessage,
  8973. Headers: responseInfo.headers,
  8974. Body: null
  8975. };
  8976. }
  8977. return response;
  8978. });
  8979. };
  8980. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  8981. return HttpRequestExecutor;
  8982. })();
  8983. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  8984. })(OfficeExtension || (OfficeExtension={}));
  8985. var OfficeExtension;
  8986. (function (OfficeExtension) {
  8987. var HttpUtility=(function () {
  8988. function HttpUtility() {
  8989. }
  8990. HttpUtility.setCustomSendRequestFunc=function (func) {
  8991. HttpUtility.s_customSendRequestFunc=func;
  8992. };
  8993. HttpUtility.xhrSendRequestFunc=function (request) {
  8994. return new OfficeExtension.Promise(function (resolve, reject) {
  8995. var xhr=new XMLHttpRequest();
  8996. xhr.open(request.method, request.url);
  8997. xhr.onload=function () {
  8998. var resp={
  8999. statusCode: xhr.status,
  9000. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  9001. body: xhr.responseText
  9002. };
  9003. resolve(resp);
  9004. };
  9005. xhr.onerror=function () {
  9006. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  9007. };
  9008. if (request.headers) {
  9009. for (var key in request.headers) {
  9010. xhr.setRequestHeader(key, request.headers[key]);
  9011. }
  9012. }
  9013. xhr.send(request.body);
  9014. });
  9015. };
  9016. HttpUtility.sendRequest=function (request) {
  9017. HttpUtility.validateAndNormalizeRequest(request);
  9018. var func;
  9019. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  9020. return func(request);
  9021. };
  9022. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  9023. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  9024. };
  9025. HttpUtility.sendLocalDocumentRequest=function (request) {
  9026. HttpUtility.validateAndNormalizeRequest(request);
  9027. var func;
  9028. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  9029. return func(request);
  9030. };
  9031. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  9032. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  9033. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  9034. return new OfficeExtension.Promise(function (resolve, reject) {
  9035. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  9036. var response;
  9037. if (asyncResult.status=="succeeded") {
  9038. response={
  9039. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  9040. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  9041. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  9042. };
  9043. }
  9044. else {
  9045. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  9046. }
  9047. OfficeExtension.Utility.log(JSON.stringify(response));
  9048. resolve(response);
  9049. });
  9050. });
  9051. };
  9052. HttpUtility.validateAndNormalizeRequest=function (request) {
  9053. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  9054. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  9055. }
  9056. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  9057. request.method="GET";
  9058. }
  9059. request.method=request.method.toUpperCase();
  9060. };
  9061. return HttpUtility;
  9062. })();
  9063. OfficeExtension.HttpUtility=HttpUtility;
  9064. })(OfficeExtension || (OfficeExtension={}));
  9065. var OfficeExtension;
  9066. (function (OfficeExtension) {
  9067. var InstantiateActionResultHandler=(function () {
  9068. function InstantiateActionResultHandler(clientObject) {
  9069. this.m_clientObject=clientObject;
  9070. }
  9071. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  9072. this.m_clientObject._handleIdResult(value);
  9073. };
  9074. return InstantiateActionResultHandler;
  9075. })();
  9076. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  9077. })(OfficeExtension || (OfficeExtension={}));
  9078. var OfficeExtension;
  9079. (function (OfficeExtension) {
  9080. })(OfficeExtension || (OfficeExtension={}));
  9081. var OfficeExtension;
  9082. (function (OfficeExtension) {
  9083. (function (RichApiRequestMessageIndex) {
  9084. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  9085. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  9086. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  9087. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  9088. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  9089. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  9090. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  9091. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  9092. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  9093. (function (RichApiResponseMessageIndex) {
  9094. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  9095. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  9096. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  9097. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  9098. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  9099. ;
  9100. (function (ActionType) {
  9101. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  9102. ActionType[ActionType["Query"]=2]="Query";
  9103. ActionType[ActionType["Method"]=3]="Method";
  9104. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  9105. ActionType[ActionType["Trace"]=5]="Trace";
  9106. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  9107. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  9108. var ActionType=OfficeExtension.ActionType;
  9109. (function (ObjectPathType) {
  9110. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  9111. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  9112. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  9113. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  9114. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  9115. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  9116. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  9117. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  9118. var ObjectPathType=OfficeExtension.ObjectPathType;
  9119. })(OfficeExtension || (OfficeExtension={}));
  9120. var OfficeExtension;
  9121. (function (OfficeExtension) {
  9122. var ObjectPath=(function () {
  9123. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  9124. this.m_objectPathInfo=objectPathInfo;
  9125. this.m_parentObjectPath=parentObjectPath;
  9126. this.m_isWriteOperation=false;
  9127. this.m_isCollection=isCollection;
  9128. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  9129. this.m_isValid=true;
  9130. }
  9131. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  9132. get: function () {
  9133. return this.m_objectPathInfo;
  9134. },
  9135. enumerable: true,
  9136. configurable: true
  9137. });
  9138. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  9139. get: function () {
  9140. return this.m_isWriteOperation;
  9141. },
  9142. set: function (value) {
  9143. this.m_isWriteOperation=value;
  9144. },
  9145. enumerable: true,
  9146. configurable: true
  9147. });
  9148. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  9149. get: function () {
  9150. return this.m_isCollection;
  9151. },
  9152. enumerable: true,
  9153. configurable: true
  9154. });
  9155. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  9156. get: function () {
  9157. return this.m_isInvalidAfterRequest;
  9158. },
  9159. enumerable: true,
  9160. configurable: true
  9161. });
  9162. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  9163. get: function () {
  9164. return this.m_parentObjectPath;
  9165. },
  9166. enumerable: true,
  9167. configurable: true
  9168. });
  9169. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  9170. get: function () {
  9171. return this.m_argumentObjectPaths;
  9172. },
  9173. set: function (value) {
  9174. this.m_argumentObjectPaths=value;
  9175. },
  9176. enumerable: true,
  9177. configurable: true
  9178. });
  9179. Object.defineProperty(ObjectPath.prototype, "isValid", {
  9180. get: function () {
  9181. return this.m_isValid;
  9182. },
  9183. set: function (value) {
  9184. this.m_isValid=value;
  9185. },
  9186. enumerable: true,
  9187. configurable: true
  9188. });
  9189. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  9190. get: function () {
  9191. return this.m_getByIdMethodName;
  9192. },
  9193. set: function (value) {
  9194. this.m_getByIdMethodName=value;
  9195. },
  9196. enumerable: true,
  9197. configurable: true
  9198. });
  9199. ObjectPath.prototype._updateAsNullObject=function () {
  9200. this.m_isInvalidAfterRequest=false;
  9201. this.m_isValid=true;
  9202. this.m_objectPathInfo.ObjectPathType=7 ;
  9203. this.m_objectPathInfo.Name="";
  9204. this.m_objectPathInfo.ArgumentInfo={};
  9205. this.m_parentObjectPath=null;
  9206. this.m_argumentObjectPaths=null;
  9207. };
  9208. ObjectPath.prototype.updateUsingObjectData=function (value) {
  9209. var referenceId=value[OfficeExtension.Constants.referenceId];
  9210. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9211. this.m_isInvalidAfterRequest=false;
  9212. this.m_isValid=true;
  9213. this.m_objectPathInfo.ObjectPathType=6 ;
  9214. this.m_objectPathInfo.Name=referenceId;
  9215. this.m_objectPathInfo.ArgumentInfo={};
  9216. this.m_parentObjectPath=null;
  9217. this.m_argumentObjectPaths=null;
  9218. return;
  9219. }
  9220. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  9221. var getByIdMethodName=this.getByIdMethodName;
  9222. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  9223. var id=value[OfficeExtension.Constants.id];
  9224. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9225. id=value[OfficeExtension.Constants.idPrivate];
  9226. }
  9227. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  9228. this.m_isInvalidAfterRequest=false;
  9229. this.m_isValid=true;
  9230. if (parentIsCollection) {
  9231. this.m_objectPathInfo.ObjectPathType=5 ;
  9232. this.m_objectPathInfo.Name="";
  9233. }
  9234. else {
  9235. this.m_objectPathInfo.ObjectPathType=3 ;
  9236. this.m_objectPathInfo.Name=getByIdMethodName;
  9237. this.m_getByIdMethodName=null;
  9238. }
  9239. this.isWriteOperation=false;
  9240. this.m_objectPathInfo.ArgumentInfo={};
  9241. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  9242. this.m_argumentObjectPaths=null;
  9243. return;
  9244. }
  9245. }
  9246. };
  9247. return ObjectPath;
  9248. })();
  9249. OfficeExtension.ObjectPath=ObjectPath;
  9250. })(OfficeExtension || (OfficeExtension={}));
  9251. var OfficeExtension;
  9252. (function (OfficeExtension) {
  9253. var ObjectPathFactory=(function () {
  9254. function ObjectPathFactory() {
  9255. }
  9256. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  9257. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  9258. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  9259. };
  9260. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  9261. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  9262. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  9263. };
  9264. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  9265. var objectPathInfo={
  9266. Id: context._nextId(),
  9267. ObjectPathType: 4 ,
  9268. Name: propertyName,
  9269. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9270. };
  9271. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9272. };
  9273. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  9274. var objectPathInfo={
  9275. Id: context._nextId(),
  9276. ObjectPathType: 5 ,
  9277. Name: "",
  9278. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9279. ArgumentInfo: {}
  9280. };
  9281. objectPathInfo.ArgumentInfo.Arguments=args;
  9282. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9283. };
  9284. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  9285. var objectPathInfo={
  9286. Id: context._nextId(),
  9287. ObjectPathType: 5 ,
  9288. Name: "",
  9289. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  9290. ArgumentInfo: {}
  9291. };
  9292. objectPathInfo.ArgumentInfo.Arguments=args;
  9293. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  9294. };
  9295. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  9296. var objectPathInfo={
  9297. Id: context._nextId(),
  9298. ObjectPathType: 3 ,
  9299. Name: methodName,
  9300. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9301. ArgumentInfo: {}
  9302. };
  9303. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  9304. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  9305. ret.argumentObjectPaths=argumentObjectPaths;
  9306. ret.isWriteOperation=(operationType !=1 );
  9307. ret.getByIdMethodName=getByIdMethodName;
  9308. return ret;
  9309. };
  9310. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  9311. var id=childItem[OfficeExtension.Constants.id];
  9312. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9313. id=childItem[OfficeExtension.Constants.idPrivate];
  9314. }
  9315. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  9316. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  9317. }
  9318. else {
  9319. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  9320. }
  9321. };
  9322. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  9323. var id=childItem[OfficeExtension.Constants.id];
  9324. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  9325. id=childItem[OfficeExtension.Constants.idPrivate];
  9326. }
  9327. var objectPathInfo=objectPathInfo={
  9328. Id: context._nextId(),
  9329. ObjectPathType: 5 ,
  9330. Name: "",
  9331. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9332. ArgumentInfo: {}
  9333. };
  9334. objectPathInfo.ArgumentInfo.Arguments=[id];
  9335. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9336. };
  9337. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  9338. var indexFromServer=childItem[OfficeExtension.Constants.index];
  9339. if (indexFromServer) {
  9340. index=indexFromServer;
  9341. }
  9342. var objectPathInfo={
  9343. Id: context._nextId(),
  9344. ObjectPathType: 3 ,
  9345. Name: OfficeExtension.Constants.getItemAt,
  9346. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  9347. ArgumentInfo: {}
  9348. };
  9349. objectPathInfo.ArgumentInfo.Arguments=[index];
  9350. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  9351. };
  9352. return ObjectPathFactory;
  9353. })();
  9354. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  9355. })(OfficeExtension || (OfficeExtension={}));
  9356. var OfficeExtension;
  9357. (function (OfficeExtension) {
  9358. var OfficeJsRequestExecutor=(function () {
  9359. function OfficeJsRequestExecutor() {
  9360. }
  9361. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  9362. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  9363. return new OfficeExtension.Promise(function (resolve, reject) {
  9364. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  9365. OfficeExtension.Utility.log("Response:");
  9366. OfficeExtension.Utility.log(JSON.stringify(result));
  9367. var response;
  9368. if (result.status=="succeeded") {
  9369. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  9370. }
  9371. else {
  9372. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  9373. }
  9374. resolve(response);
  9375. });
  9376. });
  9377. };
  9378. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  9379. return OfficeJsRequestExecutor;
  9380. })();
  9381. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  9382. })(OfficeExtension || (OfficeExtension={}));
  9383. var OfficeExtension;
  9384. (function (OfficeExtension) {
  9385. var _Internal;
  9386. (function (_Internal) {
  9387. var PromiseImpl;
  9388. (function (PromiseImpl) {
  9389. function Init() {
  9390. (function () {
  9391. "use strict";
  9392. function lib$es6$promise$utils$$objectOrFunction(x) {
  9393. return typeof x==='function' || (typeof x==='object' && x !==null);
  9394. }
  9395. function lib$es6$promise$utils$$isFunction(x) {
  9396. return typeof x==='function';
  9397. }
  9398. function lib$es6$promise$utils$$isMaybeThenable(x) {
  9399. return typeof x==='object' && x !==null;
  9400. }
  9401. var lib$es6$promise$utils$$_isArray;
  9402. if (!Array.isArray) {
  9403. lib$es6$promise$utils$$_isArray=function (x) {
  9404. return Object.prototype.toString.call(x)==='[object Array]';
  9405. };
  9406. }
  9407. else {
  9408. lib$es6$promise$utils$$_isArray=Array.isArray;
  9409. }
  9410. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  9411. var lib$es6$promise$asap$$len=0;
  9412. var lib$es6$promise$asap$$toString={}.toString;
  9413. var lib$es6$promise$asap$$vertxNext;
  9414. var lib$es6$promise$asap$$customSchedulerFn;
  9415. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  9416. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  9417. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  9418. lib$es6$promise$asap$$len+=2;
  9419. if (lib$es6$promise$asap$$len===2) {
  9420. if (lib$es6$promise$asap$$customSchedulerFn) {
  9421. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  9422. }
  9423. else {
  9424. lib$es6$promise$asap$$scheduleFlush();
  9425. }
  9426. }
  9427. };
  9428. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  9429. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  9430. }
  9431. function lib$es6$promise$asap$$setAsap(asapFn) {
  9432. lib$es6$promise$asap$$asap=asapFn;
  9433. }
  9434. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  9435. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  9436. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  9437. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  9438. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  9439. function lib$es6$promise$asap$$useNextTick() {
  9440. var nextTick=process.nextTick;
  9441. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  9442. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  9443. nextTick=setImmediate;
  9444. }
  9445. return function () {
  9446. nextTick(lib$es6$promise$asap$$flush);
  9447. };
  9448. }
  9449. function lib$es6$promise$asap$$useVertxTimer() {
  9450. return function () {
  9451. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  9452. };
  9453. }
  9454. function lib$es6$promise$asap$$useMutationObserver() {
  9455. var iterations=0;
  9456. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  9457. var node=document.createTextNode('');
  9458. observer.observe(node, { characterData: true });
  9459. return function () {
  9460. node.data=(iterations=++iterations % 2);
  9461. };
  9462. }
  9463. function lib$es6$promise$asap$$useMessageChannel() {
  9464. var channel=new MessageChannel();
  9465. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  9466. return function () {
  9467. channel.port2.postMessage(0);
  9468. };
  9469. }
  9470. function lib$es6$promise$asap$$useSetTimeout() {
  9471. return function () {
  9472. setTimeout(lib$es6$promise$asap$$flush, 1);
  9473. };
  9474. }
  9475. var lib$es6$promise$asap$$queue=new Array(1000);
  9476. function lib$es6$promise$asap$$flush() {
  9477. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  9478. var callback=lib$es6$promise$asap$$queue[i];
  9479. var arg=lib$es6$promise$asap$$queue[i+1];
  9480. callback(arg);
  9481. lib$es6$promise$asap$$queue[i]=undefined;
  9482. lib$es6$promise$asap$$queue[i+1]=undefined;
  9483. }
  9484. lib$es6$promise$asap$$len=0;
  9485. }
  9486. function lib$es6$promise$asap$$attemptVertex() {
  9487. try {
  9488. var r=require;
  9489. var vertx=r('vertx');
  9490. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  9491. return lib$es6$promise$asap$$useVertxTimer();
  9492. }
  9493. catch (e) {
  9494. return lib$es6$promise$asap$$useSetTimeout();
  9495. }
  9496. }
  9497. var lib$es6$promise$asap$$scheduleFlush;
  9498. if (lib$es6$promise$asap$$isNode) {
  9499. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  9500. }
  9501. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  9502. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  9503. }
  9504. else if (lib$es6$promise$asap$$isWorker) {
  9505. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  9506. }
  9507. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  9508. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  9509. }
  9510. else {
  9511. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  9512. }
  9513. function lib$es6$promise$$internal$$noop() {
  9514. }
  9515. var lib$es6$promise$$internal$$PENDING=void 0;
  9516. var lib$es6$promise$$internal$$FULFILLED=1;
  9517. var lib$es6$promise$$internal$$REJECTED=2;
  9518. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9519. function lib$es6$promise$$internal$$selfFullfillment() {
  9520. return new TypeError("You cannot resolve a promise with itself");
  9521. }
  9522. function lib$es6$promise$$internal$$cannotReturnOwn() {
  9523. return new TypeError('A promises callback cannot return that same promise.');
  9524. }
  9525. function lib$es6$promise$$internal$$getThen(promise) {
  9526. try {
  9527. return promise.then;
  9528. }
  9529. catch (error) {
  9530. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  9531. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  9532. }
  9533. }
  9534. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  9535. try {
  9536. then.call(value, fulfillmentHandler, rejectionHandler);
  9537. }
  9538. catch (e) {
  9539. return e;
  9540. }
  9541. }
  9542. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  9543. lib$es6$promise$asap$$asap(function (promise) {
  9544. var sealed=false;
  9545. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  9546. if (sealed) {
  9547. return;
  9548. }
  9549. sealed=true;
  9550. if (thenable !==value) {
  9551. lib$es6$promise$$internal$$resolve(promise, value);
  9552. }
  9553. else {
  9554. lib$es6$promise$$internal$$fulfill(promise, value);
  9555. }
  9556. }, function (reason) {
  9557. if (sealed) {
  9558. return;
  9559. }
  9560. sealed=true;
  9561. lib$es6$promise$$internal$$reject(promise, reason);
  9562. }, 'Settle: '+(promise._label || ' unknown promise'));
  9563. if (!sealed && error) {
  9564. sealed=true;
  9565. lib$es6$promise$$internal$$reject(promise, error);
  9566. }
  9567. }, promise);
  9568. }
  9569. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  9570. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  9571. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  9572. }
  9573. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  9574. lib$es6$promise$$internal$$reject(promise, thenable._result);
  9575. }
  9576. else {
  9577. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  9578. lib$es6$promise$$internal$$resolve(promise, value);
  9579. }, function (reason) {
  9580. lib$es6$promise$$internal$$reject(promise, reason);
  9581. });
  9582. }
  9583. }
  9584. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  9585. if (maybeThenable.constructor===promise.constructor) {
  9586. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  9587. }
  9588. else {
  9589. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  9590. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  9591. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  9592. }
  9593. else if (then===undefined) {
  9594. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9595. }
  9596. else if (lib$es6$promise$utils$$isFunction(then)) {
  9597. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  9598. }
  9599. else {
  9600. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  9601. }
  9602. }
  9603. }
  9604. function lib$es6$promise$$internal$$resolve(promise, value) {
  9605. if (promise===value) {
  9606. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  9607. }
  9608. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  9609. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  9610. }
  9611. else {
  9612. lib$es6$promise$$internal$$fulfill(promise, value);
  9613. }
  9614. }
  9615. function lib$es6$promise$$internal$$publishRejection(promise) {
  9616. if (promise._onerror) {
  9617. promise._onerror(promise._result);
  9618. }
  9619. lib$es6$promise$$internal$$publish(promise);
  9620. }
  9621. function lib$es6$promise$$internal$$fulfill(promise, value) {
  9622. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9623. return;
  9624. }
  9625. promise._result=value;
  9626. promise._state=lib$es6$promise$$internal$$FULFILLED;
  9627. if (promise._subscribers.length !==0) {
  9628. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  9629. }
  9630. }
  9631. function lib$es6$promise$$internal$$reject(promise, reason) {
  9632. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9633. return;
  9634. }
  9635. promise._state=lib$es6$promise$$internal$$REJECTED;
  9636. promise._result=reason;
  9637. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  9638. }
  9639. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  9640. var subscribers=parent._subscribers;
  9641. var length=subscribers.length;
  9642. parent._onerror=null;
  9643. subscribers[length]=child;
  9644. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  9645. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  9646. if (length===0 && parent._state) {
  9647. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  9648. }
  9649. }
  9650. function lib$es6$promise$$internal$$publish(promise) {
  9651. var subscribers=promise._subscribers;
  9652. var settled=promise._state;
  9653. if (subscribers.length===0) {
  9654. return;
  9655. }
  9656. var child, callback, detail=promise._result;
  9657. for (var i=0; i < subscribers.length; i+=3) {
  9658. child=subscribers[i];
  9659. callback=subscribers[i+settled];
  9660. if (child) {
  9661. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  9662. }
  9663. else {
  9664. callback(detail);
  9665. }
  9666. }
  9667. promise._subscribers.length=0;
  9668. }
  9669. function lib$es6$promise$$internal$$ErrorObject() {
  9670. this.error=null;
  9671. }
  9672. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  9673. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  9674. try {
  9675. return callback(detail);
  9676. }
  9677. catch (e) {
  9678. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  9679. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  9680. }
  9681. }
  9682. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  9683. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  9684. if (hasCallback) {
  9685. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  9686. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  9687. failed=true;
  9688. error=value.error;
  9689. value=null;
  9690. }
  9691. else {
  9692. succeeded=true;
  9693. }
  9694. if (promise===value) {
  9695. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  9696. return;
  9697. }
  9698. }
  9699. else {
  9700. value=detail;
  9701. succeeded=true;
  9702. }
  9703. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  9704. }
  9705. else if (hasCallback && succeeded) {
  9706. lib$es6$promise$$internal$$resolve(promise, value);
  9707. }
  9708. else if (failed) {
  9709. lib$es6$promise$$internal$$reject(promise, error);
  9710. }
  9711. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  9712. lib$es6$promise$$internal$$fulfill(promise, value);
  9713. }
  9714. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  9715. lib$es6$promise$$internal$$reject(promise, value);
  9716. }
  9717. }
  9718. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  9719. try {
  9720. resolver(function resolvePromise(value) {
  9721. lib$es6$promise$$internal$$resolve(promise, value);
  9722. }, function rejectPromise(reason) {
  9723. lib$es6$promise$$internal$$reject(promise, reason);
  9724. });
  9725. }
  9726. catch (e) {
  9727. lib$es6$promise$$internal$$reject(promise, e);
  9728. }
  9729. }
  9730. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  9731. var enumerator=this;
  9732. enumerator._instanceConstructor=Constructor;
  9733. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  9734. if (enumerator._validateInput(input)) {
  9735. enumerator._input=input;
  9736. enumerator.length=input.length;
  9737. enumerator._remaining=input.length;
  9738. enumerator._init();
  9739. if (enumerator.length===0) {
  9740. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9741. }
  9742. else {
  9743. enumerator.length=enumerator.length || 0;
  9744. enumerator._enumerate();
  9745. if (enumerator._remaining===0) {
  9746. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  9747. }
  9748. }
  9749. }
  9750. else {
  9751. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  9752. }
  9753. }
  9754. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  9755. return lib$es6$promise$utils$$isArray(input);
  9756. };
  9757. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  9758. return new _Internal.Error('Array Methods must be provided an Array');
  9759. };
  9760. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  9761. this._result=new Array(this.length);
  9762. };
  9763. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  9764. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  9765. var enumerator=this;
  9766. var length=enumerator.length;
  9767. var promise=enumerator.promise;
  9768. var input=enumerator._input;
  9769. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9770. enumerator._eachEntry(input[i], i);
  9771. }
  9772. };
  9773. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  9774. var enumerator=this;
  9775. var c=enumerator._instanceConstructor;
  9776. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  9777. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  9778. entry._onerror=null;
  9779. enumerator._settledAt(entry._state, i, entry._result);
  9780. }
  9781. else {
  9782. enumerator._willSettleAt(c.resolve(entry), i);
  9783. }
  9784. }
  9785. else {
  9786. enumerator._remaining--;
  9787. enumerator._result[i]=entry;
  9788. }
  9789. };
  9790. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  9791. var enumerator=this;
  9792. var promise=enumerator.promise;
  9793. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  9794. enumerator._remaining--;
  9795. if (state===lib$es6$promise$$internal$$REJECTED) {
  9796. lib$es6$promise$$internal$$reject(promise, value);
  9797. }
  9798. else {
  9799. enumerator._result[i]=value;
  9800. }
  9801. }
  9802. if (enumerator._remaining===0) {
  9803. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  9804. }
  9805. };
  9806. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  9807. var enumerator=this;
  9808. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  9809. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  9810. }, function (reason) {
  9811. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  9812. });
  9813. };
  9814. function lib$es6$promise$promise$all$$all(entries) {
  9815. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  9816. }
  9817. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  9818. function lib$es6$promise$promise$race$$race(entries) {
  9819. var Constructor=this;
  9820. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9821. if (!lib$es6$promise$utils$$isArray(entries)) {
  9822. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  9823. return promise;
  9824. }
  9825. var length=entries.length;
  9826. function onFulfillment(value) {
  9827. lib$es6$promise$$internal$$resolve(promise, value);
  9828. }
  9829. function onRejection(reason) {
  9830. lib$es6$promise$$internal$$reject(promise, reason);
  9831. }
  9832. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  9833. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  9834. }
  9835. return promise;
  9836. }
  9837. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  9838. function lib$es6$promise$promise$resolve$$resolve(object) {
  9839. var Constructor=this;
  9840. if (object && typeof object==='object' && object.constructor===Constructor) {
  9841. return object;
  9842. }
  9843. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9844. lib$es6$promise$$internal$$resolve(promise, object);
  9845. return promise;
  9846. }
  9847. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  9848. function lib$es6$promise$promise$reject$$reject(reason) {
  9849. var Constructor=this;
  9850. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  9851. lib$es6$promise$$internal$$reject(promise, reason);
  9852. return promise;
  9853. }
  9854. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  9855. var lib$es6$promise$promise$$counter=0;
  9856. function lib$es6$promise$promise$$needsResolver() {
  9857. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  9858. }
  9859. function lib$es6$promise$promise$$needsNew() {
  9860. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  9861. }
  9862. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  9863. function lib$es6$promise$promise$$Promise(resolver) {
  9864. this._id=lib$es6$promise$promise$$counter++;
  9865. this._state=undefined;
  9866. this._result=undefined;
  9867. this._subscribers=[];
  9868. if (lib$es6$promise$$internal$$noop !==resolver) {
  9869. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  9870. lib$es6$promise$promise$$needsResolver();
  9871. }
  9872. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  9873. lib$es6$promise$promise$$needsNew();
  9874. }
  9875. lib$es6$promise$$internal$$initializePromise(this, resolver);
  9876. }
  9877. }
  9878. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  9879. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  9880. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  9881. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  9882. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  9883. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  9884. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  9885. lib$es6$promise$promise$$Promise.prototype={
  9886. constructor: lib$es6$promise$promise$$Promise,
  9887. then: function (onFulfillment, onRejection) {
  9888. var parent=this;
  9889. var state=parent._state;
  9890. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  9891. return this;
  9892. }
  9893. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  9894. var result=parent._result;
  9895. if (state) {
  9896. var callback=arguments[state - 1];
  9897. lib$es6$promise$asap$$asap(function () {
  9898. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  9899. });
  9900. }
  9901. else {
  9902. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  9903. }
  9904. return child;
  9905. },
  9906. 'catch': function (onRejection) {
  9907. return this.then(null, onRejection);
  9908. }
  9909. };
  9910. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  9911. }).call(this);
  9912. }
  9913. PromiseImpl.Init=Init;
  9914. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  9915. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  9916. if (!OfficeExtension["Promise"]) {
  9917. if (typeof (window) !=="undefined" && window.Promise) {
  9918. if (IsEdgeLessThan14()) {
  9919. _Internal.PromiseImpl.Init();
  9920. }
  9921. else {
  9922. OfficeExtension.Promise=window.Promise;
  9923. }
  9924. }
  9925. else {
  9926. _Internal.PromiseImpl.Init();
  9927. }
  9928. }
  9929. })(OfficeExtension || (OfficeExtension={}));
  9930. function IsEdgeLessThan14() {
  9931. var userAgent=window.navigator.userAgent;
  9932. var versionIdx=userAgent.indexOf("Edge/");
  9933. if (versionIdx >=0) {
  9934. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  9935. if (userAgent < "14.14393")
  9936. return true;
  9937. else
  9938. return false;
  9939. }
  9940. return false;
  9941. }
  9942. var OfficeExtension;
  9943. (function (OfficeExtension) {
  9944. (function (OperationType) {
  9945. OperationType[OperationType["Default"]=0]="Default";
  9946. OperationType[OperationType["Read"]=1]="Read";
  9947. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  9948. var OperationType=OfficeExtension.OperationType;
  9949. })(OfficeExtension || (OfficeExtension={}));
  9950. var OfficeExtension;
  9951. (function (OfficeExtension) {
  9952. var TrackedObjects=(function () {
  9953. function TrackedObjects(context) {
  9954. this._autoCleanupList={};
  9955. this.m_context=context;
  9956. }
  9957. TrackedObjects.prototype.add=function (param) {
  9958. var _this=this;
  9959. if (Array.isArray(param)) {
  9960. param.forEach(function (item) { return _this._addCommon(item, true); });
  9961. }
  9962. else {
  9963. this._addCommon(param, true);
  9964. }
  9965. };
  9966. TrackedObjects.prototype._autoAdd=function (object) {
  9967. this._addCommon(object, false);
  9968. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  9969. };
  9970. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  9971. if (object[OfficeExtension.Constants.isTracked]) {
  9972. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9973. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9974. }
  9975. return;
  9976. }
  9977. var referenceId=object[OfficeExtension.Constants.referenceId];
  9978. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  9979. object._KeepReference();
  9980. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  9981. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  9982. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  9983. }
  9984. object[OfficeExtension.Constants.isTracked]=true;
  9985. }
  9986. };
  9987. TrackedObjects.prototype.remove=function (param) {
  9988. var _this=this;
  9989. if (Array.isArray(param)) {
  9990. param.forEach(function (item) { return _this._removeCommon(item); });
  9991. }
  9992. else {
  9993. this._removeCommon(param);
  9994. }
  9995. };
  9996. TrackedObjects.prototype._removeCommon=function (object) {
  9997. var referenceId=object[OfficeExtension.Constants.referenceId];
  9998. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  9999. var rootObject=this.m_context._rootObject;
  10000. if (rootObject._RemoveReference) {
  10001. rootObject._RemoveReference(referenceId);
  10002. }
  10003. delete object[OfficeExtension.Constants.isTracked];
  10004. }
  10005. };
  10006. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  10007. var list=this._autoCleanupList;
  10008. this._autoCleanupList={};
  10009. return list;
  10010. };
  10011. return TrackedObjects;
  10012. })();
  10013. OfficeExtension.TrackedObjects=TrackedObjects;
  10014. })(OfficeExtension || (OfficeExtension={}));
  10015. var OfficeExtension;
  10016. (function (OfficeExtension) {
  10017. var ResourceStrings=(function () {
  10018. function ResourceStrings() {
  10019. }
  10020. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  10021. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  10022. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  10023. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  10024. ResourceStrings.invalidArgument="InvalidArgument";
  10025. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  10026. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  10027. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  10028. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  10029. return ResourceStrings;
  10030. })();
  10031. OfficeExtension.ResourceStrings=ResourceStrings;
  10032. })(OfficeExtension || (OfficeExtension={}));
  10033. var OfficeExtension;
  10034. (function (OfficeExtension) {
  10035. var RichApiMessageUtility=(function () {
  10036. function RichApiMessageUtility() {
  10037. }
  10038. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  10039. var requestMessageText=JSON.stringify(requestMessage.Body);
  10040. OfficeExtension.Utility.log("Request:");
  10041. OfficeExtension.Utility.log(requestMessageText);
  10042. var headers={};
  10043. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  10044. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  10045. return messageSafearray;
  10046. };
  10047. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  10048. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10049. response.Body=JSON.parse(responseBody);
  10050. response.Headers=responseHeaders;
  10051. return response;
  10052. };
  10053. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  10054. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  10055. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  10056. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10057. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  10058. }
  10059. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10060. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  10061. }
  10062. response.ErrorMessage=message;
  10063. return response;
  10064. };
  10065. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  10066. var statusCode=500;
  10067. var errorBody={};
  10068. errorBody["error"]={};
  10069. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  10070. errorBody["error"]["message"]=message;
  10071. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  10072. statusCode=403;
  10073. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  10074. }
  10075. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  10076. statusCode=429;
  10077. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  10078. }
  10079. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  10080. };
  10081. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  10082. var headerArray=[];
  10083. if (headers) {
  10084. for (var headerName in headers) {
  10085. headerArray.push(headerName);
  10086. headerArray.push(headers[headerName]);
  10087. }
  10088. }
  10089. var appPermission=0;
  10090. var solutionId="";
  10091. var instanceId="";
  10092. var marketplaceType="";
  10093. return [
  10094. customData,
  10095. method,
  10096. path,
  10097. headerArray,
  10098. body,
  10099. appPermission,
  10100. requestFlags,
  10101. solutionId,
  10102. instanceId,
  10103. marketplaceType
  10104. ];
  10105. };
  10106. RichApiMessageUtility.getResponseBody=function (result) {
  10107. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  10108. };
  10109. RichApiMessageUtility.getResponseHeaders=function (result) {
  10110. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  10111. };
  10112. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  10113. var ret=data[2 ];
  10114. if (typeof (ret)==="string") {
  10115. return ret;
  10116. }
  10117. var arr=ret;
  10118. return arr.join("");
  10119. };
  10120. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  10121. var arrayHeader=data[1 ];
  10122. if (!arrayHeader) {
  10123. return null;
  10124. }
  10125. var headers={};
  10126. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  10127. headers[arrayHeader[i]]=arrayHeader[i+1];
  10128. }
  10129. return headers;
  10130. };
  10131. RichApiMessageUtility.getResponseStatusCode=function (result) {
  10132. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  10133. };
  10134. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  10135. return data[0 ];
  10136. };
  10137. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  10138. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  10139. return RichApiMessageUtility;
  10140. })();
  10141. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  10142. })(OfficeExtension || (OfficeExtension={}));
  10143. var OfficeExtension;
  10144. (function (OfficeExtension) {
  10145. var Utility=(function () {
  10146. function Utility() {
  10147. }
  10148. Utility.checkArgumentNull=function (value, name) {
  10149. if (Utility.isNullOrUndefined(value)) {
  10150. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  10151. }
  10152. };
  10153. Utility.isNullOrUndefined=function (value) {
  10154. if (value===null) {
  10155. return true;
  10156. }
  10157. if (typeof (value)==="undefined") {
  10158. return true;
  10159. }
  10160. return false;
  10161. };
  10162. Utility.isUndefined=function (value) {
  10163. if (typeof (value)==="undefined") {
  10164. return true;
  10165. }
  10166. return false;
  10167. };
  10168. Utility.isNullOrEmptyString=function (value) {
  10169. if (value===null) {
  10170. return true;
  10171. }
  10172. if (typeof (value)==="undefined") {
  10173. return true;
  10174. }
  10175. if (value.length==0) {
  10176. return true;
  10177. }
  10178. return false;
  10179. };
  10180. Utility.isPlainJsonObject=function (value) {
  10181. if (Utility.isNullOrUndefined(value)) {
  10182. return false;
  10183. }
  10184. if (typeof (value) !=="object") {
  10185. return false;
  10186. }
  10187. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  10188. };
  10189. Utility.trim=function (str) {
  10190. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  10191. };
  10192. Utility.caseInsensitiveCompareString=function (str1, str2) {
  10193. if (Utility.isNullOrUndefined(str1)) {
  10194. return Utility.isNullOrUndefined(str2);
  10195. }
  10196. else {
  10197. if (Utility.isNullOrUndefined(str2)) {
  10198. return false;
  10199. }
  10200. else {
  10201. return str1.toUpperCase()==str2.toUpperCase();
  10202. }
  10203. }
  10204. };
  10205. Utility.adjustToDateTime=function (value) {
  10206. if (Utility.isNullOrUndefined(value)) {
  10207. return null;
  10208. }
  10209. if (typeof (value)==="string") {
  10210. return new Date(value);
  10211. }
  10212. if (Array.isArray(value)) {
  10213. var arr=value;
  10214. for (var i=0; i < arr.length; i++) {
  10215. arr[i]=Utility.adjustToDateTime(arr[i]);
  10216. }
  10217. return arr;
  10218. }
  10219. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  10220. };
  10221. Utility.isReadonlyRestRequest=function (method) {
  10222. return Utility.caseInsensitiveCompareString(method, "GET");
  10223. };
  10224. Utility.setMethodArguments=function (context, argumentInfo, args) {
  10225. if (Utility.isNullOrUndefined(args)) {
  10226. return null;
  10227. }
  10228. var referencedObjectPaths=new Array();
  10229. var referencedObjectPathIds=new Array();
  10230. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  10231. argumentInfo.Arguments=args;
  10232. if (hasOne) {
  10233. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  10234. return referencedObjectPaths;
  10235. }
  10236. return null;
  10237. };
  10238. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  10239. var hasOne=false;
  10240. for (var i=0; i < args.length; i++) {
  10241. if (args[i] instanceof OfficeExtension.ClientObject) {
  10242. var clientObject=args[i];
  10243. Utility.validateContext(context, clientObject);
  10244. args[i]=clientObject._objectPath.objectPathInfo.Id;
  10245. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  10246. referencedObjectPaths.push(clientObject._objectPath);
  10247. hasOne=true;
  10248. }
  10249. else if (Array.isArray(args[i])) {
  10250. var childArrayObjectPathIds=new Array();
  10251. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  10252. if (childArrayHasOne) {
  10253. referencedObjectPathIds.push(childArrayObjectPathIds);
  10254. hasOne=true;
  10255. }
  10256. else {
  10257. referencedObjectPathIds.push(0);
  10258. }
  10259. }
  10260. else {
  10261. referencedObjectPathIds.push(0);
  10262. }
  10263. }
  10264. return hasOne;
  10265. };
  10266. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  10267. if (clientObject && clientObject._objectPath && value) {
  10268. clientObject._objectPath.updateUsingObjectData(value);
  10269. }
  10270. };
  10271. Utility.validateObjectPath=function (clientObject) {
  10272. var objectPath=clientObject._objectPath;
  10273. while (objectPath) {
  10274. if (!objectPath.isValid) {
  10275. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10276. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10277. }
  10278. objectPath=objectPath.parentObjectPath;
  10279. }
  10280. };
  10281. Utility.validateReferencedObjectPaths=function (objectPaths) {
  10282. if (objectPaths) {
  10283. for (var i=0; i < objectPaths.length; i++) {
  10284. var objectPath=objectPaths[i];
  10285. while (objectPath) {
  10286. if (!objectPath.isValid) {
  10287. var pathExpression=Utility.getObjectPathExpression(objectPath);
  10288. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  10289. }
  10290. objectPath=objectPath.parentObjectPath;
  10291. }
  10292. }
  10293. }
  10294. };
  10295. Utility.validateContext=function (context, obj) {
  10296. if (obj && obj.context !==context) {
  10297. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  10298. }
  10299. };
  10300. Utility.log=function (message) {
  10301. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  10302. console.log(message);
  10303. }
  10304. };
  10305. Utility.load=function (clientObj, option) {
  10306. clientObj.context.load(clientObj, option);
  10307. };
  10308. Utility._parseSelectExpand=function (select) {
  10309. var args=[];
  10310. if (!Utility.isNullOrEmptyString(select)) {
  10311. var propertyNames=select.split(",");
  10312. for (var i=0; i < propertyNames.length; i++) {
  10313. var propertyName=propertyNames[i];
  10314. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  10315. if (propertyName.length > 0) {
  10316. args.push(propertyName);
  10317. }
  10318. }
  10319. }
  10320. return args;
  10321. function sanitizeForAnyItemsSlash(propertyName) {
  10322. var propertyNameLower=propertyName.toLowerCase();
  10323. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  10324. return '*';
  10325. }
  10326. var itemsSlashLength=6;
  10327. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  10328. propertyName=propertyName.substr(itemsSlashLength);
  10329. }
  10330. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  10331. }
  10332. };
  10333. Utility.throwError=function (resourceId, arg, errorLocation) {
  10334. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  10335. };
  10336. Utility.createRuntimeError=function (code, message, location) {
  10337. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  10338. };
  10339. Utility.createInvalidArgumentException=function (name, errorLocation) {
  10340. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  10341. };
  10342. Utility._getResourceString=function (resourceId, arg) {
  10343. var ret=resourceId;
  10344. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  10345. var stringName="L_"+resourceId;
  10346. var stringValue=window.Strings.OfficeOM[stringName];
  10347. if (stringValue) {
  10348. ret=stringValue;
  10349. }
  10350. }
  10351. if (!Utility.isNullOrUndefined(arg)) {
  10352. if (Array.isArray(arg)) {
  10353. var arrArg=arg;
  10354. ret=Utility._formatString(ret, arrArg);
  10355. }
  10356. else {
  10357. ret=ret.replace("{0}", arg);
  10358. }
  10359. }
  10360. return ret;
  10361. };
  10362. Utility._formatString=function (format, arrArg) {
  10363. return format.replace(/\{\d\}/g, function (v) {
  10364. var position=parseInt(v.substr(1, v.length - 2));
  10365. if (position < arrArg.length) {
  10366. return arrArg[position];
  10367. }
  10368. else {
  10369. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  10370. }
  10371. return "";
  10372. });
  10373. };
  10374. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  10375. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  10376. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  10377. }
  10378. };
  10379. Utility.getObjectPathExpression=function (objectPath) {
  10380. var ret="";
  10381. while (objectPath) {
  10382. switch (objectPath.objectPathInfo.ObjectPathType) {
  10383. case 1 :
  10384. ret=ret;
  10385. break;
  10386. case 2 :
  10387. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  10388. break;
  10389. case 3 :
  10390. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  10391. break;
  10392. case 4 :
  10393. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  10394. break;
  10395. case 5 :
  10396. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  10397. break;
  10398. case 6 :
  10399. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  10400. break;
  10401. }
  10402. objectPath=objectPath.parentObjectPath;
  10403. }
  10404. return ret;
  10405. };
  10406. Utility._createPromiseFromResult=function (value) {
  10407. return new OfficeExtension.Promise(function (resolve, reject) {
  10408. resolve(value);
  10409. });
  10410. };
  10411. Utility._createTimeoutPromise=function (timeout) {
  10412. return new OfficeExtension.Promise(function (resolve, reject) {
  10413. setTimeout(function () {
  10414. resolve(null);
  10415. }, timeout);
  10416. });
  10417. };
  10418. Utility.promisify=function (action) {
  10419. return new OfficeExtension.Promise(function (resolve, reject) {
  10420. var callback=function (result) {
  10421. if (result.status=="failed") {
  10422. reject(result.error);
  10423. }
  10424. else {
  10425. resolve(result.value);
  10426. }
  10427. };
  10428. action(callback);
  10429. });
  10430. };
  10431. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  10432. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  10433. };
  10434. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  10435. for (var i=0; i < propertyNames.length - 1; i+=2) {
  10436. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  10437. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  10438. }
  10439. }
  10440. };
  10441. Utility.normalizeName=function (name) {
  10442. return name.substr(0, 1).toLowerCase()+name.substr(1);
  10443. };
  10444. Utility._isLocalDocumentUrl=function (url) {
  10445. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  10446. };
  10447. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  10448. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  10449. var urlLower=url.toLowerCase().trim();
  10450. for (var i=0; i < localDocumentPrefixes.length; i++) {
  10451. if (urlLower===localDocumentPrefixes[i]) {
  10452. return localDocumentPrefixes[i].length;
  10453. }
  10454. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  10455. return localDocumentPrefixes[i].length+1;
  10456. }
  10457. }
  10458. return 0;
  10459. };
  10460. Utility._validateLocalDocumentRequest=function (request) {
  10461. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  10462. if (index <=0) {
  10463. throw Utility.createInvalidArgumentException("request");
  10464. }
  10465. var path=request.url.substr(index);
  10466. var pathLower=path.toLowerCase();
  10467. if (pathLower==="_api") {
  10468. path="";
  10469. }
  10470. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  10471. path=path.substr("_api/".length);
  10472. }
  10473. return {
  10474. method: request.method,
  10475. url: path,
  10476. headers: request.headers,
  10477. body: request.body
  10478. };
  10479. };
  10480. Utility._buildRequestMessageSafeArray=function (request) {
  10481. var requestFlags=0 ;
  10482. if (!Utility.isReadonlyRestRequest(request.method)) {
  10483. requestFlags=1 ;
  10484. }
  10485. var requestInfo="";
  10486. if (request.headers) {
  10487. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  10488. if (!Utility.isNullOrEmptyString(requestInfo)) {
  10489. var parts=requestInfo.split("&");
  10490. for (var i=0; i < parts.length; i++) {
  10491. var keyvalue=parts[i].split("=");
  10492. if (keyvalue[0]=="flags") {
  10493. var flags=parseInt(keyvalue[1]);
  10494. requestFlags=flags;
  10495. break;
  10496. }
  10497. }
  10498. }
  10499. }
  10500. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  10501. };
  10502. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  10503. var responseHeaders={};
  10504. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  10505. var regex=new RegExp("\r?\n");
  10506. var entries=allResponseHeaders.split(regex);
  10507. for (var i=0; i < entries.length; i++) {
  10508. var entry=entries[i];
  10509. if (entry !=null) {
  10510. var index=entry.indexOf(':');
  10511. if (index > 0) {
  10512. var key=entry.substr(0, index);
  10513. var value=entry.substr(index+1);
  10514. key=Utility.trim(key);
  10515. value=Utility.trim(value);
  10516. responseHeaders[key.toUpperCase()]=value;
  10517. }
  10518. }
  10519. }
  10520. }
  10521. return responseHeaders;
  10522. };
  10523. Utility._logEnabled=false;
  10524. Utility.s_underscoreCharCode="_".charCodeAt(0);
  10525. return Utility;
  10526. })();
  10527. OfficeExtension.Utility=Utility;
  10528. })(OfficeExtension || (OfficeExtension={}));
  10529. var __extends=(this && this.__extends) || function (d, b) {
  10530. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10531. function __() { this.constructor=d; }
  10532. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  10533. };
  10534. var Excel;
  10535. (function (Excel) {
  10536. function lowerCaseFirst(str) {
  10537. return str[0].toLowerCase()+str.slice(1);
  10538. }
  10539. var iconSets=["ThreeArrows",
  10540. "ThreeArrowsGray",
  10541. "ThreeFlags",
  10542. "ThreeTrafficLights1",
  10543. "ThreeTrafficLights2",
  10544. "ThreeSigns",
  10545. "ThreeSymbols",
  10546. "ThreeSymbols2",
  10547. "FourArrows",
  10548. "FourArrowsGray",
  10549. "FourRedToBlack",
  10550. "FourRating",
  10551. "FourTrafficLights",
  10552. "FiveArrows",
  10553. "FiveArrowsGray",
  10554. "FiveRating",
  10555. "FiveQuarters",
  10556. "ThreeStars",
  10557. "ThreeTriangles",
  10558. "FiveBoxes"];
  10559. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  10560. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  10561. ["RedFlag", "YellowFlag", "GreenFlag"],
  10562. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10563. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  10564. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  10565. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  10566. ["RedCross", "YellowExclamation", "GreenCheck"],
  10567. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10568. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10569. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  10570. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10571. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  10572. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  10573. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  10574. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  10575. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  10576. ["SilverStar", "HalfGoldStar", "GoldStar"],
  10577. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  10578. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  10579. Excel.icons={};
  10580. iconSets.map(function (title, i) {
  10581. var camelTitle=lowerCaseFirst(title);
  10582. Excel.icons[camelTitle]=[];
  10583. iconNames[i].map(function (iconName, j) {
  10584. iconName=lowerCaseFirst(iconName);
  10585. var obj={ set: title, index: j };
  10586. Excel.icons[camelTitle].push(obj);
  10587. Excel.icons[camelTitle][iconName]=obj;
  10588. });
  10589. });
  10590. function setRangePropertiesInBulk(range, propertyName, values) {
  10591. var maxCellCount=1500;
  10592. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  10593. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  10594. range._ValidateArraySize(values.length, values[0].length);
  10595. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  10596. var rowCount=maxRowCount;
  10597. if (startRowIndex+rowCount > values.length) {
  10598. rowCount=values.length - startRowIndex;
  10599. }
  10600. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  10601. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  10602. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  10603. }
  10604. return true;
  10605. }
  10606. return false;
  10607. }
  10608. function isExcel1_3OrAbove() {
  10609. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  10610. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  10611. }
  10612. else {
  10613. return true;
  10614. }
  10615. }
  10616. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  10617. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  10618. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  10619. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  10620. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  10621. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  10622. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  10623. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  10624. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  10625. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  10626. var _isUndefined=OfficeExtension.Utility.isUndefined;
  10627. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  10628. var _load=OfficeExtension.Utility.load;
  10629. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  10630. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  10631. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  10632. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  10633. var Application=(function (_super) {
  10634. __extends(Application, _super);
  10635. function Application() {
  10636. _super.apply(this, arguments);
  10637. }
  10638. Object.defineProperty(Application.prototype, "calculationMode", {
  10639. get: function () {
  10640. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  10641. return this.m_calculationMode;
  10642. },
  10643. enumerable: true,
  10644. configurable: true
  10645. });
  10646. Application.prototype.calculate=function (calculationType) {
  10647. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  10648. };
  10649. Application.prototype._handleResult=function (value) {
  10650. _super.prototype._handleResult.call(this, value);
  10651. if (_isNullOrUndefined(value))
  10652. return;
  10653. var obj=value;
  10654. _fixObjectPathIfNecessary(this, obj);
  10655. if (!_isUndefined(obj["CalculationMode"])) {
  10656. this.m_calculationMode=obj["CalculationMode"];
  10657. }
  10658. };
  10659. Application.prototype.load=function (option) {
  10660. _load(this, option);
  10661. return this;
  10662. };
  10663. Application.prototype.toJSON=function () {
  10664. return {
  10665. "calculationMode": this.m_calculationMode
  10666. };
  10667. };
  10668. return Application;
  10669. }(OfficeExtension.ClientObject));
  10670. Excel.Application=Application;
  10671. var Workbook=(function (_super) {
  10672. __extends(Workbook, _super);
  10673. function Workbook() {
  10674. _super.apply(this, arguments);
  10675. }
  10676. Object.defineProperty(Workbook.prototype, "application", {
  10677. get: function () {
  10678. if (!this.m_application) {
  10679. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  10680. }
  10681. return this.m_application;
  10682. },
  10683. enumerable: true,
  10684. configurable: true
  10685. });
  10686. Object.defineProperty(Workbook.prototype, "bindings", {
  10687. get: function () {
  10688. if (!this.m_bindings) {
  10689. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  10690. }
  10691. return this.m_bindings;
  10692. },
  10693. enumerable: true,
  10694. configurable: true
  10695. });
  10696. Object.defineProperty(Workbook.prototype, "functions", {
  10697. get: function () {
  10698. if (!this.m_functions) {
  10699. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  10700. }
  10701. return this.m_functions;
  10702. },
  10703. enumerable: true,
  10704. configurable: true
  10705. });
  10706. Object.defineProperty(Workbook.prototype, "names", {
  10707. get: function () {
  10708. if (!this.m_names) {
  10709. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  10710. }
  10711. return this.m_names;
  10712. },
  10713. enumerable: true,
  10714. configurable: true
  10715. });
  10716. Object.defineProperty(Workbook.prototype, "pivotTables", {
  10717. get: function () {
  10718. if (!this.m_pivotTables) {
  10719. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10720. }
  10721. return this.m_pivotTables;
  10722. },
  10723. enumerable: true,
  10724. configurable: true
  10725. });
  10726. Object.defineProperty(Workbook.prototype, "tables", {
  10727. get: function () {
  10728. if (!this.m_tables) {
  10729. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10730. }
  10731. return this.m_tables;
  10732. },
  10733. enumerable: true,
  10734. configurable: true
  10735. });
  10736. Object.defineProperty(Workbook.prototype, "worksheets", {
  10737. get: function () {
  10738. if (!this.m_worksheets) {
  10739. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  10740. }
  10741. return this.m_worksheets;
  10742. },
  10743. enumerable: true,
  10744. configurable: true
  10745. });
  10746. Object.defineProperty(Workbook.prototype, "_V1Api", {
  10747. get: function () {
  10748. if (!this.m__V1Api) {
  10749. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  10750. }
  10751. return this.m__V1Api;
  10752. },
  10753. enumerable: true,
  10754. configurable: true
  10755. });
  10756. Workbook.prototype.getSelectedRange=function () {
  10757. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  10758. };
  10759. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  10760. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10761. var ret=new OfficeExtension.ClientResult();
  10762. _addActionResultHandler(this, action, ret);
  10763. return ret;
  10764. };
  10765. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  10766. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10767. var ret=new OfficeExtension.ClientResult();
  10768. _addActionResultHandler(this, action, ret);
  10769. return ret;
  10770. };
  10771. Workbook.prototype._GetReferenceCount=function () {
  10772. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  10773. var ret=new OfficeExtension.ClientResult();
  10774. _addActionResultHandler(this, action, ret);
  10775. return ret;
  10776. };
  10777. Workbook.prototype._RemoveAllReferences=function () {
  10778. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  10779. };
  10780. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  10781. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  10782. };
  10783. Workbook.prototype._handleResult=function (value) {
  10784. _super.prototype._handleResult.call(this, value);
  10785. if (_isNullOrUndefined(value))
  10786. return;
  10787. var obj=value;
  10788. _fixObjectPathIfNecessary(this, obj);
  10789. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  10790. };
  10791. Workbook.prototype.load=function (option) {
  10792. _load(this, option);
  10793. return this;
  10794. };
  10795. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  10796. get: function () {
  10797. var _this=this;
  10798. if (!this.m_selectionChanged) {
  10799. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  10800. registerFunc: function (handlerCallback) {
  10801. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  10802. },
  10803. unregisterFunc: function (handlerCallback) {
  10804. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  10805. },
  10806. eventArgsTransformFunc: function (args) {
  10807. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  10808. }
  10809. });
  10810. }
  10811. return this.m_selectionChanged;
  10812. },
  10813. enumerable: true,
  10814. configurable: true
  10815. });
  10816. Workbook.prototype.toJSON=function () {
  10817. return {};
  10818. };
  10819. return Workbook;
  10820. }(OfficeExtension.ClientObject));
  10821. Excel.Workbook=Workbook;
  10822. var Worksheet=(function (_super) {
  10823. __extends(Worksheet, _super);
  10824. function Worksheet() {
  10825. _super.apply(this, arguments);
  10826. }
  10827. Object.defineProperty(Worksheet.prototype, "charts", {
  10828. get: function () {
  10829. if (!this.m_charts) {
  10830. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  10831. }
  10832. return this.m_charts;
  10833. },
  10834. enumerable: true,
  10835. configurable: true
  10836. });
  10837. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  10838. get: function () {
  10839. if (!this.m_pivotTables) {
  10840. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  10841. }
  10842. return this.m_pivotTables;
  10843. },
  10844. enumerable: true,
  10845. configurable: true
  10846. });
  10847. Object.defineProperty(Worksheet.prototype, "protection", {
  10848. get: function () {
  10849. if (!this.m_protection) {
  10850. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  10851. }
  10852. return this.m_protection;
  10853. },
  10854. enumerable: true,
  10855. configurable: true
  10856. });
  10857. Object.defineProperty(Worksheet.prototype, "tables", {
  10858. get: function () {
  10859. if (!this.m_tables) {
  10860. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  10861. }
  10862. return this.m_tables;
  10863. },
  10864. enumerable: true,
  10865. configurable: true
  10866. });
  10867. Object.defineProperty(Worksheet.prototype, "id", {
  10868. get: function () {
  10869. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  10870. return this.m_id;
  10871. },
  10872. enumerable: true,
  10873. configurable: true
  10874. });
  10875. Object.defineProperty(Worksheet.prototype, "name", {
  10876. get: function () {
  10877. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  10878. return this.m_name;
  10879. },
  10880. set: function (value) {
  10881. this.m_name=value;
  10882. _createSetPropertyAction(this.context, this, "Name", value);
  10883. },
  10884. enumerable: true,
  10885. configurable: true
  10886. });
  10887. Object.defineProperty(Worksheet.prototype, "position", {
  10888. get: function () {
  10889. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  10890. return this.m_position;
  10891. },
  10892. set: function (value) {
  10893. this.m_position=value;
  10894. _createSetPropertyAction(this.context, this, "Position", value);
  10895. },
  10896. enumerable: true,
  10897. configurable: true
  10898. });
  10899. Object.defineProperty(Worksheet.prototype, "visibility", {
  10900. get: function () {
  10901. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  10902. return this.m_visibility;
  10903. },
  10904. set: function (value) {
  10905. this.m_visibility=value;
  10906. _createSetPropertyAction(this.context, this, "Visibility", value);
  10907. },
  10908. enumerable: true,
  10909. configurable: true
  10910. });
  10911. Worksheet.prototype.activate=function () {
  10912. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  10913. };
  10914. Worksheet.prototype.delete=function () {
  10915. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  10916. };
  10917. Worksheet.prototype.getCell=function (row, column) {
  10918. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  10919. };
  10920. Worksheet.prototype.getRange=function (address) {
  10921. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  10922. };
  10923. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  10924. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  10925. };
  10926. Worksheet.prototype._handleResult=function (value) {
  10927. _super.prototype._handleResult.call(this, value);
  10928. if (_isNullOrUndefined(value))
  10929. return;
  10930. var obj=value;
  10931. _fixObjectPathIfNecessary(this, obj);
  10932. if (!_isUndefined(obj["Id"])) {
  10933. this.m_id=obj["Id"];
  10934. }
  10935. if (!_isUndefined(obj["Name"])) {
  10936. this.m_name=obj["Name"];
  10937. }
  10938. if (!_isUndefined(obj["Position"])) {
  10939. this.m_position=obj["Position"];
  10940. }
  10941. if (!_isUndefined(obj["Visibility"])) {
  10942. this.m_visibility=obj["Visibility"];
  10943. }
  10944. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  10945. };
  10946. Worksheet.prototype.load=function (option) {
  10947. _load(this, option);
  10948. return this;
  10949. };
  10950. Worksheet.prototype._handleIdResult=function (value) {
  10951. _super.prototype._handleIdResult.call(this, value);
  10952. if (_isNullOrUndefined(value)) {
  10953. return;
  10954. }
  10955. if (!_isUndefined(value["Id"])) {
  10956. this.m_id=value["Id"];
  10957. }
  10958. };
  10959. Worksheet.prototype.toJSON=function () {
  10960. return {
  10961. "id": this.m_id,
  10962. "name": this.m_name,
  10963. "position": this.m_position,
  10964. "protection": this.m_protection,
  10965. "visibility": this.m_visibility
  10966. };
  10967. };
  10968. return Worksheet;
  10969. }(OfficeExtension.ClientObject));
  10970. Excel.Worksheet=Worksheet;
  10971. var WorksheetCollection=(function (_super) {
  10972. __extends(WorksheetCollection, _super);
  10973. function WorksheetCollection() {
  10974. _super.apply(this, arguments);
  10975. }
  10976. Object.defineProperty(WorksheetCollection.prototype, "items", {
  10977. get: function () {
  10978. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  10979. return this.m__items;
  10980. },
  10981. enumerable: true,
  10982. configurable: true
  10983. });
  10984. WorksheetCollection.prototype.add=function (name) {
  10985. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  10986. };
  10987. WorksheetCollection.prototype.getActiveWorksheet=function () {
  10988. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  10989. };
  10990. WorksheetCollection.prototype.getItem=function (key) {
  10991. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  10992. };
  10993. WorksheetCollection.prototype._handleResult=function (value) {
  10994. _super.prototype._handleResult.call(this, value);
  10995. if (_isNullOrUndefined(value))
  10996. return;
  10997. var obj=value;
  10998. _fixObjectPathIfNecessary(this, obj);
  10999. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11000. this.m__items=[];
  11001. var _data=obj[OfficeExtension.Constants.items];
  11002. for (var i=0; i < _data.length; i++) {
  11003. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11004. _item._handleResult(_data[i]);
  11005. this.m__items.push(_item);
  11006. }
  11007. }
  11008. };
  11009. WorksheetCollection.prototype.load=function (option) {
  11010. _load(this, option);
  11011. return this;
  11012. };
  11013. WorksheetCollection.prototype.toJSON=function () {
  11014. return {};
  11015. };
  11016. return WorksheetCollection;
  11017. }(OfficeExtension.ClientObject));
  11018. Excel.WorksheetCollection=WorksheetCollection;
  11019. var WorksheetProtection=(function (_super) {
  11020. __extends(WorksheetProtection, _super);
  11021. function WorksheetProtection() {
  11022. _super.apply(this, arguments);
  11023. }
  11024. Object.defineProperty(WorksheetProtection.prototype, "options", {
  11025. get: function () {
  11026. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  11027. return this.m_options;
  11028. },
  11029. enumerable: true,
  11030. configurable: true
  11031. });
  11032. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  11033. get: function () {
  11034. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  11035. return this.m_protected;
  11036. },
  11037. enumerable: true,
  11038. configurable: true
  11039. });
  11040. WorksheetProtection.prototype.protect=function (options) {
  11041. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  11042. };
  11043. WorksheetProtection.prototype.unprotect=function () {
  11044. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  11045. };
  11046. WorksheetProtection.prototype._handleResult=function (value) {
  11047. _super.prototype._handleResult.call(this, value);
  11048. if (_isNullOrUndefined(value))
  11049. return;
  11050. var obj=value;
  11051. _fixObjectPathIfNecessary(this, obj);
  11052. if (!_isUndefined(obj["Options"])) {
  11053. this.m_options=obj["Options"];
  11054. }
  11055. if (!_isUndefined(obj["Protected"])) {
  11056. this.m_protected=obj["Protected"];
  11057. }
  11058. };
  11059. WorksheetProtection.prototype.load=function (option) {
  11060. _load(this, option);
  11061. return this;
  11062. };
  11063. WorksheetProtection.prototype.toJSON=function () {
  11064. return {
  11065. "options": this.m_options,
  11066. "protected": this.m_protected
  11067. };
  11068. };
  11069. return WorksheetProtection;
  11070. }(OfficeExtension.ClientObject));
  11071. Excel.WorksheetProtection=WorksheetProtection;
  11072. var Range=(function (_super) {
  11073. __extends(Range, _super);
  11074. function Range() {
  11075. _super.apply(this, arguments);
  11076. }
  11077. Range.prototype._ensureInteger=function (num, methodName) {
  11078. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  11079. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  11080. }
  11081. };
  11082. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  11083. if (count==null) {
  11084. count=1;
  11085. }
  11086. this._ensureInteger(count, functionName);
  11087. var startRange;
  11088. var rowOffset=0;
  11089. var columnOffset=0;
  11090. if (count > 0) {
  11091. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  11092. }
  11093. else {
  11094. startRange=referenceRange;
  11095. rowOffset=rowDirection;
  11096. columnOffset=columnDirection;
  11097. }
  11098. if (Math.abs(count)==1) {
  11099. return startRange;
  11100. }
  11101. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  11102. };
  11103. Object.defineProperty(Range.prototype, "format", {
  11104. get: function () {
  11105. if (!this.m_format) {
  11106. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  11107. }
  11108. return this.m_format;
  11109. },
  11110. enumerable: true,
  11111. configurable: true
  11112. });
  11113. Object.defineProperty(Range.prototype, "sort", {
  11114. get: function () {
  11115. if (!this.m_sort) {
  11116. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  11117. }
  11118. return this.m_sort;
  11119. },
  11120. enumerable: true,
  11121. configurable: true
  11122. });
  11123. Object.defineProperty(Range.prototype, "worksheet", {
  11124. get: function () {
  11125. if (!this.m_worksheet) {
  11126. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  11127. }
  11128. return this.m_worksheet;
  11129. },
  11130. enumerable: true,
  11131. configurable: true
  11132. });
  11133. Object.defineProperty(Range.prototype, "address", {
  11134. get: function () {
  11135. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  11136. return this.m_address;
  11137. },
  11138. enumerable: true,
  11139. configurable: true
  11140. });
  11141. Object.defineProperty(Range.prototype, "addressLocal", {
  11142. get: function () {
  11143. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  11144. return this.m_addressLocal;
  11145. },
  11146. enumerable: true,
  11147. configurable: true
  11148. });
  11149. Object.defineProperty(Range.prototype, "cellCount", {
  11150. get: function () {
  11151. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  11152. return this.m_cellCount;
  11153. },
  11154. enumerable: true,
  11155. configurable: true
  11156. });
  11157. Object.defineProperty(Range.prototype, "columnCount", {
  11158. get: function () {
  11159. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  11160. return this.m_columnCount;
  11161. },
  11162. enumerable: true,
  11163. configurable: true
  11164. });
  11165. Object.defineProperty(Range.prototype, "columnHidden", {
  11166. get: function () {
  11167. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  11168. return this.m_columnHidden;
  11169. },
  11170. set: function (value) {
  11171. this.m_columnHidden=value;
  11172. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  11173. },
  11174. enumerable: true,
  11175. configurable: true
  11176. });
  11177. Object.defineProperty(Range.prototype, "columnIndex", {
  11178. get: function () {
  11179. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  11180. return this.m_columnIndex;
  11181. },
  11182. enumerable: true,
  11183. configurable: true
  11184. });
  11185. Object.defineProperty(Range.prototype, "formulas", {
  11186. get: function () {
  11187. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  11188. return this.m_formulas;
  11189. },
  11190. set: function (value) {
  11191. this.m_formulas=value;
  11192. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  11193. return;
  11194. }
  11195. this.m_formulas=value;
  11196. _createSetPropertyAction(this.context, this, "Formulas", value);
  11197. },
  11198. enumerable: true,
  11199. configurable: true
  11200. });
  11201. Object.defineProperty(Range.prototype, "formulasLocal", {
  11202. get: function () {
  11203. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  11204. return this.m_formulasLocal;
  11205. },
  11206. set: function (value) {
  11207. this.m_formulasLocal=value;
  11208. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  11209. return;
  11210. }
  11211. this.m_formulasLocal=value;
  11212. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11213. },
  11214. enumerable: true,
  11215. configurable: true
  11216. });
  11217. Object.defineProperty(Range.prototype, "formulasR1C1", {
  11218. get: function () {
  11219. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  11220. return this.m_formulasR1C1;
  11221. },
  11222. set: function (value) {
  11223. this.m_formulasR1C1=value;
  11224. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  11225. return;
  11226. }
  11227. this.m_formulasR1C1=value;
  11228. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11229. },
  11230. enumerable: true,
  11231. configurable: true
  11232. });
  11233. Object.defineProperty(Range.prototype, "hidden", {
  11234. get: function () {
  11235. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  11236. return this.m_hidden;
  11237. },
  11238. enumerable: true,
  11239. configurable: true
  11240. });
  11241. Object.defineProperty(Range.prototype, "numberFormat", {
  11242. get: function () {
  11243. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  11244. return this.m_numberFormat;
  11245. },
  11246. set: function (value) {
  11247. this.m_numberFormat=value;
  11248. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  11249. return;
  11250. }
  11251. this.m_numberFormat=value;
  11252. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11253. },
  11254. enumerable: true,
  11255. configurable: true
  11256. });
  11257. Object.defineProperty(Range.prototype, "rowCount", {
  11258. get: function () {
  11259. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  11260. return this.m_rowCount;
  11261. },
  11262. enumerable: true,
  11263. configurable: true
  11264. });
  11265. Object.defineProperty(Range.prototype, "rowHidden", {
  11266. get: function () {
  11267. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  11268. return this.m_rowHidden;
  11269. },
  11270. set: function (value) {
  11271. this.m_rowHidden=value;
  11272. _createSetPropertyAction(this.context, this, "RowHidden", value);
  11273. },
  11274. enumerable: true,
  11275. configurable: true
  11276. });
  11277. Object.defineProperty(Range.prototype, "rowIndex", {
  11278. get: function () {
  11279. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  11280. return this.m_rowIndex;
  11281. },
  11282. enumerable: true,
  11283. configurable: true
  11284. });
  11285. Object.defineProperty(Range.prototype, "text", {
  11286. get: function () {
  11287. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  11288. return this.m_text;
  11289. },
  11290. enumerable: true,
  11291. configurable: true
  11292. });
  11293. Object.defineProperty(Range.prototype, "valueTypes", {
  11294. get: function () {
  11295. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  11296. return this.m_valueTypes;
  11297. },
  11298. enumerable: true,
  11299. configurable: true
  11300. });
  11301. Object.defineProperty(Range.prototype, "values", {
  11302. get: function () {
  11303. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  11304. return this.m_values;
  11305. },
  11306. set: function (value) {
  11307. this.m_values=value;
  11308. if (setRangePropertiesInBulk(this, "Values", value)) {
  11309. return;
  11310. }
  11311. this.m_values=value;
  11312. _createSetPropertyAction(this.context, this, "Values", value);
  11313. },
  11314. enumerable: true,
  11315. configurable: true
  11316. });
  11317. Object.defineProperty(Range.prototype, "_ReferenceId", {
  11318. get: function () {
  11319. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  11320. return this.m__ReferenceId;
  11321. },
  11322. enumerable: true,
  11323. configurable: true
  11324. });
  11325. Range.prototype.clear=function (applyTo) {
  11326. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  11327. };
  11328. Range.prototype.delete=function (shift) {
  11329. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  11330. };
  11331. Range.prototype.getBoundingRect=function (anotherRange) {
  11332. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11333. };
  11334. Range.prototype.getCell=function (row, column) {
  11335. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  11336. };
  11337. Range.prototype.getColumn=function (column) {
  11338. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  11339. };
  11340. Range.prototype.getColumnsAfter=function (count) {
  11341. if (!isExcel1_3OrAbove()) {
  11342. if (count==null) {
  11343. count=1;
  11344. }
  11345. this._ensureInteger(count, "RowsAbove");
  11346. if (count==0) {
  11347. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11348. }
  11349. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  11350. }
  11351. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  11352. };
  11353. Range.prototype.getColumnsBefore=function (count) {
  11354. if (!isExcel1_3OrAbove()) {
  11355. if (count==null) {
  11356. count=1;
  11357. }
  11358. this._ensureInteger(count, "RowsAbove");
  11359. if (count==0) {
  11360. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11361. }
  11362. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  11363. }
  11364. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  11365. };
  11366. Range.prototype.getEntireColumn=function () {
  11367. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11368. };
  11369. Range.prototype.getEntireRow=function () {
  11370. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11371. };
  11372. Range.prototype.getIntersection=function (anotherRange) {
  11373. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  11374. };
  11375. Range.prototype.getLastCell=function () {
  11376. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  11377. };
  11378. Range.prototype.getLastColumn=function () {
  11379. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  11380. };
  11381. Range.prototype.getLastRow=function () {
  11382. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  11383. };
  11384. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  11385. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  11386. };
  11387. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  11388. if (!isExcel1_3OrAbove()) {
  11389. this._ensureInteger(deltaRows, "getResizedRange");
  11390. this._ensureInteger(deltaColumns, "getResizedRange");
  11391. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  11392. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  11393. }
  11394. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  11395. };
  11396. Range.prototype.getRow=function (row) {
  11397. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  11398. };
  11399. Range.prototype.getRowsAbove=function (count) {
  11400. if (!isExcel1_3OrAbove()) {
  11401. if (count==null) {
  11402. count=1;
  11403. }
  11404. this._ensureInteger(count, "RowsAbove");
  11405. if (count==0) {
  11406. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11407. }
  11408. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  11409. }
  11410. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  11411. };
  11412. Range.prototype.getRowsBelow=function (count) {
  11413. if (!isExcel1_3OrAbove()) {
  11414. if (count==null) {
  11415. count=1;
  11416. }
  11417. this._ensureInteger(count, "RowsAbove");
  11418. if (count==0) {
  11419. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  11420. }
  11421. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  11422. }
  11423. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  11424. };
  11425. Range.prototype.getUsedRange=function (valuesOnly) {
  11426. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  11427. };
  11428. Range.prototype.getVisibleView=function () {
  11429. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  11430. };
  11431. Range.prototype.insert=function (shift) {
  11432. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  11433. };
  11434. Range.prototype.merge=function (across) {
  11435. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  11436. };
  11437. Range.prototype.select=function () {
  11438. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  11439. };
  11440. Range.prototype.unmerge=function () {
  11441. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  11442. };
  11443. Range.prototype._KeepReference=function () {
  11444. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  11445. };
  11446. Range.prototype._ValidateArraySize=function (rows, columns) {
  11447. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  11448. };
  11449. Range.prototype._handleResult=function (value) {
  11450. _super.prototype._handleResult.call(this, value);
  11451. if (_isNullOrUndefined(value))
  11452. return;
  11453. var obj=value;
  11454. _fixObjectPathIfNecessary(this, obj);
  11455. if (!_isUndefined(obj["Address"])) {
  11456. this.m_address=obj["Address"];
  11457. }
  11458. if (!_isUndefined(obj["AddressLocal"])) {
  11459. this.m_addressLocal=obj["AddressLocal"];
  11460. }
  11461. if (!_isUndefined(obj["CellCount"])) {
  11462. this.m_cellCount=obj["CellCount"];
  11463. }
  11464. if (!_isUndefined(obj["ColumnCount"])) {
  11465. this.m_columnCount=obj["ColumnCount"];
  11466. }
  11467. if (!_isUndefined(obj["ColumnHidden"])) {
  11468. this.m_columnHidden=obj["ColumnHidden"];
  11469. }
  11470. if (!_isUndefined(obj["ColumnIndex"])) {
  11471. this.m_columnIndex=obj["ColumnIndex"];
  11472. }
  11473. if (!_isUndefined(obj["Formulas"])) {
  11474. this.m_formulas=obj["Formulas"];
  11475. }
  11476. if (!_isUndefined(obj["FormulasLocal"])) {
  11477. this.m_formulasLocal=obj["FormulasLocal"];
  11478. }
  11479. if (!_isUndefined(obj["FormulasR1C1"])) {
  11480. this.m_formulasR1C1=obj["FormulasR1C1"];
  11481. }
  11482. if (!_isUndefined(obj["Hidden"])) {
  11483. this.m_hidden=obj["Hidden"];
  11484. }
  11485. if (!_isUndefined(obj["NumberFormat"])) {
  11486. this.m_numberFormat=obj["NumberFormat"];
  11487. }
  11488. if (!_isUndefined(obj["RowCount"])) {
  11489. this.m_rowCount=obj["RowCount"];
  11490. }
  11491. if (!_isUndefined(obj["RowHidden"])) {
  11492. this.m_rowHidden=obj["RowHidden"];
  11493. }
  11494. if (!_isUndefined(obj["RowIndex"])) {
  11495. this.m_rowIndex=obj["RowIndex"];
  11496. }
  11497. if (!_isUndefined(obj["Text"])) {
  11498. this.m_text=obj["Text"];
  11499. }
  11500. if (!_isUndefined(obj["ValueTypes"])) {
  11501. this.m_valueTypes=obj["ValueTypes"];
  11502. }
  11503. if (!_isUndefined(obj["Values"])) {
  11504. this.m_values=obj["Values"];
  11505. }
  11506. if (!_isUndefined(obj["_ReferenceId"])) {
  11507. this.m__ReferenceId=obj["_ReferenceId"];
  11508. }
  11509. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  11510. };
  11511. Range.prototype.load=function (option) {
  11512. _load(this, option);
  11513. return this;
  11514. };
  11515. Range.prototype._handleIdResult=function (value) {
  11516. _super.prototype._handleIdResult.call(this, value);
  11517. if (_isNullOrUndefined(value)) {
  11518. return;
  11519. }
  11520. if (!_isUndefined(value["_ReferenceId"])) {
  11521. this.m__ReferenceId=value["_ReferenceId"];
  11522. }
  11523. };
  11524. Range.prototype.track=function () {
  11525. this.context.trackedObjects.add(this);
  11526. return this;
  11527. };
  11528. Range.prototype.untrack=function () {
  11529. this.context.trackedObjects.remove(this);
  11530. return this;
  11531. };
  11532. Range.prototype.toJSON=function () {
  11533. return {
  11534. "address": this.m_address,
  11535. "addressLocal": this.m_addressLocal,
  11536. "cellCount": this.m_cellCount,
  11537. "columnCount": this.m_columnCount,
  11538. "columnHidden": this.m_columnHidden,
  11539. "columnIndex": this.m_columnIndex,
  11540. "format": this.m_format,
  11541. "formulas": this.m_formulas,
  11542. "formulasLocal": this.m_formulasLocal,
  11543. "formulasR1C1": this.m_formulasR1C1,
  11544. "hidden": this.m_hidden,
  11545. "numberFormat": this.m_numberFormat,
  11546. "rowCount": this.m_rowCount,
  11547. "rowHidden": this.m_rowHidden,
  11548. "rowIndex": this.m_rowIndex,
  11549. "text": this.m_text,
  11550. "values": this.m_values,
  11551. "valueTypes": this.m_valueTypes
  11552. };
  11553. };
  11554. return Range;
  11555. }(OfficeExtension.ClientObject));
  11556. Excel.Range=Range;
  11557. var RangeView=(function (_super) {
  11558. __extends(RangeView, _super);
  11559. function RangeView() {
  11560. _super.apply(this, arguments);
  11561. }
  11562. Object.defineProperty(RangeView.prototype, "rows", {
  11563. get: function () {
  11564. if (!this.m_rows) {
  11565. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  11566. }
  11567. return this.m_rows;
  11568. },
  11569. enumerable: true,
  11570. configurable: true
  11571. });
  11572. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  11573. get: function () {
  11574. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  11575. return this.m_cellAddresses;
  11576. },
  11577. enumerable: true,
  11578. configurable: true
  11579. });
  11580. Object.defineProperty(RangeView.prototype, "columnCount", {
  11581. get: function () {
  11582. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  11583. return this.m_columnCount;
  11584. },
  11585. enumerable: true,
  11586. configurable: true
  11587. });
  11588. Object.defineProperty(RangeView.prototype, "formulas", {
  11589. get: function () {
  11590. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  11591. return this.m_formulas;
  11592. },
  11593. set: function (value) {
  11594. this.m_formulas=value;
  11595. _createSetPropertyAction(this.context, this, "Formulas", value);
  11596. },
  11597. enumerable: true,
  11598. configurable: true
  11599. });
  11600. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  11601. get: function () {
  11602. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  11603. return this.m_formulasLocal;
  11604. },
  11605. set: function (value) {
  11606. this.m_formulasLocal=value;
  11607. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  11608. },
  11609. enumerable: true,
  11610. configurable: true
  11611. });
  11612. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  11613. get: function () {
  11614. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  11615. return this.m_formulasR1C1;
  11616. },
  11617. set: function (value) {
  11618. this.m_formulasR1C1=value;
  11619. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  11620. },
  11621. enumerable: true,
  11622. configurable: true
  11623. });
  11624. Object.defineProperty(RangeView.prototype, "index", {
  11625. get: function () {
  11626. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  11627. return this.m_index;
  11628. },
  11629. enumerable: true,
  11630. configurable: true
  11631. });
  11632. Object.defineProperty(RangeView.prototype, "numberFormat", {
  11633. get: function () {
  11634. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  11635. return this.m_numberFormat;
  11636. },
  11637. set: function (value) {
  11638. this.m_numberFormat=value;
  11639. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  11640. },
  11641. enumerable: true,
  11642. configurable: true
  11643. });
  11644. Object.defineProperty(RangeView.prototype, "rowCount", {
  11645. get: function () {
  11646. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  11647. return this.m_rowCount;
  11648. },
  11649. enumerable: true,
  11650. configurable: true
  11651. });
  11652. Object.defineProperty(RangeView.prototype, "text", {
  11653. get: function () {
  11654. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  11655. return this.m_text;
  11656. },
  11657. enumerable: true,
  11658. configurable: true
  11659. });
  11660. Object.defineProperty(RangeView.prototype, "valueTypes", {
  11661. get: function () {
  11662. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  11663. return this.m_valueTypes;
  11664. },
  11665. enumerable: true,
  11666. configurable: true
  11667. });
  11668. Object.defineProperty(RangeView.prototype, "values", {
  11669. get: function () {
  11670. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  11671. return this.m_values;
  11672. },
  11673. set: function (value) {
  11674. this.m_values=value;
  11675. _createSetPropertyAction(this.context, this, "Values", value);
  11676. },
  11677. enumerable: true,
  11678. configurable: true
  11679. });
  11680. RangeView.prototype.getRange=function () {
  11681. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11682. };
  11683. RangeView.prototype._handleResult=function (value) {
  11684. _super.prototype._handleResult.call(this, value);
  11685. if (_isNullOrUndefined(value))
  11686. return;
  11687. var obj=value;
  11688. _fixObjectPathIfNecessary(this, obj);
  11689. if (!_isUndefined(obj["CellAddresses"])) {
  11690. this.m_cellAddresses=obj["CellAddresses"];
  11691. }
  11692. if (!_isUndefined(obj["ColumnCount"])) {
  11693. this.m_columnCount=obj["ColumnCount"];
  11694. }
  11695. if (!_isUndefined(obj["Formulas"])) {
  11696. this.m_formulas=obj["Formulas"];
  11697. }
  11698. if (!_isUndefined(obj["FormulasLocal"])) {
  11699. this.m_formulasLocal=obj["FormulasLocal"];
  11700. }
  11701. if (!_isUndefined(obj["FormulasR1C1"])) {
  11702. this.m_formulasR1C1=obj["FormulasR1C1"];
  11703. }
  11704. if (!_isUndefined(obj["Index"])) {
  11705. this.m_index=obj["Index"];
  11706. }
  11707. if (!_isUndefined(obj["NumberFormat"])) {
  11708. this.m_numberFormat=obj["NumberFormat"];
  11709. }
  11710. if (!_isUndefined(obj["RowCount"])) {
  11711. this.m_rowCount=obj["RowCount"];
  11712. }
  11713. if (!_isUndefined(obj["Text"])) {
  11714. this.m_text=obj["Text"];
  11715. }
  11716. if (!_isUndefined(obj["ValueTypes"])) {
  11717. this.m_valueTypes=obj["ValueTypes"];
  11718. }
  11719. if (!_isUndefined(obj["Values"])) {
  11720. this.m_values=obj["Values"];
  11721. }
  11722. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  11723. };
  11724. RangeView.prototype.load=function (option) {
  11725. _load(this, option);
  11726. return this;
  11727. };
  11728. RangeView.prototype.toJSON=function () {
  11729. return {
  11730. "cellAddresses": this.m_cellAddresses,
  11731. "columnCount": this.m_columnCount,
  11732. "formulas": this.m_formulas,
  11733. "formulasLocal": this.m_formulasLocal,
  11734. "formulasR1C1": this.m_formulasR1C1,
  11735. "index": this.m_index,
  11736. "numberFormat": this.m_numberFormat,
  11737. "rowCount": this.m_rowCount,
  11738. "text": this.m_text,
  11739. "values": this.m_values,
  11740. "valueTypes": this.m_valueTypes
  11741. };
  11742. };
  11743. return RangeView;
  11744. }(OfficeExtension.ClientObject));
  11745. Excel.RangeView=RangeView;
  11746. var RangeViewCollection=(function (_super) {
  11747. __extends(RangeViewCollection, _super);
  11748. function RangeViewCollection() {
  11749. _super.apply(this, arguments);
  11750. }
  11751. Object.defineProperty(RangeViewCollection.prototype, "items", {
  11752. get: function () {
  11753. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  11754. return this.m__items;
  11755. },
  11756. enumerable: true,
  11757. configurable: true
  11758. });
  11759. RangeViewCollection.prototype.getItemAt=function (index) {
  11760. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  11761. };
  11762. RangeViewCollection.prototype._handleResult=function (value) {
  11763. _super.prototype._handleResult.call(this, value);
  11764. if (_isNullOrUndefined(value))
  11765. return;
  11766. var obj=value;
  11767. _fixObjectPathIfNecessary(this, obj);
  11768. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11769. this.m__items=[];
  11770. var _data=obj[OfficeExtension.Constants.items];
  11771. for (var i=0; i < _data.length; i++) {
  11772. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  11773. _item._handleResult(_data[i]);
  11774. this.m__items.push(_item);
  11775. }
  11776. }
  11777. };
  11778. RangeViewCollection.prototype.load=function (option) {
  11779. _load(this, option);
  11780. return this;
  11781. };
  11782. RangeViewCollection.prototype.toJSON=function () {
  11783. return {};
  11784. };
  11785. return RangeViewCollection;
  11786. }(OfficeExtension.ClientObject));
  11787. Excel.RangeViewCollection=RangeViewCollection;
  11788. var Setting=(function (_super) {
  11789. __extends(Setting, _super);
  11790. function Setting() {
  11791. _super.apply(this, arguments);
  11792. }
  11793. Object.defineProperty(Setting.prototype, "value", {
  11794. get: function () {
  11795. return JSON.parse(this._Value);
  11796. },
  11797. set: function (value) {
  11798. this._Value=JSON.stringify(value);
  11799. },
  11800. enumerable: true,
  11801. configurable: true
  11802. });
  11803. Object.defineProperty(Setting.prototype, "key", {
  11804. get: function () {
  11805. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  11806. return this.m_key;
  11807. },
  11808. enumerable: true,
  11809. configurable: true
  11810. });
  11811. Object.defineProperty(Setting.prototype, "_Value", {
  11812. get: function () {
  11813. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  11814. return this.m__Value;
  11815. },
  11816. set: function (value) {
  11817. this.m__Value=value;
  11818. _createSetPropertyAction(this.context, this, "_Value", value);
  11819. },
  11820. enumerable: true,
  11821. configurable: true
  11822. });
  11823. Setting.prototype.delete=function () {
  11824. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  11825. };
  11826. Setting.prototype._handleResult=function (value) {
  11827. _super.prototype._handleResult.call(this, value);
  11828. if (_isNullOrUndefined(value))
  11829. return;
  11830. var obj=value;
  11831. _fixObjectPathIfNecessary(this, obj);
  11832. if (!_isUndefined(obj["Key"])) {
  11833. this.m_key=obj["Key"];
  11834. }
  11835. if (!_isUndefined(obj["_Value"])) {
  11836. this.m__Value=obj["_Value"];
  11837. }
  11838. };
  11839. Setting.prototype.load=function (option) {
  11840. _load(this, option);
  11841. return this;
  11842. };
  11843. Setting.prototype.toJSON=function () {
  11844. return {
  11845. "key": this.m_key
  11846. };
  11847. };
  11848. return Setting;
  11849. }(OfficeExtension.ClientObject));
  11850. Excel.Setting=Setting;
  11851. var NamedItemCollection=(function (_super) {
  11852. __extends(NamedItemCollection, _super);
  11853. function NamedItemCollection() {
  11854. _super.apply(this, arguments);
  11855. }
  11856. Object.defineProperty(NamedItemCollection.prototype, "items", {
  11857. get: function () {
  11858. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  11859. return this.m__items;
  11860. },
  11861. enumerable: true,
  11862. configurable: true
  11863. });
  11864. NamedItemCollection.prototype.getItem=function (name) {
  11865. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  11866. };
  11867. NamedItemCollection.prototype._handleResult=function (value) {
  11868. _super.prototype._handleResult.call(this, value);
  11869. if (_isNullOrUndefined(value))
  11870. return;
  11871. var obj=value;
  11872. _fixObjectPathIfNecessary(this, obj);
  11873. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  11874. this.m__items=[];
  11875. var _data=obj[OfficeExtension.Constants.items];
  11876. for (var i=0; i < _data.length; i++) {
  11877. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  11878. _item._handleResult(_data[i]);
  11879. this.m__items.push(_item);
  11880. }
  11881. }
  11882. };
  11883. NamedItemCollection.prototype.load=function (option) {
  11884. _load(this, option);
  11885. return this;
  11886. };
  11887. NamedItemCollection.prototype.toJSON=function () {
  11888. return {};
  11889. };
  11890. return NamedItemCollection;
  11891. }(OfficeExtension.ClientObject));
  11892. Excel.NamedItemCollection=NamedItemCollection;
  11893. var NamedItem=(function (_super) {
  11894. __extends(NamedItem, _super);
  11895. function NamedItem() {
  11896. _super.apply(this, arguments);
  11897. }
  11898. Object.defineProperty(NamedItem.prototype, "name", {
  11899. get: function () {
  11900. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  11901. return this.m_name;
  11902. },
  11903. enumerable: true,
  11904. configurable: true
  11905. });
  11906. Object.defineProperty(NamedItem.prototype, "type", {
  11907. get: function () {
  11908. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  11909. return this.m_type;
  11910. },
  11911. enumerable: true,
  11912. configurable: true
  11913. });
  11914. Object.defineProperty(NamedItem.prototype, "value", {
  11915. get: function () {
  11916. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  11917. return this.m_value;
  11918. },
  11919. enumerable: true,
  11920. configurable: true
  11921. });
  11922. Object.defineProperty(NamedItem.prototype, "visible", {
  11923. get: function () {
  11924. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  11925. return this.m_visible;
  11926. },
  11927. set: function (value) {
  11928. this.m_visible=value;
  11929. _createSetPropertyAction(this.context, this, "Visible", value);
  11930. },
  11931. enumerable: true,
  11932. configurable: true
  11933. });
  11934. Object.defineProperty(NamedItem.prototype, "_Id", {
  11935. get: function () {
  11936. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  11937. return this.m__Id;
  11938. },
  11939. enumerable: true,
  11940. configurable: true
  11941. });
  11942. NamedItem.prototype.getRange=function () {
  11943. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  11944. };
  11945. NamedItem.prototype._handleResult=function (value) {
  11946. _super.prototype._handleResult.call(this, value);
  11947. if (_isNullOrUndefined(value))
  11948. return;
  11949. var obj=value;
  11950. _fixObjectPathIfNecessary(this, obj);
  11951. if (!_isUndefined(obj["Name"])) {
  11952. this.m_name=obj["Name"];
  11953. }
  11954. if (!_isUndefined(obj["Type"])) {
  11955. this.m_type=obj["Type"];
  11956. }
  11957. if (!_isUndefined(obj["Value"])) {
  11958. this.m_value=obj["Value"];
  11959. }
  11960. if (!_isUndefined(obj["Visible"])) {
  11961. this.m_visible=obj["Visible"];
  11962. }
  11963. if (!_isUndefined(obj["_Id"])) {
  11964. this.m__Id=obj["_Id"];
  11965. }
  11966. };
  11967. NamedItem.prototype.load=function (option) {
  11968. _load(this, option);
  11969. return this;
  11970. };
  11971. NamedItem.prototype._handleIdResult=function (value) {
  11972. _super.prototype._handleIdResult.call(this, value);
  11973. if (_isNullOrUndefined(value)) {
  11974. return;
  11975. }
  11976. if (!_isUndefined(value["_Id"])) {
  11977. this.m__Id=value["_Id"];
  11978. }
  11979. };
  11980. NamedItem.prototype.toJSON=function () {
  11981. return {
  11982. "name": this.m_name,
  11983. "type": this.m_type,
  11984. "value": this.m_value,
  11985. "visible": this.m_visible
  11986. };
  11987. };
  11988. return NamedItem;
  11989. }(OfficeExtension.ClientObject));
  11990. Excel.NamedItem=NamedItem;
  11991. var Binding=(function (_super) {
  11992. __extends(Binding, _super);
  11993. function Binding() {
  11994. _super.apply(this, arguments);
  11995. }
  11996. Object.defineProperty(Binding.prototype, "id", {
  11997. get: function () {
  11998. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  11999. return this.m_id;
  12000. },
  12001. enumerable: true,
  12002. configurable: true
  12003. });
  12004. Object.defineProperty(Binding.prototype, "type", {
  12005. get: function () {
  12006. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  12007. return this.m_type;
  12008. },
  12009. enumerable: true,
  12010. configurable: true
  12011. });
  12012. Binding.prototype.delete=function () {
  12013. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12014. };
  12015. Binding.prototype.getRange=function () {
  12016. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  12017. };
  12018. Binding.prototype.getTable=function () {
  12019. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  12020. };
  12021. Binding.prototype.getText=function () {
  12022. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  12023. var ret=new OfficeExtension.ClientResult();
  12024. _addActionResultHandler(this, action, ret);
  12025. return ret;
  12026. };
  12027. Binding.prototype._handleResult=function (value) {
  12028. _super.prototype._handleResult.call(this, value);
  12029. if (_isNullOrUndefined(value))
  12030. return;
  12031. var obj=value;
  12032. _fixObjectPathIfNecessary(this, obj);
  12033. if (!_isUndefined(obj["Id"])) {
  12034. this.m_id=obj["Id"];
  12035. }
  12036. if (!_isUndefined(obj["Type"])) {
  12037. this.m_type=obj["Type"];
  12038. }
  12039. };
  12040. Binding.prototype.load=function (option) {
  12041. _load(this, option);
  12042. return this;
  12043. };
  12044. Binding.prototype._handleIdResult=function (value) {
  12045. _super.prototype._handleIdResult.call(this, value);
  12046. if (_isNullOrUndefined(value)) {
  12047. return;
  12048. }
  12049. if (!_isUndefined(value["Id"])) {
  12050. this.m_id=value["Id"];
  12051. }
  12052. };
  12053. Object.defineProperty(Binding.prototype, "onDataChanged", {
  12054. get: function () {
  12055. var _this=this;
  12056. if (!this.m_dataChanged) {
  12057. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  12058. registerFunc: function (handlerCallback) {
  12059. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12060. .then(function (officeBinding) {
  12061. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  12062. });
  12063. },
  12064. unregisterFunc: function (handlerCallback) {
  12065. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12066. .then(function (officeBinding) {
  12067. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  12068. });
  12069. },
  12070. eventArgsTransformFunc: function (args) {
  12071. var evt={
  12072. binding: _this
  12073. };
  12074. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12075. }
  12076. });
  12077. }
  12078. return this.m_dataChanged;
  12079. },
  12080. enumerable: true,
  12081. configurable: true
  12082. });
  12083. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  12084. get: function () {
  12085. var _this=this;
  12086. if (!this.m_selectionChanged) {
  12087. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  12088. registerFunc: function (handlerCallback) {
  12089. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12090. .then(function (officeBinding) {
  12091. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  12092. });
  12093. },
  12094. unregisterFunc: function (handlerCallback) {
  12095. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  12096. .then(function (officeBinding) {
  12097. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  12098. });
  12099. },
  12100. eventArgsTransformFunc: function (args) {
  12101. var evt={
  12102. binding: _this,
  12103. columnCount: args.columnCount,
  12104. rowCount: args.rowCount,
  12105. startColumn: args.startColumn,
  12106. startRow: args.startRow
  12107. };
  12108. return OfficeExtension.Utility._createPromiseFromResult(evt);
  12109. }
  12110. });
  12111. }
  12112. return this.m_selectionChanged;
  12113. },
  12114. enumerable: true,
  12115. configurable: true
  12116. });
  12117. Binding.prototype.toJSON=function () {
  12118. return {
  12119. "id": this.m_id,
  12120. "type": this.m_type
  12121. };
  12122. };
  12123. return Binding;
  12124. }(OfficeExtension.ClientObject));
  12125. Excel.Binding=Binding;
  12126. var BindingCollection=(function (_super) {
  12127. __extends(BindingCollection, _super);
  12128. function BindingCollection() {
  12129. _super.apply(this, arguments);
  12130. }
  12131. Object.defineProperty(BindingCollection.prototype, "items", {
  12132. get: function () {
  12133. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  12134. return this.m__items;
  12135. },
  12136. enumerable: true,
  12137. configurable: true
  12138. });
  12139. Object.defineProperty(BindingCollection.prototype, "count", {
  12140. get: function () {
  12141. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  12142. return this.m_count;
  12143. },
  12144. enumerable: true,
  12145. configurable: true
  12146. });
  12147. BindingCollection.prototype.add=function (range, bindingType, id) {
  12148. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  12149. };
  12150. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  12151. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  12152. };
  12153. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  12154. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  12155. };
  12156. BindingCollection.prototype.getItem=function (id) {
  12157. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  12158. };
  12159. BindingCollection.prototype.getItemAt=function (index) {
  12160. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12161. };
  12162. BindingCollection.prototype._handleResult=function (value) {
  12163. _super.prototype._handleResult.call(this, value);
  12164. if (_isNullOrUndefined(value))
  12165. return;
  12166. var obj=value;
  12167. _fixObjectPathIfNecessary(this, obj);
  12168. if (!_isUndefined(obj["Count"])) {
  12169. this.m_count=obj["Count"];
  12170. }
  12171. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12172. this.m__items=[];
  12173. var _data=obj[OfficeExtension.Constants.items];
  12174. for (var i=0; i < _data.length; i++) {
  12175. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12176. _item._handleResult(_data[i]);
  12177. this.m__items.push(_item);
  12178. }
  12179. }
  12180. };
  12181. BindingCollection.prototype.load=function (option) {
  12182. _load(this, option);
  12183. return this;
  12184. };
  12185. BindingCollection.prototype.toJSON=function () {
  12186. return {
  12187. "count": this.m_count
  12188. };
  12189. };
  12190. return BindingCollection;
  12191. }(OfficeExtension.ClientObject));
  12192. Excel.BindingCollection=BindingCollection;
  12193. var TableCollection=(function (_super) {
  12194. __extends(TableCollection, _super);
  12195. function TableCollection() {
  12196. _super.apply(this, arguments);
  12197. }
  12198. Object.defineProperty(TableCollection.prototype, "items", {
  12199. get: function () {
  12200. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  12201. return this.m__items;
  12202. },
  12203. enumerable: true,
  12204. configurable: true
  12205. });
  12206. Object.defineProperty(TableCollection.prototype, "count", {
  12207. get: function () {
  12208. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  12209. return this.m_count;
  12210. },
  12211. enumerable: true,
  12212. configurable: true
  12213. });
  12214. TableCollection.prototype.add=function (address, hasHeaders) {
  12215. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  12216. };
  12217. TableCollection.prototype.getItem=function (key) {
  12218. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12219. };
  12220. TableCollection.prototype.getItemAt=function (index) {
  12221. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12222. };
  12223. TableCollection.prototype._handleResult=function (value) {
  12224. _super.prototype._handleResult.call(this, value);
  12225. if (_isNullOrUndefined(value))
  12226. return;
  12227. var obj=value;
  12228. _fixObjectPathIfNecessary(this, obj);
  12229. if (!_isUndefined(obj["Count"])) {
  12230. this.m_count=obj["Count"];
  12231. }
  12232. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12233. this.m__items=[];
  12234. var _data=obj[OfficeExtension.Constants.items];
  12235. for (var i=0; i < _data.length; i++) {
  12236. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12237. _item._handleResult(_data[i]);
  12238. this.m__items.push(_item);
  12239. }
  12240. }
  12241. };
  12242. TableCollection.prototype.load=function (option) {
  12243. _load(this, option);
  12244. return this;
  12245. };
  12246. TableCollection.prototype.toJSON=function () {
  12247. return {
  12248. "count": this.m_count
  12249. };
  12250. };
  12251. return TableCollection;
  12252. }(OfficeExtension.ClientObject));
  12253. Excel.TableCollection=TableCollection;
  12254. var Table=(function (_super) {
  12255. __extends(Table, _super);
  12256. function Table() {
  12257. _super.apply(this, arguments);
  12258. }
  12259. Object.defineProperty(Table.prototype, "columns", {
  12260. get: function () {
  12261. if (!this.m_columns) {
  12262. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  12263. }
  12264. return this.m_columns;
  12265. },
  12266. enumerable: true,
  12267. configurable: true
  12268. });
  12269. Object.defineProperty(Table.prototype, "rows", {
  12270. get: function () {
  12271. if (!this.m_rows) {
  12272. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  12273. }
  12274. return this.m_rows;
  12275. },
  12276. enumerable: true,
  12277. configurable: true
  12278. });
  12279. Object.defineProperty(Table.prototype, "sort", {
  12280. get: function () {
  12281. if (!this.m_sort) {
  12282. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12283. }
  12284. return this.m_sort;
  12285. },
  12286. enumerable: true,
  12287. configurable: true
  12288. });
  12289. Object.defineProperty(Table.prototype, "worksheet", {
  12290. get: function () {
  12291. if (!this.m_worksheet) {
  12292. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12293. }
  12294. return this.m_worksheet;
  12295. },
  12296. enumerable: true,
  12297. configurable: true
  12298. });
  12299. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  12300. get: function () {
  12301. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  12302. return this.m_highlightFirstColumn;
  12303. },
  12304. set: function (value) {
  12305. this.m_highlightFirstColumn=value;
  12306. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  12307. },
  12308. enumerable: true,
  12309. configurable: true
  12310. });
  12311. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  12312. get: function () {
  12313. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  12314. return this.m_highlightLastColumn;
  12315. },
  12316. set: function (value) {
  12317. this.m_highlightLastColumn=value;
  12318. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  12319. },
  12320. enumerable: true,
  12321. configurable: true
  12322. });
  12323. Object.defineProperty(Table.prototype, "id", {
  12324. get: function () {
  12325. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  12326. return this.m_id;
  12327. },
  12328. enumerable: true,
  12329. configurable: true
  12330. });
  12331. Object.defineProperty(Table.prototype, "name", {
  12332. get: function () {
  12333. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  12334. return this.m_name;
  12335. },
  12336. set: function (value) {
  12337. this.m_name=value;
  12338. _createSetPropertyAction(this.context, this, "Name", value);
  12339. },
  12340. enumerable: true,
  12341. configurable: true
  12342. });
  12343. Object.defineProperty(Table.prototype, "showBandedColumns", {
  12344. get: function () {
  12345. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  12346. return this.m_showBandedColumns;
  12347. },
  12348. set: function (value) {
  12349. this.m_showBandedColumns=value;
  12350. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  12351. },
  12352. enumerable: true,
  12353. configurable: true
  12354. });
  12355. Object.defineProperty(Table.prototype, "showBandedRows", {
  12356. get: function () {
  12357. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  12358. return this.m_showBandedRows;
  12359. },
  12360. set: function (value) {
  12361. this.m_showBandedRows=value;
  12362. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  12363. },
  12364. enumerable: true,
  12365. configurable: true
  12366. });
  12367. Object.defineProperty(Table.prototype, "showFilterButton", {
  12368. get: function () {
  12369. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  12370. return this.m_showFilterButton;
  12371. },
  12372. set: function (value) {
  12373. this.m_showFilterButton=value;
  12374. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  12375. },
  12376. enumerable: true,
  12377. configurable: true
  12378. });
  12379. Object.defineProperty(Table.prototype, "showHeaders", {
  12380. get: function () {
  12381. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  12382. return this.m_showHeaders;
  12383. },
  12384. set: function (value) {
  12385. this.m_showHeaders=value;
  12386. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  12387. },
  12388. enumerable: true,
  12389. configurable: true
  12390. });
  12391. Object.defineProperty(Table.prototype, "showTotals", {
  12392. get: function () {
  12393. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  12394. return this.m_showTotals;
  12395. },
  12396. set: function (value) {
  12397. this.m_showTotals=value;
  12398. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  12399. },
  12400. enumerable: true,
  12401. configurable: true
  12402. });
  12403. Object.defineProperty(Table.prototype, "style", {
  12404. get: function () {
  12405. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  12406. return this.m_style;
  12407. },
  12408. set: function (value) {
  12409. this.m_style=value;
  12410. _createSetPropertyAction(this.context, this, "Style", value);
  12411. },
  12412. enumerable: true,
  12413. configurable: true
  12414. });
  12415. Table.prototype.clearFilters=function () {
  12416. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  12417. };
  12418. Table.prototype.convertToRange=function () {
  12419. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  12420. };
  12421. Table.prototype.delete=function () {
  12422. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12423. };
  12424. Table.prototype.getDataBodyRange=function () {
  12425. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12426. };
  12427. Table.prototype.getHeaderRowRange=function () {
  12428. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12429. };
  12430. Table.prototype.getRange=function () {
  12431. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12432. };
  12433. Table.prototype.getTotalRowRange=function () {
  12434. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12435. };
  12436. Table.prototype.reapplyFilters=function () {
  12437. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  12438. };
  12439. Table.prototype._handleResult=function (value) {
  12440. _super.prototype._handleResult.call(this, value);
  12441. if (_isNullOrUndefined(value))
  12442. return;
  12443. var obj=value;
  12444. _fixObjectPathIfNecessary(this, obj);
  12445. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  12446. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  12447. }
  12448. if (!_isUndefined(obj["HighlightLastColumn"])) {
  12449. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  12450. }
  12451. if (!_isUndefined(obj["Id"])) {
  12452. this.m_id=obj["Id"];
  12453. }
  12454. if (!_isUndefined(obj["Name"])) {
  12455. this.m_name=obj["Name"];
  12456. }
  12457. if (!_isUndefined(obj["ShowBandedColumns"])) {
  12458. this.m_showBandedColumns=obj["ShowBandedColumns"];
  12459. }
  12460. if (!_isUndefined(obj["ShowBandedRows"])) {
  12461. this.m_showBandedRows=obj["ShowBandedRows"];
  12462. }
  12463. if (!_isUndefined(obj["ShowFilterButton"])) {
  12464. this.m_showFilterButton=obj["ShowFilterButton"];
  12465. }
  12466. if (!_isUndefined(obj["ShowHeaders"])) {
  12467. this.m_showHeaders=obj["ShowHeaders"];
  12468. }
  12469. if (!_isUndefined(obj["ShowTotals"])) {
  12470. this.m_showTotals=obj["ShowTotals"];
  12471. }
  12472. if (!_isUndefined(obj["Style"])) {
  12473. this.m_style=obj["Style"];
  12474. }
  12475. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  12476. };
  12477. Table.prototype.load=function (option) {
  12478. _load(this, option);
  12479. return this;
  12480. };
  12481. Table.prototype._handleIdResult=function (value) {
  12482. _super.prototype._handleIdResult.call(this, value);
  12483. if (_isNullOrUndefined(value)) {
  12484. return;
  12485. }
  12486. if (!_isUndefined(value["Id"])) {
  12487. this.m_id=value["Id"];
  12488. }
  12489. };
  12490. Table.prototype.toJSON=function () {
  12491. return {
  12492. "highlightFirstColumn": this.m_highlightFirstColumn,
  12493. "highlightLastColumn": this.m_highlightLastColumn,
  12494. "id": this.m_id,
  12495. "name": this.m_name,
  12496. "showBandedColumns": this.m_showBandedColumns,
  12497. "showBandedRows": this.m_showBandedRows,
  12498. "showFilterButton": this.m_showFilterButton,
  12499. "showHeaders": this.m_showHeaders,
  12500. "showTotals": this.m_showTotals,
  12501. "style": this.m_style
  12502. };
  12503. };
  12504. return Table;
  12505. }(OfficeExtension.ClientObject));
  12506. Excel.Table=Table;
  12507. var TableColumnCollection=(function (_super) {
  12508. __extends(TableColumnCollection, _super);
  12509. function TableColumnCollection() {
  12510. _super.apply(this, arguments);
  12511. }
  12512. Object.defineProperty(TableColumnCollection.prototype, "items", {
  12513. get: function () {
  12514. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  12515. return this.m__items;
  12516. },
  12517. enumerable: true,
  12518. configurable: true
  12519. });
  12520. Object.defineProperty(TableColumnCollection.prototype, "count", {
  12521. get: function () {
  12522. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  12523. return this.m_count;
  12524. },
  12525. enumerable: true,
  12526. configurable: true
  12527. });
  12528. TableColumnCollection.prototype.add=function (index, values) {
  12529. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12530. };
  12531. TableColumnCollection.prototype.getItem=function (key) {
  12532. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12533. };
  12534. TableColumnCollection.prototype.getItemAt=function (index) {
  12535. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12536. };
  12537. TableColumnCollection.prototype._handleResult=function (value) {
  12538. _super.prototype._handleResult.call(this, value);
  12539. if (_isNullOrUndefined(value))
  12540. return;
  12541. var obj=value;
  12542. _fixObjectPathIfNecessary(this, obj);
  12543. if (!_isUndefined(obj["Count"])) {
  12544. this.m_count=obj["Count"];
  12545. }
  12546. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12547. this.m__items=[];
  12548. var _data=obj[OfficeExtension.Constants.items];
  12549. for (var i=0; i < _data.length; i++) {
  12550. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12551. _item._handleResult(_data[i]);
  12552. this.m__items.push(_item);
  12553. }
  12554. }
  12555. };
  12556. TableColumnCollection.prototype.load=function (option) {
  12557. _load(this, option);
  12558. return this;
  12559. };
  12560. TableColumnCollection.prototype.toJSON=function () {
  12561. return {
  12562. "count": this.m_count
  12563. };
  12564. };
  12565. return TableColumnCollection;
  12566. }(OfficeExtension.ClientObject));
  12567. Excel.TableColumnCollection=TableColumnCollection;
  12568. var TableColumn=(function (_super) {
  12569. __extends(TableColumn, _super);
  12570. function TableColumn() {
  12571. _super.apply(this, arguments);
  12572. }
  12573. Object.defineProperty(TableColumn.prototype, "filter", {
  12574. get: function () {
  12575. if (!this.m_filter) {
  12576. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  12577. }
  12578. return this.m_filter;
  12579. },
  12580. enumerable: true,
  12581. configurable: true
  12582. });
  12583. Object.defineProperty(TableColumn.prototype, "id", {
  12584. get: function () {
  12585. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  12586. return this.m_id;
  12587. },
  12588. enumerable: true,
  12589. configurable: true
  12590. });
  12591. Object.defineProperty(TableColumn.prototype, "index", {
  12592. get: function () {
  12593. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  12594. return this.m_index;
  12595. },
  12596. enumerable: true,
  12597. configurable: true
  12598. });
  12599. Object.defineProperty(TableColumn.prototype, "name", {
  12600. get: function () {
  12601. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  12602. return this.m_name;
  12603. },
  12604. enumerable: true,
  12605. configurable: true
  12606. });
  12607. Object.defineProperty(TableColumn.prototype, "values", {
  12608. get: function () {
  12609. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  12610. return this.m_values;
  12611. },
  12612. set: function (value) {
  12613. this.m_values=value;
  12614. _createSetPropertyAction(this.context, this, "Values", value);
  12615. },
  12616. enumerable: true,
  12617. configurable: true
  12618. });
  12619. TableColumn.prototype.delete=function () {
  12620. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12621. };
  12622. TableColumn.prototype.getDataBodyRange=function () {
  12623. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12624. };
  12625. TableColumn.prototype.getHeaderRowRange=function () {
  12626. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12627. };
  12628. TableColumn.prototype.getRange=function () {
  12629. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12630. };
  12631. TableColumn.prototype.getTotalRowRange=function () {
  12632. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12633. };
  12634. TableColumn.prototype._handleResult=function (value) {
  12635. _super.prototype._handleResult.call(this, value);
  12636. if (_isNullOrUndefined(value))
  12637. return;
  12638. var obj=value;
  12639. _fixObjectPathIfNecessary(this, obj);
  12640. if (!_isUndefined(obj["Id"])) {
  12641. this.m_id=obj["Id"];
  12642. }
  12643. if (!_isUndefined(obj["Index"])) {
  12644. this.m_index=obj["Index"];
  12645. }
  12646. if (!_isUndefined(obj["Name"])) {
  12647. this.m_name=obj["Name"];
  12648. }
  12649. if (!_isUndefined(obj["Values"])) {
  12650. this.m_values=obj["Values"];
  12651. }
  12652. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  12653. };
  12654. TableColumn.prototype.load=function (option) {
  12655. _load(this, option);
  12656. return this;
  12657. };
  12658. TableColumn.prototype._handleIdResult=function (value) {
  12659. _super.prototype._handleIdResult.call(this, value);
  12660. if (_isNullOrUndefined(value)) {
  12661. return;
  12662. }
  12663. if (!_isUndefined(value["Id"])) {
  12664. this.m_id=value["Id"];
  12665. }
  12666. };
  12667. TableColumn.prototype.toJSON=function () {
  12668. return {
  12669. "id": this.m_id,
  12670. "index": this.m_index,
  12671. "name": this.m_name,
  12672. "values": this.m_values
  12673. };
  12674. };
  12675. return TableColumn;
  12676. }(OfficeExtension.ClientObject));
  12677. Excel.TableColumn=TableColumn;
  12678. var TableRowCollection=(function (_super) {
  12679. __extends(TableRowCollection, _super);
  12680. function TableRowCollection() {
  12681. _super.apply(this, arguments);
  12682. }
  12683. Object.defineProperty(TableRowCollection.prototype, "items", {
  12684. get: function () {
  12685. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  12686. return this.m__items;
  12687. },
  12688. enumerable: true,
  12689. configurable: true
  12690. });
  12691. Object.defineProperty(TableRowCollection.prototype, "count", {
  12692. get: function () {
  12693. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  12694. return this.m_count;
  12695. },
  12696. enumerable: true,
  12697. configurable: true
  12698. });
  12699. TableRowCollection.prototype.add=function (index, values) {
  12700. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  12701. };
  12702. TableRowCollection.prototype.getItemAt=function (index) {
  12703. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  12704. };
  12705. TableRowCollection.prototype._handleResult=function (value) {
  12706. _super.prototype._handleResult.call(this, value);
  12707. if (_isNullOrUndefined(value))
  12708. return;
  12709. var obj=value;
  12710. _fixObjectPathIfNecessary(this, obj);
  12711. if (!_isUndefined(obj["Count"])) {
  12712. this.m_count=obj["Count"];
  12713. }
  12714. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12715. this.m__items=[];
  12716. var _data=obj[OfficeExtension.Constants.items];
  12717. for (var i=0; i < _data.length; i++) {
  12718. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  12719. _item._handleResult(_data[i]);
  12720. this.m__items.push(_item);
  12721. }
  12722. }
  12723. };
  12724. TableRowCollection.prototype.load=function (option) {
  12725. _load(this, option);
  12726. return this;
  12727. };
  12728. TableRowCollection.prototype.toJSON=function () {
  12729. return {
  12730. "count": this.m_count
  12731. };
  12732. };
  12733. return TableRowCollection;
  12734. }(OfficeExtension.ClientObject));
  12735. Excel.TableRowCollection=TableRowCollection;
  12736. var TableRow=(function (_super) {
  12737. __extends(TableRow, _super);
  12738. function TableRow() {
  12739. _super.apply(this, arguments);
  12740. }
  12741. Object.defineProperty(TableRow.prototype, "index", {
  12742. get: function () {
  12743. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  12744. return this.m_index;
  12745. },
  12746. enumerable: true,
  12747. configurable: true
  12748. });
  12749. Object.defineProperty(TableRow.prototype, "values", {
  12750. get: function () {
  12751. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  12752. return this.m_values;
  12753. },
  12754. set: function (value) {
  12755. this.m_values=value;
  12756. _createSetPropertyAction(this.context, this, "Values", value);
  12757. },
  12758. enumerable: true,
  12759. configurable: true
  12760. });
  12761. TableRow.prototype.delete=function () {
  12762. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12763. };
  12764. TableRow.prototype.getRange=function () {
  12765. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12766. };
  12767. TableRow.prototype._handleResult=function (value) {
  12768. _super.prototype._handleResult.call(this, value);
  12769. if (_isNullOrUndefined(value))
  12770. return;
  12771. var obj=value;
  12772. _fixObjectPathIfNecessary(this, obj);
  12773. if (!_isUndefined(obj["Index"])) {
  12774. this.m_index=obj["Index"];
  12775. }
  12776. if (!_isUndefined(obj["Values"])) {
  12777. this.m_values=obj["Values"];
  12778. }
  12779. };
  12780. TableRow.prototype.load=function (option) {
  12781. _load(this, option);
  12782. return this;
  12783. };
  12784. TableRow.prototype.toJSON=function () {
  12785. return {
  12786. "index": this.m_index,
  12787. "values": this.m_values
  12788. };
  12789. };
  12790. return TableRow;
  12791. }(OfficeExtension.ClientObject));
  12792. Excel.TableRow=TableRow;
  12793. var RangeFormat=(function (_super) {
  12794. __extends(RangeFormat, _super);
  12795. function RangeFormat() {
  12796. _super.apply(this, arguments);
  12797. }
  12798. Object.defineProperty(RangeFormat.prototype, "borders", {
  12799. get: function () {
  12800. if (!this.m_borders) {
  12801. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  12802. }
  12803. return this.m_borders;
  12804. },
  12805. enumerable: true,
  12806. configurable: true
  12807. });
  12808. Object.defineProperty(RangeFormat.prototype, "fill", {
  12809. get: function () {
  12810. if (!this.m_fill) {
  12811. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  12812. }
  12813. return this.m_fill;
  12814. },
  12815. enumerable: true,
  12816. configurable: true
  12817. });
  12818. Object.defineProperty(RangeFormat.prototype, "font", {
  12819. get: function () {
  12820. if (!this.m_font) {
  12821. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  12822. }
  12823. return this.m_font;
  12824. },
  12825. enumerable: true,
  12826. configurable: true
  12827. });
  12828. Object.defineProperty(RangeFormat.prototype, "protection", {
  12829. get: function () {
  12830. if (!this.m_protection) {
  12831. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12832. }
  12833. return this.m_protection;
  12834. },
  12835. enumerable: true,
  12836. configurable: true
  12837. });
  12838. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  12839. get: function () {
  12840. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  12841. return this.m_columnWidth;
  12842. },
  12843. set: function (value) {
  12844. this.m_columnWidth=value;
  12845. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  12846. },
  12847. enumerable: true,
  12848. configurable: true
  12849. });
  12850. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  12851. get: function () {
  12852. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  12853. return this.m_horizontalAlignment;
  12854. },
  12855. set: function (value) {
  12856. this.m_horizontalAlignment=value;
  12857. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  12858. },
  12859. enumerable: true,
  12860. configurable: true
  12861. });
  12862. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  12863. get: function () {
  12864. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  12865. return this.m_rowHeight;
  12866. },
  12867. set: function (value) {
  12868. this.m_rowHeight=value;
  12869. _createSetPropertyAction(this.context, this, "RowHeight", value);
  12870. },
  12871. enumerable: true,
  12872. configurable: true
  12873. });
  12874. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  12875. get: function () {
  12876. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  12877. return this.m_verticalAlignment;
  12878. },
  12879. set: function (value) {
  12880. this.m_verticalAlignment=value;
  12881. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  12882. },
  12883. enumerable: true,
  12884. configurable: true
  12885. });
  12886. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  12887. get: function () {
  12888. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  12889. return this.m_wrapText;
  12890. },
  12891. set: function (value) {
  12892. this.m_wrapText=value;
  12893. _createSetPropertyAction(this.context, this, "WrapText", value);
  12894. },
  12895. enumerable: true,
  12896. configurable: true
  12897. });
  12898. RangeFormat.prototype.autofitColumns=function () {
  12899. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  12900. };
  12901. RangeFormat.prototype.autofitRows=function () {
  12902. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  12903. };
  12904. RangeFormat.prototype._handleResult=function (value) {
  12905. _super.prototype._handleResult.call(this, value);
  12906. if (_isNullOrUndefined(value))
  12907. return;
  12908. var obj=value;
  12909. _fixObjectPathIfNecessary(this, obj);
  12910. if (!_isUndefined(obj["ColumnWidth"])) {
  12911. this.m_columnWidth=obj["ColumnWidth"];
  12912. }
  12913. if (!_isUndefined(obj["HorizontalAlignment"])) {
  12914. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  12915. }
  12916. if (!_isUndefined(obj["RowHeight"])) {
  12917. this.m_rowHeight=obj["RowHeight"];
  12918. }
  12919. if (!_isUndefined(obj["VerticalAlignment"])) {
  12920. this.m_verticalAlignment=obj["VerticalAlignment"];
  12921. }
  12922. if (!_isUndefined(obj["WrapText"])) {
  12923. this.m_wrapText=obj["WrapText"];
  12924. }
  12925. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  12926. };
  12927. RangeFormat.prototype.load=function (option) {
  12928. _load(this, option);
  12929. return this;
  12930. };
  12931. RangeFormat.prototype.toJSON=function () {
  12932. return {
  12933. "columnWidth": this.m_columnWidth,
  12934. "fill": this.m_fill,
  12935. "font": this.m_font,
  12936. "horizontalAlignment": this.m_horizontalAlignment,
  12937. "protection": this.m_protection,
  12938. "rowHeight": this.m_rowHeight,
  12939. "verticalAlignment": this.m_verticalAlignment,
  12940. "wrapText": this.m_wrapText
  12941. };
  12942. };
  12943. return RangeFormat;
  12944. }(OfficeExtension.ClientObject));
  12945. Excel.RangeFormat=RangeFormat;
  12946. var FormatProtection=(function (_super) {
  12947. __extends(FormatProtection, _super);
  12948. function FormatProtection() {
  12949. _super.apply(this, arguments);
  12950. }
  12951. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  12952. get: function () {
  12953. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  12954. return this.m_formulaHidden;
  12955. },
  12956. set: function (value) {
  12957. this.m_formulaHidden=value;
  12958. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  12959. },
  12960. enumerable: true,
  12961. configurable: true
  12962. });
  12963. Object.defineProperty(FormatProtection.prototype, "locked", {
  12964. get: function () {
  12965. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  12966. return this.m_locked;
  12967. },
  12968. set: function (value) {
  12969. this.m_locked=value;
  12970. _createSetPropertyAction(this.context, this, "Locked", value);
  12971. },
  12972. enumerable: true,
  12973. configurable: true
  12974. });
  12975. FormatProtection.prototype._handleResult=function (value) {
  12976. _super.prototype._handleResult.call(this, value);
  12977. if (_isNullOrUndefined(value))
  12978. return;
  12979. var obj=value;
  12980. _fixObjectPathIfNecessary(this, obj);
  12981. if (!_isUndefined(obj["FormulaHidden"])) {
  12982. this.m_formulaHidden=obj["FormulaHidden"];
  12983. }
  12984. if (!_isUndefined(obj["Locked"])) {
  12985. this.m_locked=obj["Locked"];
  12986. }
  12987. };
  12988. FormatProtection.prototype.load=function (option) {
  12989. _load(this, option);
  12990. return this;
  12991. };
  12992. FormatProtection.prototype.toJSON=function () {
  12993. return {
  12994. "formulaHidden": this.m_formulaHidden,
  12995. "locked": this.m_locked
  12996. };
  12997. };
  12998. return FormatProtection;
  12999. }(OfficeExtension.ClientObject));
  13000. Excel.FormatProtection=FormatProtection;
  13001. var RangeFill=(function (_super) {
  13002. __extends(RangeFill, _super);
  13003. function RangeFill() {
  13004. _super.apply(this, arguments);
  13005. }
  13006. Object.defineProperty(RangeFill.prototype, "color", {
  13007. get: function () {
  13008. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  13009. return this.m_color;
  13010. },
  13011. set: function (value) {
  13012. this.m_color=value;
  13013. _createSetPropertyAction(this.context, this, "Color", value);
  13014. },
  13015. enumerable: true,
  13016. configurable: true
  13017. });
  13018. RangeFill.prototype.clear=function () {
  13019. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  13020. };
  13021. RangeFill.prototype._handleResult=function (value) {
  13022. _super.prototype._handleResult.call(this, value);
  13023. if (_isNullOrUndefined(value))
  13024. return;
  13025. var obj=value;
  13026. _fixObjectPathIfNecessary(this, obj);
  13027. if (!_isUndefined(obj["Color"])) {
  13028. this.m_color=obj["Color"];
  13029. }
  13030. };
  13031. RangeFill.prototype.load=function (option) {
  13032. _load(this, option);
  13033. return this;
  13034. };
  13035. RangeFill.prototype.toJSON=function () {
  13036. return {
  13037. "color": this.m_color
  13038. };
  13039. };
  13040. return RangeFill;
  13041. }(OfficeExtension.ClientObject));
  13042. Excel.RangeFill=RangeFill;
  13043. var RangeBorder=(function (_super) {
  13044. __extends(RangeBorder, _super);
  13045. function RangeBorder() {
  13046. _super.apply(this, arguments);
  13047. }
  13048. Object.defineProperty(RangeBorder.prototype, "color", {
  13049. get: function () {
  13050. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  13051. return this.m_color;
  13052. },
  13053. set: function (value) {
  13054. this.m_color=value;
  13055. _createSetPropertyAction(this.context, this, "Color", value);
  13056. },
  13057. enumerable: true,
  13058. configurable: true
  13059. });
  13060. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  13061. get: function () {
  13062. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  13063. return this.m_sideIndex;
  13064. },
  13065. enumerable: true,
  13066. configurable: true
  13067. });
  13068. Object.defineProperty(RangeBorder.prototype, "style", {
  13069. get: function () {
  13070. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  13071. return this.m_style;
  13072. },
  13073. set: function (value) {
  13074. this.m_style=value;
  13075. _createSetPropertyAction(this.context, this, "Style", value);
  13076. },
  13077. enumerable: true,
  13078. configurable: true
  13079. });
  13080. Object.defineProperty(RangeBorder.prototype, "weight", {
  13081. get: function () {
  13082. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  13083. return this.m_weight;
  13084. },
  13085. set: function (value) {
  13086. this.m_weight=value;
  13087. _createSetPropertyAction(this.context, this, "Weight", value);
  13088. },
  13089. enumerable: true,
  13090. configurable: true
  13091. });
  13092. RangeBorder.prototype._handleResult=function (value) {
  13093. _super.prototype._handleResult.call(this, value);
  13094. if (_isNullOrUndefined(value))
  13095. return;
  13096. var obj=value;
  13097. _fixObjectPathIfNecessary(this, obj);
  13098. if (!_isUndefined(obj["Color"])) {
  13099. this.m_color=obj["Color"];
  13100. }
  13101. if (!_isUndefined(obj["SideIndex"])) {
  13102. this.m_sideIndex=obj["SideIndex"];
  13103. }
  13104. if (!_isUndefined(obj["Style"])) {
  13105. this.m_style=obj["Style"];
  13106. }
  13107. if (!_isUndefined(obj["Weight"])) {
  13108. this.m_weight=obj["Weight"];
  13109. }
  13110. };
  13111. RangeBorder.prototype.load=function (option) {
  13112. _load(this, option);
  13113. return this;
  13114. };
  13115. RangeBorder.prototype.toJSON=function () {
  13116. return {
  13117. "color": this.m_color,
  13118. "sideIndex": this.m_sideIndex,
  13119. "style": this.m_style,
  13120. "weight": this.m_weight
  13121. };
  13122. };
  13123. return RangeBorder;
  13124. }(OfficeExtension.ClientObject));
  13125. Excel.RangeBorder=RangeBorder;
  13126. var RangeBorderCollection=(function (_super) {
  13127. __extends(RangeBorderCollection, _super);
  13128. function RangeBorderCollection() {
  13129. _super.apply(this, arguments);
  13130. }
  13131. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  13132. get: function () {
  13133. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  13134. return this.m__items;
  13135. },
  13136. enumerable: true,
  13137. configurable: true
  13138. });
  13139. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  13140. get: function () {
  13141. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  13142. return this.m_count;
  13143. },
  13144. enumerable: true,
  13145. configurable: true
  13146. });
  13147. RangeBorderCollection.prototype.getItem=function (index) {
  13148. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  13149. };
  13150. RangeBorderCollection.prototype.getItemAt=function (index) {
  13151. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13152. };
  13153. RangeBorderCollection.prototype._handleResult=function (value) {
  13154. _super.prototype._handleResult.call(this, value);
  13155. if (_isNullOrUndefined(value))
  13156. return;
  13157. var obj=value;
  13158. _fixObjectPathIfNecessary(this, obj);
  13159. if (!_isUndefined(obj["Count"])) {
  13160. this.m_count=obj["Count"];
  13161. }
  13162. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13163. this.m__items=[];
  13164. var _data=obj[OfficeExtension.Constants.items];
  13165. for (var i=0; i < _data.length; i++) {
  13166. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13167. _item._handleResult(_data[i]);
  13168. this.m__items.push(_item);
  13169. }
  13170. }
  13171. };
  13172. RangeBorderCollection.prototype.load=function (option) {
  13173. _load(this, option);
  13174. return this;
  13175. };
  13176. RangeBorderCollection.prototype.toJSON=function () {
  13177. return {
  13178. "count": this.m_count
  13179. };
  13180. };
  13181. return RangeBorderCollection;
  13182. }(OfficeExtension.ClientObject));
  13183. Excel.RangeBorderCollection=RangeBorderCollection;
  13184. var RangeFont=(function (_super) {
  13185. __extends(RangeFont, _super);
  13186. function RangeFont() {
  13187. _super.apply(this, arguments);
  13188. }
  13189. Object.defineProperty(RangeFont.prototype, "bold", {
  13190. get: function () {
  13191. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  13192. return this.m_bold;
  13193. },
  13194. set: function (value) {
  13195. this.m_bold=value;
  13196. _createSetPropertyAction(this.context, this, "Bold", value);
  13197. },
  13198. enumerable: true,
  13199. configurable: true
  13200. });
  13201. Object.defineProperty(RangeFont.prototype, "color", {
  13202. get: function () {
  13203. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  13204. return this.m_color;
  13205. },
  13206. set: function (value) {
  13207. this.m_color=value;
  13208. _createSetPropertyAction(this.context, this, "Color", value);
  13209. },
  13210. enumerable: true,
  13211. configurable: true
  13212. });
  13213. Object.defineProperty(RangeFont.prototype, "italic", {
  13214. get: function () {
  13215. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  13216. return this.m_italic;
  13217. },
  13218. set: function (value) {
  13219. this.m_italic=value;
  13220. _createSetPropertyAction(this.context, this, "Italic", value);
  13221. },
  13222. enumerable: true,
  13223. configurable: true
  13224. });
  13225. Object.defineProperty(RangeFont.prototype, "name", {
  13226. get: function () {
  13227. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  13228. return this.m_name;
  13229. },
  13230. set: function (value) {
  13231. this.m_name=value;
  13232. _createSetPropertyAction(this.context, this, "Name", value);
  13233. },
  13234. enumerable: true,
  13235. configurable: true
  13236. });
  13237. Object.defineProperty(RangeFont.prototype, "size", {
  13238. get: function () {
  13239. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  13240. return this.m_size;
  13241. },
  13242. set: function (value) {
  13243. this.m_size=value;
  13244. _createSetPropertyAction(this.context, this, "Size", value);
  13245. },
  13246. enumerable: true,
  13247. configurable: true
  13248. });
  13249. Object.defineProperty(RangeFont.prototype, "underline", {
  13250. get: function () {
  13251. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  13252. return this.m_underline;
  13253. },
  13254. set: function (value) {
  13255. this.m_underline=value;
  13256. _createSetPropertyAction(this.context, this, "Underline", value);
  13257. },
  13258. enumerable: true,
  13259. configurable: true
  13260. });
  13261. RangeFont.prototype._handleResult=function (value) {
  13262. _super.prototype._handleResult.call(this, value);
  13263. if (_isNullOrUndefined(value))
  13264. return;
  13265. var obj=value;
  13266. _fixObjectPathIfNecessary(this, obj);
  13267. if (!_isUndefined(obj["Bold"])) {
  13268. this.m_bold=obj["Bold"];
  13269. }
  13270. if (!_isUndefined(obj["Color"])) {
  13271. this.m_color=obj["Color"];
  13272. }
  13273. if (!_isUndefined(obj["Italic"])) {
  13274. this.m_italic=obj["Italic"];
  13275. }
  13276. if (!_isUndefined(obj["Name"])) {
  13277. this.m_name=obj["Name"];
  13278. }
  13279. if (!_isUndefined(obj["Size"])) {
  13280. this.m_size=obj["Size"];
  13281. }
  13282. if (!_isUndefined(obj["Underline"])) {
  13283. this.m_underline=obj["Underline"];
  13284. }
  13285. };
  13286. RangeFont.prototype.load=function (option) {
  13287. _load(this, option);
  13288. return this;
  13289. };
  13290. RangeFont.prototype.toJSON=function () {
  13291. return {
  13292. "bold": this.m_bold,
  13293. "color": this.m_color,
  13294. "italic": this.m_italic,
  13295. "name": this.m_name,
  13296. "size": this.m_size,
  13297. "underline": this.m_underline
  13298. };
  13299. };
  13300. return RangeFont;
  13301. }(OfficeExtension.ClientObject));
  13302. Excel.RangeFont=RangeFont;
  13303. var ChartCollection=(function (_super) {
  13304. __extends(ChartCollection, _super);
  13305. function ChartCollection() {
  13306. _super.apply(this, arguments);
  13307. }
  13308. Object.defineProperty(ChartCollection.prototype, "items", {
  13309. get: function () {
  13310. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  13311. return this.m__items;
  13312. },
  13313. enumerable: true,
  13314. configurable: true
  13315. });
  13316. Object.defineProperty(ChartCollection.prototype, "count", {
  13317. get: function () {
  13318. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  13319. return this.m_count;
  13320. },
  13321. enumerable: true,
  13322. configurable: true
  13323. });
  13324. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  13325. if (!(sourceData instanceof Range)) {
  13326. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  13327. }
  13328. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  13329. };
  13330. ChartCollection.prototype.getItem=function (name) {
  13331. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  13332. };
  13333. ChartCollection.prototype.getItemAt=function (index) {
  13334. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13335. };
  13336. ChartCollection.prototype._GetItem=function (key) {
  13337. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  13338. };
  13339. ChartCollection.prototype._handleResult=function (value) {
  13340. _super.prototype._handleResult.call(this, value);
  13341. if (_isNullOrUndefined(value))
  13342. return;
  13343. var obj=value;
  13344. _fixObjectPathIfNecessary(this, obj);
  13345. if (!_isUndefined(obj["Count"])) {
  13346. this.m_count=obj["Count"];
  13347. }
  13348. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13349. this.m__items=[];
  13350. var _data=obj[OfficeExtension.Constants.items];
  13351. for (var i=0; i < _data.length; i++) {
  13352. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13353. _item._handleResult(_data[i]);
  13354. this.m__items.push(_item);
  13355. }
  13356. }
  13357. };
  13358. ChartCollection.prototype.load=function (option) {
  13359. _load(this, option);
  13360. return this;
  13361. };
  13362. ChartCollection.prototype.toJSON=function () {
  13363. return {
  13364. "count": this.m_count
  13365. };
  13366. };
  13367. return ChartCollection;
  13368. }(OfficeExtension.ClientObject));
  13369. Excel.ChartCollection=ChartCollection;
  13370. var Chart=(function (_super) {
  13371. __extends(Chart, _super);
  13372. function Chart() {
  13373. _super.apply(this, arguments);
  13374. }
  13375. Object.defineProperty(Chart.prototype, "axes", {
  13376. get: function () {
  13377. if (!this.m_axes) {
  13378. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  13379. }
  13380. return this.m_axes;
  13381. },
  13382. enumerable: true,
  13383. configurable: true
  13384. });
  13385. Object.defineProperty(Chart.prototype, "dataLabels", {
  13386. get: function () {
  13387. if (!this.m_dataLabels) {
  13388. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  13389. }
  13390. return this.m_dataLabels;
  13391. },
  13392. enumerable: true,
  13393. configurable: true
  13394. });
  13395. Object.defineProperty(Chart.prototype, "format", {
  13396. get: function () {
  13397. if (!this.m_format) {
  13398. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13399. }
  13400. return this.m_format;
  13401. },
  13402. enumerable: true,
  13403. configurable: true
  13404. });
  13405. Object.defineProperty(Chart.prototype, "legend", {
  13406. get: function () {
  13407. if (!this.m_legend) {
  13408. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  13409. }
  13410. return this.m_legend;
  13411. },
  13412. enumerable: true,
  13413. configurable: true
  13414. });
  13415. Object.defineProperty(Chart.prototype, "series", {
  13416. get: function () {
  13417. if (!this.m_series) {
  13418. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  13419. }
  13420. return this.m_series;
  13421. },
  13422. enumerable: true,
  13423. configurable: true
  13424. });
  13425. Object.defineProperty(Chart.prototype, "title", {
  13426. get: function () {
  13427. if (!this.m_title) {
  13428. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  13429. }
  13430. return this.m_title;
  13431. },
  13432. enumerable: true,
  13433. configurable: true
  13434. });
  13435. Object.defineProperty(Chart.prototype, "worksheet", {
  13436. get: function () {
  13437. if (!this.m_worksheet) {
  13438. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  13439. }
  13440. return this.m_worksheet;
  13441. },
  13442. enumerable: true,
  13443. configurable: true
  13444. });
  13445. Object.defineProperty(Chart.prototype, "height", {
  13446. get: function () {
  13447. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  13448. return this.m_height;
  13449. },
  13450. set: function (value) {
  13451. this.m_height=value;
  13452. _createSetPropertyAction(this.context, this, "Height", value);
  13453. },
  13454. enumerable: true,
  13455. configurable: true
  13456. });
  13457. Object.defineProperty(Chart.prototype, "left", {
  13458. get: function () {
  13459. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  13460. return this.m_left;
  13461. },
  13462. set: function (value) {
  13463. this.m_left=value;
  13464. _createSetPropertyAction(this.context, this, "Left", value);
  13465. },
  13466. enumerable: true,
  13467. configurable: true
  13468. });
  13469. Object.defineProperty(Chart.prototype, "name", {
  13470. get: function () {
  13471. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  13472. return this.m_name;
  13473. },
  13474. set: function (value) {
  13475. this.m_name=value;
  13476. _createSetPropertyAction(this.context, this, "Name", value);
  13477. },
  13478. enumerable: true,
  13479. configurable: true
  13480. });
  13481. Object.defineProperty(Chart.prototype, "top", {
  13482. get: function () {
  13483. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  13484. return this.m_top;
  13485. },
  13486. set: function (value) {
  13487. this.m_top=value;
  13488. _createSetPropertyAction(this.context, this, "Top", value);
  13489. },
  13490. enumerable: true,
  13491. configurable: true
  13492. });
  13493. Object.defineProperty(Chart.prototype, "width", {
  13494. get: function () {
  13495. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  13496. return this.m_width;
  13497. },
  13498. set: function (value) {
  13499. this.m_width=value;
  13500. _createSetPropertyAction(this.context, this, "Width", value);
  13501. },
  13502. enumerable: true,
  13503. configurable: true
  13504. });
  13505. Chart.prototype.delete=function () {
  13506. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13507. };
  13508. Chart.prototype.getImage=function (width, height, fittingMode) {
  13509. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  13510. var ret=new OfficeExtension.ClientResult();
  13511. _addActionResultHandler(this, action, ret);
  13512. return ret;
  13513. };
  13514. Chart.prototype.setData=function (sourceData, seriesBy) {
  13515. if (!(sourceData instanceof Range)) {
  13516. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  13517. }
  13518. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  13519. };
  13520. Chart.prototype.setPosition=function (startCell, endCell) {
  13521. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  13522. };
  13523. Chart.prototype._handleResult=function (value) {
  13524. _super.prototype._handleResult.call(this, value);
  13525. if (_isNullOrUndefined(value))
  13526. return;
  13527. var obj=value;
  13528. _fixObjectPathIfNecessary(this, obj);
  13529. if (!_isUndefined(obj["Height"])) {
  13530. this.m_height=obj["Height"];
  13531. }
  13532. if (!_isUndefined(obj["Left"])) {
  13533. this.m_left=obj["Left"];
  13534. }
  13535. if (!_isUndefined(obj["Name"])) {
  13536. this.m_name=obj["Name"];
  13537. }
  13538. if (!_isUndefined(obj["Top"])) {
  13539. this.m_top=obj["Top"];
  13540. }
  13541. if (!_isUndefined(obj["Width"])) {
  13542. this.m_width=obj["Width"];
  13543. }
  13544. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  13545. };
  13546. Chart.prototype.load=function (option) {
  13547. _load(this, option);
  13548. return this;
  13549. };
  13550. Chart.prototype.toJSON=function () {
  13551. return {
  13552. "axes": this.m_axes,
  13553. "dataLabels": this.m_dataLabels,
  13554. "format": this.m_format,
  13555. "height": this.m_height,
  13556. "left": this.m_left,
  13557. "legend": this.m_legend,
  13558. "name": this.m_name,
  13559. "title": this.m_title,
  13560. "top": this.m_top,
  13561. "width": this.m_width
  13562. };
  13563. };
  13564. return Chart;
  13565. }(OfficeExtension.ClientObject));
  13566. Excel.Chart=Chart;
  13567. var ChartAreaFormat=(function (_super) {
  13568. __extends(ChartAreaFormat, _super);
  13569. function ChartAreaFormat() {
  13570. _super.apply(this, arguments);
  13571. }
  13572. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  13573. get: function () {
  13574. if (!this.m_fill) {
  13575. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13576. }
  13577. return this.m_fill;
  13578. },
  13579. enumerable: true,
  13580. configurable: true
  13581. });
  13582. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  13583. get: function () {
  13584. if (!this.m_font) {
  13585. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  13586. }
  13587. return this.m_font;
  13588. },
  13589. enumerable: true,
  13590. configurable: true
  13591. });
  13592. ChartAreaFormat.prototype._handleResult=function (value) {
  13593. _super.prototype._handleResult.call(this, value);
  13594. if (_isNullOrUndefined(value))
  13595. return;
  13596. var obj=value;
  13597. _fixObjectPathIfNecessary(this, obj);
  13598. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  13599. };
  13600. ChartAreaFormat.prototype.load=function (option) {
  13601. _load(this, option);
  13602. return this;
  13603. };
  13604. ChartAreaFormat.prototype.toJSON=function () {
  13605. return {
  13606. "fill": this.m_fill,
  13607. "font": this.m_font
  13608. };
  13609. };
  13610. return ChartAreaFormat;
  13611. }(OfficeExtension.ClientObject));
  13612. Excel.ChartAreaFormat=ChartAreaFormat;
  13613. var ChartSeriesCollection=(function (_super) {
  13614. __extends(ChartSeriesCollection, _super);
  13615. function ChartSeriesCollection() {
  13616. _super.apply(this, arguments);
  13617. }
  13618. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  13619. get: function () {
  13620. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  13621. return this.m__items;
  13622. },
  13623. enumerable: true,
  13624. configurable: true
  13625. });
  13626. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  13627. get: function () {
  13628. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  13629. return this.m_count;
  13630. },
  13631. enumerable: true,
  13632. configurable: true
  13633. });
  13634. ChartSeriesCollection.prototype.getItemAt=function (index) {
  13635. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13636. };
  13637. ChartSeriesCollection.prototype._handleResult=function (value) {
  13638. _super.prototype._handleResult.call(this, value);
  13639. if (_isNullOrUndefined(value))
  13640. return;
  13641. var obj=value;
  13642. _fixObjectPathIfNecessary(this, obj);
  13643. if (!_isUndefined(obj["Count"])) {
  13644. this.m_count=obj["Count"];
  13645. }
  13646. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13647. this.m__items=[];
  13648. var _data=obj[OfficeExtension.Constants.items];
  13649. for (var i=0; i < _data.length; i++) {
  13650. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13651. _item._handleResult(_data[i]);
  13652. this.m__items.push(_item);
  13653. }
  13654. }
  13655. };
  13656. ChartSeriesCollection.prototype.load=function (option) {
  13657. _load(this, option);
  13658. return this;
  13659. };
  13660. ChartSeriesCollection.prototype.toJSON=function () {
  13661. return {
  13662. "count": this.m_count
  13663. };
  13664. };
  13665. return ChartSeriesCollection;
  13666. }(OfficeExtension.ClientObject));
  13667. Excel.ChartSeriesCollection=ChartSeriesCollection;
  13668. var ChartSeries=(function (_super) {
  13669. __extends(ChartSeries, _super);
  13670. function ChartSeries() {
  13671. _super.apply(this, arguments);
  13672. }
  13673. Object.defineProperty(ChartSeries.prototype, "format", {
  13674. get: function () {
  13675. if (!this.m_format) {
  13676. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13677. }
  13678. return this.m_format;
  13679. },
  13680. enumerable: true,
  13681. configurable: true
  13682. });
  13683. Object.defineProperty(ChartSeries.prototype, "points", {
  13684. get: function () {
  13685. if (!this.m_points) {
  13686. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  13687. }
  13688. return this.m_points;
  13689. },
  13690. enumerable: true,
  13691. configurable: true
  13692. });
  13693. Object.defineProperty(ChartSeries.prototype, "name", {
  13694. get: function () {
  13695. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  13696. return this.m_name;
  13697. },
  13698. set: function (value) {
  13699. this.m_name=value;
  13700. _createSetPropertyAction(this.context, this, "Name", value);
  13701. },
  13702. enumerable: true,
  13703. configurable: true
  13704. });
  13705. ChartSeries.prototype._handleResult=function (value) {
  13706. _super.prototype._handleResult.call(this, value);
  13707. if (_isNullOrUndefined(value))
  13708. return;
  13709. var obj=value;
  13710. _fixObjectPathIfNecessary(this, obj);
  13711. if (!_isUndefined(obj["Name"])) {
  13712. this.m_name=obj["Name"];
  13713. }
  13714. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  13715. };
  13716. ChartSeries.prototype.load=function (option) {
  13717. _load(this, option);
  13718. return this;
  13719. };
  13720. ChartSeries.prototype.toJSON=function () {
  13721. return {
  13722. "format": this.m_format,
  13723. "name": this.m_name
  13724. };
  13725. };
  13726. return ChartSeries;
  13727. }(OfficeExtension.ClientObject));
  13728. Excel.ChartSeries=ChartSeries;
  13729. var ChartSeriesFormat=(function (_super) {
  13730. __extends(ChartSeriesFormat, _super);
  13731. function ChartSeriesFormat() {
  13732. _super.apply(this, arguments);
  13733. }
  13734. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  13735. get: function () {
  13736. if (!this.m_fill) {
  13737. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13738. }
  13739. return this.m_fill;
  13740. },
  13741. enumerable: true,
  13742. configurable: true
  13743. });
  13744. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  13745. get: function () {
  13746. if (!this.m_line) {
  13747. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  13748. }
  13749. return this.m_line;
  13750. },
  13751. enumerable: true,
  13752. configurable: true
  13753. });
  13754. ChartSeriesFormat.prototype._handleResult=function (value) {
  13755. _super.prototype._handleResult.call(this, value);
  13756. if (_isNullOrUndefined(value))
  13757. return;
  13758. var obj=value;
  13759. _fixObjectPathIfNecessary(this, obj);
  13760. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  13761. };
  13762. ChartSeriesFormat.prototype.load=function (option) {
  13763. _load(this, option);
  13764. return this;
  13765. };
  13766. ChartSeriesFormat.prototype.toJSON=function () {
  13767. return {
  13768. "fill": this.m_fill,
  13769. "line": this.m_line
  13770. };
  13771. };
  13772. return ChartSeriesFormat;
  13773. }(OfficeExtension.ClientObject));
  13774. Excel.ChartSeriesFormat=ChartSeriesFormat;
  13775. var ChartPointsCollection=(function (_super) {
  13776. __extends(ChartPointsCollection, _super);
  13777. function ChartPointsCollection() {
  13778. _super.apply(this, arguments);
  13779. }
  13780. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  13781. get: function () {
  13782. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  13783. return this.m__items;
  13784. },
  13785. enumerable: true,
  13786. configurable: true
  13787. });
  13788. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  13789. get: function () {
  13790. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  13791. return this.m_count;
  13792. },
  13793. enumerable: true,
  13794. configurable: true
  13795. });
  13796. ChartPointsCollection.prototype.getItemAt=function (index) {
  13797. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13798. };
  13799. ChartPointsCollection.prototype._handleResult=function (value) {
  13800. _super.prototype._handleResult.call(this, value);
  13801. if (_isNullOrUndefined(value))
  13802. return;
  13803. var obj=value;
  13804. _fixObjectPathIfNecessary(this, obj);
  13805. if (!_isUndefined(obj["Count"])) {
  13806. this.m_count=obj["Count"];
  13807. }
  13808. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13809. this.m__items=[];
  13810. var _data=obj[OfficeExtension.Constants.items];
  13811. for (var i=0; i < _data.length; i++) {
  13812. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13813. _item._handleResult(_data[i]);
  13814. this.m__items.push(_item);
  13815. }
  13816. }
  13817. };
  13818. ChartPointsCollection.prototype.load=function (option) {
  13819. _load(this, option);
  13820. return this;
  13821. };
  13822. ChartPointsCollection.prototype.toJSON=function () {
  13823. return {
  13824. "count": this.m_count
  13825. };
  13826. };
  13827. return ChartPointsCollection;
  13828. }(OfficeExtension.ClientObject));
  13829. Excel.ChartPointsCollection=ChartPointsCollection;
  13830. var ChartPoint=(function (_super) {
  13831. __extends(ChartPoint, _super);
  13832. function ChartPoint() {
  13833. _super.apply(this, arguments);
  13834. }
  13835. Object.defineProperty(ChartPoint.prototype, "format", {
  13836. get: function () {
  13837. if (!this.m_format) {
  13838. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13839. }
  13840. return this.m_format;
  13841. },
  13842. enumerable: true,
  13843. configurable: true
  13844. });
  13845. Object.defineProperty(ChartPoint.prototype, "value", {
  13846. get: function () {
  13847. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  13848. return this.m_value;
  13849. },
  13850. enumerable: true,
  13851. configurable: true
  13852. });
  13853. ChartPoint.prototype._handleResult=function (value) {
  13854. _super.prototype._handleResult.call(this, value);
  13855. if (_isNullOrUndefined(value))
  13856. return;
  13857. var obj=value;
  13858. _fixObjectPathIfNecessary(this, obj);
  13859. if (!_isUndefined(obj["Value"])) {
  13860. this.m_value=obj["Value"];
  13861. }
  13862. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  13863. };
  13864. ChartPoint.prototype.load=function (option) {
  13865. _load(this, option);
  13866. return this;
  13867. };
  13868. ChartPoint.prototype.toJSON=function () {
  13869. return {
  13870. "format": this.m_format,
  13871. "value": this.m_value
  13872. };
  13873. };
  13874. return ChartPoint;
  13875. }(OfficeExtension.ClientObject));
  13876. Excel.ChartPoint=ChartPoint;
  13877. var ChartPointFormat=(function (_super) {
  13878. __extends(ChartPointFormat, _super);
  13879. function ChartPointFormat() {
  13880. _super.apply(this, arguments);
  13881. }
  13882. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  13883. get: function () {
  13884. if (!this.m_fill) {
  13885. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  13886. }
  13887. return this.m_fill;
  13888. },
  13889. enumerable: true,
  13890. configurable: true
  13891. });
  13892. ChartPointFormat.prototype._handleResult=function (value) {
  13893. _super.prototype._handleResult.call(this, value);
  13894. if (_isNullOrUndefined(value))
  13895. return;
  13896. var obj=value;
  13897. _fixObjectPathIfNecessary(this, obj);
  13898. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  13899. };
  13900. ChartPointFormat.prototype.load=function (option) {
  13901. _load(this, option);
  13902. return this;
  13903. };
  13904. ChartPointFormat.prototype.toJSON=function () {
  13905. return {
  13906. "fill": this.m_fill
  13907. };
  13908. };
  13909. return ChartPointFormat;
  13910. }(OfficeExtension.ClientObject));
  13911. Excel.ChartPointFormat=ChartPointFormat;
  13912. var ChartAxes=(function (_super) {
  13913. __extends(ChartAxes, _super);
  13914. function ChartAxes() {
  13915. _super.apply(this, arguments);
  13916. }
  13917. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  13918. get: function () {
  13919. if (!this.m_categoryAxis) {
  13920. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  13921. }
  13922. return this.m_categoryAxis;
  13923. },
  13924. enumerable: true,
  13925. configurable: true
  13926. });
  13927. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  13928. get: function () {
  13929. if (!this.m_seriesAxis) {
  13930. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  13931. }
  13932. return this.m_seriesAxis;
  13933. },
  13934. enumerable: true,
  13935. configurable: true
  13936. });
  13937. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  13938. get: function () {
  13939. if (!this.m_valueAxis) {
  13940. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  13941. }
  13942. return this.m_valueAxis;
  13943. },
  13944. enumerable: true,
  13945. configurable: true
  13946. });
  13947. ChartAxes.prototype._handleResult=function (value) {
  13948. _super.prototype._handleResult.call(this, value);
  13949. if (_isNullOrUndefined(value))
  13950. return;
  13951. var obj=value;
  13952. _fixObjectPathIfNecessary(this, obj);
  13953. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  13954. };
  13955. ChartAxes.prototype.load=function (option) {
  13956. _load(this, option);
  13957. return this;
  13958. };
  13959. ChartAxes.prototype.toJSON=function () {
  13960. return {
  13961. "categoryAxis": this.m_categoryAxis,
  13962. "seriesAxis": this.m_seriesAxis,
  13963. "valueAxis": this.m_valueAxis
  13964. };
  13965. };
  13966. return ChartAxes;
  13967. }(OfficeExtension.ClientObject));
  13968. Excel.ChartAxes=ChartAxes;
  13969. var ChartAxis=(function (_super) {
  13970. __extends(ChartAxis, _super);
  13971. function ChartAxis() {
  13972. _super.apply(this, arguments);
  13973. }
  13974. Object.defineProperty(ChartAxis.prototype, "format", {
  13975. get: function () {
  13976. if (!this.m_format) {
  13977. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  13978. }
  13979. return this.m_format;
  13980. },
  13981. enumerable: true,
  13982. configurable: true
  13983. });
  13984. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  13985. get: function () {
  13986. if (!this.m_majorGridlines) {
  13987. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  13988. }
  13989. return this.m_majorGridlines;
  13990. },
  13991. enumerable: true,
  13992. configurable: true
  13993. });
  13994. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  13995. get: function () {
  13996. if (!this.m_minorGridlines) {
  13997. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  13998. }
  13999. return this.m_minorGridlines;
  14000. },
  14001. enumerable: true,
  14002. configurable: true
  14003. });
  14004. Object.defineProperty(ChartAxis.prototype, "title", {
  14005. get: function () {
  14006. if (!this.m_title) {
  14007. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  14008. }
  14009. return this.m_title;
  14010. },
  14011. enumerable: true,
  14012. configurable: true
  14013. });
  14014. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  14015. get: function () {
  14016. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  14017. return this.m_majorUnit;
  14018. },
  14019. set: function (value) {
  14020. this.m_majorUnit=value;
  14021. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  14022. },
  14023. enumerable: true,
  14024. configurable: true
  14025. });
  14026. Object.defineProperty(ChartAxis.prototype, "maximum", {
  14027. get: function () {
  14028. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  14029. return this.m_maximum;
  14030. },
  14031. set: function (value) {
  14032. this.m_maximum=value;
  14033. _createSetPropertyAction(this.context, this, "Maximum", value);
  14034. },
  14035. enumerable: true,
  14036. configurable: true
  14037. });
  14038. Object.defineProperty(ChartAxis.prototype, "minimum", {
  14039. get: function () {
  14040. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  14041. return this.m_minimum;
  14042. },
  14043. set: function (value) {
  14044. this.m_minimum=value;
  14045. _createSetPropertyAction(this.context, this, "Minimum", value);
  14046. },
  14047. enumerable: true,
  14048. configurable: true
  14049. });
  14050. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  14051. get: function () {
  14052. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  14053. return this.m_minorUnit;
  14054. },
  14055. set: function (value) {
  14056. this.m_minorUnit=value;
  14057. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  14058. },
  14059. enumerable: true,
  14060. configurable: true
  14061. });
  14062. ChartAxis.prototype._handleResult=function (value) {
  14063. _super.prototype._handleResult.call(this, value);
  14064. if (_isNullOrUndefined(value))
  14065. return;
  14066. var obj=value;
  14067. _fixObjectPathIfNecessary(this, obj);
  14068. if (!_isUndefined(obj["MajorUnit"])) {
  14069. this.m_majorUnit=obj["MajorUnit"];
  14070. }
  14071. if (!_isUndefined(obj["Maximum"])) {
  14072. this.m_maximum=obj["Maximum"];
  14073. }
  14074. if (!_isUndefined(obj["Minimum"])) {
  14075. this.m_minimum=obj["Minimum"];
  14076. }
  14077. if (!_isUndefined(obj["MinorUnit"])) {
  14078. this.m_minorUnit=obj["MinorUnit"];
  14079. }
  14080. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  14081. };
  14082. ChartAxis.prototype.load=function (option) {
  14083. _load(this, option);
  14084. return this;
  14085. };
  14086. ChartAxis.prototype.toJSON=function () {
  14087. return {
  14088. "format": this.m_format,
  14089. "majorGridlines": this.m_majorGridlines,
  14090. "majorUnit": this.m_majorUnit,
  14091. "maximum": this.m_maximum,
  14092. "minimum": this.m_minimum,
  14093. "minorGridlines": this.m_minorGridlines,
  14094. "minorUnit": this.m_minorUnit,
  14095. "title": this.m_title
  14096. };
  14097. };
  14098. return ChartAxis;
  14099. }(OfficeExtension.ClientObject));
  14100. Excel.ChartAxis=ChartAxis;
  14101. var ChartAxisFormat=(function (_super) {
  14102. __extends(ChartAxisFormat, _super);
  14103. function ChartAxisFormat() {
  14104. _super.apply(this, arguments);
  14105. }
  14106. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  14107. get: function () {
  14108. if (!this.m_font) {
  14109. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14110. }
  14111. return this.m_font;
  14112. },
  14113. enumerable: true,
  14114. configurable: true
  14115. });
  14116. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  14117. get: function () {
  14118. if (!this.m_line) {
  14119. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14120. }
  14121. return this.m_line;
  14122. },
  14123. enumerable: true,
  14124. configurable: true
  14125. });
  14126. ChartAxisFormat.prototype._handleResult=function (value) {
  14127. _super.prototype._handleResult.call(this, value);
  14128. if (_isNullOrUndefined(value))
  14129. return;
  14130. var obj=value;
  14131. _fixObjectPathIfNecessary(this, obj);
  14132. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  14133. };
  14134. ChartAxisFormat.prototype.load=function (option) {
  14135. _load(this, option);
  14136. return this;
  14137. };
  14138. ChartAxisFormat.prototype.toJSON=function () {
  14139. return {
  14140. "font": this.m_font,
  14141. "line": this.m_line
  14142. };
  14143. };
  14144. return ChartAxisFormat;
  14145. }(OfficeExtension.ClientObject));
  14146. Excel.ChartAxisFormat=ChartAxisFormat;
  14147. var ChartAxisTitle=(function (_super) {
  14148. __extends(ChartAxisTitle, _super);
  14149. function ChartAxisTitle() {
  14150. _super.apply(this, arguments);
  14151. }
  14152. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  14153. get: function () {
  14154. if (!this.m_format) {
  14155. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14156. }
  14157. return this.m_format;
  14158. },
  14159. enumerable: true,
  14160. configurable: true
  14161. });
  14162. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  14163. get: function () {
  14164. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  14165. return this.m_text;
  14166. },
  14167. set: function (value) {
  14168. this.m_text=value;
  14169. _createSetPropertyAction(this.context, this, "Text", value);
  14170. },
  14171. enumerable: true,
  14172. configurable: true
  14173. });
  14174. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  14175. get: function () {
  14176. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  14177. return this.m_visible;
  14178. },
  14179. set: function (value) {
  14180. this.m_visible=value;
  14181. _createSetPropertyAction(this.context, this, "Visible", value);
  14182. },
  14183. enumerable: true,
  14184. configurable: true
  14185. });
  14186. ChartAxisTitle.prototype._handleResult=function (value) {
  14187. _super.prototype._handleResult.call(this, value);
  14188. if (_isNullOrUndefined(value))
  14189. return;
  14190. var obj=value;
  14191. _fixObjectPathIfNecessary(this, obj);
  14192. if (!_isUndefined(obj["Text"])) {
  14193. this.m_text=obj["Text"];
  14194. }
  14195. if (!_isUndefined(obj["Visible"])) {
  14196. this.m_visible=obj["Visible"];
  14197. }
  14198. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14199. };
  14200. ChartAxisTitle.prototype.load=function (option) {
  14201. _load(this, option);
  14202. return this;
  14203. };
  14204. ChartAxisTitle.prototype.toJSON=function () {
  14205. return {
  14206. "format": this.m_format,
  14207. "text": this.m_text,
  14208. "visible": this.m_visible
  14209. };
  14210. };
  14211. return ChartAxisTitle;
  14212. }(OfficeExtension.ClientObject));
  14213. Excel.ChartAxisTitle=ChartAxisTitle;
  14214. var ChartAxisTitleFormat=(function (_super) {
  14215. __extends(ChartAxisTitleFormat, _super);
  14216. function ChartAxisTitleFormat() {
  14217. _super.apply(this, arguments);
  14218. }
  14219. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  14220. get: function () {
  14221. if (!this.m_font) {
  14222. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14223. }
  14224. return this.m_font;
  14225. },
  14226. enumerable: true,
  14227. configurable: true
  14228. });
  14229. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  14230. _super.prototype._handleResult.call(this, value);
  14231. if (_isNullOrUndefined(value))
  14232. return;
  14233. var obj=value;
  14234. _fixObjectPathIfNecessary(this, obj);
  14235. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  14236. };
  14237. ChartAxisTitleFormat.prototype.load=function (option) {
  14238. _load(this, option);
  14239. return this;
  14240. };
  14241. ChartAxisTitleFormat.prototype.toJSON=function () {
  14242. return {
  14243. "font": this.m_font
  14244. };
  14245. };
  14246. return ChartAxisTitleFormat;
  14247. }(OfficeExtension.ClientObject));
  14248. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  14249. var ChartDataLabels=(function (_super) {
  14250. __extends(ChartDataLabels, _super);
  14251. function ChartDataLabels() {
  14252. _super.apply(this, arguments);
  14253. }
  14254. Object.defineProperty(ChartDataLabels.prototype, "format", {
  14255. get: function () {
  14256. if (!this.m_format) {
  14257. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14258. }
  14259. return this.m_format;
  14260. },
  14261. enumerable: true,
  14262. configurable: true
  14263. });
  14264. Object.defineProperty(ChartDataLabels.prototype, "position", {
  14265. get: function () {
  14266. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  14267. return this.m_position;
  14268. },
  14269. set: function (value) {
  14270. this.m_position=value;
  14271. _createSetPropertyAction(this.context, this, "Position", value);
  14272. },
  14273. enumerable: true,
  14274. configurable: true
  14275. });
  14276. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  14277. get: function () {
  14278. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  14279. return this.m_separator;
  14280. },
  14281. set: function (value) {
  14282. this.m_separator=value;
  14283. _createSetPropertyAction(this.context, this, "Separator", value);
  14284. },
  14285. enumerable: true,
  14286. configurable: true
  14287. });
  14288. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  14289. get: function () {
  14290. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  14291. return this.m_showBubbleSize;
  14292. },
  14293. set: function (value) {
  14294. this.m_showBubbleSize=value;
  14295. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  14296. },
  14297. enumerable: true,
  14298. configurable: true
  14299. });
  14300. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  14301. get: function () {
  14302. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  14303. return this.m_showCategoryName;
  14304. },
  14305. set: function (value) {
  14306. this.m_showCategoryName=value;
  14307. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  14308. },
  14309. enumerable: true,
  14310. configurable: true
  14311. });
  14312. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  14313. get: function () {
  14314. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  14315. return this.m_showLegendKey;
  14316. },
  14317. set: function (value) {
  14318. this.m_showLegendKey=value;
  14319. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  14320. },
  14321. enumerable: true,
  14322. configurable: true
  14323. });
  14324. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  14325. get: function () {
  14326. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  14327. return this.m_showPercentage;
  14328. },
  14329. set: function (value) {
  14330. this.m_showPercentage=value;
  14331. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  14332. },
  14333. enumerable: true,
  14334. configurable: true
  14335. });
  14336. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  14337. get: function () {
  14338. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  14339. return this.m_showSeriesName;
  14340. },
  14341. set: function (value) {
  14342. this.m_showSeriesName=value;
  14343. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  14344. },
  14345. enumerable: true,
  14346. configurable: true
  14347. });
  14348. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  14349. get: function () {
  14350. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  14351. return this.m_showValue;
  14352. },
  14353. set: function (value) {
  14354. this.m_showValue=value;
  14355. _createSetPropertyAction(this.context, this, "ShowValue", value);
  14356. },
  14357. enumerable: true,
  14358. configurable: true
  14359. });
  14360. ChartDataLabels.prototype._handleResult=function (value) {
  14361. _super.prototype._handleResult.call(this, value);
  14362. if (_isNullOrUndefined(value))
  14363. return;
  14364. var obj=value;
  14365. _fixObjectPathIfNecessary(this, obj);
  14366. if (!_isUndefined(obj["Position"])) {
  14367. this.m_position=obj["Position"];
  14368. }
  14369. if (!_isUndefined(obj["Separator"])) {
  14370. this.m_separator=obj["Separator"];
  14371. }
  14372. if (!_isUndefined(obj["ShowBubbleSize"])) {
  14373. this.m_showBubbleSize=obj["ShowBubbleSize"];
  14374. }
  14375. if (!_isUndefined(obj["ShowCategoryName"])) {
  14376. this.m_showCategoryName=obj["ShowCategoryName"];
  14377. }
  14378. if (!_isUndefined(obj["ShowLegendKey"])) {
  14379. this.m_showLegendKey=obj["ShowLegendKey"];
  14380. }
  14381. if (!_isUndefined(obj["ShowPercentage"])) {
  14382. this.m_showPercentage=obj["ShowPercentage"];
  14383. }
  14384. if (!_isUndefined(obj["ShowSeriesName"])) {
  14385. this.m_showSeriesName=obj["ShowSeriesName"];
  14386. }
  14387. if (!_isUndefined(obj["ShowValue"])) {
  14388. this.m_showValue=obj["ShowValue"];
  14389. }
  14390. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14391. };
  14392. ChartDataLabels.prototype.load=function (option) {
  14393. _load(this, option);
  14394. return this;
  14395. };
  14396. ChartDataLabels.prototype.toJSON=function () {
  14397. return {
  14398. "format": this.m_format,
  14399. "position": this.m_position,
  14400. "separator": this.m_separator,
  14401. "showBubbleSize": this.m_showBubbleSize,
  14402. "showCategoryName": this.m_showCategoryName,
  14403. "showLegendKey": this.m_showLegendKey,
  14404. "showPercentage": this.m_showPercentage,
  14405. "showSeriesName": this.m_showSeriesName,
  14406. "showValue": this.m_showValue
  14407. };
  14408. };
  14409. return ChartDataLabels;
  14410. }(OfficeExtension.ClientObject));
  14411. Excel.ChartDataLabels=ChartDataLabels;
  14412. var ChartDataLabelFormat=(function (_super) {
  14413. __extends(ChartDataLabelFormat, _super);
  14414. function ChartDataLabelFormat() {
  14415. _super.apply(this, arguments);
  14416. }
  14417. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  14418. get: function () {
  14419. if (!this.m_fill) {
  14420. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14421. }
  14422. return this.m_fill;
  14423. },
  14424. enumerable: true,
  14425. configurable: true
  14426. });
  14427. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  14428. get: function () {
  14429. if (!this.m_font) {
  14430. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14431. }
  14432. return this.m_font;
  14433. },
  14434. enumerable: true,
  14435. configurable: true
  14436. });
  14437. ChartDataLabelFormat.prototype._handleResult=function (value) {
  14438. _super.prototype._handleResult.call(this, value);
  14439. if (_isNullOrUndefined(value))
  14440. return;
  14441. var obj=value;
  14442. _fixObjectPathIfNecessary(this, obj);
  14443. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14444. };
  14445. ChartDataLabelFormat.prototype.load=function (option) {
  14446. _load(this, option);
  14447. return this;
  14448. };
  14449. ChartDataLabelFormat.prototype.toJSON=function () {
  14450. return {
  14451. "fill": this.m_fill,
  14452. "font": this.m_font
  14453. };
  14454. };
  14455. return ChartDataLabelFormat;
  14456. }(OfficeExtension.ClientObject));
  14457. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  14458. var ChartGridlines=(function (_super) {
  14459. __extends(ChartGridlines, _super);
  14460. function ChartGridlines() {
  14461. _super.apply(this, arguments);
  14462. }
  14463. Object.defineProperty(ChartGridlines.prototype, "format", {
  14464. get: function () {
  14465. if (!this.m_format) {
  14466. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14467. }
  14468. return this.m_format;
  14469. },
  14470. enumerable: true,
  14471. configurable: true
  14472. });
  14473. Object.defineProperty(ChartGridlines.prototype, "visible", {
  14474. get: function () {
  14475. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  14476. return this.m_visible;
  14477. },
  14478. set: function (value) {
  14479. this.m_visible=value;
  14480. _createSetPropertyAction(this.context, this, "Visible", value);
  14481. },
  14482. enumerable: true,
  14483. configurable: true
  14484. });
  14485. ChartGridlines.prototype._handleResult=function (value) {
  14486. _super.prototype._handleResult.call(this, value);
  14487. if (_isNullOrUndefined(value))
  14488. return;
  14489. var obj=value;
  14490. _fixObjectPathIfNecessary(this, obj);
  14491. if (!_isUndefined(obj["Visible"])) {
  14492. this.m_visible=obj["Visible"];
  14493. }
  14494. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14495. };
  14496. ChartGridlines.prototype.load=function (option) {
  14497. _load(this, option);
  14498. return this;
  14499. };
  14500. ChartGridlines.prototype.toJSON=function () {
  14501. return {
  14502. "format": this.m_format,
  14503. "visible": this.m_visible
  14504. };
  14505. };
  14506. return ChartGridlines;
  14507. }(OfficeExtension.ClientObject));
  14508. Excel.ChartGridlines=ChartGridlines;
  14509. var ChartGridlinesFormat=(function (_super) {
  14510. __extends(ChartGridlinesFormat, _super);
  14511. function ChartGridlinesFormat() {
  14512. _super.apply(this, arguments);
  14513. }
  14514. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  14515. get: function () {
  14516. if (!this.m_line) {
  14517. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  14518. }
  14519. return this.m_line;
  14520. },
  14521. enumerable: true,
  14522. configurable: true
  14523. });
  14524. ChartGridlinesFormat.prototype._handleResult=function (value) {
  14525. _super.prototype._handleResult.call(this, value);
  14526. if (_isNullOrUndefined(value))
  14527. return;
  14528. var obj=value;
  14529. _fixObjectPathIfNecessary(this, obj);
  14530. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  14531. };
  14532. ChartGridlinesFormat.prototype.load=function (option) {
  14533. _load(this, option);
  14534. return this;
  14535. };
  14536. ChartGridlinesFormat.prototype.toJSON=function () {
  14537. return {
  14538. "line": this.m_line
  14539. };
  14540. };
  14541. return ChartGridlinesFormat;
  14542. }(OfficeExtension.ClientObject));
  14543. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  14544. var ChartLegend=(function (_super) {
  14545. __extends(ChartLegend, _super);
  14546. function ChartLegend() {
  14547. _super.apply(this, arguments);
  14548. }
  14549. Object.defineProperty(ChartLegend.prototype, "format", {
  14550. get: function () {
  14551. if (!this.m_format) {
  14552. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14553. }
  14554. return this.m_format;
  14555. },
  14556. enumerable: true,
  14557. configurable: true
  14558. });
  14559. Object.defineProperty(ChartLegend.prototype, "overlay", {
  14560. get: function () {
  14561. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  14562. return this.m_overlay;
  14563. },
  14564. set: function (value) {
  14565. this.m_overlay=value;
  14566. _createSetPropertyAction(this.context, this, "Overlay", value);
  14567. },
  14568. enumerable: true,
  14569. configurable: true
  14570. });
  14571. Object.defineProperty(ChartLegend.prototype, "position", {
  14572. get: function () {
  14573. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  14574. return this.m_position;
  14575. },
  14576. set: function (value) {
  14577. this.m_position=value;
  14578. _createSetPropertyAction(this.context, this, "Position", value);
  14579. },
  14580. enumerable: true,
  14581. configurable: true
  14582. });
  14583. Object.defineProperty(ChartLegend.prototype, "visible", {
  14584. get: function () {
  14585. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  14586. return this.m_visible;
  14587. },
  14588. set: function (value) {
  14589. this.m_visible=value;
  14590. _createSetPropertyAction(this.context, this, "Visible", value);
  14591. },
  14592. enumerable: true,
  14593. configurable: true
  14594. });
  14595. ChartLegend.prototype._handleResult=function (value) {
  14596. _super.prototype._handleResult.call(this, value);
  14597. if (_isNullOrUndefined(value))
  14598. return;
  14599. var obj=value;
  14600. _fixObjectPathIfNecessary(this, obj);
  14601. if (!_isUndefined(obj["Overlay"])) {
  14602. this.m_overlay=obj["Overlay"];
  14603. }
  14604. if (!_isUndefined(obj["Position"])) {
  14605. this.m_position=obj["Position"];
  14606. }
  14607. if (!_isUndefined(obj["Visible"])) {
  14608. this.m_visible=obj["Visible"];
  14609. }
  14610. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14611. };
  14612. ChartLegend.prototype.load=function (option) {
  14613. _load(this, option);
  14614. return this;
  14615. };
  14616. ChartLegend.prototype.toJSON=function () {
  14617. return {
  14618. "format": this.m_format,
  14619. "overlay": this.m_overlay,
  14620. "position": this.m_position,
  14621. "visible": this.m_visible
  14622. };
  14623. };
  14624. return ChartLegend;
  14625. }(OfficeExtension.ClientObject));
  14626. Excel.ChartLegend=ChartLegend;
  14627. var ChartLegendFormat=(function (_super) {
  14628. __extends(ChartLegendFormat, _super);
  14629. function ChartLegendFormat() {
  14630. _super.apply(this, arguments);
  14631. }
  14632. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  14633. get: function () {
  14634. if (!this.m_fill) {
  14635. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14636. }
  14637. return this.m_fill;
  14638. },
  14639. enumerable: true,
  14640. configurable: true
  14641. });
  14642. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  14643. get: function () {
  14644. if (!this.m_font) {
  14645. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14646. }
  14647. return this.m_font;
  14648. },
  14649. enumerable: true,
  14650. configurable: true
  14651. });
  14652. ChartLegendFormat.prototype._handleResult=function (value) {
  14653. _super.prototype._handleResult.call(this, value);
  14654. if (_isNullOrUndefined(value))
  14655. return;
  14656. var obj=value;
  14657. _fixObjectPathIfNecessary(this, obj);
  14658. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14659. };
  14660. ChartLegendFormat.prototype.load=function (option) {
  14661. _load(this, option);
  14662. return this;
  14663. };
  14664. ChartLegendFormat.prototype.toJSON=function () {
  14665. return {
  14666. "fill": this.m_fill,
  14667. "font": this.m_font
  14668. };
  14669. };
  14670. return ChartLegendFormat;
  14671. }(OfficeExtension.ClientObject));
  14672. Excel.ChartLegendFormat=ChartLegendFormat;
  14673. var ChartTitle=(function (_super) {
  14674. __extends(ChartTitle, _super);
  14675. function ChartTitle() {
  14676. _super.apply(this, arguments);
  14677. }
  14678. Object.defineProperty(ChartTitle.prototype, "format", {
  14679. get: function () {
  14680. if (!this.m_format) {
  14681. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  14682. }
  14683. return this.m_format;
  14684. },
  14685. enumerable: true,
  14686. configurable: true
  14687. });
  14688. Object.defineProperty(ChartTitle.prototype, "overlay", {
  14689. get: function () {
  14690. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  14691. return this.m_overlay;
  14692. },
  14693. set: function (value) {
  14694. this.m_overlay=value;
  14695. _createSetPropertyAction(this.context, this, "Overlay", value);
  14696. },
  14697. enumerable: true,
  14698. configurable: true
  14699. });
  14700. Object.defineProperty(ChartTitle.prototype, "text", {
  14701. get: function () {
  14702. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  14703. return this.m_text;
  14704. },
  14705. set: function (value) {
  14706. this.m_text=value;
  14707. _createSetPropertyAction(this.context, this, "Text", value);
  14708. },
  14709. enumerable: true,
  14710. configurable: true
  14711. });
  14712. Object.defineProperty(ChartTitle.prototype, "visible", {
  14713. get: function () {
  14714. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  14715. return this.m_visible;
  14716. },
  14717. set: function (value) {
  14718. this.m_visible=value;
  14719. _createSetPropertyAction(this.context, this, "Visible", value);
  14720. },
  14721. enumerable: true,
  14722. configurable: true
  14723. });
  14724. ChartTitle.prototype._handleResult=function (value) {
  14725. _super.prototype._handleResult.call(this, value);
  14726. if (_isNullOrUndefined(value))
  14727. return;
  14728. var obj=value;
  14729. _fixObjectPathIfNecessary(this, obj);
  14730. if (!_isUndefined(obj["Overlay"])) {
  14731. this.m_overlay=obj["Overlay"];
  14732. }
  14733. if (!_isUndefined(obj["Text"])) {
  14734. this.m_text=obj["Text"];
  14735. }
  14736. if (!_isUndefined(obj["Visible"])) {
  14737. this.m_visible=obj["Visible"];
  14738. }
  14739. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  14740. };
  14741. ChartTitle.prototype.load=function (option) {
  14742. _load(this, option);
  14743. return this;
  14744. };
  14745. ChartTitle.prototype.toJSON=function () {
  14746. return {
  14747. "format": this.m_format,
  14748. "overlay": this.m_overlay,
  14749. "text": this.m_text,
  14750. "visible": this.m_visible
  14751. };
  14752. };
  14753. return ChartTitle;
  14754. }(OfficeExtension.ClientObject));
  14755. Excel.ChartTitle=ChartTitle;
  14756. var ChartTitleFormat=(function (_super) {
  14757. __extends(ChartTitleFormat, _super);
  14758. function ChartTitleFormat() {
  14759. _super.apply(this, arguments);
  14760. }
  14761. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  14762. get: function () {
  14763. if (!this.m_fill) {
  14764. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14765. }
  14766. return this.m_fill;
  14767. },
  14768. enumerable: true,
  14769. configurable: true
  14770. });
  14771. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  14772. get: function () {
  14773. if (!this.m_font) {
  14774. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14775. }
  14776. return this.m_font;
  14777. },
  14778. enumerable: true,
  14779. configurable: true
  14780. });
  14781. ChartTitleFormat.prototype._handleResult=function (value) {
  14782. _super.prototype._handleResult.call(this, value);
  14783. if (_isNullOrUndefined(value))
  14784. return;
  14785. var obj=value;
  14786. _fixObjectPathIfNecessary(this, obj);
  14787. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  14788. };
  14789. ChartTitleFormat.prototype.load=function (option) {
  14790. _load(this, option);
  14791. return this;
  14792. };
  14793. ChartTitleFormat.prototype.toJSON=function () {
  14794. return {
  14795. "fill": this.m_fill,
  14796. "font": this.m_font
  14797. };
  14798. };
  14799. return ChartTitleFormat;
  14800. }(OfficeExtension.ClientObject));
  14801. Excel.ChartTitleFormat=ChartTitleFormat;
  14802. var ChartFill=(function (_super) {
  14803. __extends(ChartFill, _super);
  14804. function ChartFill() {
  14805. _super.apply(this, arguments);
  14806. }
  14807. ChartFill.prototype.load=function (option) {
  14808. _load(this, option);
  14809. return this;
  14810. };
  14811. ChartFill.prototype.clear=function () {
  14812. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14813. };
  14814. ChartFill.prototype.setSolidColor=function (color) {
  14815. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  14816. };
  14817. ChartFill.prototype._handleResult=function (value) {
  14818. _super.prototype._handleResult.call(this, value);
  14819. if (_isNullOrUndefined(value))
  14820. return;
  14821. var obj=value;
  14822. _fixObjectPathIfNecessary(this, obj);
  14823. };
  14824. ChartFill.prototype.toJSON=function () {
  14825. return {};
  14826. };
  14827. return ChartFill;
  14828. }(OfficeExtension.ClientObject));
  14829. Excel.ChartFill=ChartFill;
  14830. var ChartLineFormat=(function (_super) {
  14831. __extends(ChartLineFormat, _super);
  14832. function ChartLineFormat() {
  14833. _super.apply(this, arguments);
  14834. }
  14835. Object.defineProperty(ChartLineFormat.prototype, "color", {
  14836. get: function () {
  14837. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  14838. return this.m_color;
  14839. },
  14840. set: function (value) {
  14841. this.m_color=value;
  14842. _createSetPropertyAction(this.context, this, "Color", value);
  14843. },
  14844. enumerable: true,
  14845. configurable: true
  14846. });
  14847. ChartLineFormat.prototype.clear=function () {
  14848. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14849. };
  14850. ChartLineFormat.prototype._handleResult=function (value) {
  14851. _super.prototype._handleResult.call(this, value);
  14852. if (_isNullOrUndefined(value))
  14853. return;
  14854. var obj=value;
  14855. _fixObjectPathIfNecessary(this, obj);
  14856. if (!_isUndefined(obj["Color"])) {
  14857. this.m_color=obj["Color"];
  14858. }
  14859. };
  14860. ChartLineFormat.prototype.load=function (option) {
  14861. _load(this, option);
  14862. return this;
  14863. };
  14864. ChartLineFormat.prototype.toJSON=function () {
  14865. return {
  14866. "color": this.m_color
  14867. };
  14868. };
  14869. return ChartLineFormat;
  14870. }(OfficeExtension.ClientObject));
  14871. Excel.ChartLineFormat=ChartLineFormat;
  14872. var ChartFont=(function (_super) {
  14873. __extends(ChartFont, _super);
  14874. function ChartFont() {
  14875. _super.apply(this, arguments);
  14876. }
  14877. Object.defineProperty(ChartFont.prototype, "bold", {
  14878. get: function () {
  14879. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  14880. return this.m_bold;
  14881. },
  14882. set: function (value) {
  14883. this.m_bold=value;
  14884. _createSetPropertyAction(this.context, this, "Bold", value);
  14885. },
  14886. enumerable: true,
  14887. configurable: true
  14888. });
  14889. Object.defineProperty(ChartFont.prototype, "color", {
  14890. get: function () {
  14891. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  14892. return this.m_color;
  14893. },
  14894. set: function (value) {
  14895. this.m_color=value;
  14896. _createSetPropertyAction(this.context, this, "Color", value);
  14897. },
  14898. enumerable: true,
  14899. configurable: true
  14900. });
  14901. Object.defineProperty(ChartFont.prototype, "italic", {
  14902. get: function () {
  14903. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  14904. return this.m_italic;
  14905. },
  14906. set: function (value) {
  14907. this.m_italic=value;
  14908. _createSetPropertyAction(this.context, this, "Italic", value);
  14909. },
  14910. enumerable: true,
  14911. configurable: true
  14912. });
  14913. Object.defineProperty(ChartFont.prototype, "name", {
  14914. get: function () {
  14915. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  14916. return this.m_name;
  14917. },
  14918. set: function (value) {
  14919. this.m_name=value;
  14920. _createSetPropertyAction(this.context, this, "Name", value);
  14921. },
  14922. enumerable: true,
  14923. configurable: true
  14924. });
  14925. Object.defineProperty(ChartFont.prototype, "size", {
  14926. get: function () {
  14927. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  14928. return this.m_size;
  14929. },
  14930. set: function (value) {
  14931. this.m_size=value;
  14932. _createSetPropertyAction(this.context, this, "Size", value);
  14933. },
  14934. enumerable: true,
  14935. configurable: true
  14936. });
  14937. Object.defineProperty(ChartFont.prototype, "underline", {
  14938. get: function () {
  14939. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  14940. return this.m_underline;
  14941. },
  14942. set: function (value) {
  14943. this.m_underline=value;
  14944. _createSetPropertyAction(this.context, this, "Underline", value);
  14945. },
  14946. enumerable: true,
  14947. configurable: true
  14948. });
  14949. ChartFont.prototype._handleResult=function (value) {
  14950. _super.prototype._handleResult.call(this, value);
  14951. if (_isNullOrUndefined(value))
  14952. return;
  14953. var obj=value;
  14954. _fixObjectPathIfNecessary(this, obj);
  14955. if (!_isUndefined(obj["Bold"])) {
  14956. this.m_bold=obj["Bold"];
  14957. }
  14958. if (!_isUndefined(obj["Color"])) {
  14959. this.m_color=obj["Color"];
  14960. }
  14961. if (!_isUndefined(obj["Italic"])) {
  14962. this.m_italic=obj["Italic"];
  14963. }
  14964. if (!_isUndefined(obj["Name"])) {
  14965. this.m_name=obj["Name"];
  14966. }
  14967. if (!_isUndefined(obj["Size"])) {
  14968. this.m_size=obj["Size"];
  14969. }
  14970. if (!_isUndefined(obj["Underline"])) {
  14971. this.m_underline=obj["Underline"];
  14972. }
  14973. };
  14974. ChartFont.prototype.load=function (option) {
  14975. _load(this, option);
  14976. return this;
  14977. };
  14978. ChartFont.prototype.toJSON=function () {
  14979. return {
  14980. "bold": this.m_bold,
  14981. "color": this.m_color,
  14982. "italic": this.m_italic,
  14983. "name": this.m_name,
  14984. "size": this.m_size,
  14985. "underline": this.m_underline
  14986. };
  14987. };
  14988. return ChartFont;
  14989. }(OfficeExtension.ClientObject));
  14990. Excel.ChartFont=ChartFont;
  14991. var RangeSort=(function (_super) {
  14992. __extends(RangeSort, _super);
  14993. function RangeSort() {
  14994. _super.apply(this, arguments);
  14995. }
  14996. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  14997. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  14998. };
  14999. RangeSort.prototype._handleResult=function (value) {
  15000. _super.prototype._handleResult.call(this, value);
  15001. if (_isNullOrUndefined(value))
  15002. return;
  15003. var obj=value;
  15004. _fixObjectPathIfNecessary(this, obj);
  15005. };
  15006. RangeSort.prototype.toJSON=function () {
  15007. return {};
  15008. };
  15009. return RangeSort;
  15010. }(OfficeExtension.ClientObject));
  15011. Excel.RangeSort=RangeSort;
  15012. var TableSort=(function (_super) {
  15013. __extends(TableSort, _super);
  15014. function TableSort() {
  15015. _super.apply(this, arguments);
  15016. }
  15017. Object.defineProperty(TableSort.prototype, "fields", {
  15018. get: function () {
  15019. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  15020. return this.m_fields;
  15021. },
  15022. enumerable: true,
  15023. configurable: true
  15024. });
  15025. Object.defineProperty(TableSort.prototype, "matchCase", {
  15026. get: function () {
  15027. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  15028. return this.m_matchCase;
  15029. },
  15030. enumerable: true,
  15031. configurable: true
  15032. });
  15033. Object.defineProperty(TableSort.prototype, "method", {
  15034. get: function () {
  15035. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  15036. return this.m_method;
  15037. },
  15038. enumerable: true,
  15039. configurable: true
  15040. });
  15041. TableSort.prototype.apply=function (fields, matchCase, method) {
  15042. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  15043. };
  15044. TableSort.prototype.clear=function () {
  15045. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15046. };
  15047. TableSort.prototype.reapply=function () {
  15048. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  15049. };
  15050. TableSort.prototype._handleResult=function (value) {
  15051. _super.prototype._handleResult.call(this, value);
  15052. if (_isNullOrUndefined(value))
  15053. return;
  15054. var obj=value;
  15055. _fixObjectPathIfNecessary(this, obj);
  15056. if (!_isUndefined(obj["Fields"])) {
  15057. this.m_fields=obj["Fields"];
  15058. }
  15059. if (!_isUndefined(obj["MatchCase"])) {
  15060. this.m_matchCase=obj["MatchCase"];
  15061. }
  15062. if (!_isUndefined(obj["Method"])) {
  15063. this.m_method=obj["Method"];
  15064. }
  15065. };
  15066. TableSort.prototype.load=function (option) {
  15067. _load(this, option);
  15068. return this;
  15069. };
  15070. TableSort.prototype.toJSON=function () {
  15071. return {
  15072. "fields": this.m_fields,
  15073. "matchCase": this.m_matchCase,
  15074. "method": this.m_method
  15075. };
  15076. };
  15077. return TableSort;
  15078. }(OfficeExtension.ClientObject));
  15079. Excel.TableSort=TableSort;
  15080. var Filter=(function (_super) {
  15081. __extends(Filter, _super);
  15082. function Filter() {
  15083. _super.apply(this, arguments);
  15084. }
  15085. Object.defineProperty(Filter.prototype, "criteria", {
  15086. get: function () {
  15087. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  15088. return this.m_criteria;
  15089. },
  15090. enumerable: true,
  15091. configurable: true
  15092. });
  15093. Filter.prototype.apply=function (criteria) {
  15094. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  15095. };
  15096. Filter.prototype.applyBottomItemsFilter=function (count) {
  15097. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15098. };
  15099. Filter.prototype.applyBottomPercentFilter=function (percent) {
  15100. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15101. };
  15102. Filter.prototype.applyCellColorFilter=function (color) {
  15103. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  15104. };
  15105. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  15106. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  15107. };
  15108. Filter.prototype.applyDynamicFilter=function (criteria) {
  15109. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  15110. };
  15111. Filter.prototype.applyFontColorFilter=function (color) {
  15112. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  15113. };
  15114. Filter.prototype.applyIconFilter=function (icon) {
  15115. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  15116. };
  15117. Filter.prototype.applyTopItemsFilter=function (count) {
  15118. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  15119. };
  15120. Filter.prototype.applyTopPercentFilter=function (percent) {
  15121. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  15122. };
  15123. Filter.prototype.applyValuesFilter=function (values) {
  15124. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  15125. };
  15126. Filter.prototype.clear=function () {
  15127. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  15128. };
  15129. Filter.prototype._handleResult=function (value) {
  15130. _super.prototype._handleResult.call(this, value);
  15131. if (_isNullOrUndefined(value))
  15132. return;
  15133. var obj=value;
  15134. _fixObjectPathIfNecessary(this, obj);
  15135. if (!_isUndefined(obj["Criteria"])) {
  15136. this.m_criteria=obj["Criteria"];
  15137. }
  15138. };
  15139. Filter.prototype.load=function (option) {
  15140. _load(this, option);
  15141. return this;
  15142. };
  15143. Filter.prototype.toJSON=function () {
  15144. return {
  15145. "criteria": this.m_criteria
  15146. };
  15147. };
  15148. return Filter;
  15149. }(OfficeExtension.ClientObject));
  15150. Excel.Filter=Filter;
  15151. var _V1Api=(function (_super) {
  15152. __extends(_V1Api, _super);
  15153. function _V1Api() {
  15154. _super.apply(this, arguments);
  15155. }
  15156. _V1Api.prototype.bindingAddColumns=function (input) {
  15157. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  15158. var ret=new OfficeExtension.ClientResult();
  15159. _addActionResultHandler(this, action, ret);
  15160. return ret;
  15161. };
  15162. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  15163. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  15164. var ret=new OfficeExtension.ClientResult();
  15165. _addActionResultHandler(this, action, ret);
  15166. return ret;
  15167. };
  15168. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  15169. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  15170. var ret=new OfficeExtension.ClientResult();
  15171. _addActionResultHandler(this, action, ret);
  15172. return ret;
  15173. };
  15174. _V1Api.prototype.bindingAddFromSelection=function (input) {
  15175. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  15176. var ret=new OfficeExtension.ClientResult();
  15177. _addActionResultHandler(this, action, ret);
  15178. return ret;
  15179. };
  15180. _V1Api.prototype.bindingAddRows=function (input) {
  15181. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  15182. var ret=new OfficeExtension.ClientResult();
  15183. _addActionResultHandler(this, action, ret);
  15184. return ret;
  15185. };
  15186. _V1Api.prototype.bindingClearFormats=function (input) {
  15187. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  15188. var ret=new OfficeExtension.ClientResult();
  15189. _addActionResultHandler(this, action, ret);
  15190. return ret;
  15191. };
  15192. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  15193. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  15194. var ret=new OfficeExtension.ClientResult();
  15195. _addActionResultHandler(this, action, ret);
  15196. return ret;
  15197. };
  15198. _V1Api.prototype.bindingGetAll=function () {
  15199. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  15200. var ret=new OfficeExtension.ClientResult();
  15201. _addActionResultHandler(this, action, ret);
  15202. return ret;
  15203. };
  15204. _V1Api.prototype.bindingGetById=function (input) {
  15205. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  15206. var ret=new OfficeExtension.ClientResult();
  15207. _addActionResultHandler(this, action, ret);
  15208. return ret;
  15209. };
  15210. _V1Api.prototype.bindingGetData=function (input) {
  15211. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  15212. var ret=new OfficeExtension.ClientResult();
  15213. _addActionResultHandler(this, action, ret);
  15214. return ret;
  15215. };
  15216. _V1Api.prototype.bindingReleaseById=function (input) {
  15217. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  15218. var ret=new OfficeExtension.ClientResult();
  15219. _addActionResultHandler(this, action, ret);
  15220. return ret;
  15221. };
  15222. _V1Api.prototype.bindingSetData=function (input) {
  15223. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  15224. var ret=new OfficeExtension.ClientResult();
  15225. _addActionResultHandler(this, action, ret);
  15226. return ret;
  15227. };
  15228. _V1Api.prototype.bindingSetFormats=function (input) {
  15229. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  15230. var ret=new OfficeExtension.ClientResult();
  15231. _addActionResultHandler(this, action, ret);
  15232. return ret;
  15233. };
  15234. _V1Api.prototype.bindingSetTableOptions=function (input) {
  15235. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  15236. var ret=new OfficeExtension.ClientResult();
  15237. _addActionResultHandler(this, action, ret);
  15238. return ret;
  15239. };
  15240. _V1Api.prototype.getSelectedData=function (input) {
  15241. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  15242. var ret=new OfficeExtension.ClientResult();
  15243. _addActionResultHandler(this, action, ret);
  15244. return ret;
  15245. };
  15246. _V1Api.prototype.gotoById=function (input) {
  15247. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  15248. var ret=new OfficeExtension.ClientResult();
  15249. _addActionResultHandler(this, action, ret);
  15250. return ret;
  15251. };
  15252. _V1Api.prototype.setSelectedData=function (input) {
  15253. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  15254. var ret=new OfficeExtension.ClientResult();
  15255. _addActionResultHandler(this, action, ret);
  15256. return ret;
  15257. };
  15258. _V1Api.prototype._handleResult=function (value) {
  15259. _super.prototype._handleResult.call(this, value);
  15260. if (_isNullOrUndefined(value))
  15261. return;
  15262. var obj=value;
  15263. _fixObjectPathIfNecessary(this, obj);
  15264. };
  15265. _V1Api.prototype.toJSON=function () {
  15266. return {};
  15267. };
  15268. return _V1Api;
  15269. }(OfficeExtension.ClientObject));
  15270. Excel._V1Api=_V1Api;
  15271. var PivotTableCollection=(function (_super) {
  15272. __extends(PivotTableCollection, _super);
  15273. function PivotTableCollection() {
  15274. _super.apply(this, arguments);
  15275. }
  15276. Object.defineProperty(PivotTableCollection.prototype, "items", {
  15277. get: function () {
  15278. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  15279. return this.m__items;
  15280. },
  15281. enumerable: true,
  15282. configurable: true
  15283. });
  15284. PivotTableCollection.prototype.getItem=function (name) {
  15285. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  15286. };
  15287. PivotTableCollection.prototype.refreshAll=function () {
  15288. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  15289. };
  15290. PivotTableCollection.prototype._handleResult=function (value) {
  15291. _super.prototype._handleResult.call(this, value);
  15292. if (_isNullOrUndefined(value))
  15293. return;
  15294. var obj=value;
  15295. _fixObjectPathIfNecessary(this, obj);
  15296. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15297. this.m__items=[];
  15298. var _data=obj[OfficeExtension.Constants.items];
  15299. for (var i=0; i < _data.length; i++) {
  15300. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15301. _item._handleResult(_data[i]);
  15302. this.m__items.push(_item);
  15303. }
  15304. }
  15305. };
  15306. PivotTableCollection.prototype.load=function (option) {
  15307. _load(this, option);
  15308. return this;
  15309. };
  15310. PivotTableCollection.prototype.toJSON=function () {
  15311. return {};
  15312. };
  15313. return PivotTableCollection;
  15314. }(OfficeExtension.ClientObject));
  15315. Excel.PivotTableCollection=PivotTableCollection;
  15316. var PivotTable=(function (_super) {
  15317. __extends(PivotTable, _super);
  15318. function PivotTable() {
  15319. _super.apply(this, arguments);
  15320. }
  15321. Object.defineProperty(PivotTable.prototype, "worksheet", {
  15322. get: function () {
  15323. if (!this.m_worksheet) {
  15324. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15325. }
  15326. return this.m_worksheet;
  15327. },
  15328. enumerable: true,
  15329. configurable: true
  15330. });
  15331. Object.defineProperty(PivotTable.prototype, "name", {
  15332. get: function () {
  15333. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  15334. return this.m_name;
  15335. },
  15336. set: function (value) {
  15337. this.m_name=value;
  15338. _createSetPropertyAction(this.context, this, "Name", value);
  15339. },
  15340. enumerable: true,
  15341. configurable: true
  15342. });
  15343. PivotTable.prototype.refresh=function () {
  15344. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  15345. };
  15346. PivotTable.prototype._handleResult=function (value) {
  15347. _super.prototype._handleResult.call(this, value);
  15348. if (_isNullOrUndefined(value))
  15349. return;
  15350. var obj=value;
  15351. _fixObjectPathIfNecessary(this, obj);
  15352. if (!_isUndefined(obj["Name"])) {
  15353. this.m_name=obj["Name"];
  15354. }
  15355. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  15356. };
  15357. PivotTable.prototype.load=function (option) {
  15358. _load(this, option);
  15359. return this;
  15360. };
  15361. PivotTable.prototype.toJSON=function () {
  15362. return {
  15363. "name": this.m_name
  15364. };
  15365. };
  15366. return PivotTable;
  15367. }(OfficeExtension.ClientObject));
  15368. Excel.PivotTable=PivotTable;
  15369. var BindingType;
  15370. (function (BindingType) {
  15371. BindingType.range="Range";
  15372. BindingType.table="Table";
  15373. BindingType.text="Text";
  15374. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  15375. var BorderIndex;
  15376. (function (BorderIndex) {
  15377. BorderIndex.edgeTop="EdgeTop";
  15378. BorderIndex.edgeBottom="EdgeBottom";
  15379. BorderIndex.edgeLeft="EdgeLeft";
  15380. BorderIndex.edgeRight="EdgeRight";
  15381. BorderIndex.insideVertical="InsideVertical";
  15382. BorderIndex.insideHorizontal="InsideHorizontal";
  15383. BorderIndex.diagonalDown="DiagonalDown";
  15384. BorderIndex.diagonalUp="DiagonalUp";
  15385. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  15386. var BorderLineStyle;
  15387. (function (BorderLineStyle) {
  15388. BorderLineStyle.none="None";
  15389. BorderLineStyle.continuous="Continuous";
  15390. BorderLineStyle.dash="Dash";
  15391. BorderLineStyle.dashDot="DashDot";
  15392. BorderLineStyle.dashDotDot="DashDotDot";
  15393. BorderLineStyle.dot="Dot";
  15394. BorderLineStyle.double="Double";
  15395. BorderLineStyle.slantDashDot="SlantDashDot";
  15396. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  15397. var BorderWeight;
  15398. (function (BorderWeight) {
  15399. BorderWeight.hairline="Hairline";
  15400. BorderWeight.thin="Thin";
  15401. BorderWeight.medium="Medium";
  15402. BorderWeight.thick="Thick";
  15403. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  15404. var CalculationMode;
  15405. (function (CalculationMode) {
  15406. CalculationMode.automatic="Automatic";
  15407. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  15408. CalculationMode.manual="Manual";
  15409. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  15410. var CalculationType;
  15411. (function (CalculationType) {
  15412. CalculationType.recalculate="Recalculate";
  15413. CalculationType.full="Full";
  15414. CalculationType.fullRebuild="FullRebuild";
  15415. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  15416. var ClearApplyTo;
  15417. (function (ClearApplyTo) {
  15418. ClearApplyTo.all="All";
  15419. ClearApplyTo.formats="Formats";
  15420. ClearApplyTo.contents="Contents";
  15421. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  15422. var ChartDataLabelPosition;
  15423. (function (ChartDataLabelPosition) {
  15424. ChartDataLabelPosition.invalid="Invalid";
  15425. ChartDataLabelPosition.none="None";
  15426. ChartDataLabelPosition.center="Center";
  15427. ChartDataLabelPosition.insideEnd="InsideEnd";
  15428. ChartDataLabelPosition.insideBase="InsideBase";
  15429. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  15430. ChartDataLabelPosition.left="Left";
  15431. ChartDataLabelPosition.right="Right";
  15432. ChartDataLabelPosition.top="Top";
  15433. ChartDataLabelPosition.bottom="Bottom";
  15434. ChartDataLabelPosition.bestFit="BestFit";
  15435. ChartDataLabelPosition.callout="Callout";
  15436. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  15437. var ChartLegendPosition;
  15438. (function (ChartLegendPosition) {
  15439. ChartLegendPosition.invalid="Invalid";
  15440. ChartLegendPosition.top="Top";
  15441. ChartLegendPosition.bottom="Bottom";
  15442. ChartLegendPosition.left="Left";
  15443. ChartLegendPosition.right="Right";
  15444. ChartLegendPosition.corner="Corner";
  15445. ChartLegendPosition.custom="Custom";
  15446. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  15447. var ChartSeriesBy;
  15448. (function (ChartSeriesBy) {
  15449. ChartSeriesBy.auto="Auto";
  15450. ChartSeriesBy.columns="Columns";
  15451. ChartSeriesBy.rows="Rows";
  15452. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  15453. var ChartType;
  15454. (function (ChartType) {
  15455. ChartType.invalid="Invalid";
  15456. ChartType.columnClustered="ColumnClustered";
  15457. ChartType.columnStacked="ColumnStacked";
  15458. ChartType.columnStacked100="ColumnStacked100";
  15459. ChartType._3DColumnClustered="3DColumnClustered";
  15460. ChartType._3DColumnStacked="3DColumnStacked";
  15461. ChartType._3DColumnStacked100="3DColumnStacked100";
  15462. ChartType.barClustered="BarClustered";
  15463. ChartType.barStacked="BarStacked";
  15464. ChartType.barStacked100="BarStacked100";
  15465. ChartType._3DBarClustered="3DBarClustered";
  15466. ChartType._3DBarStacked="3DBarStacked";
  15467. ChartType._3DBarStacked100="3DBarStacked100";
  15468. ChartType.lineStacked="LineStacked";
  15469. ChartType.lineStacked100="LineStacked100";
  15470. ChartType.lineMarkers="LineMarkers";
  15471. ChartType.lineMarkersStacked="LineMarkersStacked";
  15472. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  15473. ChartType.pieOfPie="PieOfPie";
  15474. ChartType.pieExploded="PieExploded";
  15475. ChartType._3DPieExploded="3DPieExploded";
  15476. ChartType.barOfPie="BarOfPie";
  15477. ChartType.xyscatterSmooth="XYScatterSmooth";
  15478. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  15479. ChartType.xyscatterLines="XYScatterLines";
  15480. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  15481. ChartType.areaStacked="AreaStacked";
  15482. ChartType.areaStacked100="AreaStacked100";
  15483. ChartType._3DAreaStacked="3DAreaStacked";
  15484. ChartType._3DAreaStacked100="3DAreaStacked100";
  15485. ChartType.doughnutExploded="DoughnutExploded";
  15486. ChartType.radarMarkers="RadarMarkers";
  15487. ChartType.radarFilled="RadarFilled";
  15488. ChartType.surface="Surface";
  15489. ChartType.surfaceWireframe="SurfaceWireframe";
  15490. ChartType.surfaceTopView="SurfaceTopView";
  15491. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  15492. ChartType.bubble="Bubble";
  15493. ChartType.bubble3DEffect="Bubble3DEffect";
  15494. ChartType.stockHLC="StockHLC";
  15495. ChartType.stockOHLC="StockOHLC";
  15496. ChartType.stockVHLC="StockVHLC";
  15497. ChartType.stockVOHLC="StockVOHLC";
  15498. ChartType.cylinderColClustered="CylinderColClustered";
  15499. ChartType.cylinderColStacked="CylinderColStacked";
  15500. ChartType.cylinderColStacked100="CylinderColStacked100";
  15501. ChartType.cylinderBarClustered="CylinderBarClustered";
  15502. ChartType.cylinderBarStacked="CylinderBarStacked";
  15503. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  15504. ChartType.cylinderCol="CylinderCol";
  15505. ChartType.coneColClustered="ConeColClustered";
  15506. ChartType.coneColStacked="ConeColStacked";
  15507. ChartType.coneColStacked100="ConeColStacked100";
  15508. ChartType.coneBarClustered="ConeBarClustered";
  15509. ChartType.coneBarStacked="ConeBarStacked";
  15510. ChartType.coneBarStacked100="ConeBarStacked100";
  15511. ChartType.coneCol="ConeCol";
  15512. ChartType.pyramidColClustered="PyramidColClustered";
  15513. ChartType.pyramidColStacked="PyramidColStacked";
  15514. ChartType.pyramidColStacked100="PyramidColStacked100";
  15515. ChartType.pyramidBarClustered="PyramidBarClustered";
  15516. ChartType.pyramidBarStacked="PyramidBarStacked";
  15517. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  15518. ChartType.pyramidCol="PyramidCol";
  15519. ChartType._3DColumn="3DColumn";
  15520. ChartType.line="Line";
  15521. ChartType._3DLine="3DLine";
  15522. ChartType._3DPie="3DPie";
  15523. ChartType.pie="Pie";
  15524. ChartType.xyscatter="XYScatter";
  15525. ChartType._3DArea="3DArea";
  15526. ChartType.area="Area";
  15527. ChartType.doughnut="Doughnut";
  15528. ChartType.radar="Radar";
  15529. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  15530. var ChartUnderlineStyle;
  15531. (function (ChartUnderlineStyle) {
  15532. ChartUnderlineStyle.none="None";
  15533. ChartUnderlineStyle.single="Single";
  15534. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  15535. var DeleteShiftDirection;
  15536. (function (DeleteShiftDirection) {
  15537. DeleteShiftDirection.up="Up";
  15538. DeleteShiftDirection.left="Left";
  15539. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  15540. var DynamicFilterCriteria;
  15541. (function (DynamicFilterCriteria) {
  15542. DynamicFilterCriteria.unknown="Unknown";
  15543. DynamicFilterCriteria.aboveAverage="AboveAverage";
  15544. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  15545. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  15546. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  15547. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  15548. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  15549. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  15550. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  15551. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  15552. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  15553. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  15554. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  15555. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  15556. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  15557. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  15558. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  15559. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  15560. DynamicFilterCriteria.belowAverage="BelowAverage";
  15561. DynamicFilterCriteria.lastMonth="LastMonth";
  15562. DynamicFilterCriteria.lastQuarter="LastQuarter";
  15563. DynamicFilterCriteria.lastWeek="LastWeek";
  15564. DynamicFilterCriteria.lastYear="LastYear";
  15565. DynamicFilterCriteria.nextMonth="NextMonth";
  15566. DynamicFilterCriteria.nextQuarter="NextQuarter";
  15567. DynamicFilterCriteria.nextWeek="NextWeek";
  15568. DynamicFilterCriteria.nextYear="NextYear";
  15569. DynamicFilterCriteria.thisMonth="ThisMonth";
  15570. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  15571. DynamicFilterCriteria.thisWeek="ThisWeek";
  15572. DynamicFilterCriteria.thisYear="ThisYear";
  15573. DynamicFilterCriteria.today="Today";
  15574. DynamicFilterCriteria.tomorrow="Tomorrow";
  15575. DynamicFilterCriteria.yearToDate="YearToDate";
  15576. DynamicFilterCriteria.yesterday="Yesterday";
  15577. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  15578. var FilterDatetimeSpecificity;
  15579. (function (FilterDatetimeSpecificity) {
  15580. FilterDatetimeSpecificity.year="Year";
  15581. FilterDatetimeSpecificity.month="Month";
  15582. FilterDatetimeSpecificity.day="Day";
  15583. FilterDatetimeSpecificity.hour="Hour";
  15584. FilterDatetimeSpecificity.minute="Minute";
  15585. FilterDatetimeSpecificity.second="Second";
  15586. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  15587. var FilterOn;
  15588. (function (FilterOn) {
  15589. FilterOn.bottomItems="BottomItems";
  15590. FilterOn.bottomPercent="BottomPercent";
  15591. FilterOn.cellColor="CellColor";
  15592. FilterOn.dynamic="Dynamic";
  15593. FilterOn.fontColor="FontColor";
  15594. FilterOn.values="Values";
  15595. FilterOn.topItems="TopItems";
  15596. FilterOn.topPercent="TopPercent";
  15597. FilterOn.icon="Icon";
  15598. FilterOn.custom="Custom";
  15599. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  15600. var FilterOperator;
  15601. (function (FilterOperator) {
  15602. FilterOperator.and="And";
  15603. FilterOperator.or="Or";
  15604. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  15605. var HorizontalAlignment;
  15606. (function (HorizontalAlignment) {
  15607. HorizontalAlignment.general="General";
  15608. HorizontalAlignment.left="Left";
  15609. HorizontalAlignment.center="Center";
  15610. HorizontalAlignment.right="Right";
  15611. HorizontalAlignment.fill="Fill";
  15612. HorizontalAlignment.justify="Justify";
  15613. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  15614. HorizontalAlignment.distributed="Distributed";
  15615. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  15616. var IconSet;
  15617. (function (IconSet) {
  15618. IconSet.invalid="Invalid";
  15619. IconSet.threeArrows="ThreeArrows";
  15620. IconSet.threeArrowsGray="ThreeArrowsGray";
  15621. IconSet.threeFlags="ThreeFlags";
  15622. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  15623. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  15624. IconSet.threeSigns="ThreeSigns";
  15625. IconSet.threeSymbols="ThreeSymbols";
  15626. IconSet.threeSymbols2="ThreeSymbols2";
  15627. IconSet.fourArrows="FourArrows";
  15628. IconSet.fourArrowsGray="FourArrowsGray";
  15629. IconSet.fourRedToBlack="FourRedToBlack";
  15630. IconSet.fourRating="FourRating";
  15631. IconSet.fourTrafficLights="FourTrafficLights";
  15632. IconSet.fiveArrows="FiveArrows";
  15633. IconSet.fiveArrowsGray="FiveArrowsGray";
  15634. IconSet.fiveRating="FiveRating";
  15635. IconSet.fiveQuarters="FiveQuarters";
  15636. IconSet.threeStars="ThreeStars";
  15637. IconSet.threeTriangles="ThreeTriangles";
  15638. IconSet.fiveBoxes="FiveBoxes";
  15639. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  15640. var ImageFittingMode;
  15641. (function (ImageFittingMode) {
  15642. ImageFittingMode.fit="Fit";
  15643. ImageFittingMode.fitAndCenter="FitAndCenter";
  15644. ImageFittingMode.fill="Fill";
  15645. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  15646. var InsertShiftDirection;
  15647. (function (InsertShiftDirection) {
  15648. InsertShiftDirection.down="Down";
  15649. InsertShiftDirection.right="Right";
  15650. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  15651. var NamedItemType;
  15652. (function (NamedItemType) {
  15653. NamedItemType.string="String";
  15654. NamedItemType.integer="Integer";
  15655. NamedItemType.double="Double";
  15656. NamedItemType.boolean="Boolean";
  15657. NamedItemType.range="Range";
  15658. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  15659. var RangeUnderlineStyle;
  15660. (function (RangeUnderlineStyle) {
  15661. RangeUnderlineStyle.none="None";
  15662. RangeUnderlineStyle.single="Single";
  15663. RangeUnderlineStyle.double="Double";
  15664. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  15665. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  15666. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  15667. var SheetVisibility;
  15668. (function (SheetVisibility) {
  15669. SheetVisibility.visible="Visible";
  15670. SheetVisibility.hidden="Hidden";
  15671. SheetVisibility.veryHidden="VeryHidden";
  15672. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  15673. var RangeValueType;
  15674. (function (RangeValueType) {
  15675. RangeValueType.unknown="Unknown";
  15676. RangeValueType.empty="Empty";
  15677. RangeValueType.string="String";
  15678. RangeValueType.integer="Integer";
  15679. RangeValueType.double="Double";
  15680. RangeValueType.boolean="Boolean";
  15681. RangeValueType.error="Error";
  15682. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  15683. var SortOrientation;
  15684. (function (SortOrientation) {
  15685. SortOrientation.rows="Rows";
  15686. SortOrientation.columns="Columns";
  15687. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  15688. var SortOn;
  15689. (function (SortOn) {
  15690. SortOn.value="Value";
  15691. SortOn.cellColor="CellColor";
  15692. SortOn.fontColor="FontColor";
  15693. SortOn.icon="Icon";
  15694. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  15695. var SortDataOption;
  15696. (function (SortDataOption) {
  15697. SortDataOption.normal="Normal";
  15698. SortDataOption.textAsNumber="TextAsNumber";
  15699. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  15700. var SortMethod;
  15701. (function (SortMethod) {
  15702. SortMethod.pinYin="PinYin";
  15703. SortMethod.strokeCount="StrokeCount";
  15704. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  15705. var VerticalAlignment;
  15706. (function (VerticalAlignment) {
  15707. VerticalAlignment.top="Top";
  15708. VerticalAlignment.center="Center";
  15709. VerticalAlignment.bottom="Bottom";
  15710. VerticalAlignment.justify="Justify";
  15711. VerticalAlignment.distributed="Distributed";
  15712. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  15713. var FunctionResult=(function (_super) {
  15714. __extends(FunctionResult, _super);
  15715. function FunctionResult() {
  15716. _super.apply(this, arguments);
  15717. }
  15718. Object.defineProperty(FunctionResult.prototype, "error", {
  15719. get: function () {
  15720. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  15721. return this.m_error;
  15722. },
  15723. enumerable: true,
  15724. configurable: true
  15725. });
  15726. Object.defineProperty(FunctionResult.prototype, "value", {
  15727. get: function () {
  15728. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  15729. return this.m_value;
  15730. },
  15731. enumerable: true,
  15732. configurable: true
  15733. });
  15734. FunctionResult.prototype._handleResult=function (value) {
  15735. _super.prototype._handleResult.call(this, value);
  15736. if (_isNullOrUndefined(value))
  15737. return;
  15738. var obj=value;
  15739. _fixObjectPathIfNecessary(this, obj);
  15740. if (!_isUndefined(obj["Error"])) {
  15741. this.m_error=obj["Error"];
  15742. }
  15743. if (!_isUndefined(obj["Value"])) {
  15744. this.m_value=obj["Value"];
  15745. }
  15746. };
  15747. FunctionResult.prototype.load=function (option) {
  15748. _load(this, option);
  15749. return this;
  15750. };
  15751. FunctionResult.prototype.toJSON=function () {
  15752. return {
  15753. "error": this.m_error,
  15754. "value": this.m_value
  15755. };
  15756. };
  15757. return FunctionResult;
  15758. }(OfficeExtension.ClientObject));
  15759. Excel.FunctionResult=FunctionResult;
  15760. var Functions=(function (_super) {
  15761. __extends(Functions, _super);
  15762. function Functions() {
  15763. _super.apply(this, arguments);
  15764. }
  15765. Functions.prototype.abs=function (number) {
  15766. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  15767. };
  15768. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  15769. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  15770. };
  15771. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  15772. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  15773. };
  15774. Functions.prototype.acos=function (number) {
  15775. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15776. };
  15777. Functions.prototype.acosh=function (number) {
  15778. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15779. };
  15780. Functions.prototype.acot=function (number) {
  15781. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15782. };
  15783. Functions.prototype.acoth=function (number) {
  15784. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15785. };
  15786. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15787. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15788. };
  15789. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  15790. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  15791. };
  15792. Functions.prototype.and=function () {
  15793. var values=[];
  15794. for (var _i=0; _i < arguments.length; _i++) {
  15795. values[_i - 0]=arguments[_i];
  15796. }
  15797. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  15798. };
  15799. Functions.prototype.arabic=function (text) {
  15800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  15801. };
  15802. Functions.prototype.areas=function (reference) {
  15803. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  15804. };
  15805. Functions.prototype.asc=function (text) {
  15806. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  15807. };
  15808. Functions.prototype.asin=function (number) {
  15809. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  15810. };
  15811. Functions.prototype.asinh=function (number) {
  15812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15813. };
  15814. Functions.prototype.atan=function (number) {
  15815. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  15816. };
  15817. Functions.prototype.atan2=function (xNum, yNum) {
  15818. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  15819. };
  15820. Functions.prototype.atanh=function (number) {
  15821. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15822. };
  15823. Functions.prototype.aveDev=function () {
  15824. var values=[];
  15825. for (var _i=0; _i < arguments.length; _i++) {
  15826. values[_i - 0]=arguments[_i];
  15827. }
  15828. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  15829. };
  15830. Functions.prototype.average=function () {
  15831. var values=[];
  15832. for (var _i=0; _i < arguments.length; _i++) {
  15833. values[_i - 0]=arguments[_i];
  15834. }
  15835. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  15836. };
  15837. Functions.prototype.averageA=function () {
  15838. var values=[];
  15839. for (var _i=0; _i < arguments.length; _i++) {
  15840. values[_i - 0]=arguments[_i];
  15841. }
  15842. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15843. };
  15844. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  15845. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  15846. };
  15847. Functions.prototype.averageIfs=function (averageRange) {
  15848. var values=[];
  15849. for (var _i=1; _i < arguments.length; _i++) {
  15850. values[_i - 1]=arguments[_i];
  15851. }
  15852. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  15853. };
  15854. Functions.prototype.bahtText=function (number) {
  15855. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  15856. };
  15857. Functions.prototype.base=function (number, radix, minLength) {
  15858. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  15859. };
  15860. Functions.prototype.besselI=function (x, n) {
  15861. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15862. };
  15863. Functions.prototype.besselJ=function (x, n) {
  15864. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15865. };
  15866. Functions.prototype.besselK=function (x, n) {
  15867. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15868. };
  15869. Functions.prototype.besselY=function (x, n) {
  15870. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  15871. };
  15872. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  15873. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  15874. };
  15875. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  15876. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  15877. };
  15878. Functions.prototype.bin2Dec=function (number) {
  15879. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  15880. };
  15881. Functions.prototype.bin2Hex=function (number, places) {
  15882. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15883. };
  15884. Functions.prototype.bin2Oct=function (number, places) {
  15885. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  15886. };
  15887. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  15888. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  15889. };
  15890. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  15891. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  15892. };
  15893. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  15894. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  15895. };
  15896. Functions.prototype.bitand=function (number1, number2) {
  15897. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15898. };
  15899. Functions.prototype.bitlshift=function (number, shiftAmount) {
  15900. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15901. };
  15902. Functions.prototype.bitor=function (number1, number2) {
  15903. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15904. };
  15905. Functions.prototype.bitrshift=function (number, shiftAmount) {
  15906. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  15907. };
  15908. Functions.prototype.bitxor=function (number1, number2) {
  15909. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  15910. };
  15911. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  15912. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  15913. };
  15914. Functions.prototype.ceiling_Precise=function (number, significance) {
  15915. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  15916. };
  15917. Functions.prototype.char=function (number) {
  15918. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  15919. };
  15920. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  15921. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  15922. };
  15923. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  15924. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  15925. };
  15926. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  15927. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15928. };
  15929. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  15930. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  15931. };
  15932. Functions.prototype.choose=function (indexNum) {
  15933. var values=[];
  15934. for (var _i=1; _i < arguments.length; _i++) {
  15935. values[_i - 1]=arguments[_i];
  15936. }
  15937. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  15938. };
  15939. Functions.prototype.clean=function (text) {
  15940. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  15941. };
  15942. Functions.prototype.code=function (text) {
  15943. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  15944. };
  15945. Functions.prototype.columns=function (array) {
  15946. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  15947. };
  15948. Functions.prototype.combin=function (number, numberChosen) {
  15949. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15950. };
  15951. Functions.prototype.combina=function (number, numberChosen) {
  15952. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  15953. };
  15954. Functions.prototype.complex=function (realNum, iNum, suffix) {
  15955. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  15956. };
  15957. Functions.prototype.concatenate=function () {
  15958. var values=[];
  15959. for (var _i=0; _i < arguments.length; _i++) {
  15960. values[_i - 0]=arguments[_i];
  15961. }
  15962. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  15963. };
  15964. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  15965. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15966. };
  15967. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  15968. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  15969. };
  15970. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  15971. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  15972. };
  15973. Functions.prototype.cos=function (number) {
  15974. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  15975. };
  15976. Functions.prototype.cosh=function (number) {
  15977. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  15978. };
  15979. Functions.prototype.cot=function (number) {
  15980. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  15981. };
  15982. Functions.prototype.coth=function (number) {
  15983. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  15984. };
  15985. Functions.prototype.count=function () {
  15986. var values=[];
  15987. for (var _i=0; _i < arguments.length; _i++) {
  15988. values[_i - 0]=arguments[_i];
  15989. }
  15990. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  15991. };
  15992. Functions.prototype.countA=function () {
  15993. var values=[];
  15994. for (var _i=0; _i < arguments.length; _i++) {
  15995. values[_i - 0]=arguments[_i];
  15996. }
  15997. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  15998. };
  15999. Functions.prototype.countBlank=function (range) {
  16000. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  16001. };
  16002. Functions.prototype.countIf=function (range, criteria) {
  16003. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  16004. };
  16005. Functions.prototype.countIfs=function () {
  16006. var values=[];
  16007. for (var _i=0; _i < arguments.length; _i++) {
  16008. values[_i - 0]=arguments[_i];
  16009. }
  16010. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  16011. };
  16012. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  16013. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16014. };
  16015. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  16016. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16017. };
  16018. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  16019. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16020. };
  16021. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  16022. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16023. };
  16024. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  16025. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16026. };
  16027. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  16028. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  16029. };
  16030. Functions.prototype.csc=function (number) {
  16031. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  16032. };
  16033. Functions.prototype.csch=function (number) {
  16034. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  16035. };
  16036. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16037. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16038. };
  16039. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  16040. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  16041. };
  16042. Functions.prototype.daverage=function (database, field, criteria) {
  16043. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16044. };
  16045. Functions.prototype.dcount=function (database, field, criteria) {
  16046. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16047. };
  16048. Functions.prototype.dcountA=function (database, field, criteria) {
  16049. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16050. };
  16051. Functions.prototype.dget=function (database, field, criteria) {
  16052. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16053. };
  16054. Functions.prototype.dmax=function (database, field, criteria) {
  16055. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16056. };
  16057. Functions.prototype.dmin=function (database, field, criteria) {
  16058. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16059. };
  16060. Functions.prototype.dproduct=function (database, field, criteria) {
  16061. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16062. };
  16063. Functions.prototype.dstDev=function (database, field, criteria) {
  16064. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16065. };
  16066. Functions.prototype.dstDevP=function (database, field, criteria) {
  16067. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16068. };
  16069. Functions.prototype.dsum=function (database, field, criteria) {
  16070. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16071. };
  16072. Functions.prototype.dvar=function (database, field, criteria) {
  16073. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16074. };
  16075. Functions.prototype.dvarP=function (database, field, criteria) {
  16076. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  16077. };
  16078. Functions.prototype.date=function (year, month, day) {
  16079. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  16080. };
  16081. Functions.prototype.datevalue=function (dateText) {
  16082. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  16083. };
  16084. Functions.prototype.day=function (serialNumber) {
  16085. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16086. };
  16087. Functions.prototype.days=function (endDate, startDate) {
  16088. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  16089. };
  16090. Functions.prototype.days360=function (startDate, endDate, method) {
  16091. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  16092. };
  16093. Functions.prototype.db=function (cost, salvage, life, period, month) {
  16094. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  16095. };
  16096. Functions.prototype.dbcs=function (text) {
  16097. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  16098. };
  16099. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  16100. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  16101. };
  16102. Functions.prototype.dec2Bin=function (number, places) {
  16103. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16104. };
  16105. Functions.prototype.dec2Hex=function (number, places) {
  16106. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16107. };
  16108. Functions.prototype.dec2Oct=function (number, places) {
  16109. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16110. };
  16111. Functions.prototype.decimal=function (number, radix) {
  16112. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  16113. };
  16114. Functions.prototype.degrees=function (angle) {
  16115. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16116. };
  16117. Functions.prototype.delta=function (number1, number2) {
  16118. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  16119. };
  16120. Functions.prototype.devSq=function () {
  16121. var values=[];
  16122. for (var _i=0; _i < arguments.length; _i++) {
  16123. values[_i - 0]=arguments[_i];
  16124. }
  16125. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16126. };
  16127. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  16128. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  16129. };
  16130. Functions.prototype.dollar=function (number, decimals) {
  16131. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16132. };
  16133. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  16134. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  16135. };
  16136. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  16137. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  16138. };
  16139. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16140. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16141. };
  16142. Functions.prototype.ecma_Ceiling=function (number, significance) {
  16143. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16144. };
  16145. Functions.prototype.edate=function (startDate, months) {
  16146. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16147. };
  16148. Functions.prototype.effect=function (nominalRate, npery) {
  16149. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  16150. };
  16151. Functions.prototype.eoMonth=function (startDate, months) {
  16152. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  16153. };
  16154. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  16155. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  16156. };
  16157. Functions.prototype.erfC=function (x) {
  16158. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  16159. };
  16160. Functions.prototype.erfC_Precise=function (X) {
  16161. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16162. };
  16163. Functions.prototype.erf_Precise=function (X) {
  16164. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  16165. };
  16166. Functions.prototype.error_Type=function (errorVal) {
  16167. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  16168. };
  16169. Functions.prototype.even=function (number) {
  16170. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  16171. };
  16172. Functions.prototype.exact=function (text1, text2) {
  16173. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  16174. };
  16175. Functions.prototype.exp=function (number) {
  16176. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  16177. };
  16178. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  16179. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  16180. };
  16181. Functions.prototype.fvschedule=function (principal, schedule) {
  16182. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  16183. };
  16184. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  16185. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  16186. };
  16187. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  16188. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  16189. };
  16190. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  16191. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16192. };
  16193. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  16194. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  16195. };
  16196. Functions.prototype.fact=function (number) {
  16197. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  16198. };
  16199. Functions.prototype.factDouble=function (number) {
  16200. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  16201. };
  16202. Functions.prototype.false=function () {
  16203. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  16204. };
  16205. Functions.prototype.find=function (findText, withinText, startNum) {
  16206. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16207. };
  16208. Functions.prototype.findB=function (findText, withinText, startNum) {
  16209. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  16210. };
  16211. Functions.prototype.fisher=function (x) {
  16212. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  16213. };
  16214. Functions.prototype.fisherInv=function (y) {
  16215. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  16216. };
  16217. Functions.prototype.fixed=function (number, decimals, noCommas) {
  16218. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  16219. };
  16220. Functions.prototype.floor_Math=function (number, significance, mode) {
  16221. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  16222. };
  16223. Functions.prototype.floor_Precise=function (number, significance) {
  16224. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16225. };
  16226. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  16227. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  16228. };
  16229. Functions.prototype.gamma=function (x) {
  16230. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  16231. };
  16232. Functions.prototype.gammaLn=function (x) {
  16233. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  16234. };
  16235. Functions.prototype.gammaLn_Precise=function (x) {
  16236. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  16237. };
  16238. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  16239. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16240. };
  16241. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  16242. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  16243. };
  16244. Functions.prototype.gauss=function (x) {
  16245. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  16246. };
  16247. Functions.prototype.gcd=function () {
  16248. var values=[];
  16249. for (var _i=0; _i < arguments.length; _i++) {
  16250. values[_i - 0]=arguments[_i];
  16251. }
  16252. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  16253. };
  16254. Functions.prototype.geStep=function (number, step) {
  16255. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  16256. };
  16257. Functions.prototype.geoMean=function () {
  16258. var values=[];
  16259. for (var _i=0; _i < arguments.length; _i++) {
  16260. values[_i - 0]=arguments[_i];
  16261. }
  16262. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16263. };
  16264. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  16265. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  16266. };
  16267. Functions.prototype.harMean=function () {
  16268. var values=[];
  16269. for (var _i=0; _i < arguments.length; _i++) {
  16270. values[_i - 0]=arguments[_i];
  16271. }
  16272. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  16273. };
  16274. Functions.prototype.hex2Bin=function (number, places) {
  16275. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16276. };
  16277. Functions.prototype.hex2Dec=function (number) {
  16278. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16279. };
  16280. Functions.prototype.hex2Oct=function (number, places) {
  16281. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16282. };
  16283. Functions.prototype.hour=function (serialNumber) {
  16284. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16285. };
  16286. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  16287. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  16288. };
  16289. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  16290. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  16291. };
  16292. Functions.prototype.iso_Ceiling=function (number, significance) {
  16293. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  16294. };
  16295. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  16296. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  16297. };
  16298. Functions.prototype.imAbs=function (inumber) {
  16299. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16300. };
  16301. Functions.prototype.imArgument=function (inumber) {
  16302. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16303. };
  16304. Functions.prototype.imConjugate=function (inumber) {
  16305. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16306. };
  16307. Functions.prototype.imCos=function (inumber) {
  16308. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16309. };
  16310. Functions.prototype.imCosh=function (inumber) {
  16311. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16312. };
  16313. Functions.prototype.imCot=function (inumber) {
  16314. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16315. };
  16316. Functions.prototype.imCsc=function (inumber) {
  16317. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16318. };
  16319. Functions.prototype.imCsch=function (inumber) {
  16320. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16321. };
  16322. Functions.prototype.imDiv=function (inumber1, inumber2) {
  16323. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16324. };
  16325. Functions.prototype.imExp=function (inumber) {
  16326. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16327. };
  16328. Functions.prototype.imLn=function (inumber) {
  16329. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16330. };
  16331. Functions.prototype.imLog10=function (inumber) {
  16332. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16333. };
  16334. Functions.prototype.imLog2=function (inumber) {
  16335. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16336. };
  16337. Functions.prototype.imPower=function (inumber, number) {
  16338. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  16339. };
  16340. Functions.prototype.imProduct=function () {
  16341. var values=[];
  16342. for (var _i=0; _i < arguments.length; _i++) {
  16343. values[_i - 0]=arguments[_i];
  16344. }
  16345. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  16346. };
  16347. Functions.prototype.imReal=function (inumber) {
  16348. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16349. };
  16350. Functions.prototype.imSec=function (inumber) {
  16351. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16352. };
  16353. Functions.prototype.imSech=function (inumber) {
  16354. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16355. };
  16356. Functions.prototype.imSin=function (inumber) {
  16357. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16358. };
  16359. Functions.prototype.imSinh=function (inumber) {
  16360. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16361. };
  16362. Functions.prototype.imSqrt=function (inumber) {
  16363. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16364. };
  16365. Functions.prototype.imSub=function (inumber1, inumber2) {
  16366. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  16367. };
  16368. Functions.prototype.imSum=function () {
  16369. var values=[];
  16370. for (var _i=0; _i < arguments.length; _i++) {
  16371. values[_i - 0]=arguments[_i];
  16372. }
  16373. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16374. };
  16375. Functions.prototype.imTan=function (inumber) {
  16376. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16377. };
  16378. Functions.prototype.imaginary=function (inumber) {
  16379. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  16380. };
  16381. Functions.prototype.int=function (number) {
  16382. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  16383. };
  16384. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  16385. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  16386. };
  16387. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  16388. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16389. };
  16390. Functions.prototype.irr=function (values, guess) {
  16391. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  16392. };
  16393. Functions.prototype.isErr=function (value) {
  16394. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  16395. };
  16396. Functions.prototype.isError=function (value) {
  16397. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  16398. };
  16399. Functions.prototype.isEven=function (number) {
  16400. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  16401. };
  16402. Functions.prototype.isFormula=function (reference) {
  16403. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16404. };
  16405. Functions.prototype.isLogical=function (value) {
  16406. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  16407. };
  16408. Functions.prototype.isNA=function (value) {
  16409. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  16410. };
  16411. Functions.prototype.isNonText=function (value) {
  16412. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16413. };
  16414. Functions.prototype.isNumber=function (value) {
  16415. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  16416. };
  16417. Functions.prototype.isOdd=function (number) {
  16418. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16419. };
  16420. Functions.prototype.isText=function (value) {
  16421. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  16422. };
  16423. Functions.prototype.isoWeekNum=function (date) {
  16424. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  16425. };
  16426. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  16427. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  16428. };
  16429. Functions.prototype.isref=function (value) {
  16430. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  16431. };
  16432. Functions.prototype.kurt=function () {
  16433. var values=[];
  16434. for (var _i=0; _i < arguments.length; _i++) {
  16435. values[_i - 0]=arguments[_i];
  16436. }
  16437. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  16438. };
  16439. Functions.prototype.large=function (array, k) {
  16440. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16441. };
  16442. Functions.prototype.lcm=function () {
  16443. var values=[];
  16444. for (var _i=0; _i < arguments.length; _i++) {
  16445. values[_i - 0]=arguments[_i];
  16446. }
  16447. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  16448. };
  16449. Functions.prototype.left=function (text, numChars) {
  16450. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16451. };
  16452. Functions.prototype.leftb=function (text, numBytes) {
  16453. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16454. };
  16455. Functions.prototype.len=function (text) {
  16456. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  16457. };
  16458. Functions.prototype.lenb=function (text) {
  16459. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  16460. };
  16461. Functions.prototype.ln=function (number) {
  16462. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  16463. };
  16464. Functions.prototype.log=function (number, base) {
  16465. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  16466. };
  16467. Functions.prototype.log10=function (number) {
  16468. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  16469. };
  16470. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  16471. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16472. };
  16473. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  16474. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16475. };
  16476. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  16477. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  16478. };
  16479. Functions.prototype.lower=function (text) {
  16480. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  16481. };
  16482. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  16483. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  16484. };
  16485. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  16486. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  16487. };
  16488. Functions.prototype.mround=function (number, multiple) {
  16489. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  16490. };
  16491. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  16492. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  16493. };
  16494. Functions.prototype.max=function () {
  16495. var values=[];
  16496. for (var _i=0; _i < arguments.length; _i++) {
  16497. values[_i - 0]=arguments[_i];
  16498. }
  16499. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  16500. };
  16501. Functions.prototype.maxA=function () {
  16502. var values=[];
  16503. for (var _i=0; _i < arguments.length; _i++) {
  16504. values[_i - 0]=arguments[_i];
  16505. }
  16506. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16507. };
  16508. Functions.prototype.median=function () {
  16509. var values=[];
  16510. for (var _i=0; _i < arguments.length; _i++) {
  16511. values[_i - 0]=arguments[_i];
  16512. }
  16513. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  16514. };
  16515. Functions.prototype.mid=function (text, startNum, numChars) {
  16516. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  16517. };
  16518. Functions.prototype.midb=function (text, startNum, numBytes) {
  16519. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  16520. };
  16521. Functions.prototype.min=function () {
  16522. var values=[];
  16523. for (var _i=0; _i < arguments.length; _i++) {
  16524. values[_i - 0]=arguments[_i];
  16525. }
  16526. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  16527. };
  16528. Functions.prototype.minA=function () {
  16529. var values=[];
  16530. for (var _i=0; _i < arguments.length; _i++) {
  16531. values[_i - 0]=arguments[_i];
  16532. }
  16533. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16534. };
  16535. Functions.prototype.minute=function (serialNumber) {
  16536. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16537. };
  16538. Functions.prototype.mod=function (number, divisor) {
  16539. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  16540. };
  16541. Functions.prototype.month=function (serialNumber) {
  16542. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16543. };
  16544. Functions.prototype.multiNomial=function () {
  16545. var values=[];
  16546. for (var _i=0; _i < arguments.length; _i++) {
  16547. values[_i - 0]=arguments[_i];
  16548. }
  16549. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  16550. };
  16551. Functions.prototype.n=function (value) {
  16552. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  16553. };
  16554. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  16555. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  16556. };
  16557. Functions.prototype.na=function () {
  16558. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  16559. };
  16560. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  16561. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  16562. };
  16563. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  16564. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  16565. };
  16566. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  16567. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  16568. };
  16569. Functions.prototype.nominal=function (effectRate, npery) {
  16570. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  16571. };
  16572. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  16573. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  16574. };
  16575. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  16576. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  16577. };
  16578. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  16579. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  16580. };
  16581. Functions.prototype.norm_S_Inv=function (probability) {
  16582. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  16583. };
  16584. Functions.prototype.not=function (logical) {
  16585. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  16586. };
  16587. Functions.prototype.now=function () {
  16588. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  16589. };
  16590. Functions.prototype.npv=function (rate) {
  16591. var values=[];
  16592. for (var _i=1; _i < arguments.length; _i++) {
  16593. values[_i - 1]=arguments[_i];
  16594. }
  16595. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  16596. };
  16597. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  16598. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  16599. };
  16600. Functions.prototype.oct2Bin=function (number, places) {
  16601. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16602. };
  16603. Functions.prototype.oct2Dec=function (number) {
  16604. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16605. };
  16606. Functions.prototype.oct2Hex=function (number, places) {
  16607. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  16608. };
  16609. Functions.prototype.odd=function (number) {
  16610. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  16611. };
  16612. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  16613. 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));
  16614. };
  16615. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  16616. 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));
  16617. };
  16618. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  16619. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  16620. };
  16621. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  16622. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  16623. };
  16624. Functions.prototype.or=function () {
  16625. var values=[];
  16626. for (var _i=0; _i < arguments.length; _i++) {
  16627. values[_i - 0]=arguments[_i];
  16628. }
  16629. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  16630. };
  16631. Functions.prototype.pduration=function (rate, pv, fv) {
  16632. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  16633. };
  16634. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  16635. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16636. };
  16637. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  16638. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  16639. };
  16640. Functions.prototype.percentile_Exc=function (array, k) {
  16641. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16642. };
  16643. Functions.prototype.percentile_Inc=function (array, k) {
  16644. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16645. };
  16646. Functions.prototype.permut=function (number, numberChosen) {
  16647. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16648. };
  16649. Functions.prototype.permutationa=function (number, numberChosen) {
  16650. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  16651. };
  16652. Functions.prototype.phi=function (x) {
  16653. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  16654. };
  16655. Functions.prototype.pi=function () {
  16656. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  16657. };
  16658. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  16659. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  16660. };
  16661. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  16662. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  16663. };
  16664. Functions.prototype.power=function (number, power) {
  16665. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  16666. };
  16667. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  16668. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  16669. };
  16670. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  16671. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  16672. };
  16673. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  16674. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  16675. };
  16676. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  16677. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  16678. };
  16679. Functions.prototype.product=function () {
  16680. var values=[];
  16681. for (var _i=0; _i < arguments.length; _i++) {
  16682. values[_i - 0]=arguments[_i];
  16683. }
  16684. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  16685. };
  16686. Functions.prototype.proper=function (text) {
  16687. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16688. };
  16689. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  16690. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  16691. };
  16692. Functions.prototype.quartile_Exc=function (array, quart) {
  16693. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16694. };
  16695. Functions.prototype.quartile_Inc=function (array, quart) {
  16696. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  16697. };
  16698. Functions.prototype.quotient=function (numerator, denominator) {
  16699. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  16700. };
  16701. Functions.prototype.radians=function (angle) {
  16702. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  16703. };
  16704. Functions.prototype.rand=function () {
  16705. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  16706. };
  16707. Functions.prototype.randBetween=function (bottom, top) {
  16708. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  16709. };
  16710. Functions.prototype.rank_Avg=function (number, ref, order) {
  16711. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16712. };
  16713. Functions.prototype.rank_Eq=function (number, ref, order) {
  16714. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  16715. };
  16716. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  16717. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  16718. };
  16719. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  16720. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  16721. };
  16722. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  16723. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  16724. };
  16725. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  16726. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  16727. };
  16728. Functions.prototype.rept=function (text, numberTimes) {
  16729. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  16730. };
  16731. Functions.prototype.right=function (text, numChars) {
  16732. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  16733. };
  16734. Functions.prototype.rightb=function (text, numBytes) {
  16735. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  16736. };
  16737. Functions.prototype.roman=function (number, form) {
  16738. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  16739. };
  16740. Functions.prototype.round=function (number, numDigits) {
  16741. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16742. };
  16743. Functions.prototype.roundDown=function (number, numDigits) {
  16744. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16745. };
  16746. Functions.prototype.roundUp=function (number, numDigits) {
  16747. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16748. };
  16749. Functions.prototype.rows=function (array) {
  16750. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  16751. };
  16752. Functions.prototype.rri=function (nper, pv, fv) {
  16753. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  16754. };
  16755. Functions.prototype.sec=function (number) {
  16756. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  16757. };
  16758. Functions.prototype.sech=function (number) {
  16759. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  16760. };
  16761. Functions.prototype.second=function (serialNumber) {
  16762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  16763. };
  16764. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  16765. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  16766. };
  16767. Functions.prototype.sheet=function (value) {
  16768. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  16769. };
  16770. Functions.prototype.sheets=function (reference) {
  16771. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  16772. };
  16773. Functions.prototype.sign=function (number) {
  16774. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  16775. };
  16776. Functions.prototype.sin=function (number) {
  16777. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  16778. };
  16779. Functions.prototype.sinh=function (number) {
  16780. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16781. };
  16782. Functions.prototype.skew=function () {
  16783. var values=[];
  16784. for (var _i=0; _i < arguments.length; _i++) {
  16785. values[_i - 0]=arguments[_i];
  16786. }
  16787. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  16788. };
  16789. Functions.prototype.skew_p=function () {
  16790. var values=[];
  16791. for (var _i=0; _i < arguments.length; _i++) {
  16792. values[_i - 0]=arguments[_i];
  16793. }
  16794. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  16795. };
  16796. Functions.prototype.sln=function (cost, salvage, life) {
  16797. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  16798. };
  16799. Functions.prototype.small=function (array, k) {
  16800. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  16801. };
  16802. Functions.prototype.sqrt=function (number) {
  16803. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  16804. };
  16805. Functions.prototype.sqrtPi=function (number) {
  16806. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  16807. };
  16808. Functions.prototype.stDevA=function () {
  16809. var values=[];
  16810. for (var _i=0; _i < arguments.length; _i++) {
  16811. values[_i - 0]=arguments[_i];
  16812. }
  16813. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16814. };
  16815. Functions.prototype.stDevPA=function () {
  16816. var values=[];
  16817. for (var _i=0; _i < arguments.length; _i++) {
  16818. values[_i - 0]=arguments[_i];
  16819. }
  16820. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16821. };
  16822. Functions.prototype.stDev_P=function () {
  16823. var values=[];
  16824. for (var _i=0; _i < arguments.length; _i++) {
  16825. values[_i - 0]=arguments[_i];
  16826. }
  16827. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16828. };
  16829. Functions.prototype.stDev_S=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, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16835. };
  16836. Functions.prototype.standardize=function (x, mean, standardDev) {
  16837. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  16838. };
  16839. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  16840. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  16841. };
  16842. Functions.prototype.subtotal=function (functionNum) {
  16843. var values=[];
  16844. for (var _i=1; _i < arguments.length; _i++) {
  16845. values[_i - 1]=arguments[_i];
  16846. }
  16847. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  16848. };
  16849. Functions.prototype.sum=function () {
  16850. var values=[];
  16851. for (var _i=0; _i < arguments.length; _i++) {
  16852. values[_i - 0]=arguments[_i];
  16853. }
  16854. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  16855. };
  16856. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  16857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  16858. };
  16859. Functions.prototype.sumIfs=function (sumRange) {
  16860. var values=[];
  16861. for (var _i=1; _i < arguments.length; _i++) {
  16862. values[_i - 1]=arguments[_i];
  16863. }
  16864. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  16865. };
  16866. Functions.prototype.sumSq=function () {
  16867. var values=[];
  16868. for (var _i=0; _i < arguments.length; _i++) {
  16869. values[_i - 0]=arguments[_i];
  16870. }
  16871. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  16872. };
  16873. Functions.prototype.syd=function (cost, salvage, life, per) {
  16874. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  16875. };
  16876. Functions.prototype.t=function (value) {
  16877. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  16878. };
  16879. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  16880. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16881. };
  16882. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  16883. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  16884. };
  16885. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  16886. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  16887. };
  16888. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  16889. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  16890. };
  16891. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  16892. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16893. };
  16894. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  16895. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  16896. };
  16897. Functions.prototype.t_Inv=function (probability, degFreedom) {
  16898. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16899. };
  16900. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  16901. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  16902. };
  16903. Functions.prototype.tan=function (number) {
  16904. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  16905. };
  16906. Functions.prototype.tanh=function (number) {
  16907. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  16908. };
  16909. Functions.prototype.text=function (value, formatText) {
  16910. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  16911. };
  16912. Functions.prototype.time=function (hour, minute, second) {
  16913. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  16914. };
  16915. Functions.prototype.timevalue=function (timeText) {
  16916. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  16917. };
  16918. Functions.prototype.today=function () {
  16919. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  16920. };
  16921. Functions.prototype.trim=function (text) {
  16922. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  16923. };
  16924. Functions.prototype.trimMean=function (array, percent) {
  16925. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  16926. };
  16927. Functions.prototype.true=function () {
  16928. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  16929. };
  16930. Functions.prototype.trunc=function (number, numDigits) {
  16931. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  16932. };
  16933. Functions.prototype.type=function (value) {
  16934. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  16935. };
  16936. Functions.prototype.usdollar=function (number, decimals) {
  16937. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  16938. };
  16939. Functions.prototype.unichar=function (number) {
  16940. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  16941. };
  16942. Functions.prototype.unicode=function (text) {
  16943. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  16944. };
  16945. Functions.prototype.upper=function (text) {
  16946. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  16947. };
  16948. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  16949. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  16950. };
  16951. Functions.prototype.value=function (text) {
  16952. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  16953. };
  16954. Functions.prototype.varA=function () {
  16955. var values=[];
  16956. for (var _i=0; _i < arguments.length; _i++) {
  16957. values[_i - 0]=arguments[_i];
  16958. }
  16959. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16960. };
  16961. Functions.prototype.varPA=function () {
  16962. var values=[];
  16963. for (var _i=0; _i < arguments.length; _i++) {
  16964. values[_i - 0]=arguments[_i];
  16965. }
  16966. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  16967. };
  16968. Functions.prototype.var_P=function () {
  16969. var values=[];
  16970. for (var _i=0; _i < arguments.length; _i++) {
  16971. values[_i - 0]=arguments[_i];
  16972. }
  16973. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  16974. };
  16975. Functions.prototype.var_S=function () {
  16976. var values=[];
  16977. for (var _i=0; _i < arguments.length; _i++) {
  16978. values[_i - 0]=arguments[_i];
  16979. }
  16980. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  16981. };
  16982. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  16983. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  16984. };
  16985. Functions.prototype.weekNum=function (serialNumber, returnType) {
  16986. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16987. };
  16988. Functions.prototype.weekday=function (serialNumber, returnType) {
  16989. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  16990. };
  16991. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  16992. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  16993. };
  16994. Functions.prototype.workDay=function (startDate, days, holidays) {
  16995. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  16996. };
  16997. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  16998. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  16999. };
  17000. Functions.prototype.xirr=function (values, dates, guess) {
  17001. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  17002. };
  17003. Functions.prototype.xnpv=function (rate, values, dates) {
  17004. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  17005. };
  17006. Functions.prototype.xor=function () {
  17007. var values=[];
  17008. for (var _i=0; _i < arguments.length; _i++) {
  17009. values[_i - 0]=arguments[_i];
  17010. }
  17011. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  17012. };
  17013. Functions.prototype.year=function (serialNumber) {
  17014. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  17015. };
  17016. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  17017. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  17018. };
  17019. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  17020. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  17021. };
  17022. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  17023. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  17024. };
  17025. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  17026. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  17027. };
  17028. Functions.prototype.z_Test=function (array, x, sigma) {
  17029. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  17030. };
  17031. Functions.prototype._handleResult=function (value) {
  17032. _super.prototype._handleResult.call(this, value);
  17033. if (_isNullOrUndefined(value))
  17034. return;
  17035. var obj=value;
  17036. _fixObjectPathIfNecessary(this, obj);
  17037. };
  17038. Functions.prototype.toJSON=function () {
  17039. return {};
  17040. };
  17041. return Functions;
  17042. }(OfficeExtension.ClientObject));
  17043. Excel.Functions=Functions;
  17044. var ErrorCodes;
  17045. (function (ErrorCodes) {
  17046. ErrorCodes.accessDenied="AccessDenied";
  17047. ErrorCodes.apiNotFound="ApiNotFound";
  17048. ErrorCodes.generalException="GeneralException";
  17049. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  17050. ErrorCodes.invalidArgument="InvalidArgument";
  17051. ErrorCodes.invalidBinding="InvalidBinding";
  17052. ErrorCodes.invalidOperation="InvalidOperation";
  17053. ErrorCodes.invalidReference="InvalidReference";
  17054. ErrorCodes.invalidSelection="InvalidSelection";
  17055. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  17056. ErrorCodes.itemNotFound="ItemNotFound";
  17057. ErrorCodes.notImplemented="NotImplemented";
  17058. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  17059. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  17060. })(Excel || (Excel={}));
  17061. var Excel;
  17062. (function (Excel) {
  17063. var RequestContext=(function (_super) {
  17064. __extends(RequestContext, _super);
  17065. function RequestContext(url) {
  17066. _super.call(this, url);
  17067. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  17068. this._rootObject=this.m_workbook;
  17069. }
  17070. Object.defineProperty(RequestContext.prototype, "workbook", {
  17071. get: function () {
  17072. return this.m_workbook;
  17073. },
  17074. enumerable: true,
  17075. configurable: true
  17076. });
  17077. return RequestContext;
  17078. }(OfficeExtension.ClientRequestContext));
  17079. Excel.RequestContext=RequestContext;
  17080. function run(arg1, arg2, arg3) {
  17081. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  17082. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  17083. if (requestInfo && requestInfo.headers) {
  17084. for (var name in requestInfo.headers) {
  17085. ret.requestHeaders[name]=requestInfo.headers[name];
  17086. }
  17087. }
  17088. return ret;
  17089. });
  17090. }
  17091. Excel.run=run;
  17092. })(Excel || (Excel={}));
  17093. var Excel;
  17094. (function (Excel) {
  17095. Excel._RedirectV1APIs=false;
  17096. Excel._V1APIMap={
  17097. "GetDataAsync": {
  17098. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  17099. postprocess: getDataCommonPostprocess
  17100. },
  17101. "GetSelectedDataAsync": {
  17102. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  17103. postprocess: getDataCommonPostprocess
  17104. },
  17105. "GoToByIdAsync": {
  17106. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  17107. },
  17108. "AddColumnsAsync": {
  17109. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  17110. },
  17111. "AddFromSelectionAsync": {
  17112. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  17113. postprocess: postprocessBindingDescriptor
  17114. },
  17115. "AddFromNamedItemAsync": {
  17116. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  17117. postprocess: postprocessBindingDescriptor
  17118. },
  17119. "AddFromPromptAsync": {
  17120. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  17121. postprocess: postprocessBindingDescriptor
  17122. },
  17123. "AddRowsAsync": {
  17124. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  17125. },
  17126. "GetByIdAsync": {
  17127. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  17128. postprocess: postprocessBindingDescriptor
  17129. },
  17130. "ReleaseByIdAsync": {
  17131. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  17132. },
  17133. "GetAllAsync": {
  17134. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  17135. postprocess: function (response) {
  17136. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  17137. }
  17138. },
  17139. "DeleteAllDataValuesAsync": {
  17140. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  17141. },
  17142. "SetSelectedDataAsync": {
  17143. preprocess: function (callArgs) {
  17144. var preimage=callArgs["cellFormat"];
  17145. if (window.OSF.DDA.SafeArray) {
  17146. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17147. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17148. }
  17149. }
  17150. else if (window.OSF.DDA.WAC) {
  17151. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17152. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17153. }
  17154. }
  17155. return callArgs;
  17156. },
  17157. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  17158. },
  17159. "SetDataAsync": {
  17160. preprocess: function (callArgs) {
  17161. var preimage=callArgs["cellFormat"];
  17162. if (window.OSF.DDA.SafeArray) {
  17163. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17164. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17165. }
  17166. }
  17167. else if (window.OSF.DDA.WAC) {
  17168. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17169. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17170. }
  17171. }
  17172. return callArgs;
  17173. },
  17174. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  17175. },
  17176. "SetFormatsAsync": {
  17177. preprocess: function (callArgs) {
  17178. var preimage=callArgs["cellFormat"];
  17179. if (window.OSF.DDA.SafeArray) {
  17180. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17181. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17182. }
  17183. }
  17184. else if (window.OSF.DDA.WAC) {
  17185. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  17186. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  17187. }
  17188. }
  17189. return callArgs;
  17190. },
  17191. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  17192. },
  17193. "SetTableOptionsAsync": {
  17194. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  17195. },
  17196. "ClearFormatsAsync": {
  17197. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  17198. },
  17199. };
  17200. function postprocessBindingDescriptor(response) {
  17201. var bindingDescriptor={
  17202. BindingColumnCount: response.bindingColumnCount,
  17203. BindingId: response.bindingId,
  17204. BindingRowCount: response.bindingRowCount,
  17205. bindingType: response.bindingType,
  17206. HasHeaders: response.hasHeaders
  17207. };
  17208. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  17209. }
  17210. function getDataCommonPostprocess(response, callArgs) {
  17211. var isPlainData=response.headers==null;
  17212. var data;
  17213. if (isPlainData) {
  17214. data=response.rows;
  17215. }
  17216. else {
  17217. data=response;
  17218. }
  17219. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  17220. return data==undefined ? null : data;
  17221. }
  17222. })(Excel || (Excel={}));