Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

excel-web-16.00.debug.js 743KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076
  1. /* Excel-Online-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. OSF.ShowWindowDialogParameterKeys={
  3240. Url: "url",
  3241. Width: "width",
  3242. Height: "height",
  3243. DisplayInIframe: "displayInIframe"
  3244. };
  3245. OSF.HostThemeButtonStyleKeys={
  3246. ButtonBorderColor: "buttonBorderColor",
  3247. ButtonBackgroundColor: "buttonBackgroundColor"
  3248. };
  3249. var OfficeExt;
  3250. (function (OfficeExt) {
  3251. var WACUtils;
  3252. (function (WACUtils) {
  3253. var _trustedDomain="^https:\/\/[a-zA-Z0-9]+\.(officeapps\.live|officeapps-df\.live|partner\.officewebapps)\.com\/";
  3254. function parseAppContextFromWindowName(skipSessionStorage, windowName) {
  3255. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.AppContext);
  3256. }
  3257. WACUtils.parseAppContextFromWindowName=parseAppContextFromWindowName;
  3258. function serializeObjectToString(response) {
  3259. if (typeof (JSON) !=="undefined") {
  3260. try {
  3261. return JSON.stringify(response);
  3262. }
  3263. catch (ex) {
  3264. }
  3265. }
  3266. return "";
  3267. }
  3268. WACUtils.serializeObjectToString=serializeObjectToString;
  3269. function isHostTrusted() {
  3270. return (new RegExp(_trustedDomain)).test(OSF.getClientEndPoint()._targetUrl);
  3271. }
  3272. WACUtils.isHostTrusted=isHostTrusted;
  3273. function addHostInfoAsQueryParam(url, hostInfoValue) {
  3274. if (!url) {
  3275. return null;
  3276. }
  3277. url=url.trim() || '';
  3278. var questionMark="?";
  3279. var hostInfo="_host_Info=";
  3280. var ampHostInfo="&_host_Info=";
  3281. var fragmentSeparator="#";
  3282. var urlParts=url.split(fragmentSeparator);
  3283. var urlWithoutFragment=urlParts.shift();
  3284. var fragment=urlParts.join(fragmentSeparator);
  3285. var querySplits=urlWithoutFragment.split(questionMark);
  3286. var urlWithoutFragmentWithHostInfo;
  3287. if (querySplits.length > 1) {
  3288. urlWithoutFragmentWithHostInfo=urlWithoutFragment+ampHostInfo+hostInfoValue;
  3289. }
  3290. else if (querySplits.length > 0) {
  3291. urlWithoutFragmentWithHostInfo=urlWithoutFragment+questionMark+hostInfo+hostInfoValue;
  3292. }
  3293. return [urlWithoutFragmentWithHostInfo, fragmentSeparator, fragment].join('');
  3294. }
  3295. WACUtils.addHostInfoAsQueryParam=addHostInfoAsQueryParam;
  3296. function getDomainForUrl(url) {
  3297. if (!url) {
  3298. return null;
  3299. }
  3300. var url_parser=document.createElement('a');
  3301. url_parser.href=url;
  3302. return url_parser.protocol+"//"+url_parser.host;
  3303. }
  3304. WACUtils.getDomainForUrl=getDomainForUrl;
  3305. })(WACUtils=OfficeExt.WACUtils || (OfficeExt.WACUtils={}));
  3306. })(OfficeExt || (OfficeExt={}));
  3307. var OfficeExt;
  3308. (function (OfficeExt) {
  3309. var MsAjaxTypeHelper=(function () {
  3310. function MsAjaxTypeHelper() {
  3311. }
  3312. MsAjaxTypeHelper.isInstanceOfType=function (type, instance) {
  3313. if (typeof (instance)==="undefined" || instance===null)
  3314. return false;
  3315. if (instance instanceof type)
  3316. return true;
  3317. var instanceType=instance.constructor;
  3318. if (!instanceType || (typeof (instanceType) !=="function") || !instanceType.__typeName || instanceType.__typeName==='Object') {
  3319. instanceType=Object;
  3320. }
  3321. return !!(instanceType===type) ||
  3322. (instanceType.__typeName && type.__typeName && instanceType.__typeName===type.__typeName);
  3323. };
  3324. return MsAjaxTypeHelper;
  3325. })();
  3326. OfficeExt.MsAjaxTypeHelper=MsAjaxTypeHelper;
  3327. var MsAjaxError=(function () {
  3328. function MsAjaxError() {
  3329. }
  3330. MsAjaxError.create=function (message, errorInfo) {
  3331. var err=new Error(message);
  3332. err.message=message;
  3333. if (errorInfo) {
  3334. for (var v in errorInfo) {
  3335. err[v]=errorInfo[v];
  3336. }
  3337. }
  3338. err.popStackFrame();
  3339. return err;
  3340. };
  3341. MsAjaxError.parameterCount=function (message) {
  3342. var displayMessage="Sys.ParameterCountException: "+(message ? message : "Parameter count mismatch.");
  3343. var err=MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3344. err.popStackFrame();
  3345. return err;
  3346. };
  3347. MsAjaxError.argument=function (paramName, message) {
  3348. var displayMessage="Sys.ArgumentException: "+(message ? message : "Value does not fall within the expected range.");
  3349. if (paramName) {
  3350. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3351. }
  3352. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3353. err.popStackFrame();
  3354. return err;
  3355. };
  3356. MsAjaxError.argumentNull=function (paramName, message) {
  3357. var displayMessage="Sys.ArgumentNullException: "+(message ? message : "Value cannot be null.");
  3358. if (paramName) {
  3359. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3360. }
  3361. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3362. err.popStackFrame();
  3363. return err;
  3364. };
  3365. MsAjaxError.argumentOutOfRange=function (paramName, actualValue, message) {
  3366. var displayMessage="Sys.ArgumentOutOfRangeException: "+(message ? message : "Specified argument was out of the range of valid values.");
  3367. if (paramName) {
  3368. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3369. }
  3370. if (typeof (actualValue) !=="undefined" && actualValue !==null) {
  3371. displayMessage+="\n"+MsAjaxString.format("Actual value was {0}.", actualValue);
  3372. }
  3373. var err=MsAjaxError.create(displayMessage, {
  3374. name: "Sys.ArgumentOutOfRangeException",
  3375. paramName: paramName,
  3376. actualValue: actualValue
  3377. });
  3378. err.popStackFrame();
  3379. return err;
  3380. };
  3381. MsAjaxError.argumentType=function (paramName, actualType, expectedType, message) {
  3382. var displayMessage="Sys.ArgumentTypeException: ";
  3383. if (message) {
  3384. displayMessage+=message;
  3385. }
  3386. else if (actualType && expectedType) {
  3387. displayMessage+=MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3388. }
  3389. else {
  3390. displayMessage+="Object cannot be converted to the required type.";
  3391. }
  3392. if (paramName) {
  3393. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3394. }
  3395. var err=MsAjaxError.create(displayMessage, {
  3396. name: "Sys.ArgumentTypeException",
  3397. paramName: paramName,
  3398. actualType: actualType,
  3399. expectedType: expectedType
  3400. });
  3401. err.popStackFrame();
  3402. return err;
  3403. };
  3404. MsAjaxError.argumentUndefined=function (paramName, message) {
  3405. var displayMessage="Sys.ArgumentUndefinedException: "+(message ? message : "Value cannot be undefined.");
  3406. if (paramName) {
  3407. displayMessage+="\n"+MsAjaxString.format("Parameter name: {0}", paramName);
  3408. }
  3409. var err=MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3410. err.popStackFrame();
  3411. return err;
  3412. };
  3413. MsAjaxError.invalidOperation=function (message) {
  3414. var displayMessage="Sys.InvalidOperationException: "+(message ? message : "Operation is not valid due to the current state of the object.");
  3415. var err=MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3416. err.popStackFrame();
  3417. return err;
  3418. };
  3419. return MsAjaxError;
  3420. })();
  3421. OfficeExt.MsAjaxError=MsAjaxError;
  3422. var MsAjaxString=(function () {
  3423. function MsAjaxString() {
  3424. }
  3425. MsAjaxString.format=function (format) {
  3426. var args=[];
  3427. for (var _i=1; _i < arguments.length; _i++) {
  3428. args[_i - 1]=arguments[_i];
  3429. }
  3430. var source=format;
  3431. return source.replace(/{(\d+)}/gm, function (match, number) {
  3432. var index=parseInt(number, 10);
  3433. return args[index]===undefined ? '{'+number+'}' : args[index];
  3434. });
  3435. };
  3436. MsAjaxString.startsWith=function (str, prefix) {
  3437. return (str.substr(0, prefix.length)===prefix);
  3438. };
  3439. return MsAjaxString;
  3440. })();
  3441. OfficeExt.MsAjaxString=MsAjaxString;
  3442. var MsAjaxDebug=(function () {
  3443. function MsAjaxDebug() {
  3444. }
  3445. MsAjaxDebug.trace=function (text) {
  3446. if (typeof Debug !=="undefined" && Debug.writeln)
  3447. Debug.writeln(text);
  3448. if (window.console && window.console.log)
  3449. window.console.log(text);
  3450. if (window.opera && window.opera.postError)
  3451. window.opera.postError(text);
  3452. if (window.debugService && window.debugService.trace)
  3453. window.debugService.trace(text);
  3454. var a=document.getElementById("TraceConsole");
  3455. if (a && a.tagName.toUpperCase()==="TEXTAREA") {
  3456. a.innerHTML+=text+"\n";
  3457. }
  3458. };
  3459. return MsAjaxDebug;
  3460. })();
  3461. OfficeExt.MsAjaxDebug=MsAjaxDebug;
  3462. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3463. var registerTypeInternal=function registerTypeInternal(type, name, isClass) {
  3464. if (type.__typeName===undefined) {
  3465. type.__typeName=name;
  3466. }
  3467. if (type.__class===undefined) {
  3468. type.__class=isClass;
  3469. }
  3470. };
  3471. registerTypeInternal(Function, "Function", true);
  3472. registerTypeInternal(Error, "Error", true);
  3473. registerTypeInternal(Object, "Object", true);
  3474. registerTypeInternal(String, "String", true);
  3475. registerTypeInternal(Boolean, "Boolean", true);
  3476. registerTypeInternal(Date, "Date", true);
  3477. registerTypeInternal(Number, "Number", true);
  3478. registerTypeInternal(RegExp, "RegExp", true);
  3479. registerTypeInternal(Array, "Array", true);
  3480. if (!Function.createCallback) {
  3481. Function.createCallback=function Function$createCallback(method, context) {
  3482. var e=Function._validateParams(arguments, [
  3483. { name: "method", type: Function },
  3484. { name: "context", mayBeNull: true }
  3485. ]);
  3486. if (e)
  3487. throw e;
  3488. return function () {
  3489. var l=arguments.length;
  3490. if (l > 0) {
  3491. var args=[];
  3492. for (var i=0; i < l; i++) {
  3493. args[i]=arguments[i];
  3494. }
  3495. args[l]=context;
  3496. return method.apply(this, args);
  3497. }
  3498. return method.call(this, context);
  3499. };
  3500. };
  3501. }
  3502. if (!Function.createDelegate) {
  3503. Function.createDelegate=function Function$createDelegate(instance, method) {
  3504. var e=Function._validateParams(arguments, [
  3505. { name: "instance", mayBeNull: true },
  3506. { name: "method", type: Function }
  3507. ]);
  3508. if (e)
  3509. throw e;
  3510. return function () {
  3511. return method.apply(instance, arguments);
  3512. };
  3513. };
  3514. }
  3515. if (!Function._validateParams) {
  3516. Function._validateParams=function (params, expectedParams, validateParameterCount) {
  3517. var e, expectedLength=expectedParams.length;
  3518. validateParameterCount=validateParameterCount || (typeof (validateParameterCount)==="undefined");
  3519. e=Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3520. if (e) {
  3521. e.popStackFrame();
  3522. return e;
  3523. }
  3524. for (var i=0, l=params.length; i < l; i++) {
  3525. var expectedParam=expectedParams[Math.min(i, expectedLength - 1)], paramName=expectedParam.name;
  3526. if (expectedParam.parameterArray) {
  3527. paramName+="["+(i - expectedLength+1)+"]";
  3528. }
  3529. else if (!validateParameterCount && (i >=expectedLength)) {
  3530. break;
  3531. }
  3532. e=Function._validateParameter(params[i], expectedParam, paramName);
  3533. if (e) {
  3534. e.popStackFrame();
  3535. return e;
  3536. }
  3537. }
  3538. return null;
  3539. };
  3540. }
  3541. if (!Function._validateParameterCount) {
  3542. Function._validateParameterCount=function (params, expectedParams, validateParameterCount) {
  3543. var i, error, expectedLen=expectedParams.length, actualLen=params.length;
  3544. if (actualLen < expectedLen) {
  3545. var minParams=expectedLen;
  3546. for (i=0; i < expectedLen; i++) {
  3547. var param=expectedParams[i];
  3548. if (param.optional || param.parameterArray) {
  3549. minParams--;
  3550. }
  3551. }
  3552. if (actualLen < minParams) {
  3553. error=true;
  3554. }
  3555. }
  3556. else if (validateParameterCount && (actualLen > expectedLen)) {
  3557. error=true;
  3558. for (i=0; i < expectedLen; i++) {
  3559. if (expectedParams[i].parameterArray) {
  3560. error=false;
  3561. break;
  3562. }
  3563. }
  3564. }
  3565. if (error) {
  3566. var e=MsAjaxError.parameterCount();
  3567. e.popStackFrame();
  3568. return e;
  3569. }
  3570. return null;
  3571. };
  3572. }
  3573. if (!Function._validateParameter) {
  3574. Function._validateParameter=function (param, expectedParam, paramName) {
  3575. var e, expectedType=expectedParam.type, expectedInteger=!!expectedParam.integer, expectedDomElement=!!expectedParam.domElement, mayBeNull=!!expectedParam.mayBeNull;
  3576. e=Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3577. if (e) {
  3578. e.popStackFrame();
  3579. return e;
  3580. }
  3581. var expectedElementType=expectedParam.elementType, elementMayBeNull=!!expectedParam.elementMayBeNull;
  3582. if (expectedType===Array && typeof (param) !=="undefined" && param !==null &&
  3583. (expectedElementType || !elementMayBeNull)) {
  3584. var expectedElementInteger=!!expectedParam.elementInteger, expectedElementDomElement=!!expectedParam.elementDomElement;
  3585. for (var i=0; i < param.length; i++) {
  3586. var elem=param[i];
  3587. e=Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName+"["+i+"]");
  3588. if (e) {
  3589. e.popStackFrame();
  3590. return e;
  3591. }
  3592. }
  3593. }
  3594. return null;
  3595. };
  3596. }
  3597. if (!Function._validateParameterType) {
  3598. Function._validateParameterType=function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3599. var e, i;
  3600. if (typeof (param)==="undefined") {
  3601. if (mayBeNull) {
  3602. return null;
  3603. }
  3604. else {
  3605. e=OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3606. e.popStackFrame();
  3607. return e;
  3608. }
  3609. }
  3610. if (param===null) {
  3611. if (mayBeNull) {
  3612. return null;
  3613. }
  3614. else {
  3615. e=OfficeExt.MsAjaxError.argumentNull(paramName);
  3616. e.popStackFrame();
  3617. return e;
  3618. }
  3619. }
  3620. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3621. e=OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3622. e.popStackFrame();
  3623. return e;
  3624. }
  3625. return null;
  3626. };
  3627. }
  3628. if (!window.Type) {
  3629. window.Type=Function;
  3630. }
  3631. if (!Type.registerNamespace) {
  3632. Type.registerNamespace=function (ns) {
  3633. var namespaceParts=ns.split('.');
  3634. var currentNamespace=window;
  3635. for (var i=0; i < namespaceParts.length; i++) {
  3636. currentNamespace[namespaceParts[i]]=currentNamespace[namespaceParts[i]] || {};
  3637. currentNamespace=currentNamespace[namespaceParts[i]];
  3638. }
  3639. };
  3640. }
  3641. if (!Type.prototype.registerClass) {
  3642. Type.prototype.registerClass=function (cls) { cls={}; };
  3643. }
  3644. if (typeof (Sys)==="undefined") {
  3645. Type.registerNamespace('Sys');
  3646. }
  3647. if (!Error.prototype.popStackFrame) {
  3648. Error.prototype.popStackFrame=function () {
  3649. if (arguments.length !==0)
  3650. throw MsAjaxError.parameterCount();
  3651. if (typeof (this.stack)==="undefined" || this.stack===null ||
  3652. typeof (this.fileName)==="undefined" || this.fileName===null ||
  3653. typeof (this.lineNumber)==="undefined" || this.lineNumber===null) {
  3654. return;
  3655. }
  3656. var stackFrames=this.stack.split("\n");
  3657. var currentFrame=stackFrames[0];
  3658. var pattern=this.fileName+":"+this.lineNumber;
  3659. while (typeof (currentFrame) !=="undefined" &&
  3660. currentFrame !==null &&
  3661. currentFrame.indexOf(pattern)===-1) {
  3662. stackFrames.shift();
  3663. currentFrame=stackFrames[0];
  3664. }
  3665. var nextFrame=stackFrames[1];
  3666. if (typeof (nextFrame)==="undefined" || nextFrame===null) {
  3667. return;
  3668. }
  3669. var nextFrameParts=nextFrame.match(/@(.*):(\d+)$/);
  3670. if (typeof (nextFrameParts)==="undefined" || nextFrameParts===null) {
  3671. return;
  3672. }
  3673. this.fileName=nextFrameParts[1];
  3674. this.lineNumber=parseInt(nextFrameParts[2]);
  3675. stackFrames.shift();
  3676. this.stack=stackFrames.join("\n");
  3677. };
  3678. }
  3679. OsfMsAjaxFactory.msAjaxError=MsAjaxError;
  3680. OsfMsAjaxFactory.msAjaxString=MsAjaxString;
  3681. OsfMsAjaxFactory.msAjaxDebug=MsAjaxDebug;
  3682. }
  3683. })(OfficeExt || (OfficeExt={}));
  3684. OSF.OUtil.setNamespace("Microsoft", window);
  3685. OSF.OUtil.setNamespace("Office", Microsoft);
  3686. OSF.OUtil.setNamespace("Common", Microsoft.Office);
  3687. OSF.SerializerVersion={
  3688. MsAjax: 0,
  3689. Browser: 1
  3690. };
  3691. var OfficeExt;
  3692. (function (OfficeExt) {
  3693. function appSpecificCheckOriginFunction(url, eventObj, messageObj, checkOriginFunction) {
  3694. return true;
  3695. }
  3696. ;
  3697. OfficeExt.appSpecificCheckOrigin=appSpecificCheckOriginFunction;
  3698. })(OfficeExt || (OfficeExt={}));
  3699. Microsoft.Office.Common.InvokeType={ "async": 0,
  3700. "sync": 1,
  3701. "asyncRegisterEvent": 2,
  3702. "asyncUnregisterEvent": 3,
  3703. "syncRegisterEvent": 4,
  3704. "syncUnregisterEvent": 5
  3705. };
  3706. Microsoft.Office.Common.InvokeResultCode={
  3707. "noError": 0,
  3708. "errorInRequest": -1,
  3709. "errorHandlingRequest": -2,
  3710. "errorInResponse": -3,
  3711. "errorHandlingResponse": -4,
  3712. "errorHandlingRequestAccessDenied": -5,
  3713. "errorHandlingMethodCallTimedout": -6
  3714. };
  3715. Microsoft.Office.Common.MessageType={ "request": 0,
  3716. "response": 1
  3717. };
  3718. Microsoft.Office.Common.ActionType={ "invoke": 0,
  3719. "registerEvent": 1,
  3720. "unregisterEvent": 2 };
  3721. Microsoft.Office.Common.ResponseType={ "forCalling": 0,
  3722. "forEventing": 1
  3723. };
  3724. Microsoft.Office.Common.MethodObject=function Microsoft_Office_Common_MethodObject(method, invokeType, blockingOthers) {
  3725. this._method=method;
  3726. this._invokeType=invokeType;
  3727. this._blockingOthers=blockingOthers;
  3728. };
  3729. Microsoft.Office.Common.MethodObject.prototype={
  3730. getMethod: function Microsoft_Office_Common_MethodObject$getMethod() {
  3731. return this._method;
  3732. },
  3733. getInvokeType: function Microsoft_Office_Common_MethodObject$getInvokeType() {
  3734. return this._invokeType;
  3735. },
  3736. getBlockingFlag: function Microsoft_Office_Common_MethodObject$getBlockingFlag() {
  3737. return this._blockingOthers;
  3738. }
  3739. };
  3740. Microsoft.Office.Common.EventMethodObject=function Microsoft_Office_Common_EventMethodObject(registerMethodObject, unregisterMethodObject) {
  3741. this._registerMethodObject=registerMethodObject;
  3742. this._unregisterMethodObject=unregisterMethodObject;
  3743. };
  3744. Microsoft.Office.Common.EventMethodObject.prototype={
  3745. getRegisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getRegisterMethodObject() {
  3746. return this._registerMethodObject;
  3747. },
  3748. getUnregisterMethodObject: function Microsoft_Office_Common_EventMethodObject$getUnregisterMethodObject() {
  3749. return this._unregisterMethodObject;
  3750. }
  3751. };
  3752. Microsoft.Office.Common.ServiceEndPoint=function Microsoft_Office_Common_ServiceEndPoint(serviceEndPointId) {
  3753. var e=Function._validateParams(arguments, [
  3754. { name: "serviceEndPointId", type: String, mayBeNull: false }
  3755. ]);
  3756. if (e)
  3757. throw e;
  3758. this._methodObjectList={};
  3759. this._eventHandlerProxyList={};
  3760. this._Id=serviceEndPointId;
  3761. this._conversations={};
  3762. this._policyManager=null;
  3763. this._appDomains={};
  3764. this._onHandleRequestError=null;
  3765. };
  3766. Microsoft.Office.Common.ServiceEndPoint.prototype={
  3767. registerMethod: function Microsoft_Office_Common_ServiceEndPoint$registerMethod(methodName, method, invokeType, blockingOthers) {
  3768. var e=Function._validateParams(arguments, [{ name: "methodName", type: String, mayBeNull: false },
  3769. { name: "method", type: Function, mayBeNull: false },
  3770. { name: "invokeType", type: Number, mayBeNull: false },
  3771. { name: "blockingOthers", type: Boolean, mayBeNull: false }
  3772. ]);
  3773. if (e)
  3774. throw e;
  3775. if (invokeType !==Microsoft.Office.Common.InvokeType.async
  3776. && invokeType !==Microsoft.Office.Common.InvokeType.sync) {
  3777. throw OsfMsAjaxFactory.msAjaxError.argument("invokeType");
  3778. }
  3779. var methodObject=new Microsoft.Office.Common.MethodObject(method, invokeType, blockingOthers);
  3780. this._methodObjectList[methodName]=methodObject;
  3781. },
  3782. unregisterMethod: function Microsoft_Office_Common_ServiceEndPoint$unregisterMethod(methodName) {
  3783. var e=Function._validateParams(arguments, [
  3784. { name: "methodName", type: String, mayBeNull: false }
  3785. ]);
  3786. if (e)
  3787. throw e;
  3788. delete this._methodObjectList[methodName];
  3789. },
  3790. registerEvent: function Microsoft_Office_Common_ServiceEndPoint$registerEvent(eventName, registerMethod, unregisterMethod) {
  3791. var e=Function._validateParams(arguments, [{ name: "eventName", type: String, mayBeNull: false },
  3792. { name: "registerMethod", type: Function, mayBeNull: false },
  3793. { name: "unregisterMethod", type: Function, mayBeNull: false }
  3794. ]);
  3795. if (e)
  3796. throw e;
  3797. var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, Microsoft.Office.Common.InvokeType.syncRegisterEvent, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, Microsoft.Office.Common.InvokeType.syncUnregisterEvent, false));
  3798. this._methodObjectList[eventName]=methodObject;
  3799. },
  3800. registerEventEx: function Microsoft_Office_Common_ServiceEndPoint$registerEventEx(eventName, registerMethod, registerMethodInvokeType, unregisterMethod, unregisterMethodInvokeType) {
  3801. var e=Function._validateParams(arguments, [{ name: "eventName", type: String, mayBeNull: false },
  3802. { name: "registerMethod", type: Function, mayBeNull: false },
  3803. { name: "registerMethodInvokeType", type: Number, mayBeNull: false },
  3804. { name: "unregisterMethod", type: Function, mayBeNull: false },
  3805. { name: "unregisterMethodInvokeType", type: Number, mayBeNull: false }
  3806. ]);
  3807. if (e)
  3808. throw e;
  3809. var methodObject=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(registerMethod, registerMethodInvokeType, false), new Microsoft.Office.Common.MethodObject(unregisterMethod, unregisterMethodInvokeType, false));
  3810. this._methodObjectList[eventName]=methodObject;
  3811. },
  3812. unregisterEvent: function (eventName) {
  3813. var e=Function._validateParams(arguments, [
  3814. { name: "eventName", type: String, mayBeNull: false }
  3815. ]);
  3816. if (e)
  3817. throw e;
  3818. this.unregisterMethod(eventName);
  3819. },
  3820. registerConversation: function Microsoft_Office_Common_ServiceEndPoint$registerConversation(conversationId, conversationUrl, appDomains, serializerVersion) {
  3821. var e=Function._validateParams(arguments, [
  3822. { name: "conversationId", type: String, mayBeNull: false },
  3823. { name: "conversationUrl", type: String, mayBeNull: false, optional: true },
  3824. { name: "appDomains", type: Object, mayBeNull: true, optional: true },
  3825. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  3826. ]);
  3827. if (e)
  3828. throw e;
  3829. ;
  3830. if (appDomains) {
  3831. if (!(appDomains instanceof Array)) {
  3832. throw OsfMsAjaxFactory.msAjaxError.argument("appDomains");
  3833. }
  3834. this._appDomains[conversationId]=appDomains;
  3835. }
  3836. this._conversations[conversationId]={ url: conversationUrl, serializerVersion: serializerVersion };
  3837. },
  3838. unregisterConversation: function Microsoft_Office_Common_ServiceEndPoint$unregisterConversation(conversationId) {
  3839. var e=Function._validateParams(arguments, [
  3840. { name: "conversationId", type: String, mayBeNull: false }
  3841. ]);
  3842. if (e)
  3843. throw e;
  3844. delete this._conversations[conversationId];
  3845. },
  3846. setPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$setPolicyManager(policyManager) {
  3847. var e=Function._validateParams(arguments, [
  3848. { name: "policyManager", type: Object, mayBeNull: false }
  3849. ]);
  3850. if (e)
  3851. throw e;
  3852. if (!policyManager.checkPermission) {
  3853. throw OsfMsAjaxFactory.msAjaxError.argument("policyManager");
  3854. }
  3855. this._policyManager=policyManager;
  3856. },
  3857. getPolicyManager: function Microsoft_Office_Common_ServiceEndPoint$getPolicyManager() {
  3858. return this._policyManager;
  3859. },
  3860. dispose: function Microsoft_Office_Common_ServiceEndPoint$dispose() {
  3861. this._methodObjectList=null;
  3862. this._eventHandlerProxyList=null;
  3863. this._Id=null;
  3864. this._conversations=null;
  3865. this._policyManager=null;
  3866. this._appDomains=null;
  3867. this._onHandleRequestError=null;
  3868. }
  3869. };
  3870. Microsoft.Office.Common.ClientEndPoint=function Microsoft_Office_Common_ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion) {
  3871. var e=Function._validateParams(arguments, [
  3872. { name: "conversationId", type: String, mayBeNull: false },
  3873. { name: "targetWindow", mayBeNull: false },
  3874. { name: "targetUrl", type: String, mayBeNull: false },
  3875. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  3876. ]);
  3877. if (e)
  3878. throw e;
  3879. try {
  3880. if (!targetWindow.postMessage) {
  3881. throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow");
  3882. }
  3883. }
  3884. catch (ex) {
  3885. if (!Object.prototype.hasOwnProperty.call(targetWindow, "postMessage")) {
  3886. throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow");
  3887. }
  3888. }
  3889. this._conversationId=conversationId;
  3890. this._targetWindow=targetWindow;
  3891. this._targetUrl=targetUrl;
  3892. this._callingIndex=0;
  3893. this._callbackList={};
  3894. this._eventHandlerList={};
  3895. if (serializerVersion !=null) {
  3896. this._serializerVersion=serializerVersion;
  3897. }
  3898. else {
  3899. this._serializerVersion=OSF.SerializerVersion.Browser;
  3900. }
  3901. };
  3902. Microsoft.Office.Common.ClientEndPoint.prototype={
  3903. invoke: function Microsoft_Office_Common_ClientEndPoint$invoke(targetMethodName, callback, param) {
  3904. var e=Function._validateParams(arguments, [{ name: "targetMethodName", type: String, mayBeNull: false },
  3905. { name: "callback", type: Function, mayBeNull: true },
  3906. { name: "param", mayBeNull: true }
  3907. ]);
  3908. if (e)
  3909. throw e;
  3910. var correlationId=this._callingIndex++;
  3911. var now=new Date();
  3912. var callbackEntry={ "callback": callback, "createdOn": now.getTime() };
  3913. if (param && typeof param==="object" && typeof param.__timeout__==="number") {
  3914. callbackEntry.timeout=param.__timeout__;
  3915. delete param.__timeout__;
  3916. }
  3917. this._callbackList[correlationId]=callbackEntry;
  3918. try {
  3919. var callRequest=new Microsoft.Office.Common.Request(targetMethodName, Microsoft.Office.Common.ActionType.invoke, this._conversationId, correlationId, param);
  3920. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3921. this._targetWindow.postMessage(msg, this._targetUrl);
  3922. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3923. }
  3924. catch (ex) {
  3925. try {
  3926. if (callback !==null)
  3927. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3928. }
  3929. finally {
  3930. delete this._callbackList[correlationId];
  3931. }
  3932. }
  3933. },
  3934. registerForEvent: function Microsoft_Office_Common_ClientEndPoint$registerForEvent(targetEventName, eventHandler, callback, data) {
  3935. var e=Function._validateParams(arguments, [{ name: "targetEventName", type: String, mayBeNull: false },
  3936. { name: "eventHandler", type: Function, mayBeNull: false },
  3937. { name: "callback", type: Function, mayBeNull: true },
  3938. { name: "data", mayBeNull: true, optional: true }
  3939. ]);
  3940. if (e)
  3941. throw e;
  3942. var correlationId=this._callingIndex++;
  3943. var now=new Date();
  3944. this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() };
  3945. try {
  3946. var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.registerEvent, this._conversationId, correlationId, data);
  3947. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3948. this._targetWindow.postMessage(msg, this._targetUrl);
  3949. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3950. this._eventHandlerList[targetEventName]=eventHandler;
  3951. }
  3952. catch (ex) {
  3953. try {
  3954. if (callback !==null) {
  3955. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3956. }
  3957. }
  3958. finally {
  3959. delete this._callbackList[correlationId];
  3960. }
  3961. }
  3962. },
  3963. unregisterForEvent: function Microsoft_Office_Common_ClientEndPoint$unregisterForEvent(targetEventName, callback, data) {
  3964. var e=Function._validateParams(arguments, [{ name: "targetEventName", type: String, mayBeNull: false },
  3965. { name: "callback", type: Function, mayBeNull: true },
  3966. { name: "data", mayBeNull: true, optional: true }
  3967. ]);
  3968. if (e)
  3969. throw e;
  3970. var correlationId=this._callingIndex++;
  3971. var now=new Date();
  3972. this._callbackList[correlationId]={ "callback": callback, "createdOn": now.getTime() };
  3973. try {
  3974. var callRequest=new Microsoft.Office.Common.Request(targetEventName, Microsoft.Office.Common.ActionType.unregisterEvent, this._conversationId, correlationId, data);
  3975. var msg=Microsoft.Office.Common.MessagePackager.envelope(callRequest, this._serializerVersion);
  3976. this._targetWindow.postMessage(msg, this._targetUrl);
  3977. Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer();
  3978. }
  3979. catch (ex) {
  3980. try {
  3981. if (callback !==null) {
  3982. callback(Microsoft.Office.Common.InvokeResultCode.errorInRequest, ex);
  3983. }
  3984. }
  3985. finally {
  3986. delete this._callbackList[correlationId];
  3987. }
  3988. }
  3989. finally {
  3990. delete this._eventHandlerList[targetEventName];
  3991. }
  3992. }
  3993. };
  3994. Microsoft.Office.Common.XdmCommunicationManager=(function () {
  3995. var _invokerQueue=[];
  3996. var _lastMessageProcessTime=null;
  3997. var _messageProcessingTimer=null;
  3998. var _processInterval=10;
  3999. var _blockingFlag=false;
  4000. var _methodTimeoutTimer=null;
  4001. var _methodTimeoutProcessInterval=2000;
  4002. var _methodTimeoutDefault=65000;
  4003. var _methodTimeout=_methodTimeoutDefault;
  4004. var _serviceEndPoints={};
  4005. var _clientEndPoints={};
  4006. var _initialized=false;
  4007. function _lookupServiceEndPoint(conversationId) {
  4008. for (var id in _serviceEndPoints) {
  4009. if (_serviceEndPoints[id]._conversations[conversationId]) {
  4010. return _serviceEndPoints[id];
  4011. }
  4012. }
  4013. OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id.");
  4014. throw OsfMsAjaxFactory.msAjaxError.argument("conversationId");
  4015. }
  4016. ;
  4017. function _lookupClientEndPoint(conversationId) {
  4018. var clientEndPoint=_clientEndPoints[conversationId];
  4019. if (!clientEndPoint) {
  4020. OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id.");
  4021. }
  4022. return clientEndPoint;
  4023. }
  4024. ;
  4025. function _lookupMethodObject(serviceEndPoint, messageObject) {
  4026. var methodOrEventMethodObject=serviceEndPoint._methodObjectList[messageObject._actionName];
  4027. if (!methodOrEventMethodObject) {
  4028. OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+messageObject._actionName);
  4029. throw OsfMsAjaxFactory.msAjaxError.argument("messageObject");
  4030. }
  4031. var methodObject=null;
  4032. if (messageObject._actionType===Microsoft.Office.Common.ActionType.invoke) {
  4033. methodObject=methodOrEventMethodObject;
  4034. }
  4035. else if (messageObject._actionType===Microsoft.Office.Common.ActionType.registerEvent) {
  4036. methodObject=methodOrEventMethodObject.getRegisterMethodObject();
  4037. }
  4038. else {
  4039. methodObject=methodOrEventMethodObject.getUnregisterMethodObject();
  4040. }
  4041. return methodObject;
  4042. }
  4043. ;
  4044. function _enqueInvoker(invoker) {
  4045. _invokerQueue.push(invoker);
  4046. }
  4047. ;
  4048. function _dequeInvoker() {
  4049. if (_messageProcessingTimer !==null) {
  4050. if (!_blockingFlag) {
  4051. if (_invokerQueue.length > 0) {
  4052. var invoker=_invokerQueue.shift();
  4053. _executeCommand(invoker);
  4054. }
  4055. else {
  4056. clearInterval(_messageProcessingTimer);
  4057. _messageProcessingTimer=null;
  4058. }
  4059. }
  4060. }
  4061. else {
  4062. OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.");
  4063. }
  4064. }
  4065. ;
  4066. function _executeCommand(invoker) {
  4067. _blockingFlag=invoker.getInvokeBlockingFlag();
  4068. invoker.invoke();
  4069. _lastMessageProcessTime=(new Date()).getTime();
  4070. }
  4071. ;
  4072. function _checkMethodTimeout() {
  4073. if (_methodTimeoutTimer) {
  4074. var clientEndPoint;
  4075. var methodCallsNotTimedout=0;
  4076. var now=new Date();
  4077. var timeoutValue;
  4078. for (var conversationId in _clientEndPoints) {
  4079. clientEndPoint=_clientEndPoints[conversationId];
  4080. for (var correlationId in clientEndPoint._callbackList) {
  4081. var callbackEntry=clientEndPoint._callbackList[correlationId];
  4082. timeoutValue=callbackEntry.timeout ? callbackEntry.timeout : _methodTimeout;
  4083. if (timeoutValue >=0 && Math.abs(now.getTime() - callbackEntry.createdOn) >=timeoutValue) {
  4084. try {
  4085. if (callbackEntry.callback) {
  4086. callbackEntry.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout, null);
  4087. }
  4088. }
  4089. finally {
  4090. delete clientEndPoint._callbackList[correlationId];
  4091. }
  4092. }
  4093. else {
  4094. methodCallsNotTimedout++;
  4095. }
  4096. ;
  4097. }
  4098. }
  4099. if (methodCallsNotTimedout===0) {
  4100. clearInterval(_methodTimeoutTimer);
  4101. _methodTimeoutTimer=null;
  4102. }
  4103. }
  4104. else {
  4105. OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.");
  4106. }
  4107. }
  4108. ;
  4109. function _postCallbackHandler() {
  4110. _blockingFlag=false;
  4111. }
  4112. ;
  4113. function _registerListener(listener) {
  4114. if (window.addEventListener) {
  4115. window.addEventListener("message", listener, false);
  4116. }
  4117. else if ((navigator.userAgent.indexOf("MSIE") > -1) && window.attachEvent) {
  4118. window.attachEvent("onmessage", listener);
  4119. }
  4120. else {
  4121. OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API.");
  4122. throw OsfMsAjaxFactory.msAjaxError.argument("Browser");
  4123. }
  4124. }
  4125. ;
  4126. function _checkOrigin(url, origin) {
  4127. var res=false;
  4128. if (url===true) {
  4129. return true;
  4130. }
  4131. if (!url || !origin || !url.length || !origin.length) {
  4132. return res;
  4133. }
  4134. var url_parser, org_parser;
  4135. url_parser=document.createElement('a');
  4136. org_parser=document.createElement('a');
  4137. url_parser.href=url;
  4138. org_parser.href=origin;
  4139. res=_urlCompare(url_parser, org_parser);
  4140. delete url_parser, org_parser;
  4141. return res;
  4142. }
  4143. function _checkOriginWithAppDomains(allowed_domains, origin) {
  4144. var res=false;
  4145. if (!origin || !origin.length || !(allowed_domains) || !(allowed_domains instanceof Array) || !allowed_domains.length) {
  4146. return res;
  4147. }
  4148. var org_parser=document.createElement('a');
  4149. var app_domain_parser=document.createElement('a');
  4150. org_parser.href=origin;
  4151. for (var i=0; i < allowed_domains.length && !res; i++) {
  4152. if (allowed_domains[i].indexOf("://") !==-1) {
  4153. app_domain_parser.href=allowed_domains[i];
  4154. res=_urlCompare(org_parser, app_domain_parser);
  4155. }
  4156. }
  4157. delete org_parser, app_domain_parser;
  4158. return res;
  4159. }
  4160. function _urlCompare(url_parser1, url_parser2) {
  4161. return ((url_parser1.hostname==url_parser2.hostname) &&
  4162. (url_parser1.protocol==url_parser2.protocol) &&
  4163. (url_parser1.port==url_parser2.port));
  4164. }
  4165. function _receive(e) {
  4166. if (e.data !='') {
  4167. var messageObject;
  4168. var serializerVersion=OSF.SerializerVersion.Browser;
  4169. var serializedMessage=e.data;
  4170. try {
  4171. messageObject=Microsoft.Office.Common.MessagePackager.unenvelope(serializedMessage, OSF.SerializerVersion.Browser);
  4172. serializerVersion=messageObject._serializerVersion !=null ? messageObject._serializerVersion : serializerVersion;
  4173. }
  4174. catch (ex) {
  4175. return;
  4176. }
  4177. if (messageObject._messageType===Microsoft.Office.Common.MessageType.request) {
  4178. var requesterUrl=(e.origin==null || e.origin=="null") ? messageObject._origin : e.origin;
  4179. try {
  4180. var serviceEndPoint=_lookupServiceEndPoint(messageObject._conversationId);
  4181. ;
  4182. var conversation=serviceEndPoint._conversations[messageObject._conversationId];
  4183. serializerVersion=conversation.serializerVersion !=null ? conversation.serializerVersion : serializerVersion;
  4184. ;
  4185. if (!_checkOrigin(conversation.url, e.origin) && !_checkOriginWithAppDomains(serviceEndPoint._appDomains[messageObject._conversationId], e.origin)) {
  4186. throw "Failed origin check";
  4187. }
  4188. var policyManager=serviceEndPoint.getPolicyManager();
  4189. if (policyManager && !policyManager.checkPermission(messageObject._conversationId, messageObject._actionName, messageObject._data)) {
  4190. throw "Access Denied";
  4191. }
  4192. var methodObject=_lookupMethodObject(serviceEndPoint, messageObject);
  4193. var invokeCompleteCallback=new Microsoft.Office.Common.InvokeCompleteCallback(e.source, requesterUrl, messageObject._actionName, messageObject._conversationId, messageObject._correlationId, _postCallbackHandler, serializerVersion);
  4194. var invoker=new Microsoft.Office.Common.Invoker(methodObject, messageObject._data, invokeCompleteCallback, serviceEndPoint._eventHandlerProxyList, messageObject._conversationId, messageObject._actionName, serializerVersion);
  4195. var shouldEnque=true;
  4196. if (_messageProcessingTimer==null) {
  4197. if ((_lastMessageProcessTime==null || (new Date()).getTime() - _lastMessageProcessTime > _processInterval) && !_blockingFlag) {
  4198. _executeCommand(invoker);
  4199. shouldEnque=false;
  4200. }
  4201. else {
  4202. _messageProcessingTimer=setInterval(_dequeInvoker, _processInterval);
  4203. }
  4204. }
  4205. if (shouldEnque) {
  4206. _enqueInvoker(invoker);
  4207. }
  4208. }
  4209. catch (ex) {
  4210. if (serviceEndPoint && serviceEndPoint._onHandleRequestError) {
  4211. serviceEndPoint._onHandleRequestError(messageObject, ex);
  4212. }
  4213. var errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;
  4214. if (ex=="Access Denied") {
  4215. errorCode=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied;
  4216. }
  4217. var callResponse=new Microsoft.Office.Common.Response(messageObject._actionName, messageObject._conversationId, messageObject._correlationId, errorCode, Microsoft.Office.Common.ResponseType.forCalling, ex);
  4218. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(callResponse, serializerVersion);
  4219. if (e.source && e.source.postMessage) {
  4220. e.source.postMessage(envelopedResult, requesterUrl);
  4221. }
  4222. }
  4223. }
  4224. else if (messageObject._messageType===Microsoft.Office.Common.MessageType.response) {
  4225. var clientEndPoint=_lookupClientEndPoint(messageObject._conversationId);
  4226. if (!clientEndPoint) {
  4227. return;
  4228. }
  4229. clientEndPoint._serializerVersion=serializerVersion;
  4230. ;
  4231. if (!_checkOrigin(clientEndPoint._targetUrl, e.origin)) {
  4232. throw "Failed orgin check";
  4233. }
  4234. if (messageObject._responseType===Microsoft.Office.Common.ResponseType.forCalling) {
  4235. var callbackEntry=clientEndPoint._callbackList[messageObject._correlationId];
  4236. if (callbackEntry) {
  4237. try {
  4238. if (callbackEntry.callback)
  4239. callbackEntry.callback(messageObject._errorCode, messageObject._data);
  4240. }
  4241. finally {
  4242. delete clientEndPoint._callbackList[messageObject._correlationId];
  4243. }
  4244. }
  4245. }
  4246. else {
  4247. var eventhandler=clientEndPoint._eventHandlerList[messageObject._actionName];
  4248. if (eventhandler !==undefined && eventhandler !==null) {
  4249. eventhandler(messageObject._data);
  4250. }
  4251. }
  4252. }
  4253. else {
  4254. return;
  4255. }
  4256. }
  4257. }
  4258. ;
  4259. function _initialize() {
  4260. if (!_initialized) {
  4261. _registerListener(_receive);
  4262. _initialized=true;
  4263. }
  4264. }
  4265. ;
  4266. return {
  4267. connect: function Microsoft_Office_Common_XdmCommunicationManager$connect(conversationId, targetWindow, targetUrl, serializerVersion) {
  4268. var clientEndPoint=_clientEndPoints[conversationId];
  4269. if (!clientEndPoint) {
  4270. _initialize();
  4271. clientEndPoint=new Microsoft.Office.Common.ClientEndPoint(conversationId, targetWindow, targetUrl, serializerVersion);
  4272. _clientEndPoints[conversationId]=clientEndPoint;
  4273. }
  4274. return clientEndPoint;
  4275. },
  4276. getClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getClientEndPoint(conversationId) {
  4277. var e=Function._validateParams(arguments, [
  4278. { name: "conversationId", type: String, mayBeNull: false }
  4279. ]);
  4280. if (e)
  4281. throw e;
  4282. return _clientEndPoints[conversationId];
  4283. },
  4284. createServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$createServiceEndPoint(serviceEndPointId) {
  4285. _initialize();
  4286. var serviceEndPoint=new Microsoft.Office.Common.ServiceEndPoint(serviceEndPointId);
  4287. _serviceEndPoints[serviceEndPointId]=serviceEndPoint;
  4288. return serviceEndPoint;
  4289. },
  4290. getServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$getServiceEndPoint(serviceEndPointId) {
  4291. var e=Function._validateParams(arguments, [
  4292. { name: "serviceEndPointId", type: String, mayBeNull: false }
  4293. ]);
  4294. if (e)
  4295. throw e;
  4296. return _serviceEndPoints[serviceEndPointId];
  4297. },
  4298. deleteClientEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteClientEndPoint(conversationId) {
  4299. var e=Function._validateParams(arguments, [
  4300. { name: "conversationId", type: String, mayBeNull: false }
  4301. ]);
  4302. if (e)
  4303. throw e;
  4304. delete _clientEndPoints[conversationId];
  4305. },
  4306. deleteServiceEndPoint: function Microsoft_Office_Common_XdmCommunicationManager$deleteServiceEndPoint(serviceEndPointId) {
  4307. var e=Function._validateParams(arguments, [
  4308. { name: "serviceEndPointId", type: String, mayBeNull: false }
  4309. ]);
  4310. if (e)
  4311. throw e;
  4312. delete _serviceEndPoints[serviceEndPointId];
  4313. },
  4314. checkUrlWithAppDomains: function Microsoft_Office_Common_XdmCommunicationManager$_checkUrlWithAppDomains(appDomains, origin) {
  4315. return _checkOriginWithAppDomains(appDomains, origin);
  4316. },
  4317. _setMethodTimeout: function Microsoft_Office_Common_XdmCommunicationManager$_setMethodTimeout(methodTimeout) {
  4318. var e=Function._validateParams(arguments, [
  4319. { name: "methodTimeout", type: Number, mayBeNull: false }
  4320. ]);
  4321. if (e)
  4322. throw e;
  4323. _methodTimeout=(methodTimeout <=0) ? _methodTimeoutDefault : methodTimeout;
  4324. },
  4325. _startMethodTimeoutTimer: function Microsoft_Office_Common_XdmCommunicationManager$_startMethodTimeoutTimer() {
  4326. if (!_methodTimeoutTimer) {
  4327. _methodTimeoutTimer=setInterval(_checkMethodTimeout, _methodTimeoutProcessInterval);
  4328. }
  4329. }
  4330. };
  4331. })();
  4332. Microsoft.Office.Common.Message=function Microsoft_Office_Common_Message(messageType, actionName, conversationId, correlationId, data) {
  4333. var e=Function._validateParams(arguments, [{ name: "messageType", type: Number, mayBeNull: false },
  4334. { name: "actionName", type: String, mayBeNull: false },
  4335. { name: "conversationId", type: String, mayBeNull: false },
  4336. { name: "correlationId", mayBeNull: false },
  4337. { name: "data", mayBeNull: true, optional: true }
  4338. ]);
  4339. if (e)
  4340. throw e;
  4341. this._messageType=messageType;
  4342. this._actionName=actionName;
  4343. this._conversationId=conversationId;
  4344. this._correlationId=correlationId;
  4345. this._origin=window.location.href;
  4346. if (typeof data=="undefined") {
  4347. this._data=null;
  4348. }
  4349. else {
  4350. this._data=data;
  4351. }
  4352. };
  4353. Microsoft.Office.Common.Message.prototype={
  4354. getActionName: function Microsoft_Office_Common_Message$getActionName() {
  4355. return this._actionName;
  4356. },
  4357. getConversationId: function Microsoft_Office_Common_Message$getConversationId() {
  4358. return this._conversationId;
  4359. },
  4360. getCorrelationId: function Microsoft_Office_Common_Message$getCorrelationId() {
  4361. return this._correlationId;
  4362. },
  4363. getOrigin: function Microsoft_Office_Common_Message$getOrigin() {
  4364. return this._origin;
  4365. },
  4366. getData: function Microsoft_Office_Common_Message$getData() {
  4367. return this._data;
  4368. },
  4369. getMessageType: function Microsoft_Office_Common_Message$getMessageType() {
  4370. return this._messageType;
  4371. }
  4372. };
  4373. Microsoft.Office.Common.Request=function Microsoft_Office_Common_Request(actionName, actionType, conversationId, correlationId, data) {
  4374. Microsoft.Office.Common.Request.uber.constructor.call(this, Microsoft.Office.Common.MessageType.request, actionName, conversationId, correlationId, data);
  4375. this._actionType=actionType;
  4376. };
  4377. OSF.OUtil.extend(Microsoft.Office.Common.Request, Microsoft.Office.Common.Message);
  4378. Microsoft.Office.Common.Request.prototype.getActionType=function Microsoft_Office_Common_Request$getActionType() {
  4379. return this._actionType;
  4380. };
  4381. Microsoft.Office.Common.Response=function Microsoft_Office_Common_Response(actionName, conversationId, correlationId, errorCode, responseType, data) {
  4382. Microsoft.Office.Common.Response.uber.constructor.call(this, Microsoft.Office.Common.MessageType.response, actionName, conversationId, correlationId, data);
  4383. this._errorCode=errorCode;
  4384. this._responseType=responseType;
  4385. };
  4386. OSF.OUtil.extend(Microsoft.Office.Common.Response, Microsoft.Office.Common.Message);
  4387. Microsoft.Office.Common.Response.prototype.getErrorCode=function Microsoft_Office_Common_Response$getErrorCode() {
  4388. return this._errorCode;
  4389. };
  4390. Microsoft.Office.Common.Response.prototype.getResponseType=function Microsoft_Office_Common_Response$getResponseType() {
  4391. return this._responseType;
  4392. };
  4393. Microsoft.Office.Common.MessagePackager={
  4394. envelope: function Microsoft_Office_Common_MessagePackager$envelope(messageObject, serializerVersion) {
  4395. if (typeof (messageObject)==="object") {
  4396. messageObject._serializerVersion=OSF.SerializerVersion.Browser;
  4397. }
  4398. return JSON.stringify(messageObject);
  4399. },
  4400. unenvelope: function Microsoft_Office_Common_MessagePackager$unenvelope(messageObject, serializerVersion) {
  4401. return JSON.parse(messageObject);
  4402. }
  4403. };
  4404. Microsoft.Office.Common.ResponseSender=function Microsoft_Office_Common_ResponseSender(requesterWindow, requesterUrl, actionName, conversationId, correlationId, responseType, serializerVersion) {
  4405. var e=Function._validateParams(arguments, [{ name: "requesterWindow", mayBeNull: false },
  4406. { name: "requesterUrl", type: String, mayBeNull: false },
  4407. { name: "actionName", type: String, mayBeNull: false },
  4408. { name: "conversationId", type: String, mayBeNull: false },
  4409. { name: "correlationId", mayBeNull: false },
  4410. { name: "responsetype", type: Number, maybeNull: false },
  4411. { name: "serializerVersion", type: Number, maybeNull: true, optional: true }
  4412. ]);
  4413. if (e)
  4414. throw e;
  4415. this._requesterWindow=requesterWindow;
  4416. this._requesterUrl=requesterUrl;
  4417. this._actionName=actionName;
  4418. this._conversationId=conversationId;
  4419. this._correlationId=correlationId;
  4420. this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError;
  4421. this._responseType=responseType;
  4422. var me=this;
  4423. this._send=function (result) {
  4424. try {
  4425. var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result);
  4426. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion);
  4427. me._requesterWindow.postMessage(envelopedResult, me._requesterUrl);
  4428. ;
  4429. }
  4430. catch (ex) {
  4431. OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+ex.message);
  4432. }
  4433. };
  4434. };
  4435. Microsoft.Office.Common.ResponseSender.prototype={
  4436. getRequesterWindow: function Microsoft_Office_Common_ResponseSender$getRequesterWindow() {
  4437. return this._requesterWindow;
  4438. },
  4439. getRequesterUrl: function Microsoft_Office_Common_ResponseSender$getRequesterUrl() {
  4440. return this._requesterUrl;
  4441. },
  4442. getActionName: function Microsoft_Office_Common_ResponseSender$getActionName() {
  4443. return this._actionName;
  4444. },
  4445. getConversationId: function Microsoft_Office_Common_ResponseSender$getConversationId() {
  4446. return this._conversationId;
  4447. },
  4448. getCorrelationId: function Microsoft_Office_Common_ResponseSender$getCorrelationId() {
  4449. return this._correlationId;
  4450. },
  4451. getSend: function Microsoft_Office_Common_ResponseSender$getSend() {
  4452. return this._send;
  4453. },
  4454. setResultCode: function Microsoft_Office_Common_ResponseSender$setResultCode(resultCode) {
  4455. this._invokeResultCode=resultCode;
  4456. }
  4457. };
  4458. Microsoft.Office.Common.InvokeCompleteCallback=function Microsoft_Office_Common_InvokeCompleteCallback(requesterWindow, requesterUrl, actionName, conversationId, correlationId, postCallbackHandler, serializerVersion) {
  4459. Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this, requesterWindow, requesterUrl, actionName, conversationId, correlationId, Microsoft.Office.Common.ResponseType.forCalling, serializerVersion);
  4460. this._postCallbackHandler=postCallbackHandler;
  4461. var me=this;
  4462. this._send=function (result, responseCode) {
  4463. if (responseCode !=undefined) {
  4464. me._invokeResultCode=responseCode;
  4465. }
  4466. try {
  4467. var response=new Microsoft.Office.Common.Response(me._actionName, me._conversationId, me._correlationId, me._invokeResultCode, me._responseType, result);
  4468. var envelopedResult=Microsoft.Office.Common.MessagePackager.envelope(response, serializerVersion);
  4469. me._requesterWindow.postMessage(envelopedResult, me._requesterUrl);
  4470. me._postCallbackHandler();
  4471. }
  4472. catch (ex) {
  4473. OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+ex.message);
  4474. }
  4475. };
  4476. };
  4477. OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback, Microsoft.Office.Common.ResponseSender);
  4478. Microsoft.Office.Common.Invoker=function Microsoft_Office_Common_Invoker(methodObject, paramValue, invokeCompleteCallback, eventHandlerProxyList, conversationId, eventName, serializerVersion) {
  4479. var e=Function._validateParams(arguments, [
  4480. { name: "methodObject", mayBeNull: false },
  4481. { name: "paramValue", mayBeNull: true },
  4482. { name: "invokeCompleteCallback", mayBeNull: false },
  4483. { name: "eventHandlerProxyList", mayBeNull: true },
  4484. { name: "conversationId", type: String, mayBeNull: false },
  4485. { name: "eventName", type: String, mayBeNull: false },
  4486. { name: "serializerVersion", type: Number, mayBeNull: true, optional: true }
  4487. ]);
  4488. if (e)
  4489. throw e;
  4490. this._methodObject=methodObject;
  4491. this._param=paramValue;
  4492. this._invokeCompleteCallback=invokeCompleteCallback;
  4493. this._eventHandlerProxyList=eventHandlerProxyList;
  4494. this._conversationId=conversationId;
  4495. this._eventName=eventName;
  4496. this._serializerVersion=serializerVersion;
  4497. };
  4498. Microsoft.Office.Common.Invoker.prototype={
  4499. invoke: function Microsoft_Office_Common_Invoker$invoke() {
  4500. try {
  4501. var result;
  4502. switch (this._methodObject.getInvokeType()) {
  4503. case Microsoft.Office.Common.InvokeType.async:
  4504. this._methodObject.getMethod()(this._param, this._invokeCompleteCallback.getSend());
  4505. break;
  4506. case Microsoft.Office.Common.InvokeType.sync:
  4507. result=this._methodObject.getMethod()(this._param);
  4508. this._invokeCompleteCallback.getSend()(result);
  4509. break;
  4510. case Microsoft.Office.Common.InvokeType.syncRegisterEvent:
  4511. var eventHandlerProxy=this._createEventHandlerProxyObject(this._invokeCompleteCallback);
  4512. result=this._methodObject.getMethod()(eventHandlerProxy.getSend(), this._param);
  4513. this._eventHandlerProxyList[this._conversationId+this._eventName]=eventHandlerProxy.getSend();
  4514. this._invokeCompleteCallback.getSend()(result);
  4515. break;
  4516. case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:
  4517. var eventHandler=this._eventHandlerProxyList[this._conversationId+this._eventName];
  4518. result=this._methodObject.getMethod()(eventHandler, this._param);
  4519. delete this._eventHandlerProxyList[this._conversationId+this._eventName];
  4520. this._invokeCompleteCallback.getSend()(result);
  4521. break;
  4522. case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:
  4523. var eventHandlerProxyAsync=this._createEventHandlerProxyObject(this._invokeCompleteCallback);
  4524. this._methodObject.getMethod()(eventHandlerProxyAsync.getSend(), this._invokeCompleteCallback.getSend(), this._param);
  4525. this._eventHandlerProxyList[this._callerId+this._eventName]=eventHandlerProxyAsync.getSend();
  4526. break;
  4527. case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:
  4528. var eventHandlerAsync=this._eventHandlerProxyList[this._callerId+this._eventName];
  4529. this._methodObject.getMethod()(eventHandlerAsync, this._invokeCompleteCallback.getSend(), this._param);
  4530. delete this._eventHandlerProxyList[this._callerId+this._eventName];
  4531. break;
  4532. default:
  4533. break;
  4534. }
  4535. }
  4536. catch (ex) {
  4537. this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse);
  4538. this._invokeCompleteCallback.getSend()(ex);
  4539. }
  4540. },
  4541. getInvokeBlockingFlag: function Microsoft_Office_Common_Invoker$getInvokeBlockingFlag() {
  4542. return this._methodObject.getBlockingFlag();
  4543. },
  4544. _createEventHandlerProxyObject: function Microsoft_Office_Common_Invoker$_createEventHandlerProxyObject(invokeCompleteObject) {
  4545. return new Microsoft.Office.Common.ResponseSender(invokeCompleteObject.getRequesterWindow(), invokeCompleteObject.getRequesterUrl(), invokeCompleteObject.getActionName(), invokeCompleteObject.getConversationId(), invokeCompleteObject.getCorrelationId(), Microsoft.Office.Common.ResponseType.forEventing, this._serializerVersion);
  4546. }
  4547. };
  4548. OSF.OUtil.setNamespace("WAC", OSF.DDA);
  4549. OSF.DDA.WAC.UniqueArguments={
  4550. Data: "Data",
  4551. Properties: "Properties",
  4552. BindingRequest: "DdaBindingsMethod",
  4553. BindingResponse: "Bindings",
  4554. SingleBindingResponse: "singleBindingResponse",
  4555. GetData: "DdaGetBindingData",
  4556. AddRowsColumns: "DdaAddRowsColumns",
  4557. SetData: "DdaSetBindingData",
  4558. ClearFormats: "DdaClearBindingFormats",
  4559. SetFormats: "DdaSetBindingFormats",
  4560. SettingsRequest: "DdaSettingsMethod",
  4561. BindingEventSource: "ddaBinding",
  4562. ArrayData: "ArrayData"
  4563. };
  4564. OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC);
  4565. OSF.DDA.WAC.Delegate.SpecialProcessor=function OSF_DDA_WAC_Delegate_SpecialProcessor() {
  4566. var complexTypes=[
  4567. OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,
  4568. OSF.DDA.WAC.UniqueArguments.BindingRequest,
  4569. OSF.DDA.WAC.UniqueArguments.BindingResponse,
  4570. OSF.DDA.WAC.UniqueArguments.GetData,
  4571. OSF.DDA.WAC.UniqueArguments.AddRowsColumns,
  4572. OSF.DDA.WAC.UniqueArguments.SetData,
  4573. OSF.DDA.WAC.UniqueArguments.ClearFormats,
  4574. OSF.DDA.WAC.UniqueArguments.SetFormats,
  4575. OSF.DDA.WAC.UniqueArguments.SettingsRequest,
  4576. OSF.DDA.WAC.UniqueArguments.BindingEventSource
  4577. ];
  4578. var dynamicTypes={};
  4579. OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  4580. };
  4581. OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  4582. OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor(), []);
  4583. OSF.OUtil.setNamespace("WAC", OSF.DDA);
  4584. OSF.OUtil.setNamespace("Delegate", OSF.DDA.WAC);
  4585. OSF.DDA.WAC.getDelegateMethods=function OSF_DDA_WAC_getDelegateMethods() {
  4586. var delegateMethods={};
  4587. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync;
  4588. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync;
  4589. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync;
  4590. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.WAC.Delegate.openDialog;
  4591. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.WAC.Delegate.messageParent;
  4592. delegateMethods[OSF.DDA.DispIdHost.Delegates.SendMessage]=OSF.DDA.WAC.Delegate.sendMessage;
  4593. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.WAC.Delegate.closeDialog;
  4594. return delegateMethods;
  4595. };
  4596. OSF.DDA.WAC.Delegate.version=1;
  4597. OSF.DDA.WAC.Delegate.executeAsync=function OSF_DDA_WAC_Delegate$executeAsync(args) {
  4598. if (!args.hostCallArgs) {
  4599. args.hostCallArgs={};
  4600. }
  4601. args.hostCallArgs["DdaMethod"]={
  4602. "ControlId": OSF._OfficeAppFactory.getId(),
  4603. "Version": OSF.DDA.WAC.Delegate.version,
  4604. "DispatchId": args.dispId
  4605. };
  4606. args.hostCallArgs["__timeout__"]=-1;
  4607. if (args.onCalling) {
  4608. args.onCalling();
  4609. }
  4610. var startTime=(new Date()).getTime();
  4611. OSF.getClientEndPoint().invoke("executeMethod", function OSF_DDA_WAC_Delegate$OMFacade$OnResponse(xdmStatus, payload) {
  4612. if (args.onReceiving) {
  4613. args.onReceiving();
  4614. }
  4615. var error;
  4616. if (xdmStatus==Microsoft.Office.Common.InvokeResultCode.noError) {
  4617. OSF.DDA.WAC.Delegate.version=payload["Version"];
  4618. error=payload["Error"];
  4619. }
  4620. else {
  4621. switch (xdmStatus) {
  4622. case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:
  4623. error=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  4624. break;
  4625. default:
  4626. error=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4627. break;
  4628. }
  4629. }
  4630. if (args.onComplete) {
  4631. args.onComplete(error, payload);
  4632. }
  4633. if (OSF.AppTelemetry) {
  4634. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), error);
  4635. }
  4636. }, args.hostCallArgs);
  4637. };
  4638. OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function OSF_DDA_WAC_Delegate$GetOnAfterRegisterEvent(register, args) {
  4639. var startTime=(new Date()).getTime();
  4640. return function OSF_DDA_WAC_Delegate$OnAfterRegisterEvent(xdmStatus, payload) {
  4641. if (args.onReceiving) {
  4642. args.onReceiving();
  4643. }
  4644. var status;
  4645. if (xdmStatus !=Microsoft.Office.Common.InvokeResultCode.noError) {
  4646. switch (xdmStatus) {
  4647. case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:
  4648. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  4649. break;
  4650. default:
  4651. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4652. break;
  4653. }
  4654. }
  4655. else {
  4656. if (payload) {
  4657. if (payload["Error"]) {
  4658. status=payload["Error"];
  4659. }
  4660. else {
  4661. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4662. }
  4663. }
  4664. else {
  4665. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4666. }
  4667. }
  4668. if (args.onComplete) {
  4669. args.onComplete(status);
  4670. }
  4671. if (OSF.AppTelemetry) {
  4672. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  4673. }
  4674. };
  4675. };
  4676. OSF.DDA.WAC.Delegate.registerEventAsync=function OSF_DDA_WAC_Delegate$RegisterEventAsync(args) {
  4677. if (args.onCalling) {
  4678. args.onCalling();
  4679. }
  4680. OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), function OSF_DDA_WACOMFacade$OnEvent(payload) {
  4681. if (args.onEvent) {
  4682. args.onEvent(payload);
  4683. }
  4684. if (OSF.AppTelemetry) {
  4685. OSF.AppTelemetry.onEventDone(args.dispId);
  4686. }
  4687. }, OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args), {
  4688. "controlId": OSF._OfficeAppFactory.getId(),
  4689. "eventDispId": args.dispId,
  4690. "targetId": args.targetId
  4691. });
  4692. };
  4693. OSF.DDA.WAC.Delegate.unregisterEventAsync=function OSF_DDA_WAC_Delegate$UnregisterEventAsync(args) {
  4694. if (args.onCalling) {
  4695. args.onCalling();
  4696. }
  4697. OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(args.targetId, args.eventType), OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args), {
  4698. "controlId": OSF._OfficeAppFactory.getId(),
  4699. "eventDispId": args.dispId,
  4700. "targetId": args.targetId
  4701. });
  4702. };
  4703. OSF.OUtil.setNamespace("WebApp", OSF);
  4704. OSF.WebApp.AddHostInfoAndXdmInfo=function OSF_WebApp$AddHostInfoAndXdmInfo(url) {
  4705. if (OSF._OfficeAppFactory.getWindowLocationSearch && OSF._OfficeAppFactory.getWindowLocationHash) {
  4706. return url+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash();
  4707. }
  4708. else {
  4709. return url;
  4710. }
  4711. };
  4712. OSF.WebApp._UpdateLinksForHostAndXdmInfo=function OSF_WebApp$_UpdateLinksForHostAndXdmInfo() {
  4713. var links=document.querySelectorAll("a[data-officejs-navigate]");
  4714. for (var i=0; i < links.length; i++) {
  4715. if (OSF.WebApp._isGoodUrl(links[i].href)) {
  4716. links[i].href=OSF.WebApp.AddHostInfoAndXdmInfo(links[i].href);
  4717. }
  4718. }
  4719. var forms=document.querySelectorAll("form[data-officejs-navigate]");
  4720. for (var i=0; i < forms.length; i++) {
  4721. var form=forms[i];
  4722. if (OSF.WebApp._isGoodUrl(form.action)) {
  4723. form.action=OSF.WebApp.AddHostInfoAndXdmInfo(form.action);
  4724. }
  4725. }
  4726. };
  4727. OSF.WebApp._isGoodUrl=function OSF_WebApp$_isGoodUrl(url) {
  4728. if (typeof url=='undefined')
  4729. return false;
  4730. url=url.trim();
  4731. var colonIndex=url.indexOf(':');
  4732. var protocol=colonIndex > 0 ? url.substr(0, colonIndex) : null;
  4733. var goodUrl=protocol !==null ? protocol.toLowerCase()==="http" || protocol.toLowerCase()==="https" : true;
  4734. goodUrl=goodUrl && url !="#" && url !="/" && url !="" && url !=OSF._OfficeAppFactory.getWebAppState().webAppUrl;
  4735. return goodUrl;
  4736. };
  4737. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  4738. this._hostInfo=hostInfo;
  4739. this._webAppState=webAppState;
  4740. this._context=context;
  4741. this._settings=settings;
  4742. this._hostFacade=hostFacade;
  4743. this._appContext={};
  4744. this._tabbableElements="a[href]:not([tabindex='-1']),"+"area[href]:not([tabindex='-1']),"+"button:not([disabled]):not([tabindex='-1']),"+"input:not([disabled]):not([tabindex='-1']),"+"select:not([disabled]):not([tabindex='-1']),"+"textarea:not([disabled]):not([tabindex='-1']),"+"*[tabindex]:not([tabindex='-1']),"+"*[contenteditable]:not([disabled]):not([tabindex='-1'])";
  4745. this._initializeSettings=function OSF_InitializationHelper$initializeSettings(appContext, refreshSupported) {
  4746. var settings;
  4747. var serializedSettings=appContext.get_settings();
  4748. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4749. if (osfSessionStorage) {
  4750. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  4751. if (storageSettings) {
  4752. serializedSettings=JSON.parse(storageSettings);
  4753. }
  4754. else {
  4755. storageSettings=JSON.stringify(serializedSettings);
  4756. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  4757. }
  4758. }
  4759. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  4760. if (refreshSupported) {
  4761. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  4762. }
  4763. else {
  4764. settings=new OSF.DDA.Settings(deserializedSettings);
  4765. }
  4766. return settings;
  4767. };
  4768. var windowOpen=function OSF_InitializationHelper$windowOpen(windowObj) {
  4769. var proxy=window.open;
  4770. windowObj.open=function (strUrl, strWindowName, strWindowFeatures) {
  4771. var windowObject=null;
  4772. try {
  4773. windowObject=proxy(strUrl, strWindowName, strWindowFeatures);
  4774. }
  4775. catch (ex) {
  4776. if (OSF.AppTelemetry) {
  4777. OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+ex);
  4778. }
  4779. }
  4780. if (!windowObject) {
  4781. var params={
  4782. "strUrl": strUrl,
  4783. "strWindowName": strWindowName,
  4784. "strWindowFeatures": strWindowFeatures
  4785. };
  4786. OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost", null, params);
  4787. }
  4788. return windowObject;
  4789. };
  4790. };
  4791. windowOpen(window);
  4792. };
  4793. OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  4794. var getAppIdFromWindowLocation=function OSF_InitializationHelper$getAppIdFromWindowLocation() {
  4795. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  4796. if (xdmInfoValue) {
  4797. var items=xdmInfoValue.split("|");
  4798. return items[1];
  4799. }
  4800. return null;
  4801. };
  4802. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4803. if (osfSessionStorage) {
  4804. if (!hostInfoValue) {
  4805. hostInfoValue=OSF.OUtil.parseHostInfoFromWindowName(true, OSF._OfficeAppFactory.getWindowName());
  4806. }
  4807. if (hostInfoValue && hostInfoValue.indexOf("isDialog") > -1) {
  4808. var appId=getAppIdFromWindowLocation();
  4809. if (appId !=null) {
  4810. osfSessionStorage.setItem(appId+"IsDialog", "true");
  4811. }
  4812. }
  4813. this._hostInfo.isDialog=osfSessionStorage.getItem(OSF.OUtil.getXdmFieldValue(OSF.XdmFieldName.AppId, false)+"IsDialog") !=null ? true : false;
  4814. }
  4815. };
  4816. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4817. var me=this;
  4818. var getInvocationCallbackWebApp=function OSF_InitializationHelper_getAppContextAsync$getInvocationCallbackWebApp(errorCode, appContext) {
  4819. var settings;
  4820. if (appContext._appName===OSF.AppName.ExcelWebApp) {
  4821. var serializedSettings=appContext._settings;
  4822. settings={};
  4823. for (var index in serializedSettings) {
  4824. var setting=serializedSettings[index];
  4825. settings[setting[0]]=setting[1];
  4826. }
  4827. }
  4828. else {
  4829. settings=appContext._settings;
  4830. }
  4831. if (errorCode===0 && appContext._id !=undefined && appContext._appName !=undefined && appContext._appVersion !=undefined && appContext._appUILocale !=undefined && appContext._dataLocale !=undefined &&
  4832. appContext._docUrl !=undefined && appContext._clientMode !=undefined && appContext._settings !=undefined && appContext._reason !=undefined) {
  4833. me._appContext=appContext;
  4834. var appInstanceId=(appContext._appInstanceId ? appContext._appInstanceId : appContext._id);
  4835. var touchEnabled=false;
  4836. var commerceAllowed=true;
  4837. var minorVersion=0;
  4838. if (appContext._appMinorVersion !=undefined) {
  4839. minorVersion=appContext._appMinorVersion;
  4840. }
  4841. var requirementMatrix=undefined;
  4842. if (appContext._requirementMatrix !=undefined) {
  4843. requirementMatrix=appContext._requirementMatrix;
  4844. }
  4845. var returnedContext=new OSF.OfficeAppContext(appContext._id, appContext._appName, appContext._appVersion, appContext._appUILocale, appContext._dataLocale, appContext._docUrl, appContext._clientMode, settings, appContext._reason, appContext._osfControlType, appContext._eToken, appContext._correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, appContext._hostCustomMessage, appContext._hostFullVersion, appContext._clientWindowHeight, appContext._clientWindowWidth, appContext._addinName);
  4846. if (OSF.AppTelemetry) {
  4847. OSF.AppTelemetry.initialize(returnedContext);
  4848. }
  4849. gotAppContext(returnedContext);
  4850. }
  4851. else {
  4852. var errorMsg="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+errorCode+", exception: "+appContext;
  4853. if (OSF.AppTelemetry) {
  4854. OSF.AppTelemetry.logAppException(errorMsg);
  4855. }
  4856. throw errorMsg;
  4857. }
  4858. };
  4859. try {
  4860. if (this._hostInfo.isDialog && window.opener !=null) {
  4861. var appContext=OfficeExt.WACUtils.parseAppContextFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4862. getInvocationCallbackWebApp(0, appContext);
  4863. }
  4864. else {
  4865. this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync", getInvocationCallbackWebApp, this._webAppState.id);
  4866. }
  4867. }
  4868. catch (ex) {
  4869. if (OSF.AppTelemetry) {
  4870. OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+ex+"]");
  4871. }
  4872. throw ex;
  4873. }
  4874. };
  4875. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  4876. try {
  4877. var me=this;
  4878. var xdmInfoValue=OSF.OUtil.parseXdmInfoWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash());
  4879. if (!xdmInfoValue && OSF._OfficeAppFactory.getWindowName) {
  4880. xdmInfoValue=OSF.OUtil.parseXdmInfoFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4881. }
  4882. if (xdmInfoValue) {
  4883. var xdmItems=OSF.OUtil.getInfoItems(xdmInfoValue);
  4884. if (xdmItems !=undefined && xdmItems.length >=3) {
  4885. me._webAppState.conversationID=xdmItems[0];
  4886. me._webAppState.id=xdmItems[1];
  4887. me._webAppState.webAppUrl=xdmItems[2].indexOf(":") >=0 ? xdmItems[2] : decodeURIComponent(xdmItems[2]);
  4888. }
  4889. }
  4890. me._webAppState.wnd=window.opener !=null ? window.opener : window.parent;
  4891. var serializerVersion=OSF.OUtil.parseSerializerVersionWithGivenFragment(false, OSF._OfficeAppFactory.getWindowLocationHash());
  4892. if (isNaN(serializerVersion) && OSF._OfficeAppFactory.getWindowName) {
  4893. serializerVersion=OSF.OUtil.parseSerializerVersionFromWindowName(false, OSF._OfficeAppFactory.getWindowName());
  4894. }
  4895. me._webAppState.serializerVersion=serializerVersion;
  4896. me._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(me._webAppState.conversationID, me._webAppState.wnd, me._webAppState.webAppUrl, me._webAppState.serializerVersion);
  4897. me._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(me._webAppState.id);
  4898. var notificationConversationId=me._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;
  4899. me._webAppState.serviceEndPoint.registerConversation(notificationConversationId, me._webAppState.webAppUrl);
  4900. if (this._hostInfo.isDialog && window.opener !=null) {
  4901. return;
  4902. }
  4903. var notifyAgave=function OSF__OfficeAppFactory_initialize$notifyAgave(actionId) {
  4904. switch (actionId) {
  4905. case OSF.AgaveHostAction.Select:
  4906. me._webAppState.focused=true;
  4907. break;
  4908. case OSF.AgaveHostAction.UnSelect:
  4909. me._webAppState.focused=false;
  4910. break;
  4911. case OSF.AgaveHostAction.TabIn:
  4912. case OSF.AgaveHostAction.CtrlF6In:
  4913. window.focus();
  4914. var list=document.querySelectorAll(me._tabbableElements);
  4915. var focused=OSF.OUtil.focusToFirstTabbable(list, false);
  4916. if (!focused) {
  4917. window.blur();
  4918. me._webAppState.focused=false;
  4919. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.ExitNoFocusable]);
  4920. }
  4921. break;
  4922. case OSF.AgaveHostAction.TabInShift:
  4923. window.focus();
  4924. var list=document.querySelectorAll(me._tabbableElements);
  4925. var focused=OSF.OUtil.focusToFirstTabbable(list, true);
  4926. if (!focused) {
  4927. window.blur();
  4928. me._webAppState.focused=false;
  4929. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.ExitNoFocusableShift]);
  4930. }
  4931. break;
  4932. default:
  4933. OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+actionId+" notifyAgave is wrong.");
  4934. break;
  4935. }
  4936. };
  4937. me._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave", notifyAgave, Microsoft.Office.Common.InvokeType.async, false);
  4938. OSF.OUtil.addEventListener(window, "focus", function () {
  4939. if (!me._webAppState.focused) {
  4940. me._webAppState.focused=true;
  4941. }
  4942. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.Select]);
  4943. });
  4944. OSF.OUtil.addEventListener(window, "blur", function () {
  4945. if (me._webAppState.focused) {
  4946. me._webAppState.focused=false;
  4947. }
  4948. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.UnSelect]);
  4949. });
  4950. OSF.OUtil.addEventListener(window, "keydown", function (e) {
  4951. e.preventDefault=e.preventDefault || function () {
  4952. e.returnValue=false;
  4953. };
  4954. if (e.keyCode==117 && (e.ctrlKey || e.metaKey)) {
  4955. var actionId=OSF.AgaveHostAction.CtrlF6Exit;
  4956. if (e.shiftKey) {
  4957. actionId=OSF.AgaveHostAction.CtrlF6ExitShift;
  4958. }
  4959. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, actionId]);
  4960. }
  4961. else if (e.keyCode==9) {
  4962. e.preventDefault();
  4963. var allTabbableElements=document.querySelectorAll(me._tabbableElements);
  4964. var focused=OSF.OUtil.focusToNextTabbable(allTabbableElements, e.target || e.srcElement, e.shiftKey);
  4965. if (!focused) {
  4966. if (me._hostInfo.isDialog) {
  4967. OSF.OUtil.focusToFirstTabbable(allTabbableElements, e.shiftKey);
  4968. }
  4969. else {
  4970. if (e.shiftKey) {
  4971. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.TabExitShift]);
  4972. }
  4973. else {
  4974. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.TabExit]);
  4975. }
  4976. }
  4977. }
  4978. }
  4979. else if (e.keyCode==27) {
  4980. e.preventDefault();
  4981. me.dismissDialogNotification && me.dismissDialogNotification();
  4982. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.EscExit]);
  4983. }
  4984. else if (e.keyCode==113) {
  4985. e.preventDefault();
  4986. me._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [me._webAppState.id, OSF.AgaveHostAction.F2Exit]);
  4987. }
  4988. });
  4989. OSF.OUtil.addEventListener(window, "keypress", function (e) {
  4990. if (e.keyCode==117 && e.ctrlKey) {
  4991. if (e.preventDefault) {
  4992. e.preventDefault();
  4993. }
  4994. else {
  4995. e.returnValue=false;
  4996. }
  4997. }
  4998. });
  4999. }
  5000. catch (ex) {
  5001. if (OSF.AppTelemetry) {
  5002. OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+ex+"]");
  5003. }
  5004. throw ex;
  5005. }
  5006. };
  5007. OSF.InitializationHelper.prototype.initWebDialog=function OSF_InitializationHelper$initWebDialog(appContext) {
  5008. if (appContext.get_isDialog()) {
  5009. if (OSF.DDA.UI.ChildUI) {
  5010. appContext.ui=new OSF.DDA.UI.ChildUI();
  5011. if (window.opener !=null) {
  5012. this.registerMessageReceivedEventForWindowDialog && this.registerMessageReceivedEventForWindowDialog();
  5013. }
  5014. }
  5015. }
  5016. else {
  5017. if (OSF.DDA.UI.ParentUI) {
  5018. appContext.ui=new OSF.DDA.UI.ParentUI();
  5019. if (OfficeExt.Container) {
  5020. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  5021. }
  5022. }
  5023. }
  5024. };
  5025. OSF.getClientEndPoint=function OSF$getClientEndPoint() {
  5026. var initializationHelper=OSF._OfficeAppFactory.getInitializationHelper();
  5027. return initializationHelper._webAppState.clientEndPoint;
  5028. };
  5029. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize() {
  5030. if (this._hostInfo.isDialog) {
  5031. window.focus();
  5032. var list=document.querySelectorAll(this._tabbableElements);
  5033. var focused=OSF.OUtil.focusToFirstTabbable(list, false);
  5034. if (!focused) {
  5035. window.blur();
  5036. this._webAppState.focused=false;
  5037. this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost", null, [this._webAppState.id, OSF.AgaveHostAction.ExitNoFocusable]);
  5038. }
  5039. }
  5040. };
  5041. OSF.CommonUI={
  5042. HostButtonBorderColor: "#86bfa0",
  5043. HostButtonBackgroundColor: "#d3f0e0"
  5044. };
  5045. var OSFLog;
  5046. (function (OSFLog) {
  5047. var BaseUsageData=(function () {
  5048. function BaseUsageData(table) {
  5049. this._table=table;
  5050. this._fields={};
  5051. }
  5052. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  5053. get: function () {
  5054. return this._fields;
  5055. },
  5056. enumerable: true,
  5057. configurable: true
  5058. });
  5059. Object.defineProperty(BaseUsageData.prototype, "Table", {
  5060. get: function () {
  5061. return this._table;
  5062. },
  5063. enumerable: true,
  5064. configurable: true
  5065. });
  5066. BaseUsageData.prototype.SerializeFields=function () {
  5067. };
  5068. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  5069. if (typeof (value) !=="undefined" && value !==null) {
  5070. this._serializedFields[key]=value.toString();
  5071. }
  5072. };
  5073. BaseUsageData.prototype.SerializeRow=function () {
  5074. this._serializedFields={};
  5075. this.SetSerializedField("Table", this._table);
  5076. this.SerializeFields();
  5077. return JSON.stringify(this._serializedFields);
  5078. };
  5079. return BaseUsageData;
  5080. })();
  5081. OSFLog.BaseUsageData=BaseUsageData;
  5082. var AppActivatedUsageData=(function (_super) {
  5083. __extends(AppActivatedUsageData, _super);
  5084. function AppActivatedUsageData() {
  5085. _super.call(this, "AppActivated");
  5086. }
  5087. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  5088. get: function () { return this.Fields["CorrelationId"]; },
  5089. set: function (value) { this.Fields["CorrelationId"]=value; },
  5090. enumerable: true,
  5091. configurable: true
  5092. });
  5093. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  5094. get: function () { return this.Fields["SessionId"]; },
  5095. set: function (value) { this.Fields["SessionId"]=value; },
  5096. enumerable: true,
  5097. configurable: true
  5098. });
  5099. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  5100. get: function () { return this.Fields["AppId"]; },
  5101. set: function (value) { this.Fields["AppId"]=value; },
  5102. enumerable: true,
  5103. configurable: true
  5104. });
  5105. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  5106. get: function () { return this.Fields["AppInstanceId"]; },
  5107. set: function (value) { this.Fields["AppInstanceId"]=value; },
  5108. enumerable: true,
  5109. configurable: true
  5110. });
  5111. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  5112. get: function () { return this.Fields["AppURL"]; },
  5113. set: function (value) { this.Fields["AppURL"]=value; },
  5114. enumerable: true,
  5115. configurable: true
  5116. });
  5117. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  5118. get: function () { return this.Fields["AssetId"]; },
  5119. set: function (value) { this.Fields["AssetId"]=value; },
  5120. enumerable: true,
  5121. configurable: true
  5122. });
  5123. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  5124. get: function () { return this.Fields["Browser"]; },
  5125. set: function (value) { this.Fields["Browser"]=value; },
  5126. enumerable: true,
  5127. configurable: true
  5128. });
  5129. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  5130. get: function () { return this.Fields["UserId"]; },
  5131. set: function (value) { this.Fields["UserId"]=value; },
  5132. enumerable: true,
  5133. configurable: true
  5134. });
  5135. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  5136. get: function () { return this.Fields["Host"]; },
  5137. set: function (value) { this.Fields["Host"]=value; },
  5138. enumerable: true,
  5139. configurable: true
  5140. });
  5141. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  5142. get: function () { return this.Fields["HostVersion"]; },
  5143. set: function (value) { this.Fields["HostVersion"]=value; },
  5144. enumerable: true,
  5145. configurable: true
  5146. });
  5147. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  5148. get: function () { return this.Fields["ClientId"]; },
  5149. set: function (value) { this.Fields["ClientId"]=value; },
  5150. enumerable: true,
  5151. configurable: true
  5152. });
  5153. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  5154. get: function () { return this.Fields["AppSizeWidth"]; },
  5155. set: function (value) { this.Fields["AppSizeWidth"]=value; },
  5156. enumerable: true,
  5157. configurable: true
  5158. });
  5159. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  5160. get: function () { return this.Fields["AppSizeHeight"]; },
  5161. set: function (value) { this.Fields["AppSizeHeight"]=value; },
  5162. enumerable: true,
  5163. configurable: true
  5164. });
  5165. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  5166. get: function () { return this.Fields["Message"]; },
  5167. set: function (value) { this.Fields["Message"]=value; },
  5168. enumerable: true,
  5169. configurable: true
  5170. });
  5171. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  5172. get: function () { return this.Fields["DocUrl"]; },
  5173. set: function (value) { this.Fields["DocUrl"]=value; },
  5174. enumerable: true,
  5175. configurable: true
  5176. });
  5177. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  5178. get: function () { return this.Fields["OfficeJSVersion"]; },
  5179. set: function (value) { this.Fields["OfficeJSVersion"]=value; },
  5180. enumerable: true,
  5181. configurable: true
  5182. });
  5183. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  5184. get: function () { return this.Fields["HostJSVersion"]; },
  5185. set: function (value) { this.Fields["HostJSVersion"]=value; },
  5186. enumerable: true,
  5187. configurable: true
  5188. });
  5189. AppActivatedUsageData.prototype.SerializeFields=function () {
  5190. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5191. this.SetSerializedField("SessionId", this.SessionId);
  5192. this.SetSerializedField("AppId", this.AppId);
  5193. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  5194. this.SetSerializedField("AppURL", this.AppURL);
  5195. this.SetSerializedField("AssetId", this.AssetId);
  5196. this.SetSerializedField("Browser", this.Browser);
  5197. this.SetSerializedField("UserId", this.UserId);
  5198. this.SetSerializedField("Host", this.Host);
  5199. this.SetSerializedField("HostVersion", this.HostVersion);
  5200. this.SetSerializedField("ClientId", this.ClientId);
  5201. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  5202. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  5203. this.SetSerializedField("Message", this.Message);
  5204. this.SetSerializedField("DocUrl", this.DocUrl);
  5205. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  5206. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  5207. };
  5208. return AppActivatedUsageData;
  5209. })(BaseUsageData);
  5210. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  5211. var ScriptLoadUsageData=(function (_super) {
  5212. __extends(ScriptLoadUsageData, _super);
  5213. function ScriptLoadUsageData() {
  5214. _super.call(this, "ScriptLoad");
  5215. }
  5216. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  5217. get: function () { return this.Fields["CorrelationId"]; },
  5218. set: function (value) { this.Fields["CorrelationId"]=value; },
  5219. enumerable: true,
  5220. configurable: true
  5221. });
  5222. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  5223. get: function () { return this.Fields["SessionId"]; },
  5224. set: function (value) { this.Fields["SessionId"]=value; },
  5225. enumerable: true,
  5226. configurable: true
  5227. });
  5228. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  5229. get: function () { return this.Fields["ScriptId"]; },
  5230. set: function (value) { this.Fields["ScriptId"]=value; },
  5231. enumerable: true,
  5232. configurable: true
  5233. });
  5234. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  5235. get: function () { return this.Fields["StartTime"]; },
  5236. set: function (value) { this.Fields["StartTime"]=value; },
  5237. enumerable: true,
  5238. configurable: true
  5239. });
  5240. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  5241. get: function () { return this.Fields["ResponseTime"]; },
  5242. set: function (value) { this.Fields["ResponseTime"]=value; },
  5243. enumerable: true,
  5244. configurable: true
  5245. });
  5246. ScriptLoadUsageData.prototype.SerializeFields=function () {
  5247. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5248. this.SetSerializedField("SessionId", this.SessionId);
  5249. this.SetSerializedField("ScriptId", this.ScriptId);
  5250. this.SetSerializedField("StartTime", this.StartTime);
  5251. this.SetSerializedField("ResponseTime", this.ResponseTime);
  5252. };
  5253. return ScriptLoadUsageData;
  5254. })(BaseUsageData);
  5255. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  5256. var AppClosedUsageData=(function (_super) {
  5257. __extends(AppClosedUsageData, _super);
  5258. function AppClosedUsageData() {
  5259. _super.call(this, "AppClosed");
  5260. }
  5261. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  5262. get: function () { return this.Fields["CorrelationId"]; },
  5263. set: function (value) { this.Fields["CorrelationId"]=value; },
  5264. enumerable: true,
  5265. configurable: true
  5266. });
  5267. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  5268. get: function () { return this.Fields["SessionId"]; },
  5269. set: function (value) { this.Fields["SessionId"]=value; },
  5270. enumerable: true,
  5271. configurable: true
  5272. });
  5273. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  5274. get: function () { return this.Fields["FocusTime"]; },
  5275. set: function (value) { this.Fields["FocusTime"]=value; },
  5276. enumerable: true,
  5277. configurable: true
  5278. });
  5279. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  5280. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  5281. set: function (value) { this.Fields["AppSizeFinalWidth"]=value; },
  5282. enumerable: true,
  5283. configurable: true
  5284. });
  5285. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  5286. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  5287. set: function (value) { this.Fields["AppSizeFinalHeight"]=value; },
  5288. enumerable: true,
  5289. configurable: true
  5290. });
  5291. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  5292. get: function () { return this.Fields["OpenTime"]; },
  5293. set: function (value) { this.Fields["OpenTime"]=value; },
  5294. enumerable: true,
  5295. configurable: true
  5296. });
  5297. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  5298. get: function () { return this.Fields["CloseMethod"]; },
  5299. set: function (value) { this.Fields["CloseMethod"]=value; },
  5300. enumerable: true,
  5301. configurable: true
  5302. });
  5303. AppClosedUsageData.prototype.SerializeFields=function () {
  5304. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5305. this.SetSerializedField("SessionId", this.SessionId);
  5306. this.SetSerializedField("FocusTime", this.FocusTime);
  5307. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  5308. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  5309. this.SetSerializedField("OpenTime", this.OpenTime);
  5310. this.SetSerializedField("CloseMethod", this.CloseMethod);
  5311. };
  5312. return AppClosedUsageData;
  5313. })(BaseUsageData);
  5314. OSFLog.AppClosedUsageData=AppClosedUsageData;
  5315. var APIUsageUsageData=(function (_super) {
  5316. __extends(APIUsageUsageData, _super);
  5317. function APIUsageUsageData() {
  5318. _super.call(this, "APIUsage");
  5319. }
  5320. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  5321. get: function () { return this.Fields["CorrelationId"]; },
  5322. set: function (value) { this.Fields["CorrelationId"]=value; },
  5323. enumerable: true,
  5324. configurable: true
  5325. });
  5326. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  5327. get: function () { return this.Fields["SessionId"]; },
  5328. set: function (value) { this.Fields["SessionId"]=value; },
  5329. enumerable: true,
  5330. configurable: true
  5331. });
  5332. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  5333. get: function () { return this.Fields["APIType"]; },
  5334. set: function (value) { this.Fields["APIType"]=value; },
  5335. enumerable: true,
  5336. configurable: true
  5337. });
  5338. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  5339. get: function () { return this.Fields["APIID"]; },
  5340. set: function (value) { this.Fields["APIID"]=value; },
  5341. enumerable: true,
  5342. configurable: true
  5343. });
  5344. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  5345. get: function () { return this.Fields["Parameters"]; },
  5346. set: function (value) { this.Fields["Parameters"]=value; },
  5347. enumerable: true,
  5348. configurable: true
  5349. });
  5350. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  5351. get: function () { return this.Fields["ResponseTime"]; },
  5352. set: function (value) { this.Fields["ResponseTime"]=value; },
  5353. enumerable: true,
  5354. configurable: true
  5355. });
  5356. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  5357. get: function () { return this.Fields["ErrorType"]; },
  5358. set: function (value) { this.Fields["ErrorType"]=value; },
  5359. enumerable: true,
  5360. configurable: true
  5361. });
  5362. APIUsageUsageData.prototype.SerializeFields=function () {
  5363. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5364. this.SetSerializedField("SessionId", this.SessionId);
  5365. this.SetSerializedField("APIType", this.APIType);
  5366. this.SetSerializedField("APIID", this.APIID);
  5367. this.SetSerializedField("Parameters", this.Parameters);
  5368. this.SetSerializedField("ResponseTime", this.ResponseTime);
  5369. this.SetSerializedField("ErrorType", this.ErrorType);
  5370. };
  5371. return APIUsageUsageData;
  5372. })(BaseUsageData);
  5373. OSFLog.APIUsageUsageData=APIUsageUsageData;
  5374. var AppInitializationUsageData=(function (_super) {
  5375. __extends(AppInitializationUsageData, _super);
  5376. function AppInitializationUsageData() {
  5377. _super.call(this, "AppInitialization");
  5378. }
  5379. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  5380. get: function () { return this.Fields["CorrelationId"]; },
  5381. set: function (value) { this.Fields["CorrelationId"]=value; },
  5382. enumerable: true,
  5383. configurable: true
  5384. });
  5385. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  5386. get: function () { return this.Fields["SessionId"]; },
  5387. set: function (value) { this.Fields["SessionId"]=value; },
  5388. enumerable: true,
  5389. configurable: true
  5390. });
  5391. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  5392. get: function () { return this.Fields["SuccessCode"]; },
  5393. set: function (value) { this.Fields["SuccessCode"]=value; },
  5394. enumerable: true,
  5395. configurable: true
  5396. });
  5397. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  5398. get: function () { return this.Fields["Message"]; },
  5399. set: function (value) { this.Fields["Message"]=value; },
  5400. enumerable: true,
  5401. configurable: true
  5402. });
  5403. AppInitializationUsageData.prototype.SerializeFields=function () {
  5404. this.SetSerializedField("CorrelationId", this.CorrelationId);
  5405. this.SetSerializedField("SessionId", this.SessionId);
  5406. this.SetSerializedField("SuccessCode", this.SuccessCode);
  5407. this.SetSerializedField("Message", this.Message);
  5408. };
  5409. return AppInitializationUsageData;
  5410. })(BaseUsageData);
  5411. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  5412. })(OSFLog || (OSFLog={}));
  5413. var Logger;
  5414. (function (Logger) {
  5415. "use strict";
  5416. (function (TraceLevel) {
  5417. TraceLevel[TraceLevel["info"]=0]="info";
  5418. TraceLevel[TraceLevel["warning"]=1]="warning";
  5419. TraceLevel[TraceLevel["error"]=2]="error";
  5420. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  5421. var TraceLevel=Logger.TraceLevel;
  5422. (function (SendFlag) {
  5423. SendFlag[SendFlag["none"]=0]="none";
  5424. SendFlag[SendFlag["flush"]=1]="flush";
  5425. })(Logger.SendFlag || (Logger.SendFlag={}));
  5426. var SendFlag=Logger.SendFlag;
  5427. function allowUploadingData() {
  5428. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  5429. OSF.Logger.ulsEndpoint.loadProxyFrame();
  5430. }
  5431. }
  5432. Logger.allowUploadingData=allowUploadingData;
  5433. function sendLog(traceLevel, message, flag) {
  5434. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  5435. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  5436. var logs=JSON.stringify(jsonObj);
  5437. OSF.Logger.ulsEndpoint.writeLog(logs);
  5438. }
  5439. }
  5440. Logger.sendLog=sendLog;
  5441. function creatULSEndpoint() {
  5442. try {
  5443. return new ULSEndpointProxy();
  5444. }
  5445. catch (e) {
  5446. return null;
  5447. }
  5448. }
  5449. var ULSEndpointProxy=(function () {
  5450. function ULSEndpointProxy() {
  5451. var _this=this;
  5452. this.proxyFrame=null;
  5453. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  5454. this.buffer=[];
  5455. this.proxyFrameReady=false;
  5456. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  5457. setTimeout(function () {
  5458. _this.loadProxyFrame();
  5459. }, 3000);
  5460. }
  5461. ULSEndpointProxy.prototype.writeLog=function (log) {
  5462. if (this.proxyFrameReady===true) {
  5463. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  5464. }
  5465. else {
  5466. if (this.buffer.length < 128) {
  5467. this.buffer.push(log);
  5468. }
  5469. }
  5470. };
  5471. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  5472. if (this.proxyFrame==null) {
  5473. this.proxyFrame=document.createElement("iframe");
  5474. this.proxyFrame.setAttribute("style", "display:none");
  5475. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  5476. document.head.appendChild(this.proxyFrame);
  5477. }
  5478. };
  5479. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  5480. var _this=this;
  5481. if (e.data==="ProxyFrameReadyToLog") {
  5482. this.proxyFrameReady=true;
  5483. for (var i=0; i < this.buffer.length; i++) {
  5484. this.writeLog(this.buffer[i]);
  5485. }
  5486. this.buffer.length=0;
  5487. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  5488. }
  5489. else if (e.data==="ProxyFrameReadyToInit") {
  5490. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  5491. var initStr=JSON.stringify(initJson);
  5492. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  5493. }
  5494. };
  5495. ULSEndpointProxy.telemetryOrigin="https://telemetryservice.firstpartyapps.oaspapps.com";
  5496. return ULSEndpointProxy;
  5497. })();
  5498. if (!OSF.Logger) {
  5499. OSF.Logger=Logger;
  5500. }
  5501. Logger.ulsEndpoint=creatULSEndpoint();
  5502. })(Logger || (Logger={}));
  5503. var OSFAppTelemetry;
  5504. (function (OSFAppTelemetry) {
  5505. "use strict";
  5506. var appInfo;
  5507. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  5508. var osfControlAppCorrelationId="";
  5509. var omexDomainRegex=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  5510. ;
  5511. var AppInfo=(function () {
  5512. function AppInfo() {
  5513. }
  5514. return AppInfo;
  5515. })();
  5516. var Event=(function () {
  5517. function Event(name, handler) {
  5518. this.name=name;
  5519. this.handler=handler;
  5520. }
  5521. return Event;
  5522. })();
  5523. var AppStorage=(function () {
  5524. function AppStorage() {
  5525. this.clientIDKey="Office API client";
  5526. this.logIdSetKey="Office App Log Id Set";
  5527. }
  5528. AppStorage.prototype.getClientId=function () {
  5529. var clientId=this.getValue(this.clientIDKey);
  5530. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  5531. clientId=OSF.OUtil.Guid.generateNewGuid();
  5532. this.setValue(this.clientIDKey, clientId);
  5533. }
  5534. return clientId;
  5535. };
  5536. AppStorage.prototype.saveLog=function (logId, log) {
  5537. var logIdSet=this.getValue(this.logIdSetKey);
  5538. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  5539. this.setValue(this.logIdSetKey, logIdSet);
  5540. this.setValue(logId, log);
  5541. };
  5542. AppStorage.prototype.enumerateLog=function (callback, clean) {
  5543. var logIdSet=this.getValue(this.logIdSetKey);
  5544. if (logIdSet) {
  5545. var ids=logIdSet.split(";");
  5546. for (var id in ids) {
  5547. var logId=ids[id];
  5548. var log=this.getValue(logId);
  5549. if (log) {
  5550. if (callback) {
  5551. callback(logId, log);
  5552. }
  5553. if (clean) {
  5554. this.remove(logId);
  5555. }
  5556. }
  5557. }
  5558. if (clean) {
  5559. this.remove(this.logIdSetKey);
  5560. }
  5561. }
  5562. };
  5563. AppStorage.prototype.getValue=function (key) {
  5564. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5565. var value="";
  5566. if (osfLocalStorage) {
  5567. value=osfLocalStorage.getItem(key);
  5568. }
  5569. return value;
  5570. };
  5571. AppStorage.prototype.setValue=function (key, value) {
  5572. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5573. if (osfLocalStorage) {
  5574. osfLocalStorage.setItem(key, value);
  5575. }
  5576. };
  5577. AppStorage.prototype.remove=function (key) {
  5578. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5579. if (osfLocalStorage) {
  5580. try {
  5581. osfLocalStorage.removeItem(key);
  5582. }
  5583. catch (ex) {
  5584. }
  5585. }
  5586. };
  5587. return AppStorage;
  5588. })();
  5589. var AppLogger=(function () {
  5590. function AppLogger() {
  5591. }
  5592. AppLogger.prototype.LogData=function (data) {
  5593. if (!OSF.Logger) {
  5594. return;
  5595. }
  5596. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  5597. };
  5598. AppLogger.prototype.LogRawData=function (log) {
  5599. if (!OSF.Logger) {
  5600. return;
  5601. }
  5602. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  5603. };
  5604. return AppLogger;
  5605. })();
  5606. function initialize(context) {
  5607. if (!OSF.Logger) {
  5608. return;
  5609. }
  5610. if (appInfo) {
  5611. return;
  5612. }
  5613. appInfo=new AppInfo();
  5614. if (context.get_hostFullVersion()) {
  5615. appInfo.hostVersion=context.get_hostFullVersion();
  5616. }
  5617. else {
  5618. appInfo.hostVersion=context.get_appVersion();
  5619. }
  5620. appInfo.appId=context.get_id();
  5621. appInfo.host=context.get_appName();
  5622. appInfo.browser=window.navigator.userAgent;
  5623. appInfo.correlationId=context.get_correlationId();
  5624. appInfo.clientId=(new AppStorage()).getClientId();
  5625. appInfo.appInstanceId=context.get_appInstanceId();
  5626. if (appInfo.appInstanceId) {
  5627. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  5628. }
  5629. appInfo.message=context.get_hostCustomMessage();
  5630. appInfo.officeJSVersion=OSF.ConstantNames.FileVersion;
  5631. appInfo.hostJSVersion="16.0.7526.1000";
  5632. var docUrl=context.get_docUrl();
  5633. appInfo.docUrl=omexDomainRegex.test(docUrl) ? docUrl : "";
  5634. var url=location.href;
  5635. if (url) {
  5636. url=url.split("?")[0].split("#")[0];
  5637. }
  5638. appInfo.appURL=url;
  5639. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  5640. var xmlContent;
  5641. var parser;
  5642. var xmlDoc;
  5643. appInfo.assetId="";
  5644. appInfo.userId="";
  5645. try {
  5646. xmlContent=decodeURIComponent(token);
  5647. parser=new DOMParser();
  5648. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  5649. var cidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid");
  5650. var oidNode=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("oid");
  5651. if (cidNode && cidNode.nodeValue) {
  5652. appInfo.userId=cidNode.nodeValue;
  5653. }
  5654. else if (oidNode && oidNode.nodeValue) {
  5655. appInfo.userId=oidNode.nodeValue;
  5656. }
  5657. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  5658. }
  5659. catch (e) {
  5660. }
  5661. finally {
  5662. xmlContent=null;
  5663. xmlDoc=null;
  5664. parser=null;
  5665. }
  5666. })(context.get_eToken(), appInfo);
  5667. (function handleLifecycle() {
  5668. var startTime=new Date();
  5669. var lastFocus=null;
  5670. var focusTime=0;
  5671. var finished=false;
  5672. var adjustFocusTime=function () {
  5673. if (document.hasFocus()) {
  5674. if (lastFocus==null) {
  5675. lastFocus=new Date();
  5676. }
  5677. }
  5678. else if (lastFocus) {
  5679. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5680. lastFocus=null;
  5681. }
  5682. };
  5683. var eventList=[];
  5684. eventList.push(new Event("focus", adjustFocusTime));
  5685. eventList.push(new Event("blur", adjustFocusTime));
  5686. eventList.push(new Event("focusout", adjustFocusTime));
  5687. eventList.push(new Event("focusin", adjustFocusTime));
  5688. var exitFunction=function () {
  5689. for (var i=0; i < eventList.length; i++) {
  5690. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  5691. }
  5692. eventList.length=0;
  5693. if (!finished) {
  5694. if (document.hasFocus() && lastFocus) {
  5695. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  5696. lastFocus=null;
  5697. }
  5698. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  5699. finished=true;
  5700. }
  5701. };
  5702. eventList.push(new Event("beforeunload", exitFunction));
  5703. eventList.push(new Event("unload", exitFunction));
  5704. for (var i=0; i < eventList.length; i++) {
  5705. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  5706. }
  5707. adjustFocusTime();
  5708. })();
  5709. OSFAppTelemetry.onAppActivated();
  5710. }
  5711. OSFAppTelemetry.initialize=initialize;
  5712. function onAppActivated() {
  5713. if (!appInfo) {
  5714. return;
  5715. }
  5716. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  5717. var data=new OSFLog.AppActivatedUsageData();
  5718. data.SessionId=sessionId;
  5719. data.AppId=appInfo.appId;
  5720. data.AssetId=appInfo.assetId;
  5721. data.AppURL=appInfo.appURL;
  5722. data.UserId=appInfo.userId;
  5723. data.ClientId=appInfo.clientId;
  5724. data.Browser=appInfo.browser;
  5725. data.Host=appInfo.host;
  5726. data.HostVersion=appInfo.hostVersion;
  5727. data.CorrelationId=appInfo.correlationId;
  5728. data.AppSizeWidth=window.innerWidth;
  5729. data.AppSizeHeight=window.innerHeight;
  5730. data.AppInstanceId=appInfo.appInstanceId;
  5731. data.Message=appInfo.message;
  5732. data.DocUrl=appInfo.docUrl;
  5733. data.OfficeJSVersion=appInfo.officeJSVersion;
  5734. data.HostJSVersion=appInfo.hostJSVersion;
  5735. (new AppLogger()).LogData(data);
  5736. setTimeout(function () {
  5737. if (!OSF.Logger) {
  5738. return;
  5739. }
  5740. OSF.Logger.allowUploadingData();
  5741. }, 100);
  5742. }
  5743. OSFAppTelemetry.onAppActivated=onAppActivated;
  5744. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  5745. var data=new OSFLog.ScriptLoadUsageData();
  5746. data.CorrelationId=appCorrelationId;
  5747. data.SessionId=sessionId;
  5748. data.ScriptId=scriptId;
  5749. data.StartTime=msStartTime;
  5750. data.ResponseTime=msResponseTime;
  5751. (new AppLogger()).LogData(data);
  5752. }
  5753. OSFAppTelemetry.onScriptDone=onScriptDone;
  5754. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  5755. if (!appInfo) {
  5756. return;
  5757. }
  5758. var data=new OSFLog.APIUsageUsageData();
  5759. data.CorrelationId=osfControlAppCorrelationId;
  5760. data.SessionId=sessionId;
  5761. data.APIType=apiType;
  5762. data.APIID=id;
  5763. data.Parameters=parameters;
  5764. data.ResponseTime=msResponseTime;
  5765. data.ErrorType=errorType;
  5766. (new AppLogger()).LogData(data);
  5767. }
  5768. OSFAppTelemetry.onCallDone=onCallDone;
  5769. ;
  5770. function onMethodDone(id, args, msResponseTime, errorType) {
  5771. var parameters=null;
  5772. if (args) {
  5773. if (typeof args=="number") {
  5774. parameters=String(args);
  5775. }
  5776. else if (typeof args==="object") {
  5777. for (var index in args) {
  5778. if (parameters !==null) {
  5779. parameters+=",";
  5780. }
  5781. else {
  5782. parameters="";
  5783. }
  5784. if (typeof args[index]=="number") {
  5785. parameters+=String(args[index]);
  5786. }
  5787. }
  5788. }
  5789. else {
  5790. parameters="";
  5791. }
  5792. }
  5793. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  5794. }
  5795. OSFAppTelemetry.onMethodDone=onMethodDone;
  5796. function onPropertyDone(propertyName, msResponseTime) {
  5797. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  5798. }
  5799. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5800. function onEventDone(id, errorType) {
  5801. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  5802. }
  5803. OSFAppTelemetry.onEventDone=onEventDone;
  5804. function onRegisterDone(register, id, msResponseTime, errorType) {
  5805. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  5806. }
  5807. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5808. function onAppClosed(openTime, focusTime) {
  5809. if (!appInfo) {
  5810. return;
  5811. }
  5812. var data=new OSFLog.AppClosedUsageData();
  5813. data.CorrelationId=osfControlAppCorrelationId;
  5814. data.SessionId=sessionId;
  5815. data.FocusTime=focusTime;
  5816. data.OpenTime=openTime;
  5817. data.AppSizeFinalWidth=window.innerWidth;
  5818. data.AppSizeFinalHeight=window.innerHeight;
  5819. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  5820. }
  5821. OSFAppTelemetry.onAppClosed=onAppClosed;
  5822. function setOsfControlAppCorrelationId(correlationId) {
  5823. osfControlAppCorrelationId=correlationId;
  5824. }
  5825. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5826. function doAppInitializationLogging(isException, message) {
  5827. var data=new OSFLog.AppInitializationUsageData();
  5828. data.CorrelationId=osfControlAppCorrelationId;
  5829. data.SessionId=sessionId;
  5830. data.SuccessCode=isException ? 1 : 0;
  5831. data.Message=message;
  5832. (new AppLogger()).LogData(data);
  5833. }
  5834. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5835. function logAppCommonMessage(message) {
  5836. doAppInitializationLogging(false, message);
  5837. }
  5838. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5839. function logAppException(errorMessage) {
  5840. doAppInitializationLogging(true, errorMessage);
  5841. }
  5842. OSFAppTelemetry.logAppException=logAppException;
  5843. OSF.AppTelemetry=OSFAppTelemetry;
  5844. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5845. Microsoft.Office.WebExtension.FileType={
  5846. Text: "text",
  5847. Compressed: "compressed",
  5848. Pdf: "pdf"
  5849. };
  5850. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5851. FileProperties: "FileProperties",
  5852. FileSliceProperties: "FileSliceProperties"
  5853. });
  5854. OSF.DDA.FileProperties={
  5855. Handle: "FileHandle",
  5856. FileSize: "FileSize",
  5857. SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize
  5858. };
  5859. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) {
  5860. OSF.OUtil.defineEnumerableProperties(this, {
  5861. "size": {
  5862. value: fileSize
  5863. },
  5864. "sliceCount": {
  5865. value: Math.ceil(fileSize / sliceSize)
  5866. }
  5867. });
  5868. var privateState={};
  5869. privateState[OSF.DDA.FileProperties.Handle]=handle;
  5870. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  5871. var am=OSF.DDA.AsyncMethodNames;
  5872. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5873. am.GetDocumentCopyChunkAsync,
  5874. am.ReleaseDocumentCopyAsync
  5875. ], privateState);
  5876. };
  5877. OSF.DDA.FileSliceOffset="fileSliceoffset";
  5878. OSF.DDA.AsyncMethodNames.addNames({
  5879. GetDocumentCopyAsync: "getFileAsync",
  5880. GetDocumentCopyChunkAsync: "getSliceAsync",
  5881. ReleaseDocumentCopyAsync: "closeAsync"
  5882. });
  5883. OSF.DDA.AsyncMethodCalls.define({
  5884. method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,
  5885. requiredArguments: [
  5886. {
  5887. "name": Microsoft.Office.WebExtension.Parameters.FileType,
  5888. "enum": Microsoft.Office.WebExtension.FileType
  5889. }
  5890. ],
  5891. supportedOptions: [
  5892. {
  5893. name: Microsoft.Office.WebExtension.Parameters.SliceSize,
  5894. value: {
  5895. "types": ["number"],
  5896. "defaultValue": 4 * 1024 * 1024
  5897. }
  5898. }
  5899. ],
  5900. checkCallArgs: function (callArgs, caller, stateInfo) {
  5901. var sliceSize=callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize];
  5902. if (sliceSize <=0 || sliceSize > (4 * 1024 * 1024)) {
  5903. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;
  5904. }
  5905. return callArgs;
  5906. },
  5907. onSucceeded: function (fileDescriptor, caller, callArgs) {
  5908. return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]);
  5909. }
  5910. });
  5911. OSF.DDA.AsyncMethodCalls.define({
  5912. method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,
  5913. requiredArguments: [
  5914. {
  5915. "name": Microsoft.Office.WebExtension.Parameters.SliceIndex,
  5916. "types": ["number"]
  5917. }
  5918. ],
  5919. privateStateCallbacks: [
  5920. {
  5921. name: OSF.DDA.FileProperties.Handle,
  5922. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; }
  5923. },
  5924. {
  5925. name: OSF.DDA.FileProperties.SliceSize,
  5926. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.SliceSize]; }
  5927. }
  5928. ],
  5929. checkCallArgs: function (callArgs, caller, stateInfo) {
  5930. var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex];
  5931. if (index < 0 || index >=caller.sliceCount) {
  5932. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;
  5933. }
  5934. callArgs[OSF.DDA.FileSliceOffset]=parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString());
  5935. return callArgs;
  5936. },
  5937. onSucceeded: function (sliceDescriptor, caller, callArgs) {
  5938. var slice={};
  5939. OSF.OUtil.defineEnumerableProperties(slice, {
  5940. "data": {
  5941. value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data]
  5942. },
  5943. "index": {
  5944. value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]
  5945. },
  5946. "size": {
  5947. value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize]
  5948. }
  5949. });
  5950. return slice;
  5951. }
  5952. });
  5953. OSF.DDA.AsyncMethodCalls.define({
  5954. method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,
  5955. privateStateCallbacks: [
  5956. {
  5957. name: OSF.DDA.FileProperties.Handle,
  5958. value: function (caller, stateInfo) { return stateInfo[OSF.DDA.FileProperties.Handle]; }
  5959. }
  5960. ]
  5961. });
  5962. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  5963. OSF.OUtil.setNamespace("File", OSF.DDA.Marshaling);
  5964. var OSF_DDA_Marshaling_File_FilePropertiesKeys;
  5965. (function (OSF_DDA_Marshaling_File_FilePropertiesKeys) {
  5966. OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["Handle"]=0]="Handle";
  5967. OSF_DDA_Marshaling_File_FilePropertiesKeys[OSF_DDA_Marshaling_File_FilePropertiesKeys["FileSize"]=1]="FileSize";
  5968. })(OSF_DDA_Marshaling_File_FilePropertiesKeys || (OSF_DDA_Marshaling_File_FilePropertiesKeys={}));
  5969. ;
  5970. OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys;
  5971. var OSF_DDA_Marshaling_File_SlicePropertiesKeys;
  5972. (function (OSF_DDA_Marshaling_File_SlicePropertiesKeys) {
  5973. OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["Data"]=0]="Data";
  5974. OSF_DDA_Marshaling_File_SlicePropertiesKeys[OSF_DDA_Marshaling_File_SlicePropertiesKeys["SliceSize"]=1]="SliceSize";
  5975. })(OSF_DDA_Marshaling_File_SlicePropertiesKeys || (OSF_DDA_Marshaling_File_SlicePropertiesKeys={}));
  5976. ;
  5977. OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys;
  5978. var OSF_DDA_Marshaling_File_FileType;
  5979. (function (OSF_DDA_Marshaling_File_FileType) {
  5980. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Text"]=0]="Text";
  5981. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Compressed"]=1]="Compressed";
  5982. OSF_DDA_Marshaling_File_FileType[OSF_DDA_Marshaling_File_FileType["Pdf"]=2]="Pdf";
  5983. })(OSF_DDA_Marshaling_File_FileType || (OSF_DDA_Marshaling_File_FileType={}));
  5984. ;
  5985. OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType;
  5986. var OSF_DDA_Marshaling_File_ParameterKeys;
  5987. (function (OSF_DDA_Marshaling_File_ParameterKeys) {
  5988. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["FileType"]=0]="FileType";
  5989. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceSize"]=1]="SliceSize";
  5990. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["Handle"]=2]="Handle";
  5991. OSF_DDA_Marshaling_File_ParameterKeys[OSF_DDA_Marshaling_File_ParameterKeys["SliceIndex"]=3]="SliceIndex";
  5992. })(OSF_DDA_Marshaling_File_ParameterKeys || (OSF_DDA_Marshaling_File_ParameterKeys={}));
  5993. ;
  5994. OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys;
  5995. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties);
  5996. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties);
  5997. OSF.DDA.WAC.Delegate.ParameterMap.define({
  5998. type: OSF.DDA.PropertyDescriptors.FileProperties,
  5999. fromHost: [
  6000. { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle },
  6001. { name: OSF.DDA.FileProperties.FileSize, value: OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize }
  6002. ]
  6003. });
  6004. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6005. type: OSF.DDA.PropertyDescriptors.FileSliceProperties,
  6006. fromHost: [
  6007. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data },
  6008. { name: OSF.DDA.FileProperties.SliceSize, value: OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize }
  6009. ]
  6010. });
  6011. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6012. type: Microsoft.Office.WebExtension.Parameters.FileType,
  6013. toHost: [
  6014. { name: Microsoft.Office.WebExtension.FileType.Text, value: OSF.DDA.Marshaling.File.FileType.Text },
  6015. { name: Microsoft.Office.WebExtension.FileType.Compressed, value: OSF.DDA.Marshaling.File.FileType.Compressed },
  6016. { name: Microsoft.Office.WebExtension.FileType.Pdf, value: OSF.DDA.Marshaling.File.FileType.Pdf }
  6017. ]
  6018. });
  6019. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6020. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,
  6021. toHost: [
  6022. { name: Microsoft.Office.WebExtension.Parameters.FileType, value: OSF.DDA.Marshaling.File.ParameterKeys.FileType },
  6023. { name: Microsoft.Office.WebExtension.Parameters.SliceSize, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceSize }
  6024. ],
  6025. fromHost: [
  6026. { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6027. ]
  6028. });
  6029. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6030. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,
  6031. toHost: [
  6032. { name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle },
  6033. { name: Microsoft.Office.WebExtension.Parameters.SliceIndex, value: OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex }
  6034. ],
  6035. fromHost: [
  6036. { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6037. ]
  6038. });
  6039. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6040. type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,
  6041. toHost: [{ name: OSF.DDA.FileProperties.Handle, value: OSF.DDA.Marshaling.File.ParameterKeys.Handle }]
  6042. });
  6043. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  6044. function fixData(data) {
  6045. if (data==null || data==undefined) {
  6046. return null;
  6047. }
  6048. try {
  6049. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  6050. data=[data];
  6051. }
  6052. return data;
  6053. }
  6054. catch (ex) {
  6055. }
  6056. }
  6057. ;
  6058. OSF.OUtil.defineEnumerableProperties(this, {
  6059. "headers": {
  6060. get: function () { return headers; },
  6061. set: function (value) {
  6062. headers=fixData(value);
  6063. }
  6064. },
  6065. "rows": {
  6066. get: function () { return rows; },
  6067. set: function (value) {
  6068. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ?
  6069. [] :
  6070. fixData(value);
  6071. }
  6072. }
  6073. });
  6074. this.headers=headers;
  6075. this.rows=rows;
  6076. };
  6077. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6078. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  6079. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  6080. };
  6081. Microsoft.Office.WebExtension.CoercionType={
  6082. Text: "text",
  6083. Matrix: "matrix",
  6084. Table: "table"
  6085. };
  6086. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  6087. return {
  6088. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  6089. if (OSF.OUtil.isArray(obj)) {
  6090. var dim=0;
  6091. for (var index=0; index < obj.length; index++) {
  6092. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  6093. }
  6094. return dim+1;
  6095. }
  6096. else {
  6097. return 0;
  6098. }
  6099. },
  6100. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  6101. switch (bindingType) {
  6102. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  6103. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  6104. case Microsoft.Office.WebExtension.BindingType.Text:
  6105. default:
  6106. return Microsoft.Office.WebExtension.CoercionType.Text;
  6107. }
  6108. },
  6109. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  6110. switch (coercionType) {
  6111. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  6112. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  6113. case Microsoft.Office.WebExtension.CoercionType.Text:
  6114. case Microsoft.Office.WebExtension.CoercionType.Html:
  6115. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6116. default:
  6117. return Microsoft.Office.WebExtension.BindingType.Text;
  6118. }
  6119. },
  6120. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  6121. if (data==null || data==undefined)
  6122. return null;
  6123. var sourceType=null;
  6124. var runtimeType=typeof data;
  6125. if (data.rows !==undefined) {
  6126. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  6127. }
  6128. else if (OSF.OUtil.isArray(data)) {
  6129. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  6130. }
  6131. else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  6132. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  6133. }
  6134. else {
  6135. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  6136. }
  6137. return sourceType;
  6138. },
  6139. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  6140. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  6141. if (sourceType && sourceType !=destinationType) {
  6142. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  6143. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  6144. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  6145. }
  6146. return data;
  6147. },
  6148. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  6149. if (matrix.length==1 && matrix[0].length==1)
  6150. return ""+matrix[0][0];
  6151. var val="";
  6152. for (var i=0; i < matrix.length; i++) {
  6153. val+=matrix[i].join("\t")+"\n";
  6154. }
  6155. return val.substring(0, val.length - 1);
  6156. },
  6157. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  6158. var ret=text.split("\n");
  6159. for (var i=0; i < ret.length; i++)
  6160. ret[i]=ret[i].split("\t");
  6161. return ret;
  6162. },
  6163. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  6164. var headers="";
  6165. if (table.headers !=null) {
  6166. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  6167. }
  6168. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  6169. if (rows=="") {
  6170. headers=headers.substring(0, headers.length - 1);
  6171. }
  6172. return headers+rows;
  6173. },
  6174. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  6175. var matrix=table.rows;
  6176. if (table.headers !=null) {
  6177. matrix.unshift(table.headers);
  6178. }
  6179. return matrix;
  6180. },
  6181. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  6182. var value;
  6183. switch (coercionType) {
  6184. case Microsoft.Office.WebExtension.CoercionType.Table:
  6185. value=table;
  6186. break;
  6187. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  6188. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  6189. break;
  6190. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  6191. value=null;
  6192. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  6193. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  6194. }
  6195. if (value==null) {
  6196. value=OSF.DDA.DataCoercion._tableToText(table);
  6197. }
  6198. break;
  6199. case Microsoft.Office.WebExtension.CoercionType.Text:
  6200. case Microsoft.Office.WebExtension.CoercionType.Html:
  6201. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6202. default:
  6203. value=OSF.DDA.DataCoercion._tableToText(table);
  6204. break;
  6205. }
  6206. return value;
  6207. },
  6208. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  6209. if (sourceType==undefined) {
  6210. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  6211. }
  6212. var value;
  6213. switch (sourceType) {
  6214. case Microsoft.Office.WebExtension.CoercionType.Table:
  6215. value=data;
  6216. break;
  6217. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  6218. value=new Microsoft.Office.WebExtension.TableData(data);
  6219. break;
  6220. case Microsoft.Office.WebExtension.CoercionType.Text:
  6221. case Microsoft.Office.WebExtension.CoercionType.Html:
  6222. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  6223. default:
  6224. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  6225. break;
  6226. }
  6227. return value;
  6228. }
  6229. };
  6230. })();
  6231. OSF.DDA.AsyncMethodNames.addNames({
  6232. GetSelectedDataAsync: "getSelectedDataAsync",
  6233. SetSelectedDataAsync: "setSelectedDataAsync"
  6234. });
  6235. (function () {
  6236. function processData(dataDescriptor, caller, callArgs) {
  6237. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6238. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6239. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6240. }
  6241. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  6242. return data==undefined ? null : data;
  6243. }
  6244. OSF.DDA.AsyncMethodCalls.define({
  6245. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  6246. requiredArguments: [
  6247. {
  6248. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  6249. "enum": Microsoft.Office.WebExtension.CoercionType
  6250. }
  6251. ],
  6252. supportedOptions: [
  6253. {
  6254. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  6255. value: {
  6256. "enum": Microsoft.Office.WebExtension.ValueFormat,
  6257. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  6258. }
  6259. },
  6260. {
  6261. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  6262. value: {
  6263. "enum": Microsoft.Office.WebExtension.FilterType,
  6264. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  6265. }
  6266. }
  6267. ],
  6268. privateStateCallbacks: [],
  6269. onSucceeded: processData
  6270. });
  6271. OSF.DDA.AsyncMethodCalls.define({
  6272. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  6273. requiredArguments: [
  6274. {
  6275. "name": Microsoft.Office.WebExtension.Parameters.Data,
  6276. "types": ["string", "object", "number", "boolean"]
  6277. }
  6278. ],
  6279. supportedOptions: [
  6280. {
  6281. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  6282. value: {
  6283. "enum": Microsoft.Office.WebExtension.CoercionType,
  6284. "calculate": function (requiredArgs) {
  6285. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  6286. }
  6287. }
  6288. },
  6289. {
  6290. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  6291. value: {
  6292. "types": ["number", "boolean"],
  6293. "defaultValue": false
  6294. }
  6295. },
  6296. {
  6297. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  6298. value: {
  6299. "types": ["number", "boolean"],
  6300. "defaultValue": false
  6301. }
  6302. },
  6303. {
  6304. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  6305. value: {
  6306. "types": ["number", "boolean"],
  6307. "defaultValue": false
  6308. }
  6309. },
  6310. {
  6311. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  6312. value: {
  6313. "types": ["number", "boolean"],
  6314. "defaultValue": false
  6315. }
  6316. }
  6317. ],
  6318. privateStateCallbacks: []
  6319. });
  6320. })();
  6321. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6322. type: OSF.DDA.WAC.UniqueArguments.GetData,
  6323. toHost: [
  6324. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  6325. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" },
  6326. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: "ValueFormat" },
  6327. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: "FilterType" },
  6328. { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" },
  6329. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  6330. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  6331. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  6332. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" },
  6333. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" }
  6334. ]
  6335. });
  6336. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6337. type: OSF.DDA.WAC.UniqueArguments.SetData,
  6338. toHost: [
  6339. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  6340. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: "CoerceType" },
  6341. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data },
  6342. { name: Microsoft.Office.WebExtension.Parameters.Rows, value: "Rows" },
  6343. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  6344. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  6345. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  6346. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: "ImageLeft" },
  6347. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: "ImageTop" },
  6348. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: "ImageWidth" },
  6349. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: "ImageHeight" }
  6350. ]
  6351. });
  6352. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6353. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  6354. fromHost: [
  6355. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  6356. ],
  6357. toHost: [
  6358. { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6359. ]
  6360. });
  6361. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6362. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  6363. toHost: [
  6364. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6365. ]
  6366. });
  6367. OSF.DDA.SettingsManager={
  6368. SerializedSettings: "serializedSettings",
  6369. RefreshingSettings: "refreshingSettings",
  6370. DateJSONPrefix: "Date(",
  6371. DataJSONSuffix: ")",
  6372. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  6373. var ret={};
  6374. for (var key in settingsCollection) {
  6375. var value=settingsCollection[key];
  6376. try {
  6377. if (JSON) {
  6378. value=JSON.stringify(value, function dateReplacer(k, v) {
  6379. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  6380. });
  6381. }
  6382. else {
  6383. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  6384. }
  6385. ret[key]=value;
  6386. }
  6387. catch (ex) {
  6388. }
  6389. }
  6390. return ret;
  6391. },
  6392. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  6393. var ret={};
  6394. serializedSettings=serializedSettings || {};
  6395. for (var key in serializedSettings) {
  6396. var value=serializedSettings[key];
  6397. try {
  6398. if (JSON) {
  6399. value=JSON.parse(value, function dateReviver(k, v) {
  6400. var d;
  6401. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  6402. d=new Date(parseInt(v.slice(5, -1)));
  6403. if (d) {
  6404. return d;
  6405. }
  6406. }
  6407. return v;
  6408. });
  6409. }
  6410. else {
  6411. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  6412. }
  6413. ret[key]=value;
  6414. }
  6415. catch (ex) {
  6416. }
  6417. }
  6418. return ret;
  6419. }
  6420. };
  6421. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  6422. settings=settings || {};
  6423. var cacheSessionSettings=function (settings) {
  6424. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  6425. if (osfSessionStorage) {
  6426. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  6427. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  6428. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  6429. }
  6430. };
  6431. OSF.OUtil.defineEnumerableProperties(this, {
  6432. "get": {
  6433. value: function OSF_DDA_Settings$get(name) {
  6434. var e=Function._validateParams(arguments, [
  6435. { name: "name", type: String, mayBeNull: false }
  6436. ]);
  6437. if (e)
  6438. throw e;
  6439. var setting=settings[name];
  6440. return typeof (setting)==='undefined' ? null : setting;
  6441. }
  6442. },
  6443. "set": {
  6444. value: function OSF_DDA_Settings$set(name, value) {
  6445. var e=Function._validateParams(arguments, [
  6446. { name: "name", type: String, mayBeNull: false },
  6447. { name: "value", mayBeNull: true }
  6448. ]);
  6449. if (e)
  6450. throw e;
  6451. settings[name]=value;
  6452. cacheSessionSettings(settings);
  6453. }
  6454. },
  6455. "remove": {
  6456. value: function OSF_DDA_Settings$remove(name) {
  6457. var e=Function._validateParams(arguments, [
  6458. { name: "name", type: String, mayBeNull: false }
  6459. ]);
  6460. if (e)
  6461. throw e;
  6462. delete settings[name];
  6463. cacheSessionSettings(settings);
  6464. }
  6465. }
  6466. });
  6467. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  6468. };
  6469. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  6470. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  6471. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  6472. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  6473. };
  6474. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  6475. Microsoft.Office.WebExtension.EventType={};
  6476. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  6477. this._eventHandlers={};
  6478. this._queuedEventsArgs={};
  6479. for (var entry in eventTypes) {
  6480. var eventType=eventTypes[entry];
  6481. this._eventHandlers[eventType]=[];
  6482. this._queuedEventsArgs[eventType]=[];
  6483. }
  6484. };
  6485. OSF.EventDispatch.prototype={
  6486. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  6487. var events=[];
  6488. for (var eventName in this._eventHandlers)
  6489. events.push(eventName);
  6490. return events;
  6491. },
  6492. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  6493. var isSupported=false;
  6494. for (var eventName in this._eventHandlers) {
  6495. if (event==eventName) {
  6496. isSupported=true;
  6497. break;
  6498. }
  6499. }
  6500. return isSupported;
  6501. },
  6502. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  6503. var handlers=this._eventHandlers[eventType];
  6504. if (handlers && handlers.length > 0) {
  6505. for (var h in handlers) {
  6506. if (handlers[h]===handler)
  6507. return true;
  6508. }
  6509. }
  6510. return false;
  6511. },
  6512. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  6513. if (typeof handler !="function") {
  6514. return false;
  6515. }
  6516. var handlers=this._eventHandlers[eventType];
  6517. if (handlers && !this.hasEventHandler(eventType, handler)) {
  6518. handlers.push(handler);
  6519. return true;
  6520. }
  6521. else {
  6522. return false;
  6523. }
  6524. },
  6525. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  6526. var handlers=this._eventHandlers[eventType];
  6527. var isFirstHandler=handlers.length==0;
  6528. var succeed=this.addEventHandler(eventType, handler);
  6529. if (isFirstHandler && succeed) {
  6530. this.fireQueuedEvent(eventType);
  6531. }
  6532. return succeed;
  6533. },
  6534. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  6535. var handlers=this._eventHandlers[eventType];
  6536. if (handlers && handlers.length > 0) {
  6537. for (var index=0; index < handlers.length; index++) {
  6538. if (handlers[index]===handler) {
  6539. handlers.splice(index, 1);
  6540. return true;
  6541. }
  6542. }
  6543. }
  6544. return false;
  6545. },
  6546. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  6547. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  6548. this._eventHandlers[eventType]=[];
  6549. return true;
  6550. }
  6551. return false;
  6552. },
  6553. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  6554. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  6555. },
  6556. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  6557. if (eventArgs.type==undefined)
  6558. return false;
  6559. var eventType=eventArgs.type;
  6560. if (eventType && this._eventHandlers[eventType]) {
  6561. var eventHandlers=this._eventHandlers[eventType];
  6562. for (var handler in eventHandlers)
  6563. eventHandlers[handler](eventArgs);
  6564. return true;
  6565. }
  6566. else {
  6567. return false;
  6568. }
  6569. },
  6570. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  6571. var eventType=eventArgs.type;
  6572. if (eventType && this._eventHandlers[eventType]) {
  6573. var eventHandlers=this._eventHandlers[eventType];
  6574. var queuedEvents=this._queuedEventsArgs[eventType];
  6575. if (eventHandlers.length==0) {
  6576. queuedEvents.push(eventArgs);
  6577. }
  6578. else {
  6579. this.fireEvent(eventArgs);
  6580. }
  6581. return true;
  6582. }
  6583. else {
  6584. return false;
  6585. }
  6586. },
  6587. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  6588. if (eventType && this._eventHandlers[eventType]) {
  6589. var eventHandlers=this._eventHandlers[eventType];
  6590. var queuedEvents=this._queuedEventsArgs[eventType];
  6591. if (eventHandlers.length > 0) {
  6592. var eventHandler=eventHandlers[0];
  6593. while (queuedEvents.length > 0) {
  6594. var eventArgs=queuedEvents.shift();
  6595. eventHandler(eventArgs);
  6596. }
  6597. return true;
  6598. }
  6599. }
  6600. return false;
  6601. }
  6602. };
  6603. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6604. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  6605. var args;
  6606. switch (eventType) {
  6607. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  6608. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  6609. break;
  6610. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  6611. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  6612. break;
  6613. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  6614. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  6615. break;
  6616. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  6617. args=new OSF.DDA.SettingsChangedEventArgs(target);
  6618. break;
  6619. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  6620. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  6621. break;
  6622. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  6623. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  6624. break;
  6625. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  6626. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  6627. break;
  6628. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  6629. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  6630. break;
  6631. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  6632. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6633. break;
  6634. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  6635. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6636. break;
  6637. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  6638. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  6639. break;
  6640. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  6641. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  6642. break;
  6643. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  6644. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  6645. break;
  6646. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  6647. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  6648. break;
  6649. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  6650. args=new OSF.DDA.DialogEventArgs(eventProperties);
  6651. break;
  6652. case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:
  6653. args=new OSF.DDA.DialogParentEventArgs(eventProperties);
  6654. break;
  6655. case Microsoft.Office.WebExtension.EventType.ItemChanged:
  6656. if (OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlook" || OSF._OfficeAppFactory.getHostInfo()["hostType"]=="outlookwebapp") {
  6657. args=new OSF.DDA.OlkItemSelectedChangedEventArgs(eventProperties);
  6658. target.initialize(args["initialData"]);
  6659. target.setCurrentItemNumber(args["itemNumber"].itemNumber);
  6660. }
  6661. else {
  6662. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  6663. }
  6664. break;
  6665. default:
  6666. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  6667. }
  6668. return args;
  6669. };
  6670. OSF.DDA.AsyncMethodNames.addNames({
  6671. AddHandlerAsync: "addHandlerAsync",
  6672. RemoveHandlerAsync: "removeHandlerAsync"
  6673. });
  6674. OSF.DDA.AsyncMethodCalls.define({
  6675. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  6676. requiredArguments: [{
  6677. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  6678. "enum": Microsoft.Office.WebExtension.EventType,
  6679. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  6680. },
  6681. {
  6682. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  6683. "types": ["function"]
  6684. }
  6685. ],
  6686. supportedOptions: [],
  6687. privateStateCallbacks: []
  6688. });
  6689. OSF.DDA.AsyncMethodCalls.define({
  6690. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  6691. requiredArguments: [
  6692. {
  6693. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  6694. "enum": Microsoft.Office.WebExtension.EventType,
  6695. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  6696. }
  6697. ],
  6698. supportedOptions: [
  6699. {
  6700. name: Microsoft.Office.WebExtension.Parameters.Handler,
  6701. value: {
  6702. "types": ["function", "object"],
  6703. "defaultValue": null
  6704. }
  6705. }
  6706. ],
  6707. privateStateCallbacks: []
  6708. });
  6709. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  6710. SettingsChanged: "settingsChanged"
  6711. });
  6712. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  6713. OSF.OUtil.defineEnumerableProperties(this, {
  6714. "type": {
  6715. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  6716. },
  6717. "settings": {
  6718. value: settingsInstance
  6719. }
  6720. });
  6721. };
  6722. OSF.DDA.AsyncMethodNames.addNames({
  6723. RefreshAsync: "refreshAsync",
  6724. SaveAsync: "saveAsync"
  6725. });
  6726. OSF.DDA.AsyncMethodCalls.define({
  6727. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  6728. requiredArguments: [],
  6729. supportedOptions: [],
  6730. privateStateCallbacks: [
  6731. {
  6732. name: OSF.DDA.SettingsManager.RefreshingSettings,
  6733. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  6734. return settingsCollection;
  6735. }
  6736. }
  6737. ],
  6738. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  6739. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  6740. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  6741. var oldSettings=refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  6742. for (var setting in oldSettings) {
  6743. refreshingSettings.remove(setting);
  6744. }
  6745. for (var setting in newSettings) {
  6746. refreshingSettings.set(setting, newSettings[setting]);
  6747. }
  6748. return refreshingSettings;
  6749. }
  6750. });
  6751. OSF.DDA.AsyncMethodCalls.define({
  6752. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  6753. requiredArguments: [],
  6754. supportedOptions: [
  6755. {
  6756. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  6757. value: {
  6758. "types": ["boolean"],
  6759. "defaultValue": true
  6760. }
  6761. }
  6762. ],
  6763. privateStateCallbacks: [
  6764. {
  6765. name: OSF.DDA.SettingsManager.SerializedSettings,
  6766. value: function serializeSettings(settingsInstance, settingsCollection) {
  6767. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  6768. }
  6769. }
  6770. ]
  6771. });
  6772. OSF.DDA.WAC.SettingsTranslator=(function () {
  6773. var keyIndex=0;
  6774. var valueIndex=1;
  6775. return {
  6776. read: function OSF_DDA_WAC_SettingsTranslator$read(payload) {
  6777. var serializedSettings={};
  6778. var settingsPayload=payload.Settings;
  6779. for (var index in settingsPayload) {
  6780. var setting=settingsPayload[index];
  6781. serializedSettings[setting[keyIndex]]=setting[valueIndex];
  6782. }
  6783. return serializedSettings;
  6784. },
  6785. write: function OSF_DDA_WAC_SettingsTranslator$write(serializedSettings) {
  6786. var settingsPayload=[];
  6787. for (var key in serializedSettings) {
  6788. var setting=[];
  6789. setting[keyIndex]=key;
  6790. setting[valueIndex]=serializedSettings[key];
  6791. settingsPayload.push(setting);
  6792. }
  6793. return settingsPayload;
  6794. }
  6795. };
  6796. })();
  6797. OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings, {
  6798. toHost: OSF.DDA.WAC.SettingsTranslator.write,
  6799. fromHost: OSF.DDA.WAC.SettingsTranslator.read
  6800. });
  6801. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6802. type: OSF.DDA.WAC.UniqueArguments.SettingsRequest,
  6803. toHost: [
  6804. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: "OverwriteIfStale" },
  6805. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties }
  6806. ],
  6807. invertible: true
  6808. });
  6809. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6810. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  6811. fromHost: [
  6812. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.WAC.UniqueArguments.Properties }
  6813. ]
  6814. });
  6815. OSF.DDA.WAC.Delegate.ParameterMap.define({
  6816. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  6817. toHost: [
  6818. { name: OSF.DDA.WAC.UniqueArguments.SettingsRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  6819. ]
  6820. });
  6821. OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  6822. Microsoft.Office.WebExtension.BindingType={
  6823. Table: "table",
  6824. Text: "text",
  6825. Matrix: "matrix"
  6826. };
  6827. OSF.DDA.BindingProperties={
  6828. Id: "BindingId",
  6829. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  6830. };
  6831. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  6832. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  6833. Subset: "subset",
  6834. BindingProperties: "BindingProperties"
  6835. });
  6836. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  6837. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  6838. this._id=bindingId;
  6839. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  6840. get: function () {
  6841. return errorCallback;
  6842. },
  6843. set: function (onError) {
  6844. var t=typeof onError;
  6845. if (t !="undefined" && t !="function") {
  6846. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  6847. }
  6848. errorCallback=onError;
  6849. }
  6850. });
  6851. };
  6852. OSF.DDA.BindingPromise.prototype={
  6853. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  6854. if (this.binding) {
  6855. if (onComplete)
  6856. onComplete(this.binding);
  6857. }
  6858. else {
  6859. if (!this._binding) {
  6860. var me=this;
  6861. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  6862. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  6863. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  6864. value: asyncResult.value
  6865. });
  6866. if (onComplete)
  6867. onComplete(me.binding);
  6868. }
  6869. else {
  6870. if (me.onFail)
  6871. me.onFail(asyncResult);
  6872. }
  6873. });
  6874. }
  6875. }
  6876. return this;
  6877. },
  6878. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  6879. var args=arguments;
  6880. this._fetch(function onComplete(binding) { binding.getDataAsync.apply(binding, args); });
  6881. return this;
  6882. },
  6883. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  6884. var args=arguments;
  6885. this._fetch(function onComplete(binding) { binding.setDataAsync.apply(binding, args); });
  6886. return this;
  6887. },
  6888. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  6889. var args=arguments;
  6890. this._fetch(function onComplete(binding) { binding.addHandlerAsync.apply(binding, args); });
  6891. return this;
  6892. },
  6893. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  6894. var args=arguments;
  6895. this._fetch(function onComplete(binding) { binding.removeHandlerAsync.apply(binding, args); });
  6896. return this;
  6897. }
  6898. };
  6899. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  6900. this._eventDispatches=[];
  6901. OSF.OUtil.defineEnumerableProperty(this, "document", {
  6902. value: docInstance
  6903. });
  6904. var am=OSF.DDA.AsyncMethodNames;
  6905. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6906. am.AddFromSelectionAsync,
  6907. am.AddFromNamedItemAsync,
  6908. am.GetAllAsync,
  6909. am.GetByIdAsync,
  6910. am.ReleaseByIdAsync
  6911. ]);
  6912. };
  6913. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  6914. OSF.OUtil.defineEnumerableProperties(this, {
  6915. "document": { value: docInstance },
  6916. "id": { value: id }
  6917. });
  6918. };
  6919. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  6920. OSF.OUtil.defineEnumerableProperties(this, {
  6921. "document": {
  6922. value: docInstance
  6923. },
  6924. "id": {
  6925. value: id
  6926. }
  6927. });
  6928. var am=OSF.DDA.AsyncMethodNames;
  6929. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6930. am.GetDataAsync,
  6931. am.SetDataAsync
  6932. ]);
  6933. var et=Microsoft.Office.WebExtension.EventType;
  6934. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  6935. if (!bindingEventDispatches[id]) {
  6936. bindingEventDispatches[id]=new OSF.EventDispatch([
  6937. et.BindingSelectionChanged,
  6938. et.BindingDataChanged
  6939. ]);
  6940. }
  6941. var eventDispatch=bindingEventDispatches[id];
  6942. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  6943. };
  6944. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  6945. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  6946. };
  6947. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  6948. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  6949. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  6950. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  6951. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  6952. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  6953. var binding;
  6954. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  6955. case Microsoft.Office.WebExtension.BindingType.Text:
  6956. binding=new OSF.DDA.TextBinding(id, containingDocument);
  6957. break;
  6958. case Microsoft.Office.WebExtension.BindingType.Matrix:
  6959. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  6960. break;
  6961. case Microsoft.Office.WebExtension.BindingType.Table:
  6962. var isExcelApp=function () {
  6963. return (OSF.DDA.ExcelDocument)
  6964. && (Microsoft.Office.WebExtension.context.document)
  6965. && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  6966. };
  6967. var tableBindingObject;
  6968. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  6969. tableBindingObject=OSF.DDA.ExcelTableBinding;
  6970. }
  6971. else {
  6972. tableBindingObject=OSF.DDA.TableBinding;
  6973. }
  6974. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  6975. break;
  6976. default:
  6977. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  6978. }
  6979. return binding;
  6980. };
  6981. OSF.DDA.AsyncMethodNames.addNames({
  6982. AddFromSelectionAsync: "addFromSelectionAsync",
  6983. AddFromNamedItemAsync: "addFromNamedItemAsync",
  6984. GetAllAsync: "getAllAsync",
  6985. GetByIdAsync: "getByIdAsync",
  6986. ReleaseByIdAsync: "releaseByIdAsync",
  6987. GetDataAsync: "getDataAsync",
  6988. SetDataAsync: "setDataAsync"
  6989. });
  6990. (function () {
  6991. function processBinding(bindingDescriptor) {
  6992. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  6993. }
  6994. function getObjectId(obj) { return obj.id; }
  6995. function processData(dataDescriptor, caller, callArgs) {
  6996. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  6997. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  6998. data=OSF.DDA.OMFactory.manufactureTableData(data);
  6999. }
  7000. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  7001. return data==undefined ? null : data;
  7002. }
  7003. OSF.DDA.AsyncMethodCalls.define({
  7004. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  7005. requiredArguments: [
  7006. {
  7007. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7008. "enum": Microsoft.Office.WebExtension.BindingType
  7009. }
  7010. ],
  7011. supportedOptions: [{
  7012. name: Microsoft.Office.WebExtension.Parameters.Id,
  7013. value: {
  7014. "types": ["string"],
  7015. "calculate": OSF.DDA.generateBindingId
  7016. }
  7017. },
  7018. {
  7019. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7020. value: {
  7021. "types": ["object"],
  7022. "defaultValue": null
  7023. }
  7024. }
  7025. ],
  7026. privateStateCallbacks: [],
  7027. onSucceeded: processBinding
  7028. });
  7029. OSF.DDA.AsyncMethodCalls.define({
  7030. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  7031. requiredArguments: [{
  7032. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  7033. "types": ["string"]
  7034. },
  7035. {
  7036. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7037. "enum": Microsoft.Office.WebExtension.BindingType
  7038. }
  7039. ],
  7040. supportedOptions: [{
  7041. name: Microsoft.Office.WebExtension.Parameters.Id,
  7042. value: {
  7043. "types": ["string"],
  7044. "calculate": OSF.DDA.generateBindingId
  7045. }
  7046. },
  7047. {
  7048. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7049. value: {
  7050. "types": ["object"],
  7051. "defaultValue": null
  7052. }
  7053. }
  7054. ],
  7055. privateStateCallbacks: [
  7056. {
  7057. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  7058. value: function () { return true; }
  7059. }
  7060. ],
  7061. onSucceeded: processBinding
  7062. });
  7063. OSF.DDA.AsyncMethodCalls.define({
  7064. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  7065. requiredArguments: [],
  7066. supportedOptions: [],
  7067. privateStateCallbacks: [],
  7068. onSucceeded: function (response) { return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding); }
  7069. });
  7070. OSF.DDA.AsyncMethodCalls.define({
  7071. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  7072. requiredArguments: [
  7073. {
  7074. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7075. "types": ["string"]
  7076. }
  7077. ],
  7078. supportedOptions: [],
  7079. privateStateCallbacks: [],
  7080. onSucceeded: processBinding
  7081. });
  7082. OSF.DDA.AsyncMethodCalls.define({
  7083. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  7084. requiredArguments: [
  7085. {
  7086. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7087. "types": ["string"]
  7088. }
  7089. ],
  7090. supportedOptions: [],
  7091. privateStateCallbacks: [],
  7092. onSucceeded: function (response, caller, callArgs) {
  7093. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  7094. delete caller._eventDispatches[id];
  7095. }
  7096. });
  7097. OSF.DDA.AsyncMethodCalls.define({
  7098. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  7099. requiredArguments: [],
  7100. supportedOptions: [{
  7101. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7102. value: {
  7103. "enum": Microsoft.Office.WebExtension.CoercionType,
  7104. "calculate": function (requiredArgs, binding) { return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type); }
  7105. }
  7106. },
  7107. {
  7108. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  7109. value: {
  7110. "enum": Microsoft.Office.WebExtension.ValueFormat,
  7111. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  7112. }
  7113. },
  7114. {
  7115. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  7116. value: {
  7117. "enum": Microsoft.Office.WebExtension.FilterType,
  7118. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  7119. }
  7120. },
  7121. {
  7122. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7123. value: {
  7124. "types": ["object", "string"],
  7125. "defaultValue": null
  7126. }
  7127. },
  7128. {
  7129. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7130. value: {
  7131. "types": ["object"],
  7132. "defaultValue": null
  7133. }
  7134. },
  7135. {
  7136. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7137. value: {
  7138. "types": ["number"],
  7139. "defaultValue": 0
  7140. }
  7141. },
  7142. {
  7143. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7144. value: {
  7145. "types": ["number"],
  7146. "defaultValue": 0
  7147. }
  7148. },
  7149. {
  7150. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  7151. value: {
  7152. "types": ["number"],
  7153. "defaultValue": 0
  7154. }
  7155. },
  7156. {
  7157. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  7158. value: {
  7159. "types": ["number"],
  7160. "defaultValue": 0
  7161. }
  7162. }
  7163. ],
  7164. checkCallArgs: function (callArgs, caller, stateInfo) {
  7165. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  7166. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 &&
  7167. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 &&
  7168. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  7169. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  7170. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  7171. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  7172. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  7173. }
  7174. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7175. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  7176. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] ||
  7177. callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] ||
  7178. callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  7179. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7180. }
  7181. return callArgs;
  7182. },
  7183. privateStateCallbacks: [
  7184. {
  7185. name: Microsoft.Office.WebExtension.Parameters.Id,
  7186. value: getObjectId
  7187. }
  7188. ],
  7189. onSucceeded: processData
  7190. });
  7191. OSF.DDA.AsyncMethodCalls.define({
  7192. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7193. requiredArguments: [
  7194. {
  7195. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7196. "types": ["string", "object", "number", "boolean"]
  7197. }
  7198. ],
  7199. supportedOptions: [{
  7200. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7201. value: {
  7202. "enum": Microsoft.Office.WebExtension.CoercionType,
  7203. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7204. }
  7205. },
  7206. {
  7207. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7208. value: {
  7209. "types": ["object", "string"],
  7210. "defaultValue": null
  7211. }
  7212. },
  7213. {
  7214. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7215. value: {
  7216. "types": ["object"],
  7217. "defaultValue": null
  7218. }
  7219. },
  7220. {
  7221. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7222. value: {
  7223. "types": ["number"],
  7224. "defaultValue": 0
  7225. }
  7226. },
  7227. {
  7228. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7229. value: {
  7230. "types": ["number"],
  7231. "defaultValue": 0
  7232. }
  7233. }
  7234. ],
  7235. checkCallArgs: function (callArgs, caller, stateInfo) {
  7236. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 &&
  7237. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  7238. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  7239. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  7240. }
  7241. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7242. (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] ||
  7243. callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  7244. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7245. }
  7246. return callArgs;
  7247. },
  7248. privateStateCallbacks: [
  7249. {
  7250. name: Microsoft.Office.WebExtension.Parameters.Id,
  7251. value: getObjectId
  7252. }
  7253. ]
  7254. });
  7255. })();
  7256. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  7257. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  7258. RowCount: "BindingRowCount",
  7259. ColumnCount: "BindingColumnCount",
  7260. HasHeaders: "HasHeaders"
  7261. });
  7262. OSF.DDA.TableDataProperties={
  7263. TableRows: "TableRows",
  7264. TableHeaders: "TableHeaders"
  7265. };
  7266. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  7267. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  7268. OSF.OUtil.defineEnumerableProperties(this, {
  7269. "type": {
  7270. value: Microsoft.Office.WebExtension.BindingType.Table
  7271. },
  7272. "rowCount": {
  7273. value: rows ? rows : 0
  7274. },
  7275. "columnCount": {
  7276. value: cols ? cols : 0
  7277. },
  7278. "hasHeaders": {
  7279. value: hasHeaders ? hasHeaders : false
  7280. }
  7281. });
  7282. var am=OSF.DDA.AsyncMethodNames;
  7283. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7284. am.AddRowsAsync,
  7285. am.AddColumnsAsync,
  7286. am.DeleteAllDataValuesAsync
  7287. ]);
  7288. };
  7289. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  7290. OSF.DDA.AsyncMethodNames.addNames({
  7291. AddRowsAsync: "addRowsAsync",
  7292. AddColumnsAsync: "addColumnsAsync",
  7293. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  7294. });
  7295. (function () {
  7296. function getObjectId(obj) { return obj.id; }
  7297. OSF.DDA.AsyncMethodCalls.define({
  7298. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  7299. requiredArguments: [
  7300. {
  7301. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7302. "types": ["object"]
  7303. }
  7304. ],
  7305. supportedOptions: [],
  7306. privateStateCallbacks: [
  7307. {
  7308. name: Microsoft.Office.WebExtension.Parameters.Id,
  7309. value: getObjectId
  7310. }
  7311. ]
  7312. });
  7313. OSF.DDA.AsyncMethodCalls.define({
  7314. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  7315. requiredArguments: [
  7316. {
  7317. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7318. "types": ["object"]
  7319. }
  7320. ],
  7321. supportedOptions: [],
  7322. privateStateCallbacks: [
  7323. {
  7324. name: Microsoft.Office.WebExtension.Parameters.Id,
  7325. value: getObjectId
  7326. }
  7327. ]
  7328. });
  7329. OSF.DDA.AsyncMethodCalls.define({
  7330. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  7331. requiredArguments: [],
  7332. supportedOptions: [],
  7333. privateStateCallbacks: [
  7334. {
  7335. name: Microsoft.Office.WebExtension.Parameters.Id,
  7336. value: getObjectId
  7337. }
  7338. ]
  7339. });
  7340. })();
  7341. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties);
  7342. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7343. type: OSF.DDA.WAC.UniqueArguments.BindingRequest,
  7344. toHost: [
  7345. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: "ItemName" },
  7346. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  7347. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: "BindingType" },
  7348. { name: Microsoft.Office.WebExtension.Parameters.PromptText, value: "PromptText" },
  7349. { name: Microsoft.Office.WebExtension.Parameters.Columns, value: "Columns" },
  7350. { name: Microsoft.Office.WebExtension.Parameters.SampleData, value: "SampleData" },
  7351. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: "FailOnCollision" }
  7352. ]
  7353. });
  7354. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7355. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  7356. toHost: [
  7357. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 2 },
  7358. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 3 },
  7359. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 1 }
  7360. ],
  7361. invertible: true
  7362. });
  7363. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7364. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  7365. fromHost: [
  7366. { name: OSF.DDA.BindingProperties.Id, value: "Name" },
  7367. { name: OSF.DDA.BindingProperties.Type, value: "BindingType" },
  7368. { name: OSF.DDA.BindingProperties.RowCount, value: "RowCount" },
  7369. { name: OSF.DDA.BindingProperties.ColumnCount, value: "ColCount" },
  7370. { name: OSF.DDA.BindingProperties.HasHeaders, value: "HasHeaders" }
  7371. ]
  7372. });
  7373. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7374. type: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,
  7375. fromHost: [
  7376. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 }
  7377. ]
  7378. });
  7379. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7380. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  7381. fromHost: [
  7382. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7383. ],
  7384. toHost: [
  7385. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7386. ]
  7387. });
  7388. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7389. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  7390. fromHost: [
  7391. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7392. ],
  7393. toHost: [
  7394. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7395. ]
  7396. });
  7397. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7398. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  7399. toHost: [
  7400. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7401. ]
  7402. });
  7403. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7404. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  7405. fromHost: [
  7406. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7407. ],
  7408. toHost: [
  7409. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7410. ]
  7411. });
  7412. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7413. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  7414. fromHost: [
  7415. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7416. ]
  7417. });
  7418. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7419. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  7420. fromHost: [
  7421. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  7422. ],
  7423. toHost: [
  7424. { name: OSF.DDA.WAC.UniqueArguments.GetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7425. ]
  7426. });
  7427. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7428. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  7429. toHost: [
  7430. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7431. ]
  7432. });
  7433. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7434. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  7435. toHost: [
  7436. { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7437. ]
  7438. });
  7439. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7440. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  7441. toHost: [
  7442. { name: OSF.DDA.WAC.UniqueArguments.AddRowsColumns, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7443. ]
  7444. });
  7445. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7446. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  7447. toHost: [
  7448. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7449. ]
  7450. });
  7451. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7452. type: OSF.DDA.WAC.UniqueArguments.AddRowsColumns,
  7453. toHost: [
  7454. { name: Microsoft.Office.WebExtension.Parameters.Id, value: "BindingId" },
  7455. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  7456. ]
  7457. });
  7458. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7459. type: OSF.DDA.PropertyDescriptors.Subset,
  7460. fromHost: [
  7461. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: "StartRow" },
  7462. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: "StartCol" },
  7463. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: "RowCount" },
  7464. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: "ColCount" }
  7465. ]
  7466. });
  7467. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  7468. RowCount: "BindingRowCount",
  7469. ColumnCount: "BindingColumnCount",
  7470. HasHeaders: "HasHeaders"
  7471. });
  7472. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  7473. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  7474. OSF.OUtil.defineEnumerableProperties(this, {
  7475. "type": {
  7476. value: Microsoft.Office.WebExtension.BindingType.Matrix
  7477. },
  7478. "rowCount": {
  7479. value: rows ? rows : 0
  7480. },
  7481. "columnCount": {
  7482. value: cols ? cols : 0
  7483. }
  7484. });
  7485. };
  7486. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  7487. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  7488. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  7489. OSF.OUtil.defineEnumerableProperty(this, "type", {
  7490. value: Microsoft.Office.WebExtension.BindingType.Text
  7491. });
  7492. };
  7493. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  7494. OSF.DDA.AsyncMethodNames.addNames({ AddFromPromptAsync: "addFromPromptAsync" });
  7495. OSF.DDA.AsyncMethodCalls.define({
  7496. method: OSF.DDA.AsyncMethodNames.AddFromPromptAsync,
  7497. requiredArguments: [
  7498. {
  7499. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  7500. "enum": Microsoft.Office.WebExtension.BindingType
  7501. }
  7502. ],
  7503. supportedOptions: [{
  7504. name: Microsoft.Office.WebExtension.Parameters.Id,
  7505. value: {
  7506. "types": ["string"],
  7507. "calculate": OSF.DDA.generateBindingId
  7508. }
  7509. },
  7510. {
  7511. name: Microsoft.Office.WebExtension.Parameters.PromptText,
  7512. value: {
  7513. "types": ["string"],
  7514. "calculate": function () { return Strings.OfficeOM.L_AddBindingFromPromptDefaultText; }
  7515. }
  7516. },
  7517. {
  7518. name: Microsoft.Office.WebExtension.Parameters.SampleData,
  7519. value: {
  7520. "types": ["object"],
  7521. "defaultValue": null
  7522. }
  7523. }
  7524. ],
  7525. privateStateCallbacks: [],
  7526. onSucceeded: function (bindingDescriptor) { return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document); }
  7527. });
  7528. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7529. type: OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,
  7530. fromHost: [
  7531. { name: OSF.DDA.WAC.UniqueArguments.SingleBindingResponse, value: OSF.DDA.WAC.UniqueArguments.BindingResponse }
  7532. ],
  7533. toHost: [
  7534. { name: OSF.DDA.WAC.UniqueArguments.BindingRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7535. ]
  7536. });
  7537. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  7538. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  7539. OSF.OUtil.defineEnumerableProperties(this, {
  7540. "type": {
  7541. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  7542. },
  7543. "document": {
  7544. value: docInstance
  7545. }
  7546. });
  7547. };
  7548. OSF.DDA.WAC.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  7549. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  7550. BindingSelectionChanged: "bindingSelectionChanged",
  7551. BindingDataChanged: "bindingDataChanged"
  7552. });
  7553. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  7554. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  7555. OSF.OUtil.defineEnumerableProperties(this, {
  7556. "type": {
  7557. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  7558. },
  7559. "binding": {
  7560. value: bindingInstance
  7561. }
  7562. });
  7563. for (var prop in subset) {
  7564. OSF.OUtil.defineEnumerableProperty(this, prop, {
  7565. value: subset[prop]
  7566. });
  7567. }
  7568. };
  7569. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  7570. OSF.OUtil.defineEnumerableProperties(this, {
  7571. "type": {
  7572. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  7573. },
  7574. "binding": {
  7575. value: bindingInstance
  7576. }
  7577. });
  7578. };
  7579. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent);
  7580. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7581. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  7582. fromHost: [
  7583. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource },
  7584. { name: OSF.DDA.PropertyDescriptors.Subset, value: OSF.DDA.PropertyDescriptors.Subset }
  7585. ]
  7586. });
  7587. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7588. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  7589. fromHost: [
  7590. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7591. ]
  7592. });
  7593. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7594. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  7595. fromHost: [
  7596. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.WAC.UniqueArguments.BindingEventSource }
  7597. ]
  7598. });
  7599. OSF.DDA.FilePropertiesDescriptor={
  7600. Url: "Url"
  7601. };
  7602. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  7603. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  7604. });
  7605. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  7606. OSF.OUtil.defineEnumerableProperties(this, {
  7607. "url": {
  7608. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  7609. }
  7610. });
  7611. };
  7612. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  7613. OSF.DDA.AsyncMethodCalls.define({
  7614. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  7615. fromHost: [
  7616. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  7617. ],
  7618. requiredArguments: [],
  7619. supportedOptions: [],
  7620. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  7621. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  7622. }
  7623. });
  7624. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  7625. var OSF_DDA_Marshaling_FilePropertiesKeys;
  7626. (function (OSF_DDA_Marshaling_FilePropertiesKeys) {
  7627. OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Properties"]=0]="Properties";
  7628. OSF_DDA_Marshaling_FilePropertiesKeys[OSF_DDA_Marshaling_FilePropertiesKeys["Url"]=1]="Url";
  7629. })(OSF_DDA_Marshaling_FilePropertiesKeys || (OSF_DDA_Marshaling_FilePropertiesKeys={}));
  7630. ;
  7631. OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys;
  7632. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor);
  7633. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7634. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  7635. fromHost: [
  7636. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: OSF.DDA.Marshaling.FilePropertiesKeys.Url }
  7637. ]
  7638. });
  7639. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7640. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  7641. fromHost: [
  7642. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.Marshaling.FilePropertiesKeys.Properties }
  7643. ]
  7644. });
  7645. Microsoft.Office.WebExtension.GoToType={
  7646. Binding: "binding",
  7647. NamedItem: "namedItem",
  7648. Slide: "slide",
  7649. Index: "index"
  7650. };
  7651. Microsoft.Office.WebExtension.SelectionMode={
  7652. Default: "default",
  7653. Selected: "selected",
  7654. None: "none"
  7655. };
  7656. Microsoft.Office.WebExtension.Index={
  7657. First: "first",
  7658. Last: "last",
  7659. Next: "next",
  7660. Previous: "previous"
  7661. };
  7662. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  7663. OSF.DDA.AsyncMethodCalls.define({
  7664. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  7665. requiredArguments: [{
  7666. "name": Microsoft.Office.WebExtension.Parameters.Id,
  7667. "types": ["string", "number"]
  7668. },
  7669. {
  7670. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  7671. "enum": Microsoft.Office.WebExtension.GoToType
  7672. }
  7673. ],
  7674. supportedOptions: [
  7675. {
  7676. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7677. value: {
  7678. "enum": Microsoft.Office.WebExtension.SelectionMode,
  7679. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  7680. }
  7681. }
  7682. ]
  7683. });
  7684. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  7685. OSF.DDA.Marshaling.NavigationKeys={
  7686. NavigationRequest: "DdaGoToByIdMethod",
  7687. Id: "Id",
  7688. GoToType: "GoToType",
  7689. SelectionMode: "SelectionMode"
  7690. };
  7691. var OSF_DDA_Marshaling_GoToType;
  7692. (function (OSF_DDA_Marshaling_GoToType) {
  7693. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Binding"]=0]="Binding";
  7694. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["NamedItem"]=1]="NamedItem";
  7695. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Slide"]=2]="Slide";
  7696. OSF_DDA_Marshaling_GoToType[OSF_DDA_Marshaling_GoToType["Index"]=3]="Index";
  7697. })(OSF_DDA_Marshaling_GoToType || (OSF_DDA_Marshaling_GoToType={}));
  7698. ;
  7699. OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType;
  7700. var OSF_DDA_Marshaling_SelectionMode;
  7701. (function (OSF_DDA_Marshaling_SelectionMode) {
  7702. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Default"]=0]="Default";
  7703. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["Selected"]=1]="Selected";
  7704. OSF_DDA_Marshaling_SelectionMode[OSF_DDA_Marshaling_SelectionMode["None"]=2]="None";
  7705. })(OSF_DDA_Marshaling_SelectionMode || (OSF_DDA_Marshaling_SelectionMode={}));
  7706. ;
  7707. OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode;
  7708. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest);
  7709. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7710. type: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,
  7711. toHost: [
  7712. { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.NavigationKeys.Id },
  7713. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: OSF.DDA.Marshaling.NavigationKeys.GoToType },
  7714. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: OSF.DDA.Marshaling.NavigationKeys.SelectionMode }
  7715. ]
  7716. });
  7717. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7718. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  7719. toHost: [
  7720. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: OSF.DDA.Marshaling.GoToType.Binding },
  7721. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: OSF.DDA.Marshaling.GoToType.NamedItem },
  7722. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: OSF.DDA.Marshaling.GoToType.Slide },
  7723. { name: Microsoft.Office.WebExtension.GoToType.Index, value: OSF.DDA.Marshaling.GoToType.Index }
  7724. ]
  7725. });
  7726. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7727. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  7728. toHost: [
  7729. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: OSF.DDA.Marshaling.SelectionMode.Default },
  7730. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: OSF.DDA.Marshaling.SelectionMode.Selected },
  7731. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: OSF.DDA.Marshaling.SelectionMode.None }
  7732. ]
  7733. });
  7734. OSF.DDA.WAC.Delegate.ParameterMap.define({
  7735. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  7736. toHost: [
  7737. { name: OSF.DDA.Marshaling.NavigationKeys.NavigationRequest, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  7738. ]
  7739. });
  7740. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  7741. var am=OSF.DDA.AsyncMethodNames;
  7742. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  7743. am.ClearFormatsAsync,
  7744. am.SetTableOptionsAsync,
  7745. am.SetFormatsAsync
  7746. ]);
  7747. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  7748. OSF.OUtil.finalizeProperties(this);
  7749. };
  7750. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  7751. (function () {
  7752. OSF.DDA.AsyncMethodCalls.define({
  7753. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  7754. requiredArguments: [
  7755. {
  7756. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7757. "types": ["string", "object", "number", "boolean"]
  7758. }
  7759. ],
  7760. supportedOptions: [{
  7761. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7762. value: {
  7763. "enum": Microsoft.Office.WebExtension.CoercionType,
  7764. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7765. }
  7766. },
  7767. {
  7768. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7769. value: {
  7770. "types": ["object"],
  7771. "defaultValue": []
  7772. }
  7773. },
  7774. {
  7775. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7776. value: {
  7777. "types": ["object"],
  7778. "defaultValue": []
  7779. }
  7780. }
  7781. ],
  7782. privateStateCallbacks: []
  7783. });
  7784. OSF.DDA.AsyncMethodCalls.define({
  7785. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  7786. requiredArguments: [
  7787. {
  7788. "name": Microsoft.Office.WebExtension.Parameters.Data,
  7789. "types": ["string", "object", "number", "boolean"]
  7790. }
  7791. ],
  7792. supportedOptions: [{
  7793. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  7794. value: {
  7795. "enum": Microsoft.Office.WebExtension.CoercionType,
  7796. "calculate": function (requiredArgs) { return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]); }
  7797. }
  7798. },
  7799. {
  7800. name: Microsoft.Office.WebExtension.Parameters.Rows,
  7801. value: {
  7802. "types": ["object", "string"],
  7803. "defaultValue": null
  7804. }
  7805. },
  7806. {
  7807. name: Microsoft.Office.WebExtension.Parameters.Columns,
  7808. value: {
  7809. "types": ["object"],
  7810. "defaultValue": null
  7811. }
  7812. },
  7813. {
  7814. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  7815. value: {
  7816. "types": ["number"],
  7817. "defaultValue": 0
  7818. }
  7819. },
  7820. {
  7821. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  7822. value: {
  7823. "types": ["number"],
  7824. "defaultValue": 0
  7825. }
  7826. },
  7827. {
  7828. name: Microsoft.Office.WebExtension.Parameters.CellFormat,
  7829. value: {
  7830. "types": ["object"],
  7831. "defaultValue": []
  7832. }
  7833. },
  7834. {
  7835. name: Microsoft.Office.WebExtension.Parameters.TableOptions,
  7836. value: {
  7837. "types": ["object"],
  7838. "defaultValue": []
  7839. }
  7840. }
  7841. ],
  7842. checkCallArgs: function (callArgs, caller, stateInfo) {
  7843. var Parameters=Microsoft.Office.WebExtension.Parameters;
  7844. if (callArgs[Parameters.StartRow]==0 &&
  7845. callArgs[Parameters.StartColumn]==0 &&
  7846. OSF.OUtil.isArray(callArgs[Parameters.CellFormat]) && callArgs[Parameters.CellFormat].length===0 &&
  7847. OSF.OUtil.isArray(callArgs[Parameters.TableOptions]) && callArgs[Parameters.TableOptions].length===0) {
  7848. delete callArgs[Parameters.StartRow];
  7849. delete callArgs[Parameters.StartColumn];
  7850. delete callArgs[Parameters.CellFormat];
  7851. delete callArgs[Parameters.TableOptions];
  7852. }
  7853. if (callArgs[Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) &&
  7854. ((callArgs[Parameters.StartRow] && callArgs[Parameters.StartRow] !=0) ||
  7855. (callArgs[Parameters.StartColumn] && callArgs[Parameters.StartColumn] !=0) ||
  7856. callArgs[Parameters.CellFormat] ||
  7857. callArgs[Parameters.TableOptions])) {
  7858. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  7859. }
  7860. return callArgs;
  7861. },
  7862. privateStateCallbacks: [
  7863. {
  7864. name: Microsoft.Office.WebExtension.Parameters.Id,
  7865. value: function (obj) { return obj.id; }
  7866. }
  7867. ]
  7868. });
  7869. OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function OSF_DDA_BindingPromise$setTableOptionsAsync() {
  7870. var args=arguments;
  7871. this._fetch(function onComplete(binding) { binding.setTableOptionsAsync.apply(binding, args); });
  7872. return this;
  7873. },
  7874. OSF.DDA.BindingPromise.prototype.setFormatsAsync=function OSF_DDA_BindingPromise$setFormatsAsync() {
  7875. var args=arguments;
  7876. this._fetch(function onComplete(binding) { binding.setFormatsAsync.apply(binding, args); });
  7877. return this;
  7878. },
  7879. OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function OSF_DDA_BindingPromise$clearFormatsAsync() {
  7880. var args=arguments;
  7881. this._fetch(function onComplete(binding) { binding.clearFormatsAsync.apply(binding, args); });
  7882. return this;
  7883. };
  7884. })();
  7885. (function () {
  7886. function getObjectId(obj) { return obj.id; }
  7887. OSF.DDA.AsyncMethodNames.addNames({
  7888. ClearFormatsAsync: "clearFormatsAsync",
  7889. SetTableOptionsAsync: "setTableOptionsAsync",
  7890. SetFormatsAsync: "setFormatsAsync"
  7891. });
  7892. OSF.DDA.AsyncMethodCalls.define({
  7893. method: OSF.DDA.AsyncMethodNames.ClearFormatsAsync,
  7894. requiredArguments: [],
  7895. supportedOptions: [],
  7896. privateStateCallbacks: [
  7897. {
  7898. name: Microsoft.Office.WebExtension.Parameters.Id,
  7899. value: getObjectId
  7900. }
  7901. ]
  7902. });
  7903. OSF.DDA.AsyncMethodCalls.define({
  7904. method: OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,
  7905. requiredArguments: [
  7906. {
  7907. "name": Microsoft.Office.WebExtension.Parameters.TableOptions,
  7908. "defaultValue": []
  7909. }
  7910. ],
  7911. privateStateCallbacks: [
  7912. {
  7913. name: Microsoft.Office.WebExtension.Parameters.Id,
  7914. value: getObjectId
  7915. }
  7916. ]
  7917. });
  7918. OSF.DDA.AsyncMethodCalls.define({
  7919. method: OSF.DDA.AsyncMethodNames.SetFormatsAsync,
  7920. requiredArguments: [
  7921. {
  7922. "name": Microsoft.Office.WebExtension.Parameters.CellFormat,
  7923. "defaultValue": []
  7924. }
  7925. ],
  7926. privateStateCallbacks: [
  7927. {
  7928. name: Microsoft.Office.WebExtension.Parameters.Id,
  7929. value: getObjectId
  7930. }
  7931. ]
  7932. });
  7933. })();
  7934. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  7935. OSF.DDA.Marshaling.FormatKeys={
  7936. Id: "BindingId",
  7937. CellFormat: "CellFormat",
  7938. TableOptions: "TableOptions"
  7939. };
  7940. var OSF_DDA_Marshaling_TableOptionProperties;
  7941. (function (OSF_DDA_Marshaling_TableOptionProperties) {
  7942. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["headerRow"]=0]="headerRow";
  7943. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedRows"]=1]="bandedRows";
  7944. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["firstColumn"]=2]="firstColumn";
  7945. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["lastColumn"]=3]="lastColumn";
  7946. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["bandedColumns"]=4]="bandedColumns";
  7947. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["filterButton"]=5]="filterButton";
  7948. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["style"]=6]="style";
  7949. OSF_DDA_Marshaling_TableOptionProperties[OSF_DDA_Marshaling_TableOptionProperties["totalRow"]=7]="totalRow";
  7950. })(OSF_DDA_Marshaling_TableOptionProperties || (OSF_DDA_Marshaling_TableOptionProperties={}));
  7951. ;
  7952. OSF.DDA.Marshaling.TableOptionProperties=OSF_DDA_Marshaling_TableOptionProperties;
  7953. var OSF_DDA_Marshaling_CellProperties;
  7954. (function (OSF_DDA_Marshaling_CellProperties) {
  7955. OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["row"]=0]="row";
  7956. OSF_DDA_Marshaling_CellProperties[OSF_DDA_Marshaling_CellProperties["column"]=1]="column";
  7957. })(OSF_DDA_Marshaling_CellProperties || (OSF_DDA_Marshaling_CellProperties={}));
  7958. ;
  7959. OSF.DDA.Marshaling.CellProperties=OSF_DDA_Marshaling_CellProperties;
  7960. var OSF_DDA_Marshaling_CellFormatProperties;
  7961. (function (OSF_DDA_Marshaling_CellFormatProperties) {
  7962. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignHorizontal"]=1]="alignHorizontal";
  7963. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["alignVertical"]=2]="alignVertical";
  7964. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["backgroundColor"]=101]="backgroundColor";
  7965. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderStyle"]=201]="borderStyle";
  7966. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderColor"]=202]="borderColor";
  7967. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopStyle"]=203]="borderTopStyle";
  7968. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderTopColor"]=204]="borderTopColor";
  7969. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomStyle"]=205]="borderBottomStyle";
  7970. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderBottomColor"]=206]="borderBottomColor";
  7971. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftStyle"]=207]="borderLeftStyle";
  7972. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderLeftColor"]=208]="borderLeftColor";
  7973. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightStyle"]=209]="borderRightStyle";
  7974. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderRightColor"]=210]="borderRightColor";
  7975. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineStyle"]=211]="borderOutlineStyle";
  7976. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderOutlineColor"]=212]="borderOutlineColor";
  7977. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderInlineStyle"]=213]="borderInlineStyle";
  7978. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["borderInlineColor"]=214]="borderInlineColor";
  7979. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontFamily"]=301]="fontFamily";
  7980. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontStyle"]=302]="fontStyle";
  7981. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSize"]=303]="fontSize";
  7982. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontUnderlineStyle"]=304]="fontUnderlineStyle";
  7983. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontColor"]=305]="fontColor";
  7984. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontDirection"]=306]="fontDirection";
  7985. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontStrikethrough"]=307]="fontStrikethrough";
  7986. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSuperscript"]=308]="fontSuperscript";
  7987. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontSubscript"]=309]="fontSubscript";
  7988. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["fontNormal"]=310]="fontNormal";
  7989. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentLeft"]=401]="indentLeft";
  7990. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["indentRight"]=402]="indentRight";
  7991. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["numberFormat"]=501]="numberFormat";
  7992. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["width"]=701]="width";
  7993. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["height"]=702]="height";
  7994. OSF_DDA_Marshaling_CellFormatProperties[OSF_DDA_Marshaling_CellFormatProperties["wrapping"]=703]="wrapping";
  7995. })(OSF_DDA_Marshaling_CellFormatProperties || (OSF_DDA_Marshaling_CellFormatProperties={}));
  7996. ;
  7997. OSF.DDA.Marshaling.CellFormatProperties=OSF_DDA_Marshaling_CellFormatProperties;
  7998. var OSF_DDA_Marshaling_BorderStyleType;
  7999. (function (OSF_DDA_Marshaling_BorderStyleType) {
  8000. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["none"]=0]="none";
  8001. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thin"]=1]="thin";
  8002. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["medium"]=2]="medium";
  8003. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashed"]=3]="dashed";
  8004. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dotted"]=4]="dotted";
  8005. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["thick"]=5]="thick";
  8006. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["double"]=6]="double";
  8007. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["hair"]=7]="hair";
  8008. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashed"]=8]="mediumDashed";
  8009. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDot"]=9]="dashDot";
  8010. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDot"]=10]="mediumDashDot";
  8011. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["dashDotDot"]=11]="dashDotDot";
  8012. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["mediumDashDotDot"]=12]="mediumDashDotDot";
  8013. OSF_DDA_Marshaling_BorderStyleType[OSF_DDA_Marshaling_BorderStyleType["slantDashDot"]=13]="slantDashDot";
  8014. })(OSF_DDA_Marshaling_BorderStyleType || (OSF_DDA_Marshaling_BorderStyleType={}));
  8015. ;
  8016. OSF.DDA.Marshaling.BorderStyleType=OSF_DDA_Marshaling_BorderStyleType;
  8017. var OSF_DDA_Marshaling_ColorType;
  8018. (function (OSF_DDA_Marshaling_ColorType) {
  8019. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["none"]=0]="none";
  8020. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["black"]=1]="black";
  8021. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["blue"]=2]="blue";
  8022. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["gray"]=3]="gray";
  8023. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["green"]=4]="green";
  8024. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["orange"]=5]="orange";
  8025. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["pink"]=6]="pink";
  8026. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["purple"]=7]="purple";
  8027. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["red"]=8]="red";
  8028. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["teal"]=9]="teal";
  8029. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["turquoise"]=10]="turquoise";
  8030. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["violet"]=11]="violet";
  8031. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["white"]=12]="white";
  8032. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["yellow"]=13]="yellow";
  8033. OSF_DDA_Marshaling_ColorType[OSF_DDA_Marshaling_ColorType["automatic"]=14]="automatic";
  8034. })(OSF_DDA_Marshaling_ColorType || (OSF_DDA_Marshaling_ColorType={}));
  8035. ;
  8036. OSF.DDA.Marshaling.ColorType=OSF_DDA_Marshaling_ColorType;
  8037. var OSF_DDA_Marshaling_AlignHorizontalType;
  8038. (function (OSF_DDA_Marshaling_AlignHorizontalType) {
  8039. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["general"]=0]="general";
  8040. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["left"]=1]="left";
  8041. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["center"]=2]="center";
  8042. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["right"]=3]="right";
  8043. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["fill"]=4]="fill";
  8044. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["justify"]=5]="justify";
  8045. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["centerAcrossSelection"]=6]="centerAcrossSelection";
  8046. OSF_DDA_Marshaling_AlignHorizontalType[OSF_DDA_Marshaling_AlignHorizontalType["distributed"]=7]="distributed";
  8047. })(OSF_DDA_Marshaling_AlignHorizontalType || (OSF_DDA_Marshaling_AlignHorizontalType={}));
  8048. ;
  8049. OSF.DDA.Marshaling.AlignHorizontalType=OSF_DDA_Marshaling_AlignHorizontalType;
  8050. var OSF_DDA_Marshaling_AlignVerticalType;
  8051. (function (OSF_DDA_Marshaling_AlignVerticalType) {
  8052. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["top"]=0]="top";
  8053. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["center"]=1]="center";
  8054. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["bottom"]=2]="bottom";
  8055. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["justify"]=3]="justify";
  8056. OSF_DDA_Marshaling_AlignVerticalType[OSF_DDA_Marshaling_AlignVerticalType["distributed"]=4]="distributed";
  8057. })(OSF_DDA_Marshaling_AlignVerticalType || (OSF_DDA_Marshaling_AlignVerticalType={}));
  8058. ;
  8059. OSF.DDA.Marshaling.AlignVerticalType=OSF_DDA_Marshaling_AlignVerticalType;
  8060. var OSF_DDA_Marshaling_FontStyleType;
  8061. (function (OSF_DDA_Marshaling_FontStyleType) {
  8062. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["regular"]=0]="regular";
  8063. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["italic"]=1]="italic";
  8064. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["bold"]=2]="bold";
  8065. OSF_DDA_Marshaling_FontStyleType[OSF_DDA_Marshaling_FontStyleType["boldItalic"]=3]="boldItalic";
  8066. })(OSF_DDA_Marshaling_FontStyleType || (OSF_DDA_Marshaling_FontStyleType={}));
  8067. ;
  8068. OSF.DDA.Marshaling.FontStyleType=OSF_DDA_Marshaling_FontStyleType;
  8069. var OSF_DDA_Marshaling_FontUnderlineStyleType;
  8070. (function (OSF_DDA_Marshaling_FontUnderlineStyleType) {
  8071. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["none"]=0]="none";
  8072. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["single"]=1]="single";
  8073. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["double"]=2]="double";
  8074. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["singleAccounting"]=3]="singleAccounting";
  8075. OSF_DDA_Marshaling_FontUnderlineStyleType[OSF_DDA_Marshaling_FontUnderlineStyleType["doubleAccounting"]=4]="doubleAccounting";
  8076. })(OSF_DDA_Marshaling_FontUnderlineStyleType || (OSF_DDA_Marshaling_FontUnderlineStyleType={}));
  8077. ;
  8078. OSF.DDA.Marshaling.FontUnderlineStyleType=OSF_DDA_Marshaling_FontUnderlineStyleType;
  8079. var OSF_DDA_Marshaling_FontDirectionType;
  8080. (function (OSF_DDA_Marshaling_FontDirectionType) {
  8081. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["context"]=0]="context";
  8082. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["leftToRight"]=1]="leftToRight";
  8083. OSF_DDA_Marshaling_FontDirectionType[OSF_DDA_Marshaling_FontDirectionType["rightToLeft"]=2]="rightToLeft";
  8084. })(OSF_DDA_Marshaling_FontDirectionType || (OSF_DDA_Marshaling_FontDirectionType={}));
  8085. ;
  8086. OSF.DDA.Marshaling.FontDirectionType=OSF_DDA_Marshaling_FontDirectionType;
  8087. var OSF_DDA_Marshaling_WidthType;
  8088. (function (OSF_DDA_Marshaling_WidthType) {
  8089. OSF_DDA_Marshaling_WidthType[OSF_DDA_Marshaling_WidthType["autoFit"]=-1]="autoFit";
  8090. })(OSF_DDA_Marshaling_WidthType || (OSF_DDA_Marshaling_WidthType={}));
  8091. ;
  8092. OSF.DDA.Marshaling.WidthType=OSF_DDA_Marshaling_WidthType;
  8093. var OSF_DDA_Marshaling_HeightType;
  8094. (function (OSF_DDA_Marshaling_HeightType) {
  8095. OSF_DDA_Marshaling_HeightType[OSF_DDA_Marshaling_HeightType["autoFit"]=-1]="autoFit";
  8096. })(OSF_DDA_Marshaling_HeightType || (OSF_DDA_Marshaling_HeightType={}));
  8097. ;
  8098. OSF.DDA.Marshaling.HeightType=OSF_DDA_Marshaling_HeightType;
  8099. var AgaveFormatAPI;
  8100. (function (AgaveFormatAPI) {
  8101. var alignHorizontalType=OSF.DDA.Marshaling.AlignHorizontalType;
  8102. var alignVerticalType=OSF.DDA.Marshaling.AlignVerticalType;
  8103. var borderStyleType=OSF.DDA.Marshaling.BorderStyleType;
  8104. var cellFormatProperties=OSF.DDA.Marshaling.CellFormatProperties;
  8105. var cellProperties=OSF.DDA.Marshaling.CellProperties;
  8106. var colorType=OSF.DDA.Marshaling.ColorType;
  8107. var fontDirectionType=OSF.DDA.Marshaling.FontDirectionType;
  8108. var fontStyleType=OSF.DDA.Marshaling.FontStyleType;
  8109. var fontUnderlineStyleType=OSF.DDA.Marshaling.FontUnderlineStyleType;
  8110. var heightType=OSF.DDA.Marshaling.HeightType;
  8111. var hostKeys=OSF.DDA.Marshaling.FormatKeys;
  8112. var hostParameters=Microsoft.Office.WebExtension.Parameters;
  8113. var ns=OSF.DDA.WAC.Delegate.ParameterMap;
  8114. var tableOptionProperties=OSF.DDA.Marshaling.TableOptionProperties;
  8115. var widthType=OSF.DDA.Marshaling.WidthType;
  8116. Microsoft.Office.WebExtension.Table={
  8117. All: 0,
  8118. Data: 1,
  8119. Headers: 2
  8120. };
  8121. ns.define({
  8122. type: OSF.DDA.WAC.UniqueArguments.ClearFormats,
  8123. toHost: [
  8124. { name: hostParameters.Id, value: hostKeys.Id }
  8125. ]
  8126. });
  8127. ns.define({
  8128. type: OSF.DDA.MethodDispId.dispidClearFormatsMethod,
  8129. toHost: [
  8130. { name: OSF.DDA.WAC.UniqueArguments.ClearFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8131. ]
  8132. });
  8133. ns.define({
  8134. type: OSF.DDA.WAC.UniqueArguments.SetFormats,
  8135. toHost: [
  8136. { name: hostParameters.Id, value: hostKeys.Id },
  8137. { name: hostParameters.CellFormat, value: hostKeys.CellFormat },
  8138. { name: hostParameters.TableOptions, value: hostKeys.TableOptions }
  8139. ]
  8140. });
  8141. ns.define({
  8142. type: OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,
  8143. toHost: [
  8144. { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8145. ]
  8146. });
  8147. ns.define({
  8148. type: OSF.DDA.MethodDispId.dispidSetFormatsMethod,
  8149. toHost: [
  8150. { name: OSF.DDA.WAC.UniqueArguments.SetFormats, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8151. ]
  8152. });
  8153. ns.define({
  8154. type: OSF.DDA.WAC.UniqueArguments.SetData,
  8155. toHost: [
  8156. { name: hostParameters.Id, value: hostKeys.Id },
  8157. { name: hostParameters.CoercionType, value: "CoerceType" },
  8158. { name: hostParameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data },
  8159. { name: hostParameters.Rows, value: "Rows" },
  8160. { name: hostParameters.Columns, value: "Columns" },
  8161. { name: hostParameters.StartRow, value: "StartRow" },
  8162. { name: hostParameters.StartColumn, value: "StartCol" },
  8163. { name: hostParameters.CellFormat, value: hostKeys.CellFormat },
  8164. { name: hostParameters.TableOptions, value: hostKeys.TableOptions }
  8165. ]
  8166. });
  8167. ns.define({
  8168. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  8169. toHost: [
  8170. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8171. ]
  8172. });
  8173. ns.define({
  8174. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  8175. toHost: [
  8176. { name: OSF.DDA.WAC.UniqueArguments.SetData, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  8177. ]
  8178. });
  8179. var formatProperties={
  8180. alignHorizontal: { text: "alignHorizontal", type: cellFormatProperties.alignHorizontal },
  8181. alignVertical: { text: "alignVertical", type: cellFormatProperties.alignVertical },
  8182. backgroundColor: { text: "backgroundColor", type: cellFormatProperties.backgroundColor },
  8183. borderStyle: { text: "borderStyle", type: cellFormatProperties.borderStyle },
  8184. borderColor: { text: "borderColor", type: cellFormatProperties.borderColor },
  8185. borderTopStyle: { text: "borderTopStyle", type: cellFormatProperties.borderTopStyle },
  8186. borderTopColor: { text: "borderTopColor", type: cellFormatProperties.borderTopColor },
  8187. borderBottomStyle: { text: "borderBottomStyle", type: cellFormatProperties.borderBottomStyle },
  8188. borderBottomColor: { text: "borderBottomColor", type: cellFormatProperties.borderBottomColor },
  8189. borderLeftStyle: { text: "borderLeftStyle", type: cellFormatProperties.borderLeftStyle },
  8190. borderLeftColor: { text: "borderLeftColor", type: cellFormatProperties.borderLeftColor },
  8191. borderRightStyle: { text: "borderRightStyle", type: cellFormatProperties.borderRightStyle },
  8192. borderRightColor: { text: "borderRightColor", type: cellFormatProperties.borderRightColor },
  8193. borderOutlineStyle: { text: "borderOutlineStyle", type: cellFormatProperties.borderOutlineStyle },
  8194. borderOutlineColor: { text: "borderOutlineColor", type: cellFormatProperties.borderOutlineColor },
  8195. borderInlineStyle: { text: "borderInlineStyle", type: cellFormatProperties.borderInlineStyle },
  8196. borderInlineColor: { text: "borderInlineColor", type: cellFormatProperties.borderInlineColor },
  8197. fontFamily: { text: "fontFamily", type: cellFormatProperties.fontFamily },
  8198. fontStyle: { text: "fontStyle", type: cellFormatProperties.fontStyle },
  8199. fontSize: { text: "fontSize", type: cellFormatProperties.fontSize },
  8200. fontUnderlineStyle: { text: "fontUnderlineStyle", type: cellFormatProperties.fontUnderlineStyle },
  8201. fontColor: { text: "fontColor", type: cellFormatProperties.fontColor },
  8202. fontDirection: { text: "fontDirection", type: cellFormatProperties.fontDirection },
  8203. fontStrikethrough: { text: "fontStrikethrough", type: cellFormatProperties.fontStrikethrough },
  8204. fontSuperscript: { text: "fontSuperscript", type: cellFormatProperties.fontSuperscript },
  8205. fontSubscript: { text: "fontSubscript", type: cellFormatProperties.fontSubscript },
  8206. fontNormal: { text: "fontNormal", type: cellFormatProperties.fontNormal },
  8207. indentLeft: { text: "indentLeft", type: cellFormatProperties.indentLeft },
  8208. indentRight: { text: "indentRight", type: cellFormatProperties.indentRight },
  8209. numberFormat: { text: "numberFormat", type: cellFormatProperties.numberFormat },
  8210. width: { text: "width", type: cellFormatProperties.width },
  8211. height: { text: "height", type: cellFormatProperties.height },
  8212. wrapping: { text: "wrapping", type: cellFormatProperties.wrapping }
  8213. };
  8214. var borderStyleSet=[
  8215. { name: "none", value: borderStyleType.none },
  8216. { name: "thin", value: borderStyleType.thin },
  8217. { name: "medium", value: borderStyleType.medium },
  8218. { name: "dashed", value: borderStyleType.dashed },
  8219. { name: "dotted", value: borderStyleType.dotted },
  8220. { name: "thick", value: borderStyleType.thick },
  8221. { name: "double", value: borderStyleType.double },
  8222. { name: "hair", value: borderStyleType.hair },
  8223. { name: "medium dashed", value: borderStyleType.mediumDashed },
  8224. { name: "dash dot", value: borderStyleType.dashDot },
  8225. { name: "medium dash dot", value: borderStyleType.mediumDashDot },
  8226. { name: "dash dot dot", value: borderStyleType.dashDotDot },
  8227. { name: "medium dash dot dot", value: borderStyleType.mediumDashDotDot },
  8228. { name: "slant dash dot", value: borderStyleType.slantDashDot },
  8229. ];
  8230. var colorSet=[
  8231. { name: "none", value: colorType.none },
  8232. { name: "black", value: colorType.black },
  8233. { name: "blue", value: colorType.blue },
  8234. { name: "gray", value: colorType.gray },
  8235. { name: "green", value: colorType.green },
  8236. { name: "orange", value: colorType.orange },
  8237. { name: "pink", value: colorType.pink },
  8238. { name: "purple", value: colorType.purple },
  8239. { name: "red", value: colorType.red },
  8240. { name: "teal", value: colorType.teal },
  8241. { name: "turquoise", value: colorType.turquoise },
  8242. { name: "violet", value: colorType.violet },
  8243. { name: "white", value: colorType.white },
  8244. { name: "yellow", value: colorType.yellow },
  8245. { name: "automatic", value: colorType.automatic },
  8246. ];
  8247. ns.define({
  8248. type: formatProperties.alignHorizontal.text,
  8249. toHost: [
  8250. { name: "general", value: alignHorizontalType.general },
  8251. { name: "left", value: alignHorizontalType.left },
  8252. { name: "center", value: alignHorizontalType.center },
  8253. { name: "right", value: alignHorizontalType.right },
  8254. { name: "fill", value: alignHorizontalType.fill },
  8255. { name: "justify", value: alignHorizontalType.justify },
  8256. { name: "center across selection", value: alignHorizontalType.centerAcrossSelection },
  8257. { name: "distributed", value: alignHorizontalType.distributed },
  8258. ]
  8259. });
  8260. ns.define({
  8261. type: formatProperties.alignVertical.text,
  8262. toHost: [
  8263. { name: "top", value: alignVerticalType.top },
  8264. { name: "center", value: alignVerticalType.center },
  8265. { name: "bottom", value: alignVerticalType.bottom },
  8266. { name: "justify", value: alignVerticalType.justify },
  8267. { name: "distributed", value: alignVerticalType.distributed },
  8268. ]
  8269. });
  8270. ns.define({
  8271. type: formatProperties.backgroundColor.text,
  8272. toHost: colorSet
  8273. });
  8274. ns.define({
  8275. type: formatProperties.borderStyle.text,
  8276. toHost: borderStyleSet
  8277. });
  8278. ns.define({
  8279. type: formatProperties.borderColor.text,
  8280. toHost: colorSet
  8281. });
  8282. ns.define({
  8283. type: formatProperties.borderTopStyle.text,
  8284. toHost: borderStyleSet
  8285. });
  8286. ns.define({
  8287. type: formatProperties.borderTopColor.text,
  8288. toHost: colorSet
  8289. });
  8290. ns.define({
  8291. type: formatProperties.borderBottomStyle.text,
  8292. toHost: borderStyleSet
  8293. });
  8294. ns.define({
  8295. type: formatProperties.borderBottomColor.text,
  8296. toHost: colorSet
  8297. });
  8298. ns.define({
  8299. type: formatProperties.borderLeftStyle.text,
  8300. toHost: borderStyleSet
  8301. });
  8302. ns.define({
  8303. type: formatProperties.borderLeftColor.text,
  8304. toHost: colorSet
  8305. });
  8306. ns.define({
  8307. type: formatProperties.borderRightStyle.text,
  8308. toHost: borderStyleSet
  8309. });
  8310. ns.define({
  8311. type: formatProperties.borderRightColor.text,
  8312. toHost: colorSet
  8313. });
  8314. ns.define({
  8315. type: formatProperties.borderOutlineStyle.text,
  8316. toHost: borderStyleSet
  8317. });
  8318. ns.define({
  8319. type: formatProperties.borderOutlineColor.text,
  8320. toHost: colorSet
  8321. });
  8322. ns.define({
  8323. type: formatProperties.borderInlineStyle.text,
  8324. toHost: borderStyleSet
  8325. });
  8326. ns.define({
  8327. type: formatProperties.borderInlineColor.text,
  8328. toHost: colorSet
  8329. });
  8330. ns.define({
  8331. type: formatProperties.fontStyle.text,
  8332. toHost: [
  8333. { name: "regular", value: fontStyleType.regular },
  8334. { name: "italic", value: fontStyleType.italic },
  8335. { name: "bold", value: fontStyleType.bold },
  8336. { name: "bold italic", value: fontStyleType.boldItalic },
  8337. ]
  8338. });
  8339. ns.define({
  8340. type: formatProperties.fontUnderlineStyle.text,
  8341. toHost: [
  8342. { name: "none", value: fontUnderlineStyleType.none },
  8343. { name: "single", value: fontUnderlineStyleType.single },
  8344. { name: "double", value: fontUnderlineStyleType.double },
  8345. { name: "single accounting", value: fontUnderlineStyleType.singleAccounting },
  8346. { name: "double accounting", value: fontUnderlineStyleType.doubleAccounting },
  8347. ]
  8348. });
  8349. ns.define({
  8350. type: formatProperties.fontColor.text,
  8351. toHost: colorSet
  8352. });
  8353. ns.define({
  8354. type: formatProperties.fontDirection.text,
  8355. toHost: [
  8356. { name: "context", value: fontDirectionType.context },
  8357. { name: "left-to-right", value: fontDirectionType.leftToRight },
  8358. { name: "right-to-left", value: fontDirectionType.rightToLeft },
  8359. ]
  8360. });
  8361. ns.define({
  8362. type: formatProperties.width.text,
  8363. toHost: [
  8364. { name: "auto fit", value: widthType.autoFit },
  8365. ]
  8366. });
  8367. ns.define({
  8368. type: formatProperties.height.text,
  8369. toHost: [
  8370. { name: "auto fit", value: heightType.autoFit },
  8371. ]
  8372. });
  8373. ns.define({
  8374. type: hostParameters.TableOptions,
  8375. toHost: [
  8376. { name: "headerRow", value: tableOptionProperties.headerRow },
  8377. { name: "bandedRows", value: tableOptionProperties.bandedRows },
  8378. { name: "firstColumn", value: tableOptionProperties.firstColumn },
  8379. { name: "lastColumn", value: tableOptionProperties.lastColumn },
  8380. { name: "bandedColumns", value: tableOptionProperties.bandedCoumns },
  8381. { name: "filterButton", value: tableOptionProperties.filterButton },
  8382. { name: "style", value: tableOptionProperties.style },
  8383. { name: "totalRow", value: tableOptionProperties.totalRow }
  8384. ]
  8385. });
  8386. ns.dynamicTypes[hostParameters.CellFormat]={
  8387. toHost: function (data) {
  8388. for (var entry in data) {
  8389. if (data[entry].format) {
  8390. data[entry].format=ns.doMapValues(data[entry].format, "toHost");
  8391. }
  8392. }
  8393. return data;
  8394. },
  8395. fromHost: function (args) {
  8396. return args;
  8397. }
  8398. };
  8399. ns.setDynamicType(hostParameters.CellFormat, {
  8400. toHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  8401. var textCells="cells";
  8402. var textFormat="format";
  8403. var posCells=0;
  8404. var posFormat=1;
  8405. var ret=[];
  8406. for (var index in cellFormats) {
  8407. var cfOld=cellFormats[index];
  8408. var cfNew=[];
  8409. if (typeof (cfOld[textCells]) !=="undefined") {
  8410. var cellsOld=cfOld[textCells];
  8411. var cellsNew;
  8412. if (typeof cfOld[textCells]==="object") {
  8413. cellsNew=[];
  8414. for (var entry in cellsOld) {
  8415. if (typeof (cellProperties[entry]) !=="undefined") {
  8416. cellsNew[cellProperties[entry]]=cellsOld[entry];
  8417. }
  8418. }
  8419. }
  8420. else {
  8421. cellsNew=cellsOld;
  8422. }
  8423. cfNew[posCells]=cellsNew;
  8424. }
  8425. if (cfOld[textFormat]) {
  8426. var formatOld=cfOld[textFormat];
  8427. var formatNew=[];
  8428. for (var entry2 in formatOld) {
  8429. if (typeof (formatProperties[entry2]) !=="undefined") {
  8430. formatNew.push([
  8431. formatProperties[entry2].type,
  8432. formatOld[entry2]
  8433. ]);
  8434. }
  8435. }
  8436. cfNew[posFormat]=formatNew;
  8437. }
  8438. ret[index]=cfNew;
  8439. }
  8440. return ret;
  8441. },
  8442. fromHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  8443. return hostArgs;
  8444. }
  8445. });
  8446. ns.setDynamicType(hostParameters.TableOptions, {
  8447. toHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  8448. var ret=[];
  8449. for (var entry in tableOptions) {
  8450. if (typeof (tableOptionProperties[entry]) !="undefined") {
  8451. ret[tableOptionProperties[entry]]=tableOptions[entry];
  8452. }
  8453. }
  8454. return ret;
  8455. },
  8456. fromHost: function OSF_DDA_WAC_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  8457. return hostArgs;
  8458. }
  8459. });
  8460. alignHorizontalType=null;
  8461. alignVerticalType=null;
  8462. borderStyleType=null;
  8463. cellFormatProperties=null;
  8464. colorType=null;
  8465. fontDirectionType=null;
  8466. fontStyleType=null;
  8467. fontUnderlineStyleType=null;
  8468. heightType=null;
  8469. hostKeys=null;
  8470. widthType=null;
  8471. })(AgaveFormatAPI || (AgaveFormatAPI={}));
  8472. OSF.DDA.AsyncMethodNames.addNames({
  8473. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  8474. });
  8475. OSF.DDA.AsyncMethodCalls.define({
  8476. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  8477. requiredArguments: [
  8478. {
  8479. name: Microsoft.Office.WebExtension.Parameters.Data,
  8480. types: ["object"]
  8481. }
  8482. ],
  8483. supportedOptions: []
  8484. });
  8485. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  8486. OSF.DDA.WAC.Delegate.ParameterMap.define({
  8487. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  8488. toHost: [
  8489. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.ArrayData }
  8490. ],
  8491. fromHost: [
  8492. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.WAC.UniqueArguments.Data }
  8493. ]
  8494. });
  8495. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  8496. var OfficeExt;
  8497. (function (OfficeExt) {
  8498. var AppCommand;
  8499. (function (AppCommand) {
  8500. var AppCommandManager=(function () {
  8501. function AppCommandManager() {
  8502. var _this=this;
  8503. this._pseudoDocument=null;
  8504. this._eventDispatch=null;
  8505. this._processAppCommandInvocation=function (args) {
  8506. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  8507. if (verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  8508. _this._invokeAppCommandCompletedMethod(args.appCommandId, verifyResult.errorCode, "");
  8509. return;
  8510. }
  8511. var eventObj=_this._constructEventObjectForCallback(args);
  8512. if (eventObj) {
  8513. window.setTimeout(function () { verifyResult.callback(eventObj); }, 0);
  8514. }
  8515. else {
  8516. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError, "");
  8517. }
  8518. };
  8519. }
  8520. AppCommandManager.initializeOsfDda=function () {
  8521. OSF.DDA.AsyncMethodNames.addNames({
  8522. AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"
  8523. });
  8524. OSF.DDA.AsyncMethodCalls.define({
  8525. method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  8526. requiredArguments: [{
  8527. "name": Microsoft.Office.WebExtension.Parameters.Id,
  8528. "types": ["string"]
  8529. },
  8530. {
  8531. "name": Microsoft.Office.WebExtension.Parameters.Status,
  8532. "types": ["number"]
  8533. },
  8534. {
  8535. "name": Microsoft.Office.WebExtension.Parameters.Data,
  8536. "types": ["string"]
  8537. }
  8538. ]
  8539. });
  8540. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  8541. AppCommandInvokedEvent: "AppCommandInvokedEvent"
  8542. });
  8543. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  8544. AppCommandInvoked: "appCommandInvoked"
  8545. });
  8546. OSF.OUtil.setNamespace("AppCommand", OSF.DDA);
  8547. OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs;
  8548. };
  8549. AppCommandManager.prototype.initializeAndChangeOnce=function (callback) {
  8550. AppCommand.registerDdaFacade();
  8551. this._pseudoDocument={};
  8552. OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument, [
  8553. OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  8554. ]);
  8555. this._eventDispatch=new OSF.EventDispatch([
  8556. Microsoft.Office.WebExtension.EventType.AppCommandInvoked,
  8557. ]);
  8558. var onRegisterCompleted=function (result) {
  8559. if (callback) {
  8560. if (result.status=="succeeded") {
  8561. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  8562. }
  8563. else {
  8564. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  8565. }
  8566. }
  8567. };
  8568. OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument, this._eventDispatch);
  8569. this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked, this._processAppCommandInvocation, onRegisterCompleted);
  8570. };
  8571. AppCommandManager.prototype._verifyManifestCallback=function (callbackName) {
  8572. var defaultResult={ callback: null, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback };
  8573. callbackName=callbackName.trim();
  8574. try {
  8575. var callList=callbackName.split(".");
  8576. var parentObject=window;
  8577. for (var i=0; i < callList.length - 1; i++) {
  8578. if (parentObject[callList[i]] && (typeof parentObject[callList[i]]=="object" || typeof parentObject[callList[i]]=="function")) {
  8579. parentObject=parentObject[callList[i]];
  8580. }
  8581. else {
  8582. return defaultResult;
  8583. }
  8584. }
  8585. var callbackFunc=parentObject[callList[callList.length - 1]];
  8586. if (typeof callbackFunc !="function") {
  8587. return defaultResult;
  8588. }
  8589. }
  8590. catch (e) {
  8591. return defaultResult;
  8592. }
  8593. return { callback: callbackFunc, errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess };
  8594. };
  8595. AppCommandManager.prototype._invokeAppCommandCompletedMethod=function (appCommandId, resultCode, data) {
  8596. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId, resultCode, data);
  8597. };
  8598. AppCommandManager.prototype._constructEventObjectForCallback=function (args) {
  8599. var _this=this;
  8600. var eventObj=new AppCommandCallbackEventArgs();
  8601. try {
  8602. var jsonData=JSON.parse(args.eventObjStr);
  8603. this._translateEventObjectInternal(jsonData, eventObj);
  8604. Object.defineProperty(eventObj, 'completed', {
  8605. value: function (completedContext) {
  8606. eventObj.completedContext=completedContext;
  8607. var jsonString=JSON.stringify(eventObj);
  8608. _this._invokeAppCommandCompletedMethod(args.appCommandId, OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess, jsonString);
  8609. },
  8610. enumerable: true
  8611. });
  8612. }
  8613. catch (e) {
  8614. eventObj=null;
  8615. }
  8616. return eventObj;
  8617. };
  8618. AppCommandManager.prototype._translateEventObjectInternal=function (input, output) {
  8619. for (var key in input) {
  8620. if (!input.hasOwnProperty(key))
  8621. continue;
  8622. var inputChild=input[key];
  8623. if (typeof inputChild=="object" && inputChild !=null) {
  8624. OSF.OUtil.defineEnumerableProperty(output, key, {
  8625. value: {}
  8626. });
  8627. this._translateEventObjectInternal(inputChild, output[key]);
  8628. }
  8629. else {
  8630. Object.defineProperty(output, key, {
  8631. value: inputChild,
  8632. enumerable: true,
  8633. writable: true
  8634. });
  8635. }
  8636. }
  8637. };
  8638. AppCommandManager.prototype._constructObjectByTemplate=function (template, input) {
  8639. var output={};
  8640. if (!template || !input)
  8641. return output;
  8642. for (var key in template) {
  8643. if (template.hasOwnProperty(key)) {
  8644. output[key]=null;
  8645. if (input[key] !=null) {
  8646. var templateChild=template[key];
  8647. var inputChild=input[key];
  8648. var inputChildType=typeof inputChild;
  8649. if (typeof templateChild=="object" && templateChild !=null) {
  8650. output[key]=this._constructObjectByTemplate(templateChild, inputChild);
  8651. }
  8652. else if (inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean") {
  8653. output[key]=inputChild;
  8654. }
  8655. }
  8656. }
  8657. }
  8658. return output;
  8659. };
  8660. AppCommandManager.instance=function () {
  8661. if (AppCommandManager._instance==null) {
  8662. AppCommandManager._instance=new AppCommandManager();
  8663. }
  8664. return AppCommandManager._instance;
  8665. };
  8666. AppCommandManager._instance=null;
  8667. return AppCommandManager;
  8668. })();
  8669. AppCommand.AppCommandManager=AppCommandManager;
  8670. var AppCommandInvokedEventArgs=(function () {
  8671. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr) {
  8672. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  8673. this.appCommandId=appCommandId;
  8674. this.callbackName=callbackName;
  8675. this.eventObjStr=eventObjStr;
  8676. }
  8677. AppCommandInvokedEventArgs.create=function (eventProperties) {
  8678. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId], eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName], eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr]);
  8679. };
  8680. return AppCommandInvokedEventArgs;
  8681. })();
  8682. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  8683. var AppCommandCallbackEventArgs=(function () {
  8684. function AppCommandCallbackEventArgs() {
  8685. }
  8686. return AppCommandCallbackEventArgs;
  8687. })();
  8688. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  8689. AppCommand.AppCommandInvokedEventEnums={
  8690. AppCommandId: "appCommandId",
  8691. CallbackName: "callbackName",
  8692. EventObjStr: "eventObjStr"
  8693. };
  8694. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  8695. })(OfficeExt || (OfficeExt={}));
  8696. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  8697. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  8698. OSF.OUtil.setNamespace("AppCommand", OSF.DDA.Marshaling);
  8699. var OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys;
  8700. (function (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys) {
  8701. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["AppCommandId"]=0]="AppCommandId";
  8702. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["CallbackName"]=1]="CallbackName";
  8703. OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys[OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys["EventObjStr"]=2]="EventObjStr";
  8704. })(OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys={}));
  8705. ;
  8706. OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys=OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys;
  8707. var OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys;
  8708. (function (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys) {
  8709. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Id"]=0]="Id";
  8710. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Status"]=1]="Status";
  8711. OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys[OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys["Data"]=2]="Data";
  8712. })(OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys || (OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys={}));
  8713. ;
  8714. OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys=OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys;
  8715. var OfficeExt;
  8716. (function (OfficeExt) {
  8717. var AppCommand;
  8718. (function (AppCommand) {
  8719. function registerDdaFacade() {
  8720. if (OSF.DDA.WAC) {
  8721. var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap;
  8722. parameterMap.define({
  8723. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  8724. toHost: [
  8725. { name: Microsoft.Office.WebExtension.Parameters.Id, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Id },
  8726. { name: Microsoft.Office.WebExtension.Parameters.Status, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Status },
  8727. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Data }
  8728. ]
  8729. });
  8730. parameterMap.define({
  8731. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  8732. fromHost: [
  8733. { name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent, value: parameterMap.self }
  8734. ]
  8735. });
  8736. parameterMap.addComplexType(OSF.DDA.EventDescriptors.AppCommandInvokedEvent);
  8737. parameterMap.define({
  8738. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  8739. fromHost: [
  8740. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.AppCommandId },
  8741. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.CallbackName },
  8742. { name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr, value: OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.EventObjStr },
  8743. ]
  8744. });
  8745. }
  8746. }
  8747. AppCommand.registerDdaFacade=registerDdaFacade;
  8748. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}));
  8749. })(OfficeExt || (OfficeExt={}));
  8750. OSF.DialogShownStatus={ hasDialogShown: false, isWindowDialog: false };
  8751. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  8752. DialogMessageReceivedEvent: "DialogMessageReceivedEvent"
  8753. });
  8754. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  8755. DialogMessageReceived: "dialogMessageReceived",
  8756. DialogEventReceived: "dialogEventReceived"
  8757. });
  8758. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  8759. MessageType: "messageType",
  8760. MessageContent: "messageContent"
  8761. });
  8762. OSF.DDA.DialogEventType={};
  8763. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  8764. DialogClosed: "dialogClosed",
  8765. NavigationFailed: "naviationFailed"
  8766. });
  8767. OSF.DDA.AsyncMethodNames.addNames({
  8768. DisplayDialogAsync: "displayDialogAsync",
  8769. CloseAsync: "close"
  8770. });
  8771. OSF.DDA.SyncMethodNames.addNames({
  8772. MessageParent: "messageParent",
  8773. AddMessageHandler: "addEventHandler",
  8774. SendMessage: "sendMessage"
  8775. });
  8776. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI() {
  8777. var eventDispatch=new OSF.EventDispatch([
  8778. Microsoft.Office.WebExtension.EventType.DialogMessageReceived,
  8779. Microsoft.Office.WebExtension.EventType.DialogEventReceived,
  8780. Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  8781. ]);
  8782. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  8783. var target=this;
  8784. if (!target[openDialogName]) {
  8785. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  8786. value: function () {
  8787. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  8788. openDialog(arguments, eventDispatch, target);
  8789. }
  8790. });
  8791. }
  8792. OSF.OUtil.finalizeProperties(this);
  8793. };
  8794. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI() {
  8795. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  8796. var target=this;
  8797. if (!target[messageParentName]) {
  8798. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  8799. value: function () {
  8800. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  8801. return messageParent(arguments, target);
  8802. }
  8803. });
  8804. }
  8805. var addEventHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  8806. if (!target[addEventHandler] && typeof OSF.DialogParentMessageEventDispatch !="undefined") {
  8807. OSF.DDA.DispIdHost.addEventSupport(target, OSF.DialogParentMessageEventDispatch);
  8808. }
  8809. OSF.OUtil.finalizeProperties(this);
  8810. };
  8811. OSF.DialogHandler=function OSF_DialogHandler() { };
  8812. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message) {
  8813. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived) {
  8814. OSF.OUtil.defineEnumerableProperties(this, {
  8815. "type": {
  8816. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  8817. },
  8818. "message": {
  8819. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  8820. }
  8821. });
  8822. }
  8823. else {
  8824. OSF.OUtil.defineEnumerableProperties(this, {
  8825. "type": {
  8826. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  8827. },
  8828. "error": {
  8829. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  8830. }
  8831. });
  8832. }
  8833. };
  8834. OSF.DDA.DialogParentEventArgs=function OSF_DDA_DialogParentEventArgs(message) {
  8835. if (message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogParentMessageReceived) {
  8836. OSF.OUtil.defineEnumerableProperties(this, {
  8837. "type": {
  8838. value: Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived
  8839. },
  8840. "message": {
  8841. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  8842. }
  8843. });
  8844. }
  8845. else {
  8846. OSF.OUtil.defineEnumerableProperties(this, {
  8847. "type": {
  8848. value: Microsoft.Office.WebExtension.EventType.DialogParentEventReceived
  8849. },
  8850. "error": {
  8851. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  8852. }
  8853. });
  8854. }
  8855. };
  8856. OSF.DDA.AsyncMethodCalls.define({
  8857. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  8858. requiredArguments: [
  8859. {
  8860. "name": Microsoft.Office.WebExtension.Parameters.Url,
  8861. "types": ["string"]
  8862. }
  8863. ],
  8864. supportedOptions: [
  8865. {
  8866. name: Microsoft.Office.WebExtension.Parameters.Width,
  8867. value: {
  8868. "types": ["number"],
  8869. "defaultValue": 99
  8870. }
  8871. },
  8872. {
  8873. name: Microsoft.Office.WebExtension.Parameters.Height,
  8874. value: {
  8875. "types": ["number"],
  8876. "defaultValue": 99
  8877. }
  8878. },
  8879. {
  8880. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  8881. value: {
  8882. "types": ["boolean"],
  8883. "defaultValue": true
  8884. }
  8885. },
  8886. {
  8887. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  8888. value: {
  8889. "types": ["boolean"],
  8890. "defaultValue": false
  8891. }
  8892. }
  8893. ],
  8894. privateStateCallbacks: [],
  8895. onSucceeded: function (args, caller, callArgs) {
  8896. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  8897. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  8898. var dialog=new OSF.DialogHandler();
  8899. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  8900. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  8901. value: function () {
  8902. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  8903. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  8904. }
  8905. });
  8906. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  8907. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  8908. value: function () {
  8909. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  8910. var callArgs=syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  8911. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  8912. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  8913. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  8914. }
  8915. });
  8916. var sendMessage=OSF.DDA.SyncMethodNames.SendMessage.displayName;
  8917. OSF.OUtil.defineEnumerableProperty(dialog, sendMessage, {
  8918. value: function () {
  8919. var execute=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];
  8920. return execute(arguments, eventDispatch, dialog);
  8921. }
  8922. });
  8923. return dialog;
  8924. },
  8925. checkCallArgs: function (callArgs, caller, stateInfo) {
  8926. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0) {
  8927. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  8928. }
  8929. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  8930. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  8931. }
  8932. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0) {
  8933. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  8934. }
  8935. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  8936. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  8937. }
  8938. if (!callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]) {
  8939. callArgs[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=true;
  8940. }
  8941. return callArgs;
  8942. }
  8943. });
  8944. OSF.DDA.AsyncMethodCalls.define({
  8945. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  8946. requiredArguments: [],
  8947. supportedOptions: [],
  8948. privateStateCallbacks: []
  8949. });
  8950. OSF.DDA.SyncMethodCalls.define({
  8951. method: OSF.DDA.SyncMethodNames.MessageParent,
  8952. requiredArguments: [
  8953. {
  8954. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  8955. "types": ["string", "number", "boolean"]
  8956. }
  8957. ],
  8958. supportedOptions: []
  8959. });
  8960. OSF.DDA.SyncMethodCalls.define({
  8961. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  8962. requiredArguments: [
  8963. {
  8964. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  8965. "enum": Microsoft.Office.WebExtension.EventType,
  8966. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  8967. },
  8968. {
  8969. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  8970. "types": ["function"]
  8971. }
  8972. ],
  8973. supportedOptions: []
  8974. });
  8975. OSF.DDA.SyncMethodCalls.define({
  8976. method: OSF.DDA.SyncMethodNames.SendMessage,
  8977. requiredArguments: [
  8978. {
  8979. "name": Microsoft.Office.WebExtension.Parameters.MessageContent,
  8980. "types": ["string"]
  8981. }
  8982. ],
  8983. supportedOptions: [],
  8984. privateStateCallbacks: []
  8985. });
  8986. OSF.OUtil.setNamespace("Marshaling", OSF.DDA);
  8987. OSF.OUtil.setNamespace("Dialog", OSF.DDA.Marshaling);
  8988. OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys={
  8989. MessageType: "messageType",
  8990. MessageContent: "messageContent"
  8991. };
  8992. OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys={
  8993. MessageType: "messageType",
  8994. MessageContent: "messageContent"
  8995. };
  8996. OSF.DDA.Marshaling.MessageParentKeys={
  8997. MessageToParent: "messageToParent"
  8998. };
  8999. OSF.DDA.Marshaling.DialogNotificationShownEventType={
  9000. DialogNotificationShown: "dialogNotificationShown"
  9001. };
  9002. OSF.DDA.Marshaling.SendMessageKeys={
  9003. MessageContent: "messageContent"
  9004. };
  9005. var OfficeExt;
  9006. (function (OfficeExt) {
  9007. var WacCommonUICssManager;
  9008. (function (WacCommonUICssManager) {
  9009. var hostType={
  9010. Excel: "excel",
  9011. Word: "word",
  9012. PowerPoint: "powerpoint",
  9013. Outlook: "outlook"
  9014. };
  9015. function getDialogCssManager(applicationHostType) {
  9016. switch (applicationHostType) {
  9017. case hostType.Excel:
  9018. case hostType.Word:
  9019. case hostType.PowerPoint:
  9020. case hostType.Outlook:
  9021. return new DefaultDialogCSSManager();
  9022. default:
  9023. return new DefaultDialogCSSManager();
  9024. }
  9025. return null;
  9026. }
  9027. WacCommonUICssManager.getDialogCssManager=getDialogCssManager;
  9028. var DefaultDialogCSSManager=(function () {
  9029. function DefaultDialogCSSManager() {
  9030. this.overlayElementCSS=[
  9031. "position: absolute",
  9032. "top: 0",
  9033. "left: 0",
  9034. "width: 100%",
  9035. "height: 100%",
  9036. "background-color: rgba(198, 198, 198, 0.5)",
  9037. "z-index: 99998"
  9038. ];
  9039. this.dialogNotificationPanelCSS=[
  9040. "width: 100%",
  9041. "height: 190px",
  9042. "position: absolute",
  9043. "z-index: 99999",
  9044. "background-color: rgba(255, 255, 255, 1)",
  9045. "left: 0px",
  9046. "top: 50%",
  9047. "margin-top: -95px"
  9048. ];
  9049. this.newWindowNotificationTextPanelCSS=[
  9050. "margin: 20px 14px",
  9051. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9052. "font-size: 14px",
  9053. "height: 100px",
  9054. "line-height: 100px"
  9055. ];
  9056. this.newWindowNotificationTextSpanCSS=[
  9057. "display: inline-block",
  9058. "line-height: normal",
  9059. "vertical-align: middle"
  9060. ];
  9061. this.crossZoneNotificationTextPanelCSS=[
  9062. "margin: 20px 14px",
  9063. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9064. "font-size: 14px",
  9065. "height: 100px",
  9066. ];
  9067. this.dialogNotificationButtonPanelCSS="margin:0px 9px";
  9068. this.buttonStyleCSS=[
  9069. "text-align: center",
  9070. "width: 70px",
  9071. "height: 25px",
  9072. "font-size: 14px",
  9073. "font-family: Segoe UI,Arial,Verdana,sans-serif",
  9074. "margin: 0px 5px",
  9075. "border-width: 1px",
  9076. "border-style: solid"
  9077. ];
  9078. }
  9079. DefaultDialogCSSManager.prototype.getOverlayElementCSS=function () {
  9080. return this.overlayElementCSS.join(";");
  9081. };
  9082. DefaultDialogCSSManager.prototype.getDialogNotificationPanelCSS=function () {
  9083. return this.dialogNotificationPanelCSS.join(";");
  9084. };
  9085. DefaultDialogCSSManager.prototype.getNewWindowNotificationTextPanelCSS=function () {
  9086. return this.newWindowNotificationTextPanelCSS.join(";");
  9087. };
  9088. DefaultDialogCSSManager.prototype.getNewWindowNotificationTextSpanCSS=function () {
  9089. return this.newWindowNotificationTextSpanCSS.join(";");
  9090. };
  9091. DefaultDialogCSSManager.prototype.getCrossZoneNotificationTextPanelCSS=function () {
  9092. return this.crossZoneNotificationTextPanelCSS.join(";");
  9093. };
  9094. DefaultDialogCSSManager.prototype.getDialogNotificationButtonPanelCSS=function () {
  9095. return this.dialogNotificationButtonPanelCSS;
  9096. };
  9097. DefaultDialogCSSManager.prototype.getDialogButtonCSS=function () {
  9098. return this.buttonStyleCSS.join(";");
  9099. };
  9100. return DefaultDialogCSSManager;
  9101. })();
  9102. WacCommonUICssManager.DefaultDialogCSSManager=DefaultDialogCSSManager;
  9103. })(WacCommonUICssManager=OfficeExt.WacCommonUICssManager || (OfficeExt.WacCommonUICssManager={}));
  9104. })(OfficeExt || (OfficeExt={}));
  9105. var OfficeExt;
  9106. (function (OfficeExt) {
  9107. var AddinNativeAction;
  9108. (function (AddinNativeAction) {
  9109. var Dialog;
  9110. (function (Dialog) {
  9111. var windowInstance=null;
  9112. var handler=null;
  9113. var overlayElement=null;
  9114. var dialogNotificationPanel=null;
  9115. var configureBrowserLink=null;
  9116. var closeDialogKey="action=closeDialog";
  9117. var showDialogCallback=null;
  9118. var hasCrossZoneNotification=false;
  9119. var checkWindowDialogCloseInterval=-1;
  9120. var hostThemeButtonStyle=null;
  9121. var commonButtonBorderColor="#ababab";
  9122. var commonButtonBackgroundColor="#ffffff";
  9123. var commonEventInButtonBackgroundColor="#ccc";
  9124. var newWindowNotificationId="newWindowNotificaiton";
  9125. var registerDialogNotificationShownArgs={
  9126. "dispId": OSF.DDA.EventDispId.dispidDialogNotificationShownInAddinEvent,
  9127. "eventType": OSF.DDA.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,
  9128. "onComplete": null
  9129. };
  9130. function setHostThemeButtonStyle(args) {
  9131. var hostThemeButtonStyleArgs=args.input;
  9132. if (hostThemeButtonStyleArgs !=null) {
  9133. hostThemeButtonStyle={
  9134. HostButtonBorderColor: hostThemeButtonStyleArgs[OSF.HostThemeButtonStyleKeys.ButtonBorderColor],
  9135. HostButtonBackgroundColor: hostThemeButtonStyleArgs[OSF.HostThemeButtonStyleKeys.ButtonBackgroundColor]
  9136. };
  9137. }
  9138. args.completed();
  9139. }
  9140. Dialog.setHostThemeButtonStyle=setHostThemeButtonStyle;
  9141. function handleNewWindowDialog(dialogInfo) {
  9142. try {
  9143. hasCrossZoneNotification=false;
  9144. var allowButtonKeyDownClick=false;
  9145. var ignoreButtonKeyDownClick=false;
  9146. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9147. var dialogCssManager=OfficeExt.WacCommonUICssManager.getDialogCssManager(hostInfoObj.hostType);
  9148. var notificationText=OSF.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification, OSF._OfficeAppFactory.getInitializationHelper()._appContext._addinName);
  9149. overlayElement=createOverlayElement(dialogCssManager);
  9150. document.body.insertBefore(overlayElement, document.body.firstChild);
  9151. dialogNotificationPanel=createNotificationPanel(dialogCssManager, notificationText);
  9152. dialogNotificationPanel.id=newWindowNotificationId;
  9153. var dialogNotificationButtonPanel=createButtonPanel(dialogCssManager);
  9154. var allowButton=createButtonControl(dialogCssManager, Strings.OfficeOM.L_ShowWindowDialogNotificationAllow);
  9155. var ignoreButton=createButtonControl(dialogCssManager, Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore);
  9156. dialogNotificationButtonPanel.appendChild(allowButton);
  9157. dialogNotificationButtonPanel.appendChild(ignoreButton);
  9158. dialogNotificationPanel.appendChild(dialogNotificationButtonPanel);
  9159. document.body.insertBefore(dialogNotificationPanel, document.body.firstChild);
  9160. function allowButtonClickEventHandler() {
  9161. showDialog(dialogInfo);
  9162. if (!hasCrossZoneNotification) {
  9163. dismissDialogNotification();
  9164. }
  9165. }
  9166. allowButton.onclick=allowButtonClickEventHandler;
  9167. function ignoreButtonClickEventHandler() {
  9168. function unregisterDialogNotificationShownEventCallback(status) {
  9169. removeDialogNotificationElement();
  9170. setFocusOnFirstElement(status);
  9171. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore);
  9172. }
  9173. registerDialogNotificationShownArgs.onComplete=unregisterDialogNotificationShownEventCallback;
  9174. OSF.DDA.WAC.Delegate.unregisterEventAsync(registerDialogNotificationShownArgs);
  9175. }
  9176. ignoreButton.onclick=ignoreButtonClickEventHandler;
  9177. allowButton.addEventListener("keydown", function (event) {
  9178. if (event.shiftKey && event.keyCode==9) {
  9179. handleButtonControlEventOut(allowButton);
  9180. handleButtonControlEventIn(ignoreButton);
  9181. ignoreButton.focus();
  9182. event.preventDefault();
  9183. event.stopPropagation();
  9184. }
  9185. else if (event.keyCode==13) {
  9186. allowButtonKeyDownClick=true;
  9187. event.preventDefault();
  9188. event.stopPropagation();
  9189. }
  9190. }, false);
  9191. allowButton.addEventListener("keyup", function (event) {
  9192. if (event.keyCode==13 && allowButtonKeyDownClick) {
  9193. allowButtonKeyDownClick=false;
  9194. allowButtonClickEventHandler();
  9195. event.preventDefault();
  9196. event.stopPropagation();
  9197. }
  9198. }, false);
  9199. ignoreButton.addEventListener("keydown", function (event) {
  9200. if (!event.shiftKey && event.keyCode==9) {
  9201. handleButtonControlEventOut(ignoreButton);
  9202. handleButtonControlEventIn(allowButton);
  9203. allowButton.focus();
  9204. event.preventDefault();
  9205. event.stopPropagation();
  9206. }
  9207. else if (event.keyCode==13) {
  9208. ignoreButtonKeyDownClick=true;
  9209. event.preventDefault();
  9210. event.stopPropagation();
  9211. }
  9212. }, false);
  9213. ignoreButton.addEventListener("keyup", function (event) {
  9214. if (event.keyCode==13 && ignoreButtonKeyDownClick) {
  9215. ignoreButtonKeyDownClick=false;
  9216. ignoreButtonClickEventHandler();
  9217. event.preventDefault();
  9218. event.stopPropagation();
  9219. }
  9220. }, false);
  9221. window.focus();
  9222. function registerDialogNotificationShownEventCallback(status) {
  9223. allowButton.focus();
  9224. }
  9225. registerDialogNotificationShownArgs.onComplete=registerDialogNotificationShownEventCallback;
  9226. OSF.DDA.WAC.Delegate.registerEventAsync(registerDialogNotificationShownArgs);
  9227. }
  9228. catch (e) {
  9229. if (OSF.AppTelemetry) {
  9230. OSF.AppTelemetry.logAppException("Exception happens at new window dialog."+e);
  9231. }
  9232. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9233. }
  9234. }
  9235. Dialog.handleNewWindowDialog=handleNewWindowDialog;
  9236. function closeDialog(callback) {
  9237. try {
  9238. if (windowInstance !=null) {
  9239. var appDomains=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;
  9240. if (appDomains) {
  9241. for (var i=0; i < appDomains.length && appDomains[i].indexOf("://") !==-1; i++) {
  9242. windowInstance.postMessage(closeDialogKey, appDomains[i]);
  9243. }
  9244. }
  9245. if (windowInstance !=null && !windowInstance.closed) {
  9246. windowInstance.close();
  9247. }
  9248. window.removeEventListener("message", receiveMessage);
  9249. window.clearInterval(checkWindowDialogCloseInterval);
  9250. windowInstance=null;
  9251. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  9252. }
  9253. else {
  9254. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9255. }
  9256. }
  9257. catch (e) {
  9258. if (OSF.AppTelemetry) {
  9259. OSF.AppTelemetry.logAppException("Exception happens at close window dialog."+e);
  9260. }
  9261. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  9262. }
  9263. }
  9264. Dialog.closeDialog=closeDialog;
  9265. function messageParent(params) {
  9266. var message=params.hostCallArgs[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  9267. var appDomains=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;
  9268. if (appDomains) {
  9269. for (var i=0; i < appDomains.length && appDomains[i].indexOf("://") !==-1; i++) {
  9270. window.opener.postMessage(message, appDomains[i]);
  9271. }
  9272. }
  9273. }
  9274. Dialog.messageParent=messageParent;
  9275. function registerMessageReceivedEvent() {
  9276. function receiveCloseDialogMessage(event) {
  9277. if (event.source==window.opener && event.data.indexOf(closeDialogKey) > -1) {
  9278. window.close();
  9279. }
  9280. }
  9281. window.addEventListener("message", receiveCloseDialogMessage);
  9282. }
  9283. Dialog.registerMessageReceivedEvent=registerMessageReceivedEvent;
  9284. function setHandlerAndShowDialogCallback(onEventHandler, callback) {
  9285. handler=onEventHandler;
  9286. showDialogCallback=callback;
  9287. }
  9288. Dialog.setHandlerAndShowDialogCallback=setHandlerAndShowDialogCallback;
  9289. function escDismissDialogNotification() {
  9290. if (dialogNotificationPanel && (dialogNotificationPanel.id==newWindowNotificationId) && showDialogCallback) {
  9291. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore);
  9292. }
  9293. dismissDialogNotification();
  9294. }
  9295. Dialog.escDismissDialogNotification=escDismissDialogNotification;
  9296. function receiveMessage(event) {
  9297. if (event.source==windowInstance) {
  9298. try {
  9299. var dialogMessageReceivedArgs={};
  9300. dialogMessageReceivedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived;
  9301. dialogMessageReceivedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=event.data;
  9302. handler(dialogMessageReceivedArgs);
  9303. }
  9304. catch (e) {
  9305. if (OSF.AppTelemetry) {
  9306. OSF.AppTelemetry.logAppException("Error happened during receive message handler."+e);
  9307. }
  9308. }
  9309. }
  9310. }
  9311. function showDialog(dialogInfo) {
  9312. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9313. var hostInfoVals=[
  9314. hostInfoObj.hostType,
  9315. hostInfoObj.hostPlatform,
  9316. hostInfoObj.hostSpecificFileVersion,
  9317. hostInfoObj.hostLocale,
  9318. hostInfoObj.osfControlAppCorrelationId,
  9319. "isDialog"
  9320. ];
  9321. var hostInfo=hostInfoVals.join("|");
  9322. var appContext=OSF._OfficeAppFactory.getInitializationHelper()._appContext;
  9323. var windowUrl=dialogInfo[OSF.ShowWindowDialogParameterKeys.Url];
  9324. windowUrl=OfficeExt.WACUtils.addHostInfoAsQueryParam(windowUrl, hostInfo);
  9325. var windowName=JSON.parse(window.name);
  9326. windowName[OSF.WindowNameItemKeys.HostInfo]=hostInfo;
  9327. windowName[OSF.WindowNameItemKeys.AppContext]=appContext;
  9328. var width=dialogInfo[OSF.ShowWindowDialogParameterKeys.Width] * appContext._clientWindowWidth / 100;
  9329. var height=dialogInfo[OSF.ShowWindowDialogParameterKeys.Height] * appContext._clientWindowHeight / 100;
  9330. var left=appContext._clientWindowWidth / 2 - width / 2;
  9331. var top=appContext._clientWindowHeight / 2 - height / 2;
  9332. var windowSpecs="width="+width+", height="+height+", left="+left+", top="+top+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";
  9333. windowInstance=window.open(windowUrl, OfficeExt.WACUtils.serializeObjectToString(windowName), windowSpecs);
  9334. if (windowInstance==null) {
  9335. OSF.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api.");
  9336. removeDialogNotificationElement();
  9337. showCrossZoneNotification(windowUrl);
  9338. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone);
  9339. return;
  9340. }
  9341. window.addEventListener("message", receiveMessage);
  9342. function checkWindowClose() {
  9343. try {
  9344. if (windowInstance==null || windowInstance.closed) {
  9345. window.clearInterval(checkWindowDialogCloseInterval);
  9346. window.removeEventListener("message", receiveMessage);
  9347. var dialogClosedArgs={};
  9348. dialogClosedArgs[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogClosed;
  9349. handler(dialogClosedArgs);
  9350. }
  9351. }
  9352. catch (e) {
  9353. if (OSF.AppTelemetry) {
  9354. OSF.AppTelemetry.logAppException("Error happened during check or handle window close."+e);
  9355. }
  9356. }
  9357. }
  9358. checkWindowDialogCloseInterval=window.setInterval(checkWindowClose, 1000);
  9359. if (showDialogCallback !=null) {
  9360. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  9361. }
  9362. else {
  9363. if (OSF.AppTelemetry) {
  9364. OSF.AppTelemetry.logAppException("showDialogCallback can not be null.");
  9365. }
  9366. }
  9367. }
  9368. function createButtonControl(dialogCssManager, buttonValue) {
  9369. var buttonControl=document.createElement("input");
  9370. buttonControl.setAttribute("type", "button");
  9371. buttonControl.style.cssText=dialogCssManager.getDialogButtonCSS();
  9372. buttonControl.style.borderColor=commonButtonBorderColor;
  9373. buttonControl.style.backgroundColor=commonButtonBackgroundColor;
  9374. buttonControl.setAttribute("value", buttonValue);
  9375. var buttonControlEventInHandler=function () {
  9376. handleButtonControlEventIn(buttonControl);
  9377. };
  9378. var buttonControlEventOutHandler=function () {
  9379. handleButtonControlEventOut(buttonControl);
  9380. };
  9381. buttonControl.addEventListener("mouseover", buttonControlEventInHandler);
  9382. buttonControl.addEventListener("focus", buttonControlEventInHandler);
  9383. buttonControl.addEventListener("mouseout", buttonControlEventOutHandler);
  9384. buttonControl.addEventListener("focusout", buttonControlEventOutHandler);
  9385. return buttonControl;
  9386. }
  9387. function handleButtonControlEventIn(buttonControl) {
  9388. if (hostThemeButtonStyle !=null) {
  9389. buttonControl.style.borderColor=hostThemeButtonStyle.HostButtonBorderColor;
  9390. buttonControl.style.backgroundColor=hostThemeButtonStyle.HostButtonBackgroundColor;
  9391. }
  9392. else if (OSF.CommonUI && OSF.CommonUI.HostButtonBorderColor && OSF.CommonUI.HostButtonBackgroundColor) {
  9393. buttonControl.style.borderColor=OSF.CommonUI.HostButtonBorderColor;
  9394. buttonControl.style.backgroundColor=OSF.CommonUI.HostButtonBackgroundColor;
  9395. }
  9396. else {
  9397. buttonControl.style.backgroundColor=commonEventInButtonBackgroundColor;
  9398. }
  9399. }
  9400. function handleButtonControlEventOut(buttonControl) {
  9401. buttonControl.style.borderColor=commonButtonBorderColor;
  9402. buttonControl.style.backgroundColor=commonButtonBackgroundColor;
  9403. }
  9404. function dismissDialogNotification() {
  9405. function unregisterDialogNotificationShownEventCallback(status) {
  9406. removeDialogNotificationElement();
  9407. setFocusOnFirstElement(status);
  9408. }
  9409. registerDialogNotificationShownArgs.onComplete=unregisterDialogNotificationShownEventCallback;
  9410. OSF.DDA.WAC.Delegate.unregisterEventAsync(registerDialogNotificationShownArgs);
  9411. }
  9412. function removeDialogNotificationElement() {
  9413. configureBrowserLink=null;
  9414. if (dialogNotificationPanel !=null) {
  9415. document.body.removeChild(dialogNotificationPanel);
  9416. dialogNotificationPanel=null;
  9417. }
  9418. if (overlayElement !=null) {
  9419. document.body.removeChild(overlayElement);
  9420. overlayElement=null;
  9421. }
  9422. }
  9423. function createOverlayElement(dialogCssManager) {
  9424. var overlayElement=document.createElement("div");
  9425. overlayElement.style.cssText=dialogCssManager.getOverlayElementCSS();
  9426. return overlayElement;
  9427. }
  9428. function createNotificationPanel(dialogCssManager, notificationString) {
  9429. var dialogNotificationPanel=document.createElement("div");
  9430. dialogNotificationPanel.style.cssText=dialogCssManager.getDialogNotificationPanelCSS();
  9431. var dialogNotificationTextPanel=document.createElement("div");
  9432. dialogNotificationTextPanel.style.cssText=dialogCssManager.getNewWindowNotificationTextPanelCSS();
  9433. if (document.documentElement.getAttribute("dir")=="rtl") {
  9434. dialogNotificationTextPanel.style.paddingRight="30px";
  9435. }
  9436. else {
  9437. dialogNotificationTextPanel.style.paddingLeft="30px";
  9438. }
  9439. var dialogNotificationTextSpan=document.createElement("span");
  9440. dialogNotificationTextSpan.style.cssText=dialogCssManager.getNewWindowNotificationTextSpanCSS();
  9441. dialogNotificationTextSpan.innerText=notificationString;
  9442. dialogNotificationTextPanel.appendChild(dialogNotificationTextSpan);
  9443. dialogNotificationPanel.appendChild(dialogNotificationTextPanel);
  9444. return dialogNotificationPanel;
  9445. }
  9446. function createButtonPanel(dialogCssManager) {
  9447. var dialogNotificationButtonPanel=document.createElement("div");
  9448. dialogNotificationButtonPanel.style.cssText=dialogCssManager.getDialogNotificationButtonPanelCSS();
  9449. if (document.documentElement.getAttribute("dir")=="rtl") {
  9450. dialogNotificationButtonPanel.style.cssFloat="left";
  9451. }
  9452. else {
  9453. dialogNotificationButtonPanel.style.cssFloat="right";
  9454. }
  9455. return dialogNotificationButtonPanel;
  9456. }
  9457. function setFocusOnFirstElement(status) {
  9458. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  9459. var list=document.querySelectorAll(OSF._OfficeAppFactory.getInitializationHelper()._tabbableElements);
  9460. OSF.OUtil.focusToFirstTabbable(list, false);
  9461. }
  9462. }
  9463. function createNotificationPanelForCrossZoneIssue(dialogCssManager, windowUrl) {
  9464. var dialogNotificationPanel=document.createElement("div");
  9465. dialogNotificationPanel.style.cssText=dialogCssManager.getDialogNotificationPanelCSS();
  9466. var dialogNotificationTextPanel=document.createElement("div");
  9467. dialogNotificationTextPanel.style.cssText=dialogCssManager.getCrossZoneNotificationTextPanelCSS();
  9468. configureBrowserLink=document.createElement("a");
  9469. configureBrowserLink.href="#";
  9470. configureBrowserLink.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink;
  9471. configureBrowserLink.setAttribute("onclick", "window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");
  9472. var dialogNotificationTextSpan=document.createElement("span");
  9473. if (Strings.OfficeOM.L_NewWindowCrossZone) {
  9474. dialogNotificationTextSpan.innerHTML=OSF.OUtil.formatString(Strings.OfficeOM.L_NewWindowCrossZone, configureBrowserLink.outerHTML, OfficeExt.WACUtils.getDomainForUrl(windowUrl));
  9475. }
  9476. dialogNotificationTextPanel.appendChild(dialogNotificationTextSpan);
  9477. dialogNotificationPanel.appendChild(dialogNotificationTextPanel);
  9478. return dialogNotificationPanel;
  9479. }
  9480. function showCrossZoneNotification(windowUrl) {
  9481. var okButtonKeyDownClick=false;
  9482. var hostInfoObj=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo;
  9483. var dialogCssManager=OfficeExt.WacCommonUICssManager.getDialogCssManager(hostInfoObj.hostType);
  9484. overlayElement=createOverlayElement(dialogCssManager);
  9485. document.body.insertBefore(overlayElement, document.body.firstChild);
  9486. dialogNotificationPanel=createNotificationPanelForCrossZoneIssue(dialogCssManager, windowUrl);
  9487. var dialogNotificationButtonPanel=createButtonPanel(dialogCssManager);
  9488. var okButton=createButtonControl(dialogCssManager, "OK");
  9489. dialogNotificationButtonPanel.appendChild(okButton);
  9490. dialogNotificationPanel.appendChild(dialogNotificationButtonPanel);
  9491. document.body.insertBefore(dialogNotificationPanel, document.body.firstChild);
  9492. hasCrossZoneNotification=true;
  9493. okButton.onclick=function () {
  9494. dismissDialogNotification();
  9495. };
  9496. okButton.addEventListener("keydown", function (event) {
  9497. if (event.keyCode==9) {
  9498. configureBrowserLink.focus();
  9499. event.preventDefault();
  9500. event.stopPropagation();
  9501. }
  9502. else if (event.keyCode==13) {
  9503. okButtonKeyDownClick=true;
  9504. event.preventDefault();
  9505. event.stopPropagation();
  9506. }
  9507. }, false);
  9508. okButton.addEventListener("keyup", function (event) {
  9509. if (event.keyCode==13 && okButtonKeyDownClick) {
  9510. okButtonKeyDownClick=false;
  9511. dismissDialogNotification();
  9512. event.preventDefault();
  9513. event.stopPropagation();
  9514. }
  9515. }, false);
  9516. configureBrowserLink.addEventListener("keydown", function (event) {
  9517. if (event.keyCode==9) {
  9518. okButton.focus();
  9519. event.preventDefault();
  9520. event.stopPropagation();
  9521. }
  9522. }, false);
  9523. window.focus();
  9524. okButton.focus();
  9525. }
  9526. })(Dialog=AddinNativeAction.Dialog || (AddinNativeAction.Dialog={}));
  9527. })(AddinNativeAction=OfficeExt.AddinNativeAction || (OfficeExt.AddinNativeAction={}));
  9528. })(OfficeExt || (OfficeExt={}));
  9529. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9530. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  9531. fromHost: [
  9532. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  9533. ]
  9534. });
  9535. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogMessageReceivedEvent);
  9536. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9537. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  9538. fromHost: [
  9539. { name: OSF.DDA.PropertyDescriptors.MessageType, value: OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType },
  9540. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent }
  9541. ]
  9542. });
  9543. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9544. type: OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,
  9545. fromHost: [
  9546. { name: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent, value: OSF.DDA.WAC.Delegate.ParameterMap.self }
  9547. ]
  9548. });
  9549. OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent);
  9550. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9551. type: OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,
  9552. fromHost: [
  9553. { name: OSF.DDA.PropertyDescriptors.MessageType, value: OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageType },
  9554. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageContent }
  9555. ]
  9556. });
  9557. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9558. type: OSF.DDA.MethodDispId.dispidMessageParentMethod,
  9559. toHost: [
  9560. { name: Microsoft.Office.WebExtension.Parameters.MessageToParent, value: OSF.DDA.Marshaling.MessageParentKeys.MessageToParent }
  9561. ]
  9562. });
  9563. OSF.DDA.WAC.Delegate.ParameterMap.define({
  9564. type: OSF.DDA.MethodDispId.dispidSendMessageMethod,
  9565. toHost: [
  9566. { name: Microsoft.Office.WebExtension.Parameters.MessageContent, value: OSF.DDA.Marshaling.SendMessageKeys.MessageContent }
  9567. ]
  9568. });
  9569. OSF.DDA.WAC.Delegate.openDialog=function OSF_DDA_WAC_Delegate$OpenDialog(args) {
  9570. var httpsIdentifyString="https://";
  9571. var httpIdentifyString="http://";
  9572. var dialogInfo=JSON.parse(args.targetId);
  9573. var callback=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(true, args);
  9574. function showDialogCallback(status) {
  9575. var payload={ "Error": status };
  9576. callback(Microsoft.Office.Common.InvokeResultCode.noError, payload);
  9577. }
  9578. if (OSF.DialogShownStatus.hasDialogShown) {
  9579. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened);
  9580. return;
  9581. }
  9582. var dialogUrl=dialogInfo[OSF.ShowWindowDialogParameterKeys.Url].toLowerCase();
  9583. if (dialogUrl==null || !(dialogUrl.substr(0, httpsIdentifyString.length)===httpsIdentifyString)) {
  9584. if (dialogUrl.substr(0, httpIdentifyString.length)===httpIdentifyString) {
  9585. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS);
  9586. }
  9587. else {
  9588. showDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme);
  9589. }
  9590. return;
  9591. }
  9592. if (!dialogInfo[OSF.ShowWindowDialogParameterKeys.DisplayInIframe]) {
  9593. OSF.DialogShownStatus.isWindowDialog=true;
  9594. OfficeExt.AddinNativeAction.Dialog.setHandlerAndShowDialogCallback(function OSF_DDA_WACDelegate$RegisterEventAsync_OnEvent(payload) {
  9595. if (args.onEvent) {
  9596. args.onEvent(payload);
  9597. }
  9598. if (OSF.AppTelemetry) {
  9599. OSF.AppTelemetry.onEventDone(args.dispId);
  9600. }
  9601. }, showDialogCallback);
  9602. OfficeExt.AddinNativeAction.Dialog.handleNewWindowDialog(dialogInfo);
  9603. }
  9604. else {
  9605. OSF.DialogShownStatus.isWindowDialog=false;
  9606. OSF.DDA.WAC.Delegate.registerEventAsync(args);
  9607. }
  9608. };
  9609. OSF.DDA.WAC.Delegate.messageParent=function OSF_DDA_WAC_Delegate$MessageParent(args) {
  9610. if (window.opener !=null) {
  9611. OfficeExt.AddinNativeAction.Dialog.messageParent(args);
  9612. }
  9613. else {
  9614. OSF.DDA.WAC.Delegate.executeAsync(args);
  9615. }
  9616. };
  9617. OSF.DDA.WAC.Delegate.sendMessage=function OSF_DDA_WAC_Delegate$SendMessage(args) {
  9618. OSF.DDA.WAC.Delegate.executeAsync(args);
  9619. };
  9620. OSF.DDA.WAC.Delegate.closeDialog=function OSF_DDA_WAC_Delegate$CloseDialog(args) {
  9621. var callback=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(false, args);
  9622. function closeDialogCallback(status) {
  9623. var payload={ "Error": status };
  9624. callback(Microsoft.Office.Common.InvokeResultCode.noError, payload);
  9625. }
  9626. if (!OSF.DialogShownStatus.hasDialogShown) {
  9627. closeDialogCallback(OSF.DDA.ErrorCodeManager.errorCodes.ooeWebDialogClosed);
  9628. }
  9629. else {
  9630. if (OSF.DialogShownStatus.isWindowDialog) {
  9631. if (args.onCalling) {
  9632. args.onCalling();
  9633. }
  9634. OfficeExt.AddinNativeAction.Dialog.closeDialog(closeDialogCallback);
  9635. }
  9636. else {
  9637. OSF.DDA.WAC.Delegate.unregisterEventAsync(args);
  9638. }
  9639. }
  9640. };
  9641. OSF.InitializationHelper.prototype.dismissDialogNotification=function OSF_InitializationHelper$dismissDialogNotification() {
  9642. OfficeExt.AddinNativeAction.Dialog.escDismissDialogNotification();
  9643. };
  9644. OSF.InitializationHelper.prototype.registerMessageReceivedEventForWindowDialog=function OSF_InitializationHelper$registerMessageReceivedEventForWindowDialog() {
  9645. OfficeExt.AddinNativeAction.Dialog.registerMessageReceivedEvent();
  9646. };
  9647. OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(Microsoft.Office.WebExtension.Parameters.Data, (function () {
  9648. var tableRows="Rows";
  9649. var tableHeaders="Headers";
  9650. return {
  9651. toHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$toHost(data) {
  9652. if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  9653. var tableData={};
  9654. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  9655. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  9656. data=tableData;
  9657. }
  9658. else if (OSF.DDA.DataCoercion.determineCoercionType(data)==Microsoft.Office.WebExtension.CoercionType.Text) {
  9659. data=[[data]];
  9660. }
  9661. return data;
  9662. },
  9663. fromHost: function OSF_DDA_XLS_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  9664. var ret;
  9665. if (hostArgs[tableRows] !=undefined) {
  9666. ret={};
  9667. ret[OSF.DDA.TableDataProperties.TableRows]=hostArgs[tableRows];
  9668. ret[OSF.DDA.TableDataProperties.TableHeaders]=hostArgs[tableHeaders];
  9669. }
  9670. else {
  9671. ret=hostArgs;
  9672. }
  9673. return ret;
  9674. }
  9675. };
  9676. })());
  9677. OSF.DDA.ExcelDocument=function Microsoft_Office_WebExtension_ExcelDocument(officeAppContext, settings) {
  9678. var bf=new OSF.DDA.BindingFacade(this);
  9679. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  9680. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  9681. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GoToByIdAsync]);
  9682. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync]);
  9683. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.SyncMethodNames.MessageParent]);
  9684. OSF.DDA.ExcelDocument.uber.constructor.call(this, officeAppContext, bf, settings);
  9685. if (this.mode==OSF.ClientMode.ReadOnly) {
  9686. this.url=document.URL;
  9687. }
  9688. OSF.OUtil.finalizeProperties(this);
  9689. };
  9690. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  9691. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  9692. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  9693. appContext.doc=new OSF.DDA.ExcelDocument(appContext, this._initializeSettings(appContext, true));
  9694. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  9695. appReady();
  9696. };
  9697. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  9698. this.prepareApiSurface(appContext);
  9699. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  9700. };
  9701. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  9702. OSF.WebApp._UpdateLinksForHostAndXdmInfo();
  9703. var license=new OSF.DDA.License(appContext.get_eToken());
  9704. this.initWebDialog(appContext);
  9705. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license));
  9706. var getDelegateMethods=OSF.DDA.WAC.getDelegateMethods;
  9707. var parameterMap=OSF.DDA.WAC.Delegate.ParameterMap;
  9708. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  9709. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  9710. appCommandHandler.initializeAndChangeOnce();
  9711. };
  9712. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) { return appContext.get_reason(); };
  9713. var OfficeExtension;
  9714. (function (OfficeExtension) {
  9715. var Action=(function () {
  9716. function Action(actionInfo, isWriteOperation) {
  9717. this.m_actionInfo=actionInfo;
  9718. this.m_isWriteOperation=isWriteOperation;
  9719. }
  9720. Object.defineProperty(Action.prototype, "actionInfo", {
  9721. get: function () {
  9722. return this.m_actionInfo;
  9723. },
  9724. enumerable: true,
  9725. configurable: true
  9726. });
  9727. Object.defineProperty(Action.prototype, "isWriteOperation", {
  9728. get: function () {
  9729. return this.m_isWriteOperation;
  9730. },
  9731. enumerable: true,
  9732. configurable: true
  9733. });
  9734. return Action;
  9735. })();
  9736. OfficeExtension.Action=Action;
  9737. })(OfficeExtension || (OfficeExtension={}));
  9738. var OfficeExtension;
  9739. (function (OfficeExtension) {
  9740. var ActionFactory=(function () {
  9741. function ActionFactory() {
  9742. }
  9743. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  9744. OfficeExtension.Utility.validateObjectPath(parent);
  9745. var actionInfo={
  9746. Id: context._nextId(),
  9747. ActionType: 4 ,
  9748. Name: propertyName,
  9749. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9750. ArgumentInfo: {}
  9751. };
  9752. var args=[value];
  9753. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  9754. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  9755. var ret=new OfficeExtension.Action(actionInfo, true);
  9756. context._pendingRequest.addAction(ret);
  9757. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9758. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  9759. return ret;
  9760. };
  9761. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  9762. OfficeExtension.Utility.validateObjectPath(parent);
  9763. var actionInfo={
  9764. Id: context._nextId(),
  9765. ActionType: 3 ,
  9766. Name: methodName,
  9767. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9768. ArgumentInfo: {}
  9769. };
  9770. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  9771. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  9772. var isWriteOperation=operationType !=1 ;
  9773. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  9774. context._pendingRequest.addAction(ret);
  9775. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9776. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  9777. return ret;
  9778. };
  9779. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  9780. OfficeExtension.Utility.validateObjectPath(parent);
  9781. var actionInfo={
  9782. Id: context._nextId(),
  9783. ActionType: 2 ,
  9784. Name: "",
  9785. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9786. };
  9787. actionInfo.QueryInfo=queryOption;
  9788. var ret=new OfficeExtension.Action(actionInfo, false);
  9789. context._pendingRequest.addAction(ret);
  9790. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9791. return ret;
  9792. };
  9793. ActionFactory.createRecursiveQueryAction=function (context, parent, query) {
  9794. OfficeExtension.Utility.validateObjectPath(parent);
  9795. var actionInfo={
  9796. Id: context._nextId(),
  9797. ActionType: 6 ,
  9798. Name: "",
  9799. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  9800. RecursiveQueryInfo: query
  9801. };
  9802. var ret=new OfficeExtension.Action(actionInfo, false);
  9803. context._pendingRequest.addAction(ret);
  9804. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  9805. return ret;
  9806. };
  9807. ActionFactory.createInstantiateAction=function (context, obj) {
  9808. OfficeExtension.Utility.validateObjectPath(obj);
  9809. var actionInfo={
  9810. Id: context._nextId(),
  9811. ActionType: 1 ,
  9812. Name: "",
  9813. ObjectPathId: obj._objectPath.objectPathInfo.Id
  9814. };
  9815. var ret=new OfficeExtension.Action(actionInfo, false);
  9816. context._pendingRequest.addAction(ret);
  9817. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  9818. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  9819. return ret;
  9820. };
  9821. ActionFactory.createTraceAction=function (context, message, addTraceMessage) {
  9822. var actionInfo={
  9823. Id: context._nextId(),
  9824. ActionType: 5 ,
  9825. Name: "Trace",
  9826. ObjectPathId: 0
  9827. };
  9828. var ret=new OfficeExtension.Action(actionInfo, false);
  9829. context._pendingRequest.addAction(ret);
  9830. if (addTraceMessage) {
  9831. context._pendingRequest.addTrace(actionInfo.Id, message);
  9832. }
  9833. return ret;
  9834. };
  9835. return ActionFactory;
  9836. })();
  9837. OfficeExtension.ActionFactory=ActionFactory;
  9838. })(OfficeExtension || (OfficeExtension={}));
  9839. var OfficeExtension;
  9840. (function (OfficeExtension) {
  9841. var ClientObject=(function () {
  9842. function ClientObject(context, objectPath) {
  9843. OfficeExtension.Utility.checkArgumentNull(context, "context");
  9844. this.m_context=context;
  9845. this.m_objectPath=objectPath;
  9846. if (this.m_objectPath) {
  9847. if (!context._processingResult) {
  9848. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  9849. if ((context._autoCleanup) && (this._KeepReference)) {
  9850. context.trackedObjects._autoAdd(this);
  9851. }
  9852. }
  9853. }
  9854. }
  9855. Object.defineProperty(ClientObject.prototype, "context", {
  9856. get: function () {
  9857. return this.m_context;
  9858. },
  9859. enumerable: true,
  9860. configurable: true
  9861. });
  9862. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  9863. get: function () {
  9864. return this.m_objectPath;
  9865. },
  9866. set: function (value) {
  9867. this.m_objectPath=value;
  9868. },
  9869. enumerable: true,
  9870. configurable: true
  9871. });
  9872. Object.defineProperty(ClientObject.prototype, "isNull", {
  9873. get: function () {
  9874. OfficeExtension.Utility.throwIfNotLoaded("isNull", this._isNull, null, this._isNull);
  9875. return this._isNull;
  9876. },
  9877. enumerable: true,
  9878. configurable: true
  9879. });
  9880. Object.defineProperty(ClientObject.prototype, "isNullObject", {
  9881. get: function () {
  9882. OfficeExtension.Utility.throwIfNotLoaded("isNullObject", this._isNull, null, this._isNull);
  9883. return this._isNull;
  9884. },
  9885. enumerable: true,
  9886. configurable: true
  9887. });
  9888. Object.defineProperty(ClientObject.prototype, "_isNull", {
  9889. get: function () {
  9890. return this.m_isNull;
  9891. },
  9892. set: function (value) {
  9893. this.m_isNull=value;
  9894. if (value && this.m_objectPath) {
  9895. this.m_objectPath._updateAsNullObject();
  9896. }
  9897. },
  9898. enumerable: true,
  9899. configurable: true
  9900. });
  9901. ClientObject.prototype._handleResult=function (value) {
  9902. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  9903. };
  9904. ClientObject.prototype._handleIdResult=function (value) {
  9905. this._isNull=OfficeExtension.Utility.isNullOrUndefined(value);
  9906. OfficeExtension.Utility.fixObjectPathIfNecessary(this, value);
  9907. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this._initReferenceId) {
  9908. this._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  9909. }
  9910. };
  9911. return ClientObject;
  9912. })();
  9913. OfficeExtension.ClientObject=ClientObject;
  9914. })(OfficeExtension || (OfficeExtension={}));
  9915. var OfficeExtension;
  9916. (function (OfficeExtension) {
  9917. var ClientRequest=(function () {
  9918. function ClientRequest(context) {
  9919. this.m_context=context;
  9920. this.m_actions=[];
  9921. this.m_actionResultHandler={};
  9922. this.m_referencedObjectPaths={};
  9923. this.m_flags=0 ;
  9924. this.m_traceInfos={};
  9925. this.m_pendingProcessEventHandlers=[];
  9926. this.m_pendingEventHandlerActions={};
  9927. this.m_responseTraceIds={};
  9928. this.m_responseTraceMessages=[];
  9929. }
  9930. Object.defineProperty(ClientRequest.prototype, "flags", {
  9931. get: function () {
  9932. return this.m_flags;
  9933. },
  9934. enumerable: true,
  9935. configurable: true
  9936. });
  9937. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  9938. get: function () {
  9939. return this.m_traceInfos;
  9940. },
  9941. enumerable: true,
  9942. configurable: true
  9943. });
  9944. Object.defineProperty(ClientRequest.prototype, "_responseTraceMessages", {
  9945. get: function () {
  9946. return this.m_responseTraceMessages;
  9947. },
  9948. enumerable: true,
  9949. configurable: true
  9950. });
  9951. Object.defineProperty(ClientRequest.prototype, "_responseTraceIds", {
  9952. get: function () {
  9953. return this.m_responseTraceIds;
  9954. },
  9955. enumerable: true,
  9956. configurable: true
  9957. });
  9958. ClientRequest.prototype._setResponseTraceIds=function (value) {
  9959. if (value) {
  9960. for (var i=0; i < value.length; i++) {
  9961. var traceId=value[i];
  9962. this.m_responseTraceIds[traceId]=traceId;
  9963. var message=this.m_traceInfos[traceId];
  9964. if (!OfficeExtension.Utility.isNullOrUndefined(message)) {
  9965. this.m_responseTraceMessages.push(message);
  9966. }
  9967. }
  9968. }
  9969. };
  9970. ClientRequest.prototype.addAction=function (action) {
  9971. if (action.isWriteOperation) {
  9972. this.m_flags=this.m_flags | 1 ;
  9973. }
  9974. this.m_actions.push(action);
  9975. };
  9976. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  9977. get: function () {
  9978. return this.m_actions.length > 0;
  9979. },
  9980. enumerable: true,
  9981. configurable: true
  9982. });
  9983. ClientRequest.prototype.addTrace=function (actionId, message) {
  9984. this.m_traceInfos[actionId]=message;
  9985. };
  9986. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  9987. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  9988. return;
  9989. }
  9990. if (!objectPath.isValid) {
  9991. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  9992. }
  9993. while (objectPath) {
  9994. if (objectPath.isWriteOperation) {
  9995. this.m_flags=this.m_flags | 1 ;
  9996. }
  9997. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  9998. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  9999. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  10000. }
  10001. objectPath=objectPath.parentObjectPath;
  10002. }
  10003. };
  10004. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  10005. if (objectPaths) {
  10006. for (var i=0; i < objectPaths.length; i++) {
  10007. this.addReferencedObjectPath(objectPaths[i]);
  10008. }
  10009. }
  10010. };
  10011. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  10012. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  10013. };
  10014. ClientRequest.prototype.buildRequestMessageBody=function () {
  10015. var objectPaths={};
  10016. for (var i in this.m_referencedObjectPaths) {
  10017. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  10018. }
  10019. var actions=[];
  10020. for (var index=0; index < this.m_actions.length; index++) {
  10021. actions.push(this.m_actions[index].actionInfo);
  10022. }
  10023. var ret={
  10024. Actions: actions,
  10025. ObjectPaths: objectPaths
  10026. };
  10027. return ret;
  10028. };
  10029. ClientRequest.prototype.processResponse=function (msg) {
  10030. if (msg && msg.Results) {
  10031. for (var i=0; i < msg.Results.length; i++) {
  10032. var actionResult=msg.Results[i];
  10033. var handler=this.m_actionResultHandler[actionResult.ActionId];
  10034. if (handler) {
  10035. handler._handleResult(actionResult.Value);
  10036. }
  10037. }
  10038. }
  10039. };
  10040. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  10041. for (var i in this.m_referencedObjectPaths) {
  10042. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  10043. this.m_referencedObjectPaths[i].isValid=false;
  10044. }
  10045. }
  10046. };
  10047. ClientRequest.prototype._addPendingEventHandlerAction=function (eventHandlers, action) {
  10048. if (!this.m_pendingEventHandlerActions[eventHandlers._id]) {
  10049. this.m_pendingEventHandlerActions[eventHandlers._id]=[];
  10050. this.m_pendingProcessEventHandlers.push(eventHandlers);
  10051. }
  10052. this.m_pendingEventHandlerActions[eventHandlers._id].push(action);
  10053. };
  10054. Object.defineProperty(ClientRequest.prototype, "_pendingProcessEventHandlers", {
  10055. get: function () {
  10056. return this.m_pendingProcessEventHandlers;
  10057. },
  10058. enumerable: true,
  10059. configurable: true
  10060. });
  10061. ClientRequest.prototype._getPendingEventHandlerActions=function (eventHandlers) {
  10062. return this.m_pendingEventHandlerActions[eventHandlers._id];
  10063. };
  10064. return ClientRequest;
  10065. })();
  10066. OfficeExtension.ClientRequest=ClientRequest;
  10067. })(OfficeExtension || (OfficeExtension={}));
  10068. var OfficeExtension;
  10069. (function (OfficeExtension) {
  10070. var _requestExecutorFactory;
  10071. function _setRequestExecutorFactory(reqExecFactory) {
  10072. _requestExecutorFactory=reqExecFactory;
  10073. }
  10074. OfficeExtension._setRequestExecutorFactory=_setRequestExecutorFactory;
  10075. var ClientRequestContext=(function () {
  10076. function ClientRequestContext(url) {
  10077. this.m_requestHeaders={};
  10078. this._onRunFinishedNotifiers=[];
  10079. this.m_nextId=0;
  10080. if (OfficeExtension.Utility.isNullOrUndefined(url) || typeof (url)==="string" && url.length===0) {
  10081. var defaultUrlAndHeaders=ClientRequestContext.defaultRequestUrlAndHeaders;
  10082. if (defaultUrlAndHeaders && !OfficeExtension.Utility.isNullOrEmptyString(defaultUrlAndHeaders.url)) {
  10083. this.m_url=defaultUrlAndHeaders.url;
  10084. if (defaultUrlAndHeaders.headers) {
  10085. for (var key in defaultUrlAndHeaders.headers) {
  10086. this.m_requestHeaders[key]=defaultUrlAndHeaders.headers[key];
  10087. }
  10088. }
  10089. }
  10090. else {
  10091. this.m_url=OfficeExtension.Constants.localDocument;
  10092. }
  10093. }
  10094. else if (typeof (url)==="string") {
  10095. this.m_url=url;
  10096. }
  10097. else {
  10098. var requestInfo=url;
  10099. if (OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url)) {
  10100. throw OfficeExtension.Utility.createInvalidArgumentException("url");
  10101. }
  10102. this.m_url=requestInfo.url;
  10103. if (requestInfo.headers) {
  10104. for (var key in requestInfo.headers) {
  10105. this.m_requestHeaders[key]=requestInfo.headers[key];
  10106. }
  10107. }
  10108. }
  10109. this._processingResult=false;
  10110. this._customData=OfficeExtension.Constants.iterativeExecutor;
  10111. if (_requestExecutorFactory) {
  10112. this._requestExecutor=_requestExecutorFactory();
  10113. }
  10114. else {
  10115. if (OfficeExtension.Utility._isLocalDocumentUrl(this.m_url)) {
  10116. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  10117. }
  10118. else {
  10119. this._requestExecutor=new OfficeExtension.HttpRequestExecutor();
  10120. }
  10121. }
  10122. this.sync=this.sync.bind(this);
  10123. }
  10124. Object.defineProperty(ClientRequestContext.prototype, "_url", {
  10125. get: function () {
  10126. return this.m_url;
  10127. },
  10128. enumerable: true,
  10129. configurable: true
  10130. });
  10131. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  10132. get: function () {
  10133. if (this.m_pendingRequest==null) {
  10134. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  10135. }
  10136. return this.m_pendingRequest;
  10137. },
  10138. enumerable: true,
  10139. configurable: true
  10140. });
  10141. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  10142. get: function () {
  10143. if (!this.m_trackedObjects) {
  10144. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  10145. }
  10146. return this.m_trackedObjects;
  10147. },
  10148. enumerable: true,
  10149. configurable: true
  10150. });
  10151. Object.defineProperty(ClientRequestContext.prototype, "requestHeaders", {
  10152. get: function () {
  10153. return this.m_requestHeaders;
  10154. },
  10155. enumerable: true,
  10156. configurable: true
  10157. });
  10158. ClientRequestContext.prototype.load=function (clientObj, option) {
  10159. OfficeExtension.Utility.validateContext(this, clientObj);
  10160. var queryOption=ClientRequestContext.parseQueryOption(option);
  10161. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  10162. this._pendingRequest.addActionResultHandler(action, clientObj);
  10163. };
  10164. ClientRequestContext.parseQueryOption=function (option) {
  10165. var queryOption={};
  10166. if (typeof (option)=="string") {
  10167. var select=option;
  10168. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(select);
  10169. }
  10170. else if (Array.isArray(option)) {
  10171. queryOption.Select=option;
  10172. }
  10173. else if (typeof (option)=="object") {
  10174. var loadOption=option;
  10175. if (typeof (loadOption.select)=="string") {
  10176. queryOption.Select=OfficeExtension.Utility._parseSelectExpand(loadOption.select);
  10177. }
  10178. else if (Array.isArray(loadOption.select)) {
  10179. queryOption.Select=loadOption.select;
  10180. }
  10181. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  10182. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  10183. }
  10184. if (typeof (loadOption.expand)=="string") {
  10185. queryOption.Expand=OfficeExtension.Utility._parseSelectExpand(loadOption.expand);
  10186. }
  10187. else if (Array.isArray(loadOption.expand)) {
  10188. queryOption.Expand=loadOption.expand;
  10189. }
  10190. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  10191. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  10192. }
  10193. if (typeof (loadOption.top)=="number") {
  10194. queryOption.Top=loadOption.top;
  10195. }
  10196. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  10197. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  10198. }
  10199. if (typeof (loadOption.skip)=="number") {
  10200. queryOption.Skip=loadOption.skip;
  10201. }
  10202. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  10203. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  10204. }
  10205. }
  10206. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  10207. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  10208. }
  10209. return queryOption;
  10210. };
  10211. ClientRequestContext.prototype.loadRecursive=function (clientObj, options, maxDepth) {
  10212. if (!OfficeExtension.Utility.isPlainJsonObject(options)) {
  10213. throw OfficeExtension.Utility.createInvalidArgumentException("options");
  10214. }
  10215. var quries={};
  10216. for (var key in options) {
  10217. quries[key]=ClientRequestContext.parseQueryOption(options[key]);
  10218. }
  10219. var action=OfficeExtension.ActionFactory.createRecursiveQueryAction(this, clientObj, { Queries: quries, MaxDepth: maxDepth });
  10220. this._pendingRequest.addActionResultHandler(action, clientObj);
  10221. };
  10222. ClientRequestContext.prototype.trace=function (message) {
  10223. OfficeExtension.ActionFactory.createTraceAction(this, message, true);
  10224. };
  10225. ClientRequestContext.prototype.syncPrivate=function () {
  10226. var _this=this;
  10227. var req=this._pendingRequest;
  10228. this.m_pendingRequest=null;
  10229. if (!req.hasActions) {
  10230. return this.processPendingEventHandlers(req);
  10231. }
  10232. var msgBody=req.buildRequestMessageBody();
  10233. var requestFlags=req.flags;
  10234. var requestExecutor=this._requestExecutor;
  10235. if (!requestExecutor) {
  10236. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  10237. }
  10238. var requestExecutorRequestMessage={
  10239. Url: this.m_url,
  10240. Headers: this.m_requestHeaders,
  10241. Body: msgBody
  10242. };
  10243. req.invalidatePendingInvalidObjectPaths();
  10244. var errorFromResponse=null;
  10245. var errorFromProcessEventHandlers=null;
  10246. return requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage).then(function (response) {
  10247. errorFromResponse=_this.processRequestExecutorResponseMessage(req, response);
  10248. return _this.processPendingEventHandlers(req).catch(function (ex) {
  10249. OfficeExtension.Utility.log("Error in processPendingEventHandlers");
  10250. OfficeExtension.Utility.log(JSON.stringify(ex));
  10251. errorFromProcessEventHandlers=ex;
  10252. });
  10253. }).then(function () {
  10254. if (errorFromResponse) {
  10255. OfficeExtension.Utility.log("Throw error from response: "+JSON.stringify(errorFromResponse));
  10256. throw errorFromResponse;
  10257. }
  10258. if (errorFromProcessEventHandlers) {
  10259. OfficeExtension.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(errorFromProcessEventHandlers));
  10260. var transformedError=null;
  10261. if (errorFromProcessEventHandlers instanceof OfficeExtension.Error) {
  10262. transformedError=errorFromProcessEventHandlers;
  10263. transformedError.traceMessages=req._responseTraceMessages;
  10264. }
  10265. else {
  10266. var message=null;
  10267. if (typeof (errorFromProcessEventHandlers)==="string") {
  10268. message=errorFromProcessEventHandlers;
  10269. }
  10270. else {
  10271. message=errorFromProcessEventHandlers.message;
  10272. }
  10273. if (OfficeExtension.Utility.isNullOrEmptyString(message)) {
  10274. message=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.cannotRegisterEvent);
  10275. }
  10276. transformedError=new OfficeExtension._Internal.RuntimeError(OfficeExtension.ErrorCodes.cannotRegisterEvent, message, req._responseTraceMessages, {});
  10277. }
  10278. throw transformedError;
  10279. }
  10280. });
  10281. };
  10282. ClientRequestContext.prototype.processRequestExecutorResponseMessage=function (req, response) {
  10283. if (response.Body && response.Body.TraceIds) {
  10284. req._setResponseTraceIds(response.Body.TraceIds);
  10285. }
  10286. var traceMessages=req._responseTraceMessages;
  10287. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  10288. return new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  10289. }
  10290. else if (response.Body && response.Body.Error) {
  10291. return new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  10292. errorLocation: response.Body.Error.Location
  10293. });
  10294. }
  10295. this._processingResult=true;
  10296. try {
  10297. req.processResponse(response.Body);
  10298. }
  10299. finally {
  10300. this._processingResult=false;
  10301. }
  10302. return null;
  10303. };
  10304. ClientRequestContext.prototype.processPendingEventHandlers=function (req) {
  10305. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  10306. for (var i=0; i < req._pendingProcessEventHandlers.length; i++) {
  10307. var eventHandlers=req._pendingProcessEventHandlers[i];
  10308. ret=ret.then(this.createProcessOneEventHandlersFunc(eventHandlers, req));
  10309. }
  10310. return ret;
  10311. };
  10312. ClientRequestContext.prototype.createProcessOneEventHandlersFunc=function (eventHandlers, req) {
  10313. return function () { return eventHandlers._processRegistration(req); };
  10314. };
  10315. ClientRequestContext.prototype.sync=function (passThroughValue) {
  10316. return this.syncPrivate().then(function () { return passThroughValue; });
  10317. };
  10318. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10319. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  10320. if (retryDelay===void 0) { retryDelay=5000; }
  10321. return ClientRequestContext._runCommon("run", null, ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  10322. };
  10323. ClientRequestContext._runBatch=function (functionName, receivedRunArgs, ctxInitializer, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10324. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  10325. if (retryDelay===void 0) { retryDelay=5000; }
  10326. var ctxRetriever;
  10327. var batch;
  10328. var requestInfo=null;
  10329. var argOffset=0;
  10330. if (receivedRunArgs.length > 0 && typeof (receivedRunArgs[0])==="object" && receivedRunArgs[0] !==null && Object.getPrototypeOf(receivedRunArgs[0])===Object.getPrototypeOf({}) && !OfficeExtension.Utility.isNullOrUndefined(receivedRunArgs[0].url)) {
  10331. requestInfo=receivedRunArgs[0];
  10332. argOffset=1;
  10333. }
  10334. if (receivedRunArgs.length==argOffset+1) {
  10335. ctxRetriever=ctxInitializer;
  10336. batch=receivedRunArgs[argOffset+0];
  10337. }
  10338. else if (receivedRunArgs.length==argOffset+2) {
  10339. if (receivedRunArgs[argOffset+0] instanceof OfficeExtension.ClientObject) {
  10340. ctxRetriever=function () { return receivedRunArgs[argOffset+0].context; };
  10341. }
  10342. else if (Array.isArray(receivedRunArgs[argOffset+0])) {
  10343. var array=receivedRunArgs[argOffset+0];
  10344. if (array.length==0) {
  10345. return ClientRequestContext.createErrorPromise(functionName);
  10346. }
  10347. for (var i=0; i < array.length; i++) {
  10348. if (!(array[i] instanceof OfficeExtension.ClientObject)) {
  10349. return ClientRequestContext.createErrorPromise(functionName);
  10350. }
  10351. if (array[i].context !=array[0].context) {
  10352. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ResourceStrings.invalidRequestContext);
  10353. }
  10354. }
  10355. ctxRetriever=function () { return array[0].context; };
  10356. }
  10357. else {
  10358. return ClientRequestContext.createErrorPromise(functionName);
  10359. }
  10360. batch=receivedRunArgs[argOffset+1];
  10361. }
  10362. else {
  10363. return ClientRequestContext.createErrorPromise(functionName);
  10364. }
  10365. return ClientRequestContext._runCommon(functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure);
  10366. };
  10367. ClientRequestContext.createErrorPromise=function (functionName, code) {
  10368. if (code===void 0) { code=OfficeExtension.ResourceStrings.invalidArgument; }
  10369. return OfficeExtension.Promise.reject(OfficeExtension.Utility.createRuntimeError(code, OfficeExtension.Utility._getResourceString(code), functionName));
  10370. };
  10371. ClientRequestContext._runCommon=function (functionName, requestInfo, ctxRetriever, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  10372. var starterPromise=new OfficeExtension.Promise(function (resolve, reject) {
  10373. resolve();
  10374. });
  10375. var ctx;
  10376. var succeeded=false;
  10377. var resultOrError;
  10378. return starterPromise.then(function () {
  10379. ctx=ctxRetriever(requestInfo);
  10380. if (requestInfo && !OfficeExtension.Utility.isNullOrEmptyString(requestInfo.url) && requestInfo.url !==ctx.m_url) {
  10381. return ClientRequestContext.createErrorPromise(functionName, OfficeExtension.ErrorCodes.invalidRequestContext);
  10382. }
  10383. if (ctx._autoCleanup) {
  10384. return new OfficeExtension.Promise(function (resolve, reject) {
  10385. ctx._onRunFinishedNotifiers.push(function () {
  10386. ctx._autoCleanup=true;
  10387. resolve();
  10388. });
  10389. });
  10390. }
  10391. else {
  10392. ctx._autoCleanup=true;
  10393. }
  10394. }).then(function () {
  10395. if (typeof batch !=='function') {
  10396. return ClientRequestContext.createErrorPromise(functionName);
  10397. }
  10398. var batchResult=batch(ctx);
  10399. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  10400. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  10401. }
  10402. return batchResult;
  10403. }).then(function (batchResult) {
  10404. return ctx.sync(batchResult);
  10405. }).then(function (result) {
  10406. succeeded=true;
  10407. resultOrError=result;
  10408. }).catch(function (error) {
  10409. resultOrError=error;
  10410. }).then(function () {
  10411. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  10412. ctx._autoCleanup=false;
  10413. for (var key in itemsToRemove) {
  10414. itemsToRemove[key]._objectPath.isValid=false;
  10415. }
  10416. var cleanupCounter=0;
  10417. attemptCleanup();
  10418. function attemptCleanup() {
  10419. cleanupCounter++;
  10420. for (var key in itemsToRemove) {
  10421. ctx.trackedObjects.remove(itemsToRemove[key]);
  10422. }
  10423. ctx.sync().then(function () {
  10424. if (onCleanupSuccess) {
  10425. onCleanupSuccess(cleanupCounter);
  10426. }
  10427. }).catch(function () {
  10428. if (onCleanupFailure) {
  10429. onCleanupFailure(cleanupCounter);
  10430. }
  10431. if (cleanupCounter < numCleanupAttempts) {
  10432. setTimeout(function () {
  10433. attemptCleanup();
  10434. }, retryDelay);
  10435. }
  10436. });
  10437. }
  10438. }).then(function () {
  10439. if (ctx._onRunFinishedNotifiers && ctx._onRunFinishedNotifiers.length > 0) {
  10440. var func=ctx._onRunFinishedNotifiers.shift();
  10441. func();
  10442. }
  10443. if (succeeded) {
  10444. return resultOrError;
  10445. }
  10446. else {
  10447. throw resultOrError;
  10448. }
  10449. });
  10450. };
  10451. ClientRequestContext.prototype._nextId=function () {
  10452. return++this.m_nextId;
  10453. };
  10454. return ClientRequestContext;
  10455. })();
  10456. OfficeExtension.ClientRequestContext=ClientRequestContext;
  10457. })(OfficeExtension || (OfficeExtension={}));
  10458. var OfficeExtension;
  10459. (function (OfficeExtension) {
  10460. (function (ClientRequestFlags) {
  10461. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  10462. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  10463. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  10464. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  10465. })(OfficeExtension || (OfficeExtension={}));
  10466. var OfficeExtension;
  10467. (function (OfficeExtension) {
  10468. (function (ClientResultProcessingType) {
  10469. ClientResultProcessingType[ClientResultProcessingType["none"]=0]="none";
  10470. ClientResultProcessingType[ClientResultProcessingType["date"]=1]="date";
  10471. })(OfficeExtension.ClientResultProcessingType || (OfficeExtension.ClientResultProcessingType={}));
  10472. var ClientResultProcessingType=OfficeExtension.ClientResultProcessingType;
  10473. var ClientResult=(function () {
  10474. function ClientResult(type) {
  10475. this.m_type=type;
  10476. }
  10477. Object.defineProperty(ClientResult.prototype, "value", {
  10478. get: function () {
  10479. if (!this.m_isLoaded) {
  10480. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.valueNotLoaded);
  10481. }
  10482. return this.m_value;
  10483. },
  10484. enumerable: true,
  10485. configurable: true
  10486. });
  10487. ClientResult.prototype._handleResult=function (value) {
  10488. this.m_isLoaded=true;
  10489. if (typeof (value)==="object" && value && value._IsNull) {
  10490. return;
  10491. }
  10492. if (this.m_type===1 ) {
  10493. this.m_value=OfficeExtension.Utility.adjustToDateTime(value);
  10494. }
  10495. else {
  10496. this.m_value=value;
  10497. }
  10498. };
  10499. return ClientResult;
  10500. })();
  10501. OfficeExtension.ClientResult=ClientResult;
  10502. })(OfficeExtension || (OfficeExtension={}));
  10503. var OfficeExtension;
  10504. (function (OfficeExtension) {
  10505. var Constants=(function () {
  10506. function Constants() {
  10507. }
  10508. Constants.getItemAt="GetItemAt";
  10509. Constants.id="Id";
  10510. Constants.idPrivate="_Id";
  10511. Constants.index="_Index";
  10512. Constants.items="_Items";
  10513. Constants.iterativeExecutor="IterativeExecutor";
  10514. Constants.localDocument="http://document.localhost/";
  10515. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  10516. Constants.referenceId="_ReferenceId";
  10517. Constants.isTracked="_IsTracked";
  10518. Constants.sourceLibHeader="SdkVersion";
  10519. Constants.requestInfoHeader="Office-RequestInfo";
  10520. return Constants;
  10521. })();
  10522. OfficeExtension.Constants=Constants;
  10523. })(OfficeExtension || (OfficeExtension={}));
  10524. var OfficeExtension;
  10525. (function (OfficeExtension) {
  10526. var EmbedRequestExecutor=(function () {
  10527. function EmbedRequestExecutor() {
  10528. }
  10529. EmbedRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  10530. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, EmbedRequestExecutor.SourceLibHeaderValue);
  10531. return new OfficeExtension.Promise(function (resolve, reject) {
  10532. var endpoint=OfficeExtension.Embedded && OfficeExtension.Embedded._getEndpoint();
  10533. if (!endpoint) {
  10534. resolve(OfficeExtension.RichApiMessageUtility.buildResponseOnError(OfficeExtension.Embedded.EmbeddedApiStatus.InternalError, ""));
  10535. return;
  10536. }
  10537. endpoint.invoke("executeMethod", function (status, result) {
  10538. OfficeExtension.Utility.log("Response:");
  10539. OfficeExtension.Utility.log(JSON.stringify(result));
  10540. var response;
  10541. if (status==OfficeExtension.Embedded.EmbeddedApiStatus.Success) {
  10542. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBodyFromSafeArray(result.Data), OfficeExtension.RichApiMessageUtility.getResponseHeadersFromSafeArray(result.Data));
  10543. }
  10544. else {
  10545. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.Code, result.error.Message);
  10546. }
  10547. resolve(response);
  10548. }, EmbedRequestExecutor._transformMessageArrayIntoParams(messageSafearray));
  10549. });
  10550. };
  10551. EmbedRequestExecutor._transformMessageArrayIntoParams=function (msgArray) {
  10552. return {
  10553. ArrayData: msgArray,
  10554. DdaMethod: {
  10555. DispatchId: EmbedRequestExecutor.DispidExecuteRichApiRequestMethod
  10556. }
  10557. };
  10558. };
  10559. EmbedRequestExecutor.DispidExecuteRichApiRequestMethod=93;
  10560. EmbedRequestExecutor.SourceLibHeaderValue="Embedded";
  10561. return EmbedRequestExecutor;
  10562. })();
  10563. OfficeExtension.EmbedRequestExecutor=EmbedRequestExecutor;
  10564. })(OfficeExtension || (OfficeExtension={}));
  10565. var __extends=this.__extends || function (d, b) {
  10566. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  10567. function __() { this.constructor=d; }
  10568. __.prototype=b.prototype;
  10569. d.prototype=new __();
  10570. };
  10571. var OfficeExtension;
  10572. (function (OfficeExtension) {
  10573. var _Internal;
  10574. (function (_Internal) {
  10575. var RuntimeError=(function (_super) {
  10576. __extends(RuntimeError, _super);
  10577. function RuntimeError(code, message, traceMessages, debugInfo) {
  10578. _super.call(this, message);
  10579. this.name="OfficeExtension.Error";
  10580. this.code=code;
  10581. this.message=message;
  10582. this.traceMessages=traceMessages;
  10583. this.debugInfo=debugInfo;
  10584. }
  10585. RuntimeError.prototype.toString=function () {
  10586. return this.code+': '+this.message;
  10587. };
  10588. return RuntimeError;
  10589. })(Error);
  10590. _Internal.RuntimeError=RuntimeError;
  10591. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  10592. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  10593. })(OfficeExtension || (OfficeExtension={}));
  10594. var OfficeExtension;
  10595. (function (OfficeExtension) {
  10596. var ErrorCodes=(function () {
  10597. function ErrorCodes() {
  10598. }
  10599. ErrorCodes.accessDenied="AccessDenied";
  10600. ErrorCodes.generalException="GeneralException";
  10601. ErrorCodes.activityLimitReached="ActivityLimitReached";
  10602. ErrorCodes.invalidObjectPath="InvalidObjectPath";
  10603. ErrorCodes.propertyNotLoaded="PropertyNotLoaded";
  10604. ErrorCodes.valueNotLoaded="ValueNotLoaded";
  10605. ErrorCodes.invalidRequestContext="InvalidRequestContext";
  10606. ErrorCodes.invalidArgument="InvalidArgument";
  10607. ErrorCodes.runMustReturnPromise="RunMustReturnPromise";
  10608. ErrorCodes.cannotRegisterEvent="CannotRegisterEvent";
  10609. ErrorCodes.apiNotFound="ApiNotFound";
  10610. ErrorCodes.connectionFailure="ConnectionFailure";
  10611. return ErrorCodes;
  10612. })();
  10613. OfficeExtension.ErrorCodes=ErrorCodes;
  10614. })(OfficeExtension || (OfficeExtension={}));
  10615. var OfficeExtension;
  10616. (function (OfficeExtension) {
  10617. var _Internal;
  10618. (function (_Internal) {
  10619. (function (EventHandlerActionType) {
  10620. EventHandlerActionType[EventHandlerActionType["add"]=0]="add";
  10621. EventHandlerActionType[EventHandlerActionType["remove"]=1]="remove";
  10622. EventHandlerActionType[EventHandlerActionType["removeAll"]=2]="removeAll";
  10623. })(_Internal.EventHandlerActionType || (_Internal.EventHandlerActionType={}));
  10624. var EventHandlerActionType=_Internal.EventHandlerActionType;
  10625. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  10626. })(OfficeExtension || (OfficeExtension={}));
  10627. var OfficeExtension;
  10628. (function (OfficeExtension) {
  10629. var EventHandlers=(function () {
  10630. function EventHandlers(context, parentObject, name, eventInfo) {
  10631. var _this=this;
  10632. this.m_id=context._nextId();
  10633. this.m_context=context;
  10634. this.m_name=name;
  10635. this.m_handlers=[];
  10636. this.m_registered=false;
  10637. this.m_eventInfo=eventInfo;
  10638. this.m_callback=function (args) {
  10639. _this.m_eventInfo.eventArgsTransformFunc(args).then(function (newArgs) { return _this.fireEvent(newArgs); });
  10640. };
  10641. }
  10642. Object.defineProperty(EventHandlers.prototype, "_registered", {
  10643. get: function () {
  10644. return this.m_registered;
  10645. },
  10646. enumerable: true,
  10647. configurable: true
  10648. });
  10649. Object.defineProperty(EventHandlers.prototype, "_id", {
  10650. get: function () {
  10651. return this.m_id;
  10652. },
  10653. enumerable: true,
  10654. configurable: true
  10655. });
  10656. Object.defineProperty(EventHandlers.prototype, "_handlers", {
  10657. get: function () {
  10658. return this.m_handlers;
  10659. },
  10660. enumerable: true,
  10661. configurable: true
  10662. });
  10663. EventHandlers.prototype.add=function (handler) {
  10664. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10665. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 0 });
  10666. return new OfficeExtension.EventHandlerResult(this.m_context, this, handler);
  10667. };
  10668. EventHandlers.prototype.remove=function (handler) {
  10669. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10670. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: handler, operation: 1 });
  10671. };
  10672. EventHandlers.prototype.removeAll=function () {
  10673. var action=OfficeExtension.ActionFactory.createTraceAction(this.m_context, null, false);
  10674. this.m_context._pendingRequest._addPendingEventHandlerAction(this, { id: action.actionInfo.Id, handler: null, operation: 2 });
  10675. };
  10676. EventHandlers.prototype._processRegistration=function (req) {
  10677. var _this=this;
  10678. var ret=OfficeExtension.Utility._createPromiseFromResult(null);
  10679. var actions=req._getPendingEventHandlerActions(this);
  10680. if (!actions) {
  10681. return ret;
  10682. }
  10683. var handlersResult=[];
  10684. for (var i=0; i < this.m_handlers.length; i++) {
  10685. handlersResult.push(this.m_handlers[i]);
  10686. }
  10687. var hasChange=false;
  10688. for (var i=0; i < actions.length; i++) {
  10689. if (req._responseTraceIds[actions[i].id]) {
  10690. hasChange=true;
  10691. switch (actions[i].operation) {
  10692. case 0 :
  10693. handlersResult.push(actions[i].handler);
  10694. break;
  10695. case 1 :
  10696. for (var index=handlersResult.length - 1; index >=0; index--) {
  10697. if (handlersResult[index]===actions[i].handler) {
  10698. handlersResult.splice(index, 1);
  10699. break;
  10700. }
  10701. }
  10702. break;
  10703. case 2 :
  10704. handlersResult=[];
  10705. break;
  10706. }
  10707. }
  10708. }
  10709. if (hasChange) {
  10710. if (!this.m_registered && handlersResult.length > 0) {
  10711. ret=ret.then(function () { return _this.m_eventInfo.registerFunc(_this.m_callback); }).then(function () { return (_this.m_registered=true); });
  10712. }
  10713. else if (this.m_registered && handlersResult.length==0) {
  10714. ret=ret.then(function () { return _this.m_eventInfo.unregisterFunc(_this.m_callback); }).catch(function (ex) {
  10715. OfficeExtension.Utility.log("Error when unregister event: "+JSON.stringify(ex));
  10716. }).then(function () { return (_this.m_registered=false); });
  10717. }
  10718. ret=ret.then(function () { return (_this.m_handlers=handlersResult); });
  10719. }
  10720. return ret;
  10721. };
  10722. EventHandlers.prototype.fireEvent=function (args) {
  10723. var promises=[];
  10724. for (var i=0; i < this.m_handlers.length; i++) {
  10725. var handler=this.m_handlers[i];
  10726. var p=OfficeExtension.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(handler, args)).catch(function (ex) {
  10727. OfficeExtension.Utility.log("Error when invoke handler: "+JSON.stringify(ex));
  10728. });
  10729. promises.push(p);
  10730. }
  10731. OfficeExtension.Promise.all(promises);
  10732. };
  10733. EventHandlers.prototype.createFireOneEventHandlerFunc=function (handler, args) {
  10734. return function () { return handler(args); };
  10735. };
  10736. return EventHandlers;
  10737. })();
  10738. OfficeExtension.EventHandlers=EventHandlers;
  10739. })(OfficeExtension || (OfficeExtension={}));
  10740. var OfficeExtension;
  10741. (function (OfficeExtension) {
  10742. var EventHandlerResult=(function () {
  10743. function EventHandlerResult(context, handlers, handler) {
  10744. this.m_context=context;
  10745. this.m_allHandlers=handlers;
  10746. this.m_handler=handler;
  10747. }
  10748. EventHandlerResult.prototype.remove=function () {
  10749. if (this.m_allHandlers && this.m_handler) {
  10750. this.m_allHandlers.remove(this.m_handler);
  10751. this.m_allHandlers=null;
  10752. this.m_handler=null;
  10753. }
  10754. };
  10755. return EventHandlerResult;
  10756. })();
  10757. OfficeExtension.EventHandlerResult=EventHandlerResult;
  10758. })(OfficeExtension || (OfficeExtension={}));
  10759. var OfficeExtension;
  10760. (function (OfficeExtension) {
  10761. var HttpRequestExecutor=(function () {
  10762. function HttpRequestExecutor() {
  10763. }
  10764. HttpRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  10765. var requestMessageText=JSON.stringify(requestMessage.Body);
  10766. OfficeExtension.Utility.log("Request:");
  10767. OfficeExtension.Utility.log(requestMessageText);
  10768. var url=requestMessage.Url;
  10769. if (url.charAt(url.length - 1) !="/") {
  10770. url=url+"/";
  10771. }
  10772. url=url+"ProcessQuery";
  10773. var requestInfo={
  10774. method: "POST",
  10775. url: url,
  10776. headers: {},
  10777. body: requestMessageText
  10778. };
  10779. requestInfo.headers[OfficeExtension.Constants.sourceLibHeader]=HttpRequestExecutor.SourceLibHeaderValue;
  10780. requestInfo.headers[OfficeExtension.Constants.requestInfoHeader]="flags="+requestFlags.toString();
  10781. requestInfo.headers["CONTENT-TYPE"]="application/json";
  10782. if (requestMessage.Headers) {
  10783. for (var key in requestMessage.Headers) {
  10784. requestInfo.headers[key]=requestMessage.Headers[key];
  10785. }
  10786. }
  10787. return OfficeExtension.HttpUtility.sendRequest(requestInfo).then(function (responseInfo) {
  10788. var response;
  10789. if (responseInfo.statusCode===200) {
  10790. response={ ErrorCode: null, ErrorMessage: null, Headers: responseInfo.headers, Body: JSON.parse(responseInfo.body) };
  10791. }
  10792. else {
  10793. var errorObj=null;
  10794. OfficeExtension.Utility.log("Error Response:"+responseInfo.body);
  10795. if (!OfficeExtension.Utility.isNullOrEmptyString(responseInfo.body)) {
  10796. var errorResponseBody=OfficeExtension.Utility.trim(responseInfo.body);
  10797. try {
  10798. errorObj=JSON.parse(errorResponseBody);
  10799. }
  10800. catch (e) {
  10801. OfficeExtension.Utility.log("Error when parse "+errorResponseBody);
  10802. }
  10803. }
  10804. var errorMessage;
  10805. var errorCode;
  10806. if (!OfficeExtension.Utility.isNullOrUndefined(errorObj) && typeof (errorObj)==="object" && errorObj.error) {
  10807. errorCode=errorObj.error.code;
  10808. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithDetails, [responseInfo.statusCode.toString(), errorObj.error.code, errorObj.error.message]);
  10809. }
  10810. else {
  10811. errorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, responseInfo.statusCode.toString());
  10812. }
  10813. if (OfficeExtension.Utility.isNullOrEmptyString(errorCode)) {
  10814. errorCode=OfficeExtension.ErrorCodes.connectionFailure;
  10815. }
  10816. response={
  10817. ErrorCode: errorCode,
  10818. ErrorMessage: errorMessage,
  10819. Headers: responseInfo.headers,
  10820. Body: null
  10821. };
  10822. }
  10823. return response;
  10824. });
  10825. };
  10826. HttpRequestExecutor.SourceLibHeaderValue="officejs-rest";
  10827. return HttpRequestExecutor;
  10828. })();
  10829. OfficeExtension.HttpRequestExecutor=HttpRequestExecutor;
  10830. })(OfficeExtension || (OfficeExtension={}));
  10831. var OfficeExtension;
  10832. (function (OfficeExtension) {
  10833. var HttpUtility=(function () {
  10834. function HttpUtility() {
  10835. }
  10836. HttpUtility.setCustomSendRequestFunc=function (func) {
  10837. HttpUtility.s_customSendRequestFunc=func;
  10838. };
  10839. HttpUtility.xhrSendRequestFunc=function (request) {
  10840. return new OfficeExtension.Promise(function (resolve, reject) {
  10841. var xhr=new XMLHttpRequest();
  10842. xhr.open(request.method, request.url);
  10843. xhr.onload=function () {
  10844. var resp={
  10845. statusCode: xhr.status,
  10846. headers: OfficeExtension.Utility._parseHttpResponseHeaders(xhr.getAllResponseHeaders()),
  10847. body: xhr.responseText
  10848. };
  10849. resolve(resp);
  10850. };
  10851. xhr.onerror=function () {
  10852. reject(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.connectionFailure, OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.connectionFailureWithStatus, xhr.statusText), null));
  10853. };
  10854. if (request.headers) {
  10855. for (var key in request.headers) {
  10856. xhr.setRequestHeader(key, request.headers[key]);
  10857. }
  10858. }
  10859. xhr.send(request.body);
  10860. });
  10861. };
  10862. HttpUtility.sendRequest=function (request) {
  10863. HttpUtility.validateAndNormalizeRequest(request);
  10864. var func;
  10865. func=HttpUtility.s_customSendRequestFunc || HttpUtility.xhrSendRequestFunc;
  10866. return func(request);
  10867. };
  10868. HttpUtility.setCustomSendLocalDocumentRequestFunc=function (func) {
  10869. HttpUtility.s_customSendLocalDocumentRequestFunc=func;
  10870. };
  10871. HttpUtility.sendLocalDocumentRequest=function (request) {
  10872. HttpUtility.validateAndNormalizeRequest(request);
  10873. var func;
  10874. func=HttpUtility.s_customSendLocalDocumentRequestFunc || HttpUtility.officeJsSendLocalDocumentRequestFunc;
  10875. return func(request);
  10876. };
  10877. HttpUtility.officeJsSendLocalDocumentRequestFunc=function (request) {
  10878. request=OfficeExtension.Utility._validateLocalDocumentRequest(request);
  10879. var requestSafeArray=OfficeExtension.Utility._buildRequestMessageSafeArray(request);
  10880. return new OfficeExtension.Promise(function (resolve, reject) {
  10881. OSF.DDA.RichApi.executeRichApiRequestAsync(requestSafeArray, function (asyncResult) {
  10882. var response;
  10883. if (asyncResult.status=="succeeded") {
  10884. response={
  10885. statusCode: OfficeExtension.RichApiMessageUtility.getResponseStatusCode(asyncResult),
  10886. headers: OfficeExtension.RichApiMessageUtility.getResponseHeaders(asyncResult),
  10887. body: OfficeExtension.RichApiMessageUtility.getResponseBody(asyncResult)
  10888. };
  10889. }
  10890. else {
  10891. response=OfficeExtension.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(asyncResult.error.code, asyncResult.error.message);
  10892. }
  10893. OfficeExtension.Utility.log(JSON.stringify(response));
  10894. resolve(response);
  10895. });
  10896. });
  10897. };
  10898. HttpUtility.validateAndNormalizeRequest=function (request) {
  10899. if (OfficeExtension.Utility.isNullOrUndefined(request)) {
  10900. throw OfficeExtension.Utility.createInvalidArgumentException("request");
  10901. }
  10902. if (OfficeExtension.Utility.isNullOrEmptyString(request.method)) {
  10903. request.method="GET";
  10904. }
  10905. request.method=request.method.toUpperCase();
  10906. };
  10907. return HttpUtility;
  10908. })();
  10909. OfficeExtension.HttpUtility=HttpUtility;
  10910. })(OfficeExtension || (OfficeExtension={}));
  10911. var OfficeExtension;
  10912. (function (OfficeExtension) {
  10913. var InstantiateActionResultHandler=(function () {
  10914. function InstantiateActionResultHandler(clientObject) {
  10915. this.m_clientObject=clientObject;
  10916. }
  10917. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  10918. this.m_clientObject._handleIdResult(value);
  10919. };
  10920. return InstantiateActionResultHandler;
  10921. })();
  10922. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  10923. })(OfficeExtension || (OfficeExtension={}));
  10924. var OfficeExtension;
  10925. (function (OfficeExtension) {
  10926. })(OfficeExtension || (OfficeExtension={}));
  10927. var OfficeExtension;
  10928. (function (OfficeExtension) {
  10929. (function (RichApiRequestMessageIndex) {
  10930. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  10931. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  10932. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  10933. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  10934. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  10935. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  10936. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  10937. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  10938. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  10939. (function (RichApiResponseMessageIndex) {
  10940. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  10941. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  10942. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  10943. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  10944. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  10945. ;
  10946. (function (ActionType) {
  10947. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  10948. ActionType[ActionType["Query"]=2]="Query";
  10949. ActionType[ActionType["Method"]=3]="Method";
  10950. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  10951. ActionType[ActionType["Trace"]=5]="Trace";
  10952. ActionType[ActionType["RecursiveQuery"]=6]="RecursiveQuery";
  10953. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  10954. var ActionType=OfficeExtension.ActionType;
  10955. (function (ObjectPathType) {
  10956. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  10957. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  10958. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  10959. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  10960. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  10961. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  10962. ObjectPathType[ObjectPathType["NullObject"]=7]="NullObject";
  10963. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  10964. var ObjectPathType=OfficeExtension.ObjectPathType;
  10965. })(OfficeExtension || (OfficeExtension={}));
  10966. var OfficeExtension;
  10967. (function (OfficeExtension) {
  10968. var ObjectPath=(function () {
  10969. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  10970. this.m_objectPathInfo=objectPathInfo;
  10971. this.m_parentObjectPath=parentObjectPath;
  10972. this.m_isWriteOperation=false;
  10973. this.m_isCollection=isCollection;
  10974. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  10975. this.m_isValid=true;
  10976. }
  10977. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  10978. get: function () {
  10979. return this.m_objectPathInfo;
  10980. },
  10981. enumerable: true,
  10982. configurable: true
  10983. });
  10984. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  10985. get: function () {
  10986. return this.m_isWriteOperation;
  10987. },
  10988. set: function (value) {
  10989. this.m_isWriteOperation=value;
  10990. },
  10991. enumerable: true,
  10992. configurable: true
  10993. });
  10994. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  10995. get: function () {
  10996. return this.m_isCollection;
  10997. },
  10998. enumerable: true,
  10999. configurable: true
  11000. });
  11001. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  11002. get: function () {
  11003. return this.m_isInvalidAfterRequest;
  11004. },
  11005. enumerable: true,
  11006. configurable: true
  11007. });
  11008. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  11009. get: function () {
  11010. return this.m_parentObjectPath;
  11011. },
  11012. enumerable: true,
  11013. configurable: true
  11014. });
  11015. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  11016. get: function () {
  11017. return this.m_argumentObjectPaths;
  11018. },
  11019. set: function (value) {
  11020. this.m_argumentObjectPaths=value;
  11021. },
  11022. enumerable: true,
  11023. configurable: true
  11024. });
  11025. Object.defineProperty(ObjectPath.prototype, "isValid", {
  11026. get: function () {
  11027. return this.m_isValid;
  11028. },
  11029. set: function (value) {
  11030. this.m_isValid=value;
  11031. },
  11032. enumerable: true,
  11033. configurable: true
  11034. });
  11035. Object.defineProperty(ObjectPath.prototype, "getByIdMethodName", {
  11036. get: function () {
  11037. return this.m_getByIdMethodName;
  11038. },
  11039. set: function (value) {
  11040. this.m_getByIdMethodName=value;
  11041. },
  11042. enumerable: true,
  11043. configurable: true
  11044. });
  11045. ObjectPath.prototype._updateAsNullObject=function () {
  11046. this.m_isInvalidAfterRequest=false;
  11047. this.m_isValid=true;
  11048. this.m_objectPathInfo.ObjectPathType=7 ;
  11049. this.m_objectPathInfo.Name="";
  11050. this.m_objectPathInfo.ArgumentInfo={};
  11051. this.m_parentObjectPath=null;
  11052. this.m_argumentObjectPaths=null;
  11053. };
  11054. ObjectPath.prototype.updateUsingObjectData=function (value) {
  11055. var referenceId=value[OfficeExtension.Constants.referenceId];
  11056. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  11057. this.m_isInvalidAfterRequest=false;
  11058. this.m_isValid=true;
  11059. this.m_objectPathInfo.ObjectPathType=6 ;
  11060. this.m_objectPathInfo.Name=referenceId;
  11061. this.m_objectPathInfo.ArgumentInfo={};
  11062. this.m_parentObjectPath=null;
  11063. this.m_argumentObjectPaths=null;
  11064. return;
  11065. }
  11066. var parentIsCollection=this.parentObjectPath && this.parentObjectPath.isCollection;
  11067. var getByIdMethodName=this.getByIdMethodName;
  11068. if (parentIsCollection || !OfficeExtension.Utility.isNullOrEmptyString(getByIdMethodName)) {
  11069. var id=value[OfficeExtension.Constants.id];
  11070. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11071. id=value[OfficeExtension.Constants.idPrivate];
  11072. }
  11073. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  11074. this.m_isInvalidAfterRequest=false;
  11075. this.m_isValid=true;
  11076. if (parentIsCollection) {
  11077. this.m_objectPathInfo.ObjectPathType=5 ;
  11078. this.m_objectPathInfo.Name="";
  11079. }
  11080. else {
  11081. this.m_objectPathInfo.ObjectPathType=3 ;
  11082. this.m_objectPathInfo.Name=getByIdMethodName;
  11083. this.m_getByIdMethodName=null;
  11084. }
  11085. this.isWriteOperation=false;
  11086. this.m_objectPathInfo.ArgumentInfo={};
  11087. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  11088. this.m_argumentObjectPaths=null;
  11089. return;
  11090. }
  11091. }
  11092. };
  11093. return ObjectPath;
  11094. })();
  11095. OfficeExtension.ObjectPath=ObjectPath;
  11096. })(OfficeExtension || (OfficeExtension={}));
  11097. var OfficeExtension;
  11098. (function (OfficeExtension) {
  11099. var ObjectPathFactory=(function () {
  11100. function ObjectPathFactory() {
  11101. }
  11102. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  11103. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  11104. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  11105. };
  11106. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  11107. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  11108. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  11109. };
  11110. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  11111. var objectPathInfo={
  11112. Id: context._nextId(),
  11113. ObjectPathType: 4 ,
  11114. Name: propertyName,
  11115. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11116. };
  11117. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  11118. };
  11119. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  11120. var objectPathInfo={
  11121. Id: context._nextId(),
  11122. ObjectPathType: 5 ,
  11123. Name: "",
  11124. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11125. ArgumentInfo: {}
  11126. };
  11127. objectPathInfo.ArgumentInfo.Arguments=args;
  11128. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11129. };
  11130. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  11131. var objectPathInfo={
  11132. Id: context._nextId(),
  11133. ObjectPathType: 5 ,
  11134. Name: "",
  11135. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  11136. ArgumentInfo: {}
  11137. };
  11138. objectPathInfo.ArgumentInfo.Arguments=args;
  11139. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  11140. };
  11141. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest, getByIdMethodName) {
  11142. var objectPathInfo={
  11143. Id: context._nextId(),
  11144. ObjectPathType: 3 ,
  11145. Name: methodName,
  11146. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11147. ArgumentInfo: {}
  11148. };
  11149. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  11150. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  11151. ret.argumentObjectPaths=argumentObjectPaths;
  11152. ret.isWriteOperation=(operationType !=1 );
  11153. ret.getByIdMethodName=getByIdMethodName;
  11154. return ret;
  11155. };
  11156. ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt=function (hasIndexerMethod, context, parent, childItem, index) {
  11157. var id=childItem[OfficeExtension.Constants.id];
  11158. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11159. id=childItem[OfficeExtension.Constants.idPrivate];
  11160. }
  11161. if (hasIndexerMethod && !OfficeExtension.Utility.isNullOrUndefined(id)) {
  11162. return ObjectPathFactory.createChildItemObjectPathUsingIndexer(context, parent, childItem);
  11163. }
  11164. else {
  11165. return ObjectPathFactory.createChildItemObjectPathUsingGetItemAt(context, parent, childItem, index);
  11166. }
  11167. };
  11168. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  11169. var id=childItem[OfficeExtension.Constants.id];
  11170. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  11171. id=childItem[OfficeExtension.Constants.idPrivate];
  11172. }
  11173. var objectPathInfo=objectPathInfo={
  11174. Id: context._nextId(),
  11175. ObjectPathType: 5 ,
  11176. Name: "",
  11177. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11178. ArgumentInfo: {}
  11179. };
  11180. objectPathInfo.ArgumentInfo.Arguments=[id];
  11181. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11182. };
  11183. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  11184. var indexFromServer=childItem[OfficeExtension.Constants.index];
  11185. if (indexFromServer) {
  11186. index=indexFromServer;
  11187. }
  11188. var objectPathInfo={
  11189. Id: context._nextId(),
  11190. ObjectPathType: 3 ,
  11191. Name: OfficeExtension.Constants.getItemAt,
  11192. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  11193. ArgumentInfo: {}
  11194. };
  11195. objectPathInfo.ArgumentInfo.Arguments=[index];
  11196. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  11197. };
  11198. return ObjectPathFactory;
  11199. })();
  11200. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  11201. })(OfficeExtension || (OfficeExtension={}));
  11202. var OfficeExtension;
  11203. (function (OfficeExtension) {
  11204. var OfficeJsRequestExecutor=(function () {
  11205. function OfficeJsRequestExecutor() {
  11206. }
  11207. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage) {
  11208. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(customData, requestFlags, requestMessage, OfficeJsRequestExecutor.SourceLibHeaderValue);
  11209. return new OfficeExtension.Promise(function (resolve, reject) {
  11210. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  11211. OfficeExtension.Utility.log("Response:");
  11212. OfficeExtension.Utility.log(JSON.stringify(result));
  11213. var response;
  11214. if (result.status=="succeeded") {
  11215. response=OfficeExtension.RichApiMessageUtility.buildResponseOnSuccess(OfficeExtension.RichApiMessageUtility.getResponseBody(result), OfficeExtension.RichApiMessageUtility.getResponseHeaders(result));
  11216. }
  11217. else {
  11218. response=OfficeExtension.RichApiMessageUtility.buildResponseOnError(result.error.code, result.error.message);
  11219. }
  11220. resolve(response);
  11221. });
  11222. });
  11223. };
  11224. OfficeJsRequestExecutor.SourceLibHeaderValue="officejs";
  11225. return OfficeJsRequestExecutor;
  11226. })();
  11227. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  11228. })(OfficeExtension || (OfficeExtension={}));
  11229. var OfficeExtension;
  11230. (function (OfficeExtension) {
  11231. var _Internal;
  11232. (function (_Internal) {
  11233. var PromiseImpl;
  11234. (function (PromiseImpl) {
  11235. function Init() {
  11236. (function () {
  11237. "use strict";
  11238. function lib$es6$promise$utils$$objectOrFunction(x) {
  11239. return typeof x==='function' || (typeof x==='object' && x !==null);
  11240. }
  11241. function lib$es6$promise$utils$$isFunction(x) {
  11242. return typeof x==='function';
  11243. }
  11244. function lib$es6$promise$utils$$isMaybeThenable(x) {
  11245. return typeof x==='object' && x !==null;
  11246. }
  11247. var lib$es6$promise$utils$$_isArray;
  11248. if (!Array.isArray) {
  11249. lib$es6$promise$utils$$_isArray=function (x) {
  11250. return Object.prototype.toString.call(x)==='[object Array]';
  11251. };
  11252. }
  11253. else {
  11254. lib$es6$promise$utils$$_isArray=Array.isArray;
  11255. }
  11256. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  11257. var lib$es6$promise$asap$$len=0;
  11258. var lib$es6$promise$asap$$toString={}.toString;
  11259. var lib$es6$promise$asap$$vertxNext;
  11260. var lib$es6$promise$asap$$customSchedulerFn;
  11261. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  11262. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  11263. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  11264. lib$es6$promise$asap$$len+=2;
  11265. if (lib$es6$promise$asap$$len===2) {
  11266. if (lib$es6$promise$asap$$customSchedulerFn) {
  11267. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  11268. }
  11269. else {
  11270. lib$es6$promise$asap$$scheduleFlush();
  11271. }
  11272. }
  11273. };
  11274. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  11275. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  11276. }
  11277. function lib$es6$promise$asap$$setAsap(asapFn) {
  11278. lib$es6$promise$asap$$asap=asapFn;
  11279. }
  11280. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  11281. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  11282. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  11283. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  11284. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  11285. function lib$es6$promise$asap$$useNextTick() {
  11286. var nextTick=process.nextTick;
  11287. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  11288. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  11289. nextTick=setImmediate;
  11290. }
  11291. return function () {
  11292. nextTick(lib$es6$promise$asap$$flush);
  11293. };
  11294. }
  11295. function lib$es6$promise$asap$$useVertxTimer() {
  11296. return function () {
  11297. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  11298. };
  11299. }
  11300. function lib$es6$promise$asap$$useMutationObserver() {
  11301. var iterations=0;
  11302. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  11303. var node=document.createTextNode('');
  11304. observer.observe(node, { characterData: true });
  11305. return function () {
  11306. node.data=(iterations=++iterations % 2);
  11307. };
  11308. }
  11309. function lib$es6$promise$asap$$useMessageChannel() {
  11310. var channel=new MessageChannel();
  11311. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  11312. return function () {
  11313. channel.port2.postMessage(0);
  11314. };
  11315. }
  11316. function lib$es6$promise$asap$$useSetTimeout() {
  11317. return function () {
  11318. setTimeout(lib$es6$promise$asap$$flush, 1);
  11319. };
  11320. }
  11321. var lib$es6$promise$asap$$queue=new Array(1000);
  11322. function lib$es6$promise$asap$$flush() {
  11323. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  11324. var callback=lib$es6$promise$asap$$queue[i];
  11325. var arg=lib$es6$promise$asap$$queue[i+1];
  11326. callback(arg);
  11327. lib$es6$promise$asap$$queue[i]=undefined;
  11328. lib$es6$promise$asap$$queue[i+1]=undefined;
  11329. }
  11330. lib$es6$promise$asap$$len=0;
  11331. }
  11332. function lib$es6$promise$asap$$attemptVertex() {
  11333. try {
  11334. var r=require;
  11335. var vertx=r('vertx');
  11336. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  11337. return lib$es6$promise$asap$$useVertxTimer();
  11338. }
  11339. catch (e) {
  11340. return lib$es6$promise$asap$$useSetTimeout();
  11341. }
  11342. }
  11343. var lib$es6$promise$asap$$scheduleFlush;
  11344. if (lib$es6$promise$asap$$isNode) {
  11345. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  11346. }
  11347. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  11348. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  11349. }
  11350. else if (lib$es6$promise$asap$$isWorker) {
  11351. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  11352. }
  11353. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  11354. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  11355. }
  11356. else {
  11357. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  11358. }
  11359. function lib$es6$promise$$internal$$noop() {
  11360. }
  11361. var lib$es6$promise$$internal$$PENDING=void 0;
  11362. var lib$es6$promise$$internal$$FULFILLED=1;
  11363. var lib$es6$promise$$internal$$REJECTED=2;
  11364. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  11365. function lib$es6$promise$$internal$$selfFullfillment() {
  11366. return new TypeError("You cannot resolve a promise with itself");
  11367. }
  11368. function lib$es6$promise$$internal$$cannotReturnOwn() {
  11369. return new TypeError('A promises callback cannot return that same promise.');
  11370. }
  11371. function lib$es6$promise$$internal$$getThen(promise) {
  11372. try {
  11373. return promise.then;
  11374. }
  11375. catch (error) {
  11376. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  11377. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  11378. }
  11379. }
  11380. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  11381. try {
  11382. then.call(value, fulfillmentHandler, rejectionHandler);
  11383. }
  11384. catch (e) {
  11385. return e;
  11386. }
  11387. }
  11388. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  11389. lib$es6$promise$asap$$asap(function (promise) {
  11390. var sealed=false;
  11391. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  11392. if (sealed) {
  11393. return;
  11394. }
  11395. sealed=true;
  11396. if (thenable !==value) {
  11397. lib$es6$promise$$internal$$resolve(promise, value);
  11398. }
  11399. else {
  11400. lib$es6$promise$$internal$$fulfill(promise, value);
  11401. }
  11402. }, function (reason) {
  11403. if (sealed) {
  11404. return;
  11405. }
  11406. sealed=true;
  11407. lib$es6$promise$$internal$$reject(promise, reason);
  11408. }, 'Settle: '+(promise._label || ' unknown promise'));
  11409. if (!sealed && error) {
  11410. sealed=true;
  11411. lib$es6$promise$$internal$$reject(promise, error);
  11412. }
  11413. }, promise);
  11414. }
  11415. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  11416. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  11417. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  11418. }
  11419. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  11420. lib$es6$promise$$internal$$reject(promise, thenable._result);
  11421. }
  11422. else {
  11423. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  11424. lib$es6$promise$$internal$$resolve(promise, value);
  11425. }, function (reason) {
  11426. lib$es6$promise$$internal$$reject(promise, reason);
  11427. });
  11428. }
  11429. }
  11430. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  11431. if (maybeThenable.constructor===promise.constructor) {
  11432. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  11433. }
  11434. else {
  11435. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  11436. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  11437. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  11438. }
  11439. else if (then===undefined) {
  11440. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  11441. }
  11442. else if (lib$es6$promise$utils$$isFunction(then)) {
  11443. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  11444. }
  11445. else {
  11446. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  11447. }
  11448. }
  11449. }
  11450. function lib$es6$promise$$internal$$resolve(promise, value) {
  11451. if (promise===value) {
  11452. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  11453. }
  11454. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  11455. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  11456. }
  11457. else {
  11458. lib$es6$promise$$internal$$fulfill(promise, value);
  11459. }
  11460. }
  11461. function lib$es6$promise$$internal$$publishRejection(promise) {
  11462. if (promise._onerror) {
  11463. promise._onerror(promise._result);
  11464. }
  11465. lib$es6$promise$$internal$$publish(promise);
  11466. }
  11467. function lib$es6$promise$$internal$$fulfill(promise, value) {
  11468. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11469. return;
  11470. }
  11471. promise._result=value;
  11472. promise._state=lib$es6$promise$$internal$$FULFILLED;
  11473. if (promise._subscribers.length !==0) {
  11474. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  11475. }
  11476. }
  11477. function lib$es6$promise$$internal$$reject(promise, reason) {
  11478. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11479. return;
  11480. }
  11481. promise._state=lib$es6$promise$$internal$$REJECTED;
  11482. promise._result=reason;
  11483. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  11484. }
  11485. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  11486. var subscribers=parent._subscribers;
  11487. var length=subscribers.length;
  11488. parent._onerror=null;
  11489. subscribers[length]=child;
  11490. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  11491. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  11492. if (length===0 && parent._state) {
  11493. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  11494. }
  11495. }
  11496. function lib$es6$promise$$internal$$publish(promise) {
  11497. var subscribers=promise._subscribers;
  11498. var settled=promise._state;
  11499. if (subscribers.length===0) {
  11500. return;
  11501. }
  11502. var child, callback, detail=promise._result;
  11503. for (var i=0; i < subscribers.length; i+=3) {
  11504. child=subscribers[i];
  11505. callback=subscribers[i+settled];
  11506. if (child) {
  11507. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  11508. }
  11509. else {
  11510. callback(detail);
  11511. }
  11512. }
  11513. promise._subscribers.length=0;
  11514. }
  11515. function lib$es6$promise$$internal$$ErrorObject() {
  11516. this.error=null;
  11517. }
  11518. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  11519. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  11520. try {
  11521. return callback(detail);
  11522. }
  11523. catch (e) {
  11524. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  11525. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  11526. }
  11527. }
  11528. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  11529. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  11530. if (hasCallback) {
  11531. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  11532. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  11533. failed=true;
  11534. error=value.error;
  11535. value=null;
  11536. }
  11537. else {
  11538. succeeded=true;
  11539. }
  11540. if (promise===value) {
  11541. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  11542. return;
  11543. }
  11544. }
  11545. else {
  11546. value=detail;
  11547. succeeded=true;
  11548. }
  11549. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  11550. }
  11551. else if (hasCallback && succeeded) {
  11552. lib$es6$promise$$internal$$resolve(promise, value);
  11553. }
  11554. else if (failed) {
  11555. lib$es6$promise$$internal$$reject(promise, error);
  11556. }
  11557. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  11558. lib$es6$promise$$internal$$fulfill(promise, value);
  11559. }
  11560. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  11561. lib$es6$promise$$internal$$reject(promise, value);
  11562. }
  11563. }
  11564. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  11565. try {
  11566. resolver(function resolvePromise(value) {
  11567. lib$es6$promise$$internal$$resolve(promise, value);
  11568. }, function rejectPromise(reason) {
  11569. lib$es6$promise$$internal$$reject(promise, reason);
  11570. });
  11571. }
  11572. catch (e) {
  11573. lib$es6$promise$$internal$$reject(promise, e);
  11574. }
  11575. }
  11576. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  11577. var enumerator=this;
  11578. enumerator._instanceConstructor=Constructor;
  11579. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  11580. if (enumerator._validateInput(input)) {
  11581. enumerator._input=input;
  11582. enumerator.length=input.length;
  11583. enumerator._remaining=input.length;
  11584. enumerator._init();
  11585. if (enumerator.length===0) {
  11586. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  11587. }
  11588. else {
  11589. enumerator.length=enumerator.length || 0;
  11590. enumerator._enumerate();
  11591. if (enumerator._remaining===0) {
  11592. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  11593. }
  11594. }
  11595. }
  11596. else {
  11597. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  11598. }
  11599. }
  11600. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  11601. return lib$es6$promise$utils$$isArray(input);
  11602. };
  11603. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  11604. return new _Internal.Error('Array Methods must be provided an Array');
  11605. };
  11606. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  11607. this._result=new Array(this.length);
  11608. };
  11609. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  11610. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  11611. var enumerator=this;
  11612. var length=enumerator.length;
  11613. var promise=enumerator.promise;
  11614. var input=enumerator._input;
  11615. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  11616. enumerator._eachEntry(input[i], i);
  11617. }
  11618. };
  11619. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  11620. var enumerator=this;
  11621. var c=enumerator._instanceConstructor;
  11622. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  11623. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  11624. entry._onerror=null;
  11625. enumerator._settledAt(entry._state, i, entry._result);
  11626. }
  11627. else {
  11628. enumerator._willSettleAt(c.resolve(entry), i);
  11629. }
  11630. }
  11631. else {
  11632. enumerator._remaining--;
  11633. enumerator._result[i]=entry;
  11634. }
  11635. };
  11636. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  11637. var enumerator=this;
  11638. var promise=enumerator.promise;
  11639. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  11640. enumerator._remaining--;
  11641. if (state===lib$es6$promise$$internal$$REJECTED) {
  11642. lib$es6$promise$$internal$$reject(promise, value);
  11643. }
  11644. else {
  11645. enumerator._result[i]=value;
  11646. }
  11647. }
  11648. if (enumerator._remaining===0) {
  11649. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  11650. }
  11651. };
  11652. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  11653. var enumerator=this;
  11654. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  11655. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  11656. }, function (reason) {
  11657. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  11658. });
  11659. };
  11660. function lib$es6$promise$promise$all$$all(entries) {
  11661. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  11662. }
  11663. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  11664. function lib$es6$promise$promise$race$$race(entries) {
  11665. var Constructor=this;
  11666. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11667. if (!lib$es6$promise$utils$$isArray(entries)) {
  11668. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  11669. return promise;
  11670. }
  11671. var length=entries.length;
  11672. function onFulfillment(value) {
  11673. lib$es6$promise$$internal$$resolve(promise, value);
  11674. }
  11675. function onRejection(reason) {
  11676. lib$es6$promise$$internal$$reject(promise, reason);
  11677. }
  11678. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  11679. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  11680. }
  11681. return promise;
  11682. }
  11683. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  11684. function lib$es6$promise$promise$resolve$$resolve(object) {
  11685. var Constructor=this;
  11686. if (object && typeof object==='object' && object.constructor===Constructor) {
  11687. return object;
  11688. }
  11689. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11690. lib$es6$promise$$internal$$resolve(promise, object);
  11691. return promise;
  11692. }
  11693. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  11694. function lib$es6$promise$promise$reject$$reject(reason) {
  11695. var Constructor=this;
  11696. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  11697. lib$es6$promise$$internal$$reject(promise, reason);
  11698. return promise;
  11699. }
  11700. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  11701. var lib$es6$promise$promise$$counter=0;
  11702. function lib$es6$promise$promise$$needsResolver() {
  11703. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  11704. }
  11705. function lib$es6$promise$promise$$needsNew() {
  11706. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  11707. }
  11708. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  11709. function lib$es6$promise$promise$$Promise(resolver) {
  11710. this._id=lib$es6$promise$promise$$counter++;
  11711. this._state=undefined;
  11712. this._result=undefined;
  11713. this._subscribers=[];
  11714. if (lib$es6$promise$$internal$$noop !==resolver) {
  11715. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  11716. lib$es6$promise$promise$$needsResolver();
  11717. }
  11718. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  11719. lib$es6$promise$promise$$needsNew();
  11720. }
  11721. lib$es6$promise$$internal$$initializePromise(this, resolver);
  11722. }
  11723. }
  11724. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  11725. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  11726. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  11727. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  11728. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  11729. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  11730. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  11731. lib$es6$promise$promise$$Promise.prototype={
  11732. constructor: lib$es6$promise$promise$$Promise,
  11733. then: function (onFulfillment, onRejection) {
  11734. var parent=this;
  11735. var state=parent._state;
  11736. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  11737. return this;
  11738. }
  11739. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  11740. var result=parent._result;
  11741. if (state) {
  11742. var callback=arguments[state - 1];
  11743. lib$es6$promise$asap$$asap(function () {
  11744. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  11745. });
  11746. }
  11747. else {
  11748. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  11749. }
  11750. return child;
  11751. },
  11752. 'catch': function (onRejection) {
  11753. return this.then(null, onRejection);
  11754. }
  11755. };
  11756. OfficeExtension.Promise=lib$es6$promise$promise$$default;
  11757. }).call(this);
  11758. }
  11759. PromiseImpl.Init=Init;
  11760. })(PromiseImpl=_Internal.PromiseImpl || (_Internal.PromiseImpl={}));
  11761. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  11762. if (!OfficeExtension["Promise"]) {
  11763. if (typeof (window) !=="undefined" && window.Promise) {
  11764. if (IsEdgeLessThan14()) {
  11765. _Internal.PromiseImpl.Init();
  11766. }
  11767. else {
  11768. OfficeExtension.Promise=window.Promise;
  11769. }
  11770. }
  11771. else {
  11772. _Internal.PromiseImpl.Init();
  11773. }
  11774. }
  11775. })(OfficeExtension || (OfficeExtension={}));
  11776. function IsEdgeLessThan14() {
  11777. var userAgent=window.navigator.userAgent;
  11778. var versionIdx=userAgent.indexOf("Edge/");
  11779. if (versionIdx >=0) {
  11780. userAgent=userAgent.substring(versionIdx+5, userAgent.length);
  11781. if (userAgent < "14.14393")
  11782. return true;
  11783. else
  11784. return false;
  11785. }
  11786. return false;
  11787. }
  11788. var OfficeExtension;
  11789. (function (OfficeExtension) {
  11790. (function (OperationType) {
  11791. OperationType[OperationType["Default"]=0]="Default";
  11792. OperationType[OperationType["Read"]=1]="Read";
  11793. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  11794. var OperationType=OfficeExtension.OperationType;
  11795. })(OfficeExtension || (OfficeExtension={}));
  11796. var OfficeExtension;
  11797. (function (OfficeExtension) {
  11798. var TrackedObjects=(function () {
  11799. function TrackedObjects(context) {
  11800. this._autoCleanupList={};
  11801. this.m_context=context;
  11802. }
  11803. TrackedObjects.prototype.add=function (param) {
  11804. var _this=this;
  11805. if (Array.isArray(param)) {
  11806. param.forEach(function (item) { return _this._addCommon(item, true); });
  11807. }
  11808. else {
  11809. this._addCommon(param, true);
  11810. }
  11811. };
  11812. TrackedObjects.prototype._autoAdd=function (object) {
  11813. this._addCommon(object, false);
  11814. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  11815. };
  11816. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  11817. if (object[OfficeExtension.Constants.isTracked]) {
  11818. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  11819. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  11820. }
  11821. return;
  11822. }
  11823. var referenceId=object[OfficeExtension.Constants.referenceId];
  11824. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  11825. object._KeepReference();
  11826. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  11827. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  11828. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  11829. }
  11830. object[OfficeExtension.Constants.isTracked]=true;
  11831. }
  11832. };
  11833. TrackedObjects.prototype.remove=function (param) {
  11834. var _this=this;
  11835. if (Array.isArray(param)) {
  11836. param.forEach(function (item) { return _this._removeCommon(item); });
  11837. }
  11838. else {
  11839. this._removeCommon(param);
  11840. }
  11841. };
  11842. TrackedObjects.prototype._removeCommon=function (object) {
  11843. var referenceId=object[OfficeExtension.Constants.referenceId];
  11844. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  11845. var rootObject=this.m_context._rootObject;
  11846. if (rootObject._RemoveReference) {
  11847. rootObject._RemoveReference(referenceId);
  11848. }
  11849. delete object[OfficeExtension.Constants.isTracked];
  11850. }
  11851. };
  11852. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  11853. var list=this._autoCleanupList;
  11854. this._autoCleanupList={};
  11855. return list;
  11856. };
  11857. return TrackedObjects;
  11858. })();
  11859. OfficeExtension.TrackedObjects=TrackedObjects;
  11860. })(OfficeExtension || (OfficeExtension={}));
  11861. var OfficeExtension;
  11862. (function (OfficeExtension) {
  11863. var ResourceStrings=(function () {
  11864. function ResourceStrings() {
  11865. }
  11866. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  11867. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  11868. ResourceStrings.valueNotLoaded="ValueNotLoaded";
  11869. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  11870. ResourceStrings.invalidArgument="InvalidArgument";
  11871. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  11872. ResourceStrings.cannotRegisterEvent="CannotRegisterEvent";
  11873. ResourceStrings.connectionFailureWithStatus="ConnectionFailureWithStatus";
  11874. ResourceStrings.connectionFailureWithDetails="ConnectionFailureWithDetails";
  11875. return ResourceStrings;
  11876. })();
  11877. OfficeExtension.ResourceStrings=ResourceStrings;
  11878. })(OfficeExtension || (OfficeExtension={}));
  11879. var OfficeExtension;
  11880. (function (OfficeExtension) {
  11881. var RichApiMessageUtility=(function () {
  11882. function RichApiMessageUtility() {
  11883. }
  11884. RichApiMessageUtility.buildMessageArrayForIRequestExecutor=function (customData, requestFlags, requestMessage, sourceLibHeaderValue) {
  11885. var requestMessageText=JSON.stringify(requestMessage.Body);
  11886. OfficeExtension.Utility.log("Request:");
  11887. OfficeExtension.Utility.log(requestMessageText);
  11888. var headers={};
  11889. headers[OfficeExtension.Constants.sourceLibHeader]=sourceLibHeaderValue;
  11890. var messageSafearray=RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", headers, requestMessageText);
  11891. return messageSafearray;
  11892. };
  11893. RichApiMessageUtility.buildResponseOnSuccess=function (responseBody, responseHeaders) {
  11894. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  11895. response.Body=JSON.parse(responseBody);
  11896. response.Headers=responseHeaders;
  11897. return response;
  11898. };
  11899. RichApiMessageUtility.buildResponseOnError=function (errorCode, message) {
  11900. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  11901. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  11902. if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  11903. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  11904. }
  11905. else if (errorCode==RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  11906. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  11907. }
  11908. response.ErrorMessage=message;
  11909. return response;
  11910. };
  11911. RichApiMessageUtility.buildHttpResponseFromOfficeJsError=function (errorCode, message) {
  11912. var statusCode=500;
  11913. var errorBody={};
  11914. errorBody["error"]={};
  11915. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.generalException;
  11916. errorBody["error"]["message"]=message;
  11917. if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability) {
  11918. statusCode=403;
  11919. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.accessDenied;
  11920. }
  11921. else if (errorCode===RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached) {
  11922. statusCode=429;
  11923. errorBody["error"]["code"]=OfficeExtension.ErrorCodes.activityLimitReached;
  11924. }
  11925. return { statusCode: statusCode, headers: {}, body: JSON.stringify(errorBody) };
  11926. };
  11927. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  11928. var headerArray=[];
  11929. if (headers) {
  11930. for (var headerName in headers) {
  11931. headerArray.push(headerName);
  11932. headerArray.push(headers[headerName]);
  11933. }
  11934. }
  11935. var appPermission=0;
  11936. var solutionId="";
  11937. var instanceId="";
  11938. var marketplaceType="";
  11939. return [
  11940. customData,
  11941. method,
  11942. path,
  11943. headerArray,
  11944. body,
  11945. appPermission,
  11946. requestFlags,
  11947. solutionId,
  11948. instanceId,
  11949. marketplaceType
  11950. ];
  11951. };
  11952. RichApiMessageUtility.getResponseBody=function (result) {
  11953. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  11954. };
  11955. RichApiMessageUtility.getResponseHeaders=function (result) {
  11956. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  11957. };
  11958. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  11959. var ret=data[2 ];
  11960. if (typeof (ret)==="string") {
  11961. return ret;
  11962. }
  11963. var arr=ret;
  11964. return arr.join("");
  11965. };
  11966. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  11967. var arrayHeader=data[1 ];
  11968. if (!arrayHeader) {
  11969. return null;
  11970. }
  11971. var headers={};
  11972. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  11973. headers[arrayHeader[i]]=arrayHeader[i+1];
  11974. }
  11975. return headers;
  11976. };
  11977. RichApiMessageUtility.getResponseStatusCode=function (result) {
  11978. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  11979. };
  11980. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  11981. return data[0 ];
  11982. };
  11983. RichApiMessageUtility.OfficeJsErrorCode_ooeNoCapability=7000;
  11984. RichApiMessageUtility.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  11985. return RichApiMessageUtility;
  11986. })();
  11987. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  11988. })(OfficeExtension || (OfficeExtension={}));
  11989. var OfficeExtension;
  11990. (function (OfficeExtension) {
  11991. var Utility=(function () {
  11992. function Utility() {
  11993. }
  11994. Utility.checkArgumentNull=function (value, name) {
  11995. if (Utility.isNullOrUndefined(value)) {
  11996. Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, name);
  11997. }
  11998. };
  11999. Utility.isNullOrUndefined=function (value) {
  12000. if (value===null) {
  12001. return true;
  12002. }
  12003. if (typeof (value)==="undefined") {
  12004. return true;
  12005. }
  12006. return false;
  12007. };
  12008. Utility.isUndefined=function (value) {
  12009. if (typeof (value)==="undefined") {
  12010. return true;
  12011. }
  12012. return false;
  12013. };
  12014. Utility.isNullOrEmptyString=function (value) {
  12015. if (value===null) {
  12016. return true;
  12017. }
  12018. if (typeof (value)==="undefined") {
  12019. return true;
  12020. }
  12021. if (value.length==0) {
  12022. return true;
  12023. }
  12024. return false;
  12025. };
  12026. Utility.isPlainJsonObject=function (value) {
  12027. if (Utility.isNullOrUndefined(value)) {
  12028. return false;
  12029. }
  12030. if (typeof (value) !=="object") {
  12031. return false;
  12032. }
  12033. return Object.getPrototypeOf(value)===Object.getPrototypeOf({});
  12034. };
  12035. Utility.trim=function (str) {
  12036. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  12037. };
  12038. Utility.caseInsensitiveCompareString=function (str1, str2) {
  12039. if (Utility.isNullOrUndefined(str1)) {
  12040. return Utility.isNullOrUndefined(str2);
  12041. }
  12042. else {
  12043. if (Utility.isNullOrUndefined(str2)) {
  12044. return false;
  12045. }
  12046. else {
  12047. return str1.toUpperCase()==str2.toUpperCase();
  12048. }
  12049. }
  12050. };
  12051. Utility.adjustToDateTime=function (value) {
  12052. if (Utility.isNullOrUndefined(value)) {
  12053. return null;
  12054. }
  12055. if (typeof (value)==="string") {
  12056. return new Date(value);
  12057. }
  12058. if (Array.isArray(value)) {
  12059. var arr=value;
  12060. for (var i=0; i < arr.length; i++) {
  12061. arr[i]=Utility.adjustToDateTime(arr[i]);
  12062. }
  12063. return arr;
  12064. }
  12065. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "date"), null);
  12066. };
  12067. Utility.isReadonlyRestRequest=function (method) {
  12068. return Utility.caseInsensitiveCompareString(method, "GET");
  12069. };
  12070. Utility.setMethodArguments=function (context, argumentInfo, args) {
  12071. if (Utility.isNullOrUndefined(args)) {
  12072. return null;
  12073. }
  12074. var referencedObjectPaths=new Array();
  12075. var referencedObjectPathIds=new Array();
  12076. var hasOne=Utility.collectObjectPathInfos(context, args, referencedObjectPaths, referencedObjectPathIds);
  12077. argumentInfo.Arguments=args;
  12078. if (hasOne) {
  12079. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  12080. return referencedObjectPaths;
  12081. }
  12082. return null;
  12083. };
  12084. Utility.collectObjectPathInfos=function (context, args, referencedObjectPaths, referencedObjectPathIds) {
  12085. var hasOne=false;
  12086. for (var i=0; i < args.length; i++) {
  12087. if (args[i] instanceof OfficeExtension.ClientObject) {
  12088. var clientObject=args[i];
  12089. Utility.validateContext(context, clientObject);
  12090. args[i]=clientObject._objectPath.objectPathInfo.Id;
  12091. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  12092. referencedObjectPaths.push(clientObject._objectPath);
  12093. hasOne=true;
  12094. }
  12095. else if (Array.isArray(args[i])) {
  12096. var childArrayObjectPathIds=new Array();
  12097. var childArrayHasOne=Utility.collectObjectPathInfos(context, args[i], referencedObjectPaths, childArrayObjectPathIds);
  12098. if (childArrayHasOne) {
  12099. referencedObjectPathIds.push(childArrayObjectPathIds);
  12100. hasOne=true;
  12101. }
  12102. else {
  12103. referencedObjectPathIds.push(0);
  12104. }
  12105. }
  12106. else {
  12107. referencedObjectPathIds.push(0);
  12108. }
  12109. }
  12110. return hasOne;
  12111. };
  12112. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  12113. if (clientObject && clientObject._objectPath && value) {
  12114. clientObject._objectPath.updateUsingObjectData(value);
  12115. }
  12116. };
  12117. Utility.validateObjectPath=function (clientObject) {
  12118. var objectPath=clientObject._objectPath;
  12119. while (objectPath) {
  12120. if (!objectPath.isValid) {
  12121. var pathExpression=Utility.getObjectPathExpression(objectPath);
  12122. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  12123. }
  12124. objectPath=objectPath.parentObjectPath;
  12125. }
  12126. };
  12127. Utility.validateReferencedObjectPaths=function (objectPaths) {
  12128. if (objectPaths) {
  12129. for (var i=0; i < objectPaths.length; i++) {
  12130. var objectPath=objectPaths[i];
  12131. while (objectPath) {
  12132. if (!objectPath.isValid) {
  12133. var pathExpression=Utility.getObjectPathExpression(objectPath);
  12134. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  12135. }
  12136. objectPath=objectPath.parentObjectPath;
  12137. }
  12138. }
  12139. }
  12140. };
  12141. Utility.validateContext=function (context, obj) {
  12142. if (obj && obj.context !==context) {
  12143. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  12144. }
  12145. };
  12146. Utility.log=function (message) {
  12147. if (Utility._logEnabled && typeof (console) !=="undefined" && console.log) {
  12148. console.log(message);
  12149. }
  12150. };
  12151. Utility.load=function (clientObj, option) {
  12152. clientObj.context.load(clientObj, option);
  12153. };
  12154. Utility._parseSelectExpand=function (select) {
  12155. var args=[];
  12156. if (!Utility.isNullOrEmptyString(select)) {
  12157. var propertyNames=select.split(",");
  12158. for (var i=0; i < propertyNames.length; i++) {
  12159. var propertyName=propertyNames[i];
  12160. propertyName=sanitizeForAnyItemsSlash(propertyName.trim());
  12161. if (propertyName.length > 0) {
  12162. args.push(propertyName);
  12163. }
  12164. }
  12165. }
  12166. return args;
  12167. function sanitizeForAnyItemsSlash(propertyName) {
  12168. var propertyNameLower=propertyName.toLowerCase();
  12169. if (propertyNameLower==="items" || propertyNameLower==="items/") {
  12170. return '*';
  12171. }
  12172. var itemsSlashLength=6;
  12173. if (propertyNameLower.substr(0, itemsSlashLength)==="items/") {
  12174. propertyName=propertyName.substr(itemsSlashLength);
  12175. }
  12176. return propertyName.replace(new RegExp("\/items\/", "gi"), "/");
  12177. }
  12178. };
  12179. Utility.throwError=function (resourceId, arg, errorLocation) {
  12180. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), errorLocation ? { errorLocation: errorLocation } : {});
  12181. };
  12182. Utility.createRuntimeError=function (code, message, location) {
  12183. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  12184. };
  12185. Utility.createInvalidArgumentException=function (name, errorLocation) {
  12186. return Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, name), errorLocation);
  12187. };
  12188. Utility._getResourceString=function (resourceId, arg) {
  12189. var ret=resourceId;
  12190. if (typeof (window) !=="undefined" && window.Strings && window.Strings.OfficeOM) {
  12191. var stringName="L_"+resourceId;
  12192. var stringValue=window.Strings.OfficeOM[stringName];
  12193. if (stringValue) {
  12194. ret=stringValue;
  12195. }
  12196. }
  12197. if (!Utility.isNullOrUndefined(arg)) {
  12198. if (Array.isArray(arg)) {
  12199. var arrArg=arg;
  12200. ret=Utility._formatString(ret, arrArg);
  12201. }
  12202. else {
  12203. ret=ret.replace("{0}", arg);
  12204. }
  12205. }
  12206. return ret;
  12207. };
  12208. Utility._formatString=function (format, arrArg) {
  12209. return format.replace(/\{\d\}/g, function (v) {
  12210. var position=parseInt(v.substr(1, v.length - 2));
  12211. if (position < arrArg.length) {
  12212. return arrArg[position];
  12213. }
  12214. else {
  12215. throw Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument, Utility._getResourceString(OfficeExtension.ResourceStrings.invalidArgument, "format"), null);
  12216. }
  12217. return "";
  12218. });
  12219. };
  12220. Utility.throwIfNotLoaded=function (propertyName, fieldValue, entityName, isNull) {
  12221. if (!isNull && Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  12222. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName, (entityName ? entityName+"."+propertyName : null));
  12223. }
  12224. };
  12225. Utility.getObjectPathExpression=function (objectPath) {
  12226. var ret="";
  12227. while (objectPath) {
  12228. switch (objectPath.objectPathInfo.ObjectPathType) {
  12229. case 1 :
  12230. ret=ret;
  12231. break;
  12232. case 2 :
  12233. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  12234. break;
  12235. case 3 :
  12236. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  12237. break;
  12238. case 4 :
  12239. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  12240. break;
  12241. case 5 :
  12242. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  12243. break;
  12244. case 6 :
  12245. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  12246. break;
  12247. }
  12248. objectPath=objectPath.parentObjectPath;
  12249. }
  12250. return ret;
  12251. };
  12252. Utility._createPromiseFromResult=function (value) {
  12253. return new OfficeExtension.Promise(function (resolve, reject) {
  12254. resolve(value);
  12255. });
  12256. };
  12257. Utility._createTimeoutPromise=function (timeout) {
  12258. return new OfficeExtension.Promise(function (resolve, reject) {
  12259. setTimeout(function () {
  12260. resolve(null);
  12261. }, timeout);
  12262. });
  12263. };
  12264. Utility.promisify=function (action) {
  12265. return new OfficeExtension.Promise(function (resolve, reject) {
  12266. var callback=function (result) {
  12267. if (result.status=="failed") {
  12268. reject(result.error);
  12269. }
  12270. else {
  12271. resolve(result.value);
  12272. }
  12273. };
  12274. action(callback);
  12275. });
  12276. };
  12277. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  12278. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  12279. };
  12280. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  12281. for (var i=0; i < propertyNames.length - 1; i+=2) {
  12282. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  12283. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  12284. }
  12285. }
  12286. };
  12287. Utility.normalizeName=function (name) {
  12288. return name.substr(0, 1).toLowerCase()+name.substr(1);
  12289. };
  12290. Utility._isLocalDocumentUrl=function (url) {
  12291. return Utility._getLocalDocumentUrlPrefixLength(url) > 0;
  12292. };
  12293. Utility._getLocalDocumentUrlPrefixLength=function (url) {
  12294. var localDocumentPrefixes=["http://document.localhost", "https://document.localhost", "//document.localhost"];
  12295. var urlLower=url.toLowerCase().trim();
  12296. for (var i=0; i < localDocumentPrefixes.length; i++) {
  12297. if (urlLower===localDocumentPrefixes[i]) {
  12298. return localDocumentPrefixes[i].length;
  12299. }
  12300. else if (urlLower.substr(0, localDocumentPrefixes[i].length+1)===localDocumentPrefixes[i]+"/") {
  12301. return localDocumentPrefixes[i].length+1;
  12302. }
  12303. }
  12304. return 0;
  12305. };
  12306. Utility._validateLocalDocumentRequest=function (request) {
  12307. var index=Utility._getLocalDocumentUrlPrefixLength(request.url);
  12308. if (index <=0) {
  12309. throw Utility.createInvalidArgumentException("request");
  12310. }
  12311. var path=request.url.substr(index);
  12312. var pathLower=path.toLowerCase();
  12313. if (pathLower==="_api") {
  12314. path="";
  12315. }
  12316. else if (pathLower.substr(0, "_api/".length)==="_api/") {
  12317. path=path.substr("_api/".length);
  12318. }
  12319. return {
  12320. method: request.method,
  12321. url: path,
  12322. headers: request.headers,
  12323. body: request.body
  12324. };
  12325. };
  12326. Utility._buildRequestMessageSafeArray=function (request) {
  12327. var requestFlags=0 ;
  12328. if (!Utility.isReadonlyRestRequest(request.method)) {
  12329. requestFlags=1 ;
  12330. }
  12331. var requestInfo="";
  12332. if (request.headers) {
  12333. requestInfo=request.headers[OfficeExtension.Constants.requestInfoHeader];
  12334. if (!Utility.isNullOrEmptyString(requestInfo)) {
  12335. var parts=requestInfo.split("&");
  12336. for (var i=0; i < parts.length; i++) {
  12337. var keyvalue=parts[i].split("=");
  12338. if (keyvalue[0]=="flags") {
  12339. var flags=parseInt(keyvalue[1]);
  12340. requestFlags=flags;
  12341. break;
  12342. }
  12343. }
  12344. }
  12345. }
  12346. return OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray("", requestFlags, request.method, request.url, request.headers, request.body);
  12347. };
  12348. Utility._parseHttpResponseHeaders=function (allResponseHeaders) {
  12349. var responseHeaders={};
  12350. if (!Utility.isNullOrEmptyString(allResponseHeaders)) {
  12351. var regex=new RegExp("\r?\n");
  12352. var entries=allResponseHeaders.split(regex);
  12353. for (var i=0; i < entries.length; i++) {
  12354. var entry=entries[i];
  12355. if (entry !=null) {
  12356. var index=entry.indexOf(':');
  12357. if (index > 0) {
  12358. var key=entry.substr(0, index);
  12359. var value=entry.substr(index+1);
  12360. key=Utility.trim(key);
  12361. value=Utility.trim(value);
  12362. responseHeaders[key.toUpperCase()]=value;
  12363. }
  12364. }
  12365. }
  12366. }
  12367. return responseHeaders;
  12368. };
  12369. Utility._logEnabled=false;
  12370. Utility.s_underscoreCharCode="_".charCodeAt(0);
  12371. return Utility;
  12372. })();
  12373. OfficeExtension.Utility=Utility;
  12374. })(OfficeExtension || (OfficeExtension={}));
  12375. var __extends=(this && this.__extends) || function (d, b) {
  12376. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  12377. function __() { this.constructor=d; }
  12378. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype, new __());
  12379. };
  12380. var Excel;
  12381. (function (Excel) {
  12382. function lowerCaseFirst(str) {
  12383. return str[0].toLowerCase()+str.slice(1);
  12384. }
  12385. var iconSets=["ThreeArrows",
  12386. "ThreeArrowsGray",
  12387. "ThreeFlags",
  12388. "ThreeTrafficLights1",
  12389. "ThreeTrafficLights2",
  12390. "ThreeSigns",
  12391. "ThreeSymbols",
  12392. "ThreeSymbols2",
  12393. "FourArrows",
  12394. "FourArrowsGray",
  12395. "FourRedToBlack",
  12396. "FourRating",
  12397. "FourTrafficLights",
  12398. "FiveArrows",
  12399. "FiveArrowsGray",
  12400. "FiveRating",
  12401. "FiveQuarters",
  12402. "ThreeStars",
  12403. "ThreeTriangles",
  12404. "FiveBoxes"];
  12405. var iconNames=[["RedDownArrow", "YellowSideArrow", "GreenUpArrow"],
  12406. ["GrayDownArrow", "GraySideArrow", "GrayUpArrow"],
  12407. ["RedFlag", "YellowFlag", "GreenFlag"],
  12408. ["RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  12409. ["RedTrafficLight", "YellowTrafficLight", "GreenTrafficLight"],
  12410. ["RedDiamond", "YellowTriangle", "GreenCircle"],
  12411. ["RedCrossSymbol", "YellowExclamationSymbol", "GreenCheckSymbol"],
  12412. ["RedCross", "YellowExclamation", "GreenCheck"],
  12413. ["RedDownArrow", "YellowDownInclineArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  12414. ["GrayDownArrow", "GrayDownInclineArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  12415. ["BlackCircle", "GrayCircle", "PinkCircle", "RedCircle"],
  12416. ["OneBar", "TwoBars", "ThreeBars", "FourBars"],
  12417. ["BlackCircleWithBorder", "RedCircleWithBorder", "YellowCircle", "GreenCircle"],
  12418. ["RedDownArrow", "YellowDownInclineArrow", "YellowSideArrow", "YellowUpInclineArrow", "GreenUpArrow"],
  12419. ["GrayDownArrow", "GrayDownInclineArrow", "GraySideArrow", "GrayUpInclineArrow", "GrayUpArrow"],
  12420. ["NoBars", "OneBar", "TwoBars", "ThreeBars", "FourBars"],
  12421. ["WhiteCircleAllWhiteQuarters", "CircleWithThreeWhiteQuarters", "CircleWithTwoWhiteQuarters", "CircleWithOneWhiteQuarter", "BlackCircle"],
  12422. ["SilverStar", "HalfGoldStar", "GoldStar"],
  12423. ["RedDownTriangle", "YellowDash", "GreenUpTriangle"],
  12424. ["NoFilledBoxes", "OneFilledBox", "TwoFilledBoxes", "ThreeFilledBoxes", "FourFilledBoxes"],];
  12425. Excel.icons={};
  12426. iconSets.map(function (title, i) {
  12427. var camelTitle=lowerCaseFirst(title);
  12428. Excel.icons[camelTitle]=[];
  12429. iconNames[i].map(function (iconName, j) {
  12430. iconName=lowerCaseFirst(iconName);
  12431. var obj={ set: title, index: j };
  12432. Excel.icons[camelTitle].push(obj);
  12433. Excel.icons[camelTitle][iconName]=obj;
  12434. });
  12435. });
  12436. function setRangePropertiesInBulk(range, propertyName, values) {
  12437. var maxCellCount=1500;
  12438. if (Array.isArray(values) && values.length > 0 && Array.isArray(values[0]) && (values.length * values[0].length > maxCellCount) && isExcel1_3OrAbove()) {
  12439. var maxRowCount=Math.max(1, Math.round(maxCellCount / values[0].length));
  12440. range._ValidateArraySize(values.length, values[0].length);
  12441. for (var startRowIndex=0; startRowIndex < values.length; startRowIndex+=maxRowCount) {
  12442. var rowCount=maxRowCount;
  12443. if (startRowIndex+rowCount > values.length) {
  12444. rowCount=values.length - startRowIndex;
  12445. }
  12446. var chunk=range.getRow(startRowIndex).getBoundingRect(range.getRow(startRowIndex+rowCount - 1));
  12447. var valueSlice=values.slice(startRowIndex, startRowIndex+rowCount);
  12448. _createSetPropertyAction(chunk.context, chunk, propertyName, valueSlice);
  12449. }
  12450. return true;
  12451. }
  12452. return false;
  12453. }
  12454. function isExcel1_3OrAbove() {
  12455. if (typeof (window) !=="undefined" && window.Office && window.Office.context && window.Office.context.requirements) {
  12456. return window.Office.context.requirements.isSetSupported("ExcelApi", 1.3);
  12457. }
  12458. else {
  12459. return true;
  12460. }
  12461. }
  12462. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  12463. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  12464. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  12465. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  12466. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  12467. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  12468. var _createChildItemObjectPathUsingIndexerOrGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt;
  12469. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  12470. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  12471. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  12472. var _isUndefined=OfficeExtension.Utility.isUndefined;
  12473. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  12474. var _load=OfficeExtension.Utility.load;
  12475. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  12476. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  12477. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  12478. var _adjustToDateTime=OfficeExtension.Utility.adjustToDateTime;
  12479. var Application=(function (_super) {
  12480. __extends(Application, _super);
  12481. function Application() {
  12482. _super.apply(this, arguments);
  12483. }
  12484. Object.defineProperty(Application.prototype, "calculationMode", {
  12485. get: function () {
  12486. _throwIfNotLoaded("calculationMode", this.m_calculationMode, "Application", this._isNull);
  12487. return this.m_calculationMode;
  12488. },
  12489. enumerable: true,
  12490. configurable: true
  12491. });
  12492. Application.prototype.calculate=function (calculationType) {
  12493. _createMethodAction(this.context, this, "Calculate", OfficeExtension.OperationType.Default, [calculationType]);
  12494. };
  12495. Application.prototype._handleResult=function (value) {
  12496. _super.prototype._handleResult.call(this, value);
  12497. if (_isNullOrUndefined(value))
  12498. return;
  12499. var obj=value;
  12500. _fixObjectPathIfNecessary(this, obj);
  12501. if (!_isUndefined(obj["CalculationMode"])) {
  12502. this.m_calculationMode=obj["CalculationMode"];
  12503. }
  12504. };
  12505. Application.prototype.load=function (option) {
  12506. _load(this, option);
  12507. return this;
  12508. };
  12509. Application.prototype.toJSON=function () {
  12510. return {
  12511. "calculationMode": this.m_calculationMode
  12512. };
  12513. };
  12514. return Application;
  12515. }(OfficeExtension.ClientObject));
  12516. Excel.Application=Application;
  12517. var Workbook=(function (_super) {
  12518. __extends(Workbook, _super);
  12519. function Workbook() {
  12520. _super.apply(this, arguments);
  12521. }
  12522. Object.defineProperty(Workbook.prototype, "application", {
  12523. get: function () {
  12524. if (!this.m_application) {
  12525. this.m_application=new Excel.Application(this.context, _createPropertyObjectPath(this.context, this, "Application", false, false));
  12526. }
  12527. return this.m_application;
  12528. },
  12529. enumerable: true,
  12530. configurable: true
  12531. });
  12532. Object.defineProperty(Workbook.prototype, "bindings", {
  12533. get: function () {
  12534. if (!this.m_bindings) {
  12535. this.m_bindings=new Excel.BindingCollection(this.context, _createPropertyObjectPath(this.context, this, "Bindings", true, false));
  12536. }
  12537. return this.m_bindings;
  12538. },
  12539. enumerable: true,
  12540. configurable: true
  12541. });
  12542. Object.defineProperty(Workbook.prototype, "functions", {
  12543. get: function () {
  12544. if (!this.m_functions) {
  12545. this.m_functions=new Excel.Functions(this.context, _createPropertyObjectPath(this.context, this, "Functions", false, false));
  12546. }
  12547. return this.m_functions;
  12548. },
  12549. enumerable: true,
  12550. configurable: true
  12551. });
  12552. Object.defineProperty(Workbook.prototype, "names", {
  12553. get: function () {
  12554. if (!this.m_names) {
  12555. this.m_names=new Excel.NamedItemCollection(this.context, _createPropertyObjectPath(this.context, this, "Names", true, false));
  12556. }
  12557. return this.m_names;
  12558. },
  12559. enumerable: true,
  12560. configurable: true
  12561. });
  12562. Object.defineProperty(Workbook.prototype, "pivotTables", {
  12563. get: function () {
  12564. if (!this.m_pivotTables) {
  12565. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  12566. }
  12567. return this.m_pivotTables;
  12568. },
  12569. enumerable: true,
  12570. configurable: true
  12571. });
  12572. Object.defineProperty(Workbook.prototype, "tables", {
  12573. get: function () {
  12574. if (!this.m_tables) {
  12575. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  12576. }
  12577. return this.m_tables;
  12578. },
  12579. enumerable: true,
  12580. configurable: true
  12581. });
  12582. Object.defineProperty(Workbook.prototype, "worksheets", {
  12583. get: function () {
  12584. if (!this.m_worksheets) {
  12585. this.m_worksheets=new Excel.WorksheetCollection(this.context, _createPropertyObjectPath(this.context, this, "Worksheets", true, false));
  12586. }
  12587. return this.m_worksheets;
  12588. },
  12589. enumerable: true,
  12590. configurable: true
  12591. });
  12592. Object.defineProperty(Workbook.prototype, "_V1Api", {
  12593. get: function () {
  12594. if (!this.m__V1Api) {
  12595. this.m__V1Api=new Excel._V1Api(this.context, _createPropertyObjectPath(this.context, this, "_V1Api", false, false));
  12596. }
  12597. return this.m__V1Api;
  12598. },
  12599. enumerable: true,
  12600. configurable: true
  12601. });
  12602. Workbook.prototype.getSelectedRange=function () {
  12603. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelectedRange", OfficeExtension.OperationType.Read, [], false, true, null));
  12604. };
  12605. Workbook.prototype._GetObjectByReferenceId=function (bstrReferenceId) {
  12606. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12607. var ret=new OfficeExtension.ClientResult();
  12608. _addActionResultHandler(this, action, ret);
  12609. return ret;
  12610. };
  12611. Workbook.prototype._GetObjectTypeNameByReferenceId=function (bstrReferenceId) {
  12612. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12613. var ret=new OfficeExtension.ClientResult();
  12614. _addActionResultHandler(this, action, ret);
  12615. return ret;
  12616. };
  12617. Workbook.prototype._GetReferenceCount=function () {
  12618. var action=_createMethodAction(this.context, this, "_GetReferenceCount", OfficeExtension.OperationType.Read, []);
  12619. var ret=new OfficeExtension.ClientResult();
  12620. _addActionResultHandler(this, action, ret);
  12621. return ret;
  12622. };
  12623. Workbook.prototype._RemoveAllReferences=function () {
  12624. _createMethodAction(this.context, this, "_RemoveAllReferences", OfficeExtension.OperationType.Read, []);
  12625. };
  12626. Workbook.prototype._RemoveReference=function (bstrReferenceId) {
  12627. _createMethodAction(this.context, this, "_RemoveReference", OfficeExtension.OperationType.Read, [bstrReferenceId]);
  12628. };
  12629. Workbook.prototype._handleResult=function (value) {
  12630. _super.prototype._handleResult.call(this, value);
  12631. if (_isNullOrUndefined(value))
  12632. return;
  12633. var obj=value;
  12634. _fixObjectPathIfNecessary(this, obj);
  12635. _handleNavigationPropertyResults(this, obj, ["application", "Application", "bindings", "Bindings", "functions", "Functions", "names", "Names", "pivotTables", "PivotTables", "tables", "Tables", "worksheets", "Worksheets", "_V1Api", "_V1Api"]);
  12636. };
  12637. Workbook.prototype.load=function (option) {
  12638. _load(this, option);
  12639. return this;
  12640. };
  12641. Object.defineProperty(Workbook.prototype, "onSelectionChanged", {
  12642. get: function () {
  12643. var _this=this;
  12644. if (!this.m_selectionChanged) {
  12645. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  12646. registerFunc: function (handlerCallback) {
  12647. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, handlerCallback, callback); });
  12648. },
  12649. unregisterFunc: function (handlerCallback) {
  12650. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged, { handler: handlerCallback }, callback); });
  12651. },
  12652. eventArgsTransformFunc: function (args) {
  12653. return OfficeExtension.Utility._createPromiseFromResult({ workbook: _this });
  12654. }
  12655. });
  12656. }
  12657. return this.m_selectionChanged;
  12658. },
  12659. enumerable: true,
  12660. configurable: true
  12661. });
  12662. Workbook.prototype.toJSON=function () {
  12663. return {};
  12664. };
  12665. return Workbook;
  12666. }(OfficeExtension.ClientObject));
  12667. Excel.Workbook=Workbook;
  12668. var Worksheet=(function (_super) {
  12669. __extends(Worksheet, _super);
  12670. function Worksheet() {
  12671. _super.apply(this, arguments);
  12672. }
  12673. Object.defineProperty(Worksheet.prototype, "charts", {
  12674. get: function () {
  12675. if (!this.m_charts) {
  12676. this.m_charts=new Excel.ChartCollection(this.context, _createPropertyObjectPath(this.context, this, "Charts", true, false));
  12677. }
  12678. return this.m_charts;
  12679. },
  12680. enumerable: true,
  12681. configurable: true
  12682. });
  12683. Object.defineProperty(Worksheet.prototype, "pivotTables", {
  12684. get: function () {
  12685. if (!this.m_pivotTables) {
  12686. this.m_pivotTables=new Excel.PivotTableCollection(this.context, _createPropertyObjectPath(this.context, this, "PivotTables", true, false));
  12687. }
  12688. return this.m_pivotTables;
  12689. },
  12690. enumerable: true,
  12691. configurable: true
  12692. });
  12693. Object.defineProperty(Worksheet.prototype, "protection", {
  12694. get: function () {
  12695. if (!this.m_protection) {
  12696. this.m_protection=new Excel.WorksheetProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  12697. }
  12698. return this.m_protection;
  12699. },
  12700. enumerable: true,
  12701. configurable: true
  12702. });
  12703. Object.defineProperty(Worksheet.prototype, "tables", {
  12704. get: function () {
  12705. if (!this.m_tables) {
  12706. this.m_tables=new Excel.TableCollection(this.context, _createPropertyObjectPath(this.context, this, "Tables", true, false));
  12707. }
  12708. return this.m_tables;
  12709. },
  12710. enumerable: true,
  12711. configurable: true
  12712. });
  12713. Object.defineProperty(Worksheet.prototype, "id", {
  12714. get: function () {
  12715. _throwIfNotLoaded("id", this.m_id, "Worksheet", this._isNull);
  12716. return this.m_id;
  12717. },
  12718. enumerable: true,
  12719. configurable: true
  12720. });
  12721. Object.defineProperty(Worksheet.prototype, "name", {
  12722. get: function () {
  12723. _throwIfNotLoaded("name", this.m_name, "Worksheet", this._isNull);
  12724. return this.m_name;
  12725. },
  12726. set: function (value) {
  12727. this.m_name=value;
  12728. _createSetPropertyAction(this.context, this, "Name", value);
  12729. },
  12730. enumerable: true,
  12731. configurable: true
  12732. });
  12733. Object.defineProperty(Worksheet.prototype, "position", {
  12734. get: function () {
  12735. _throwIfNotLoaded("position", this.m_position, "Worksheet", this._isNull);
  12736. return this.m_position;
  12737. },
  12738. set: function (value) {
  12739. this.m_position=value;
  12740. _createSetPropertyAction(this.context, this, "Position", value);
  12741. },
  12742. enumerable: true,
  12743. configurable: true
  12744. });
  12745. Object.defineProperty(Worksheet.prototype, "visibility", {
  12746. get: function () {
  12747. _throwIfNotLoaded("visibility", this.m_visibility, "Worksheet", this._isNull);
  12748. return this.m_visibility;
  12749. },
  12750. set: function (value) {
  12751. this.m_visibility=value;
  12752. _createSetPropertyAction(this.context, this, "Visibility", value);
  12753. },
  12754. enumerable: true,
  12755. configurable: true
  12756. });
  12757. Worksheet.prototype.activate=function () {
  12758. _createMethodAction(this.context, this, "Activate", OfficeExtension.OperationType.Read, []);
  12759. };
  12760. Worksheet.prototype.delete=function () {
  12761. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  12762. };
  12763. Worksheet.prototype.getCell=function (row, column) {
  12764. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  12765. };
  12766. Worksheet.prototype.getRange=function (address) {
  12767. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [address], false, true, null));
  12768. };
  12769. Worksheet.prototype.getUsedRange=function (valuesOnly) {
  12770. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  12771. };
  12772. Worksheet.prototype._handleResult=function (value) {
  12773. _super.prototype._handleResult.call(this, value);
  12774. if (_isNullOrUndefined(value))
  12775. return;
  12776. var obj=value;
  12777. _fixObjectPathIfNecessary(this, obj);
  12778. if (!_isUndefined(obj["Id"])) {
  12779. this.m_id=obj["Id"];
  12780. }
  12781. if (!_isUndefined(obj["Name"])) {
  12782. this.m_name=obj["Name"];
  12783. }
  12784. if (!_isUndefined(obj["Position"])) {
  12785. this.m_position=obj["Position"];
  12786. }
  12787. if (!_isUndefined(obj["Visibility"])) {
  12788. this.m_visibility=obj["Visibility"];
  12789. }
  12790. _handleNavigationPropertyResults(this, obj, ["charts", "Charts", "pivotTables", "PivotTables", "protection", "Protection", "tables", "Tables"]);
  12791. };
  12792. Worksheet.prototype.load=function (option) {
  12793. _load(this, option);
  12794. return this;
  12795. };
  12796. Worksheet.prototype._handleIdResult=function (value) {
  12797. _super.prototype._handleIdResult.call(this, value);
  12798. if (_isNullOrUndefined(value)) {
  12799. return;
  12800. }
  12801. if (!_isUndefined(value["Id"])) {
  12802. this.m_id=value["Id"];
  12803. }
  12804. };
  12805. Worksheet.prototype.toJSON=function () {
  12806. return {
  12807. "id": this.m_id,
  12808. "name": this.m_name,
  12809. "position": this.m_position,
  12810. "protection": this.m_protection,
  12811. "visibility": this.m_visibility
  12812. };
  12813. };
  12814. return Worksheet;
  12815. }(OfficeExtension.ClientObject));
  12816. Excel.Worksheet=Worksheet;
  12817. var WorksheetCollection=(function (_super) {
  12818. __extends(WorksheetCollection, _super);
  12819. function WorksheetCollection() {
  12820. _super.apply(this, arguments);
  12821. }
  12822. Object.defineProperty(WorksheetCollection.prototype, "items", {
  12823. get: function () {
  12824. _throwIfNotLoaded("items", this.m__items, "WorksheetCollection", this._isNull);
  12825. return this.m__items;
  12826. },
  12827. enumerable: true,
  12828. configurable: true
  12829. });
  12830. WorksheetCollection.prototype.add=function (name) {
  12831. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [name], false, true, null));
  12832. };
  12833. WorksheetCollection.prototype.getActiveWorksheet=function () {
  12834. return new Excel.Worksheet(this.context, _createMethodObjectPath(this.context, this, "GetActiveWorksheet", OfficeExtension.OperationType.Read, [], false, false, null));
  12835. };
  12836. WorksheetCollection.prototype.getItem=function (key) {
  12837. return new Excel.Worksheet(this.context, _createIndexerObjectPath(this.context, this, [key]));
  12838. };
  12839. WorksheetCollection.prototype._handleResult=function (value) {
  12840. _super.prototype._handleResult.call(this, value);
  12841. if (_isNullOrUndefined(value))
  12842. return;
  12843. var obj=value;
  12844. _fixObjectPathIfNecessary(this, obj);
  12845. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  12846. this.m__items=[];
  12847. var _data=obj[OfficeExtension.Constants.items];
  12848. for (var i=0; i < _data.length; i++) {
  12849. var _item=new Excel.Worksheet(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  12850. _item._handleResult(_data[i]);
  12851. this.m__items.push(_item);
  12852. }
  12853. }
  12854. };
  12855. WorksheetCollection.prototype.load=function (option) {
  12856. _load(this, option);
  12857. return this;
  12858. };
  12859. WorksheetCollection.prototype.toJSON=function () {
  12860. return {};
  12861. };
  12862. return WorksheetCollection;
  12863. }(OfficeExtension.ClientObject));
  12864. Excel.WorksheetCollection=WorksheetCollection;
  12865. var WorksheetProtection=(function (_super) {
  12866. __extends(WorksheetProtection, _super);
  12867. function WorksheetProtection() {
  12868. _super.apply(this, arguments);
  12869. }
  12870. Object.defineProperty(WorksheetProtection.prototype, "options", {
  12871. get: function () {
  12872. _throwIfNotLoaded("options", this.m_options, "WorksheetProtection", this._isNull);
  12873. return this.m_options;
  12874. },
  12875. enumerable: true,
  12876. configurable: true
  12877. });
  12878. Object.defineProperty(WorksheetProtection.prototype, "protected", {
  12879. get: function () {
  12880. _throwIfNotLoaded("protected", this.m_protected, "WorksheetProtection", this._isNull);
  12881. return this.m_protected;
  12882. },
  12883. enumerable: true,
  12884. configurable: true
  12885. });
  12886. WorksheetProtection.prototype.protect=function (options) {
  12887. _createMethodAction(this.context, this, "Protect", OfficeExtension.OperationType.Default, [options]);
  12888. };
  12889. WorksheetProtection.prototype.unprotect=function () {
  12890. _createMethodAction(this.context, this, "Unprotect", OfficeExtension.OperationType.Default, []);
  12891. };
  12892. WorksheetProtection.prototype._handleResult=function (value) {
  12893. _super.prototype._handleResult.call(this, value);
  12894. if (_isNullOrUndefined(value))
  12895. return;
  12896. var obj=value;
  12897. _fixObjectPathIfNecessary(this, obj);
  12898. if (!_isUndefined(obj["Options"])) {
  12899. this.m_options=obj["Options"];
  12900. }
  12901. if (!_isUndefined(obj["Protected"])) {
  12902. this.m_protected=obj["Protected"];
  12903. }
  12904. };
  12905. WorksheetProtection.prototype.load=function (option) {
  12906. _load(this, option);
  12907. return this;
  12908. };
  12909. WorksheetProtection.prototype.toJSON=function () {
  12910. return {
  12911. "options": this.m_options,
  12912. "protected": this.m_protected
  12913. };
  12914. };
  12915. return WorksheetProtection;
  12916. }(OfficeExtension.ClientObject));
  12917. Excel.WorksheetProtection=WorksheetProtection;
  12918. var Range=(function (_super) {
  12919. __extends(Range, _super);
  12920. function Range() {
  12921. _super.apply(this, arguments);
  12922. }
  12923. Range.prototype._ensureInteger=function (num, methodName) {
  12924. if (!(typeof num==="number" && isFinite(num) && Math.floor(num)===num)) {
  12925. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, num, methodName);
  12926. }
  12927. };
  12928. Range.prototype._getAdjacentRange=function (functionName, count, referenceRange, rowDirection, columnDirection) {
  12929. if (count==null) {
  12930. count=1;
  12931. }
  12932. this._ensureInteger(count, functionName);
  12933. var startRange;
  12934. var rowOffset=0;
  12935. var columnOffset=0;
  12936. if (count > 0) {
  12937. startRange=referenceRange.getOffsetRange(rowDirection, columnDirection);
  12938. }
  12939. else {
  12940. startRange=referenceRange;
  12941. rowOffset=rowDirection;
  12942. columnOffset=columnDirection;
  12943. }
  12944. if (Math.abs(count)==1) {
  12945. return startRange;
  12946. }
  12947. return startRange.getBoundingRect(referenceRange.getOffsetRange(rowDirection * count+rowOffset, columnDirection * count+columnOffset));
  12948. };
  12949. Object.defineProperty(Range.prototype, "format", {
  12950. get: function () {
  12951. if (!this.m_format) {
  12952. this.m_format=new Excel.RangeFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  12953. }
  12954. return this.m_format;
  12955. },
  12956. enumerable: true,
  12957. configurable: true
  12958. });
  12959. Object.defineProperty(Range.prototype, "sort", {
  12960. get: function () {
  12961. if (!this.m_sort) {
  12962. this.m_sort=new Excel.RangeSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  12963. }
  12964. return this.m_sort;
  12965. },
  12966. enumerable: true,
  12967. configurable: true
  12968. });
  12969. Object.defineProperty(Range.prototype, "worksheet", {
  12970. get: function () {
  12971. if (!this.m_worksheet) {
  12972. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  12973. }
  12974. return this.m_worksheet;
  12975. },
  12976. enumerable: true,
  12977. configurable: true
  12978. });
  12979. Object.defineProperty(Range.prototype, "address", {
  12980. get: function () {
  12981. _throwIfNotLoaded("address", this.m_address, "Range", this._isNull);
  12982. return this.m_address;
  12983. },
  12984. enumerable: true,
  12985. configurable: true
  12986. });
  12987. Object.defineProperty(Range.prototype, "addressLocal", {
  12988. get: function () {
  12989. _throwIfNotLoaded("addressLocal", this.m_addressLocal, "Range", this._isNull);
  12990. return this.m_addressLocal;
  12991. },
  12992. enumerable: true,
  12993. configurable: true
  12994. });
  12995. Object.defineProperty(Range.prototype, "cellCount", {
  12996. get: function () {
  12997. _throwIfNotLoaded("cellCount", this.m_cellCount, "Range", this._isNull);
  12998. return this.m_cellCount;
  12999. },
  13000. enumerable: true,
  13001. configurable: true
  13002. });
  13003. Object.defineProperty(Range.prototype, "columnCount", {
  13004. get: function () {
  13005. _throwIfNotLoaded("columnCount", this.m_columnCount, "Range", this._isNull);
  13006. return this.m_columnCount;
  13007. },
  13008. enumerable: true,
  13009. configurable: true
  13010. });
  13011. Object.defineProperty(Range.prototype, "columnHidden", {
  13012. get: function () {
  13013. _throwIfNotLoaded("columnHidden", this.m_columnHidden, "Range", this._isNull);
  13014. return this.m_columnHidden;
  13015. },
  13016. set: function (value) {
  13017. this.m_columnHidden=value;
  13018. _createSetPropertyAction(this.context, this, "ColumnHidden", value);
  13019. },
  13020. enumerable: true,
  13021. configurable: true
  13022. });
  13023. Object.defineProperty(Range.prototype, "columnIndex", {
  13024. get: function () {
  13025. _throwIfNotLoaded("columnIndex", this.m_columnIndex, "Range", this._isNull);
  13026. return this.m_columnIndex;
  13027. },
  13028. enumerable: true,
  13029. configurable: true
  13030. });
  13031. Object.defineProperty(Range.prototype, "formulas", {
  13032. get: function () {
  13033. _throwIfNotLoaded("formulas", this.m_formulas, "Range", this._isNull);
  13034. return this.m_formulas;
  13035. },
  13036. set: function (value) {
  13037. this.m_formulas=value;
  13038. if (setRangePropertiesInBulk(this, "Formulas", value)) {
  13039. return;
  13040. }
  13041. this.m_formulas=value;
  13042. _createSetPropertyAction(this.context, this, "Formulas", value);
  13043. },
  13044. enumerable: true,
  13045. configurable: true
  13046. });
  13047. Object.defineProperty(Range.prototype, "formulasLocal", {
  13048. get: function () {
  13049. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "Range", this._isNull);
  13050. return this.m_formulasLocal;
  13051. },
  13052. set: function (value) {
  13053. this.m_formulasLocal=value;
  13054. if (setRangePropertiesInBulk(this, "FormulasLocal", value)) {
  13055. return;
  13056. }
  13057. this.m_formulasLocal=value;
  13058. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  13059. },
  13060. enumerable: true,
  13061. configurable: true
  13062. });
  13063. Object.defineProperty(Range.prototype, "formulasR1C1", {
  13064. get: function () {
  13065. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "Range", this._isNull);
  13066. return this.m_formulasR1C1;
  13067. },
  13068. set: function (value) {
  13069. this.m_formulasR1C1=value;
  13070. if (setRangePropertiesInBulk(this, "FormulasR1C1", value)) {
  13071. return;
  13072. }
  13073. this.m_formulasR1C1=value;
  13074. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  13075. },
  13076. enumerable: true,
  13077. configurable: true
  13078. });
  13079. Object.defineProperty(Range.prototype, "hidden", {
  13080. get: function () {
  13081. _throwIfNotLoaded("hidden", this.m_hidden, "Range", this._isNull);
  13082. return this.m_hidden;
  13083. },
  13084. enumerable: true,
  13085. configurable: true
  13086. });
  13087. Object.defineProperty(Range.prototype, "numberFormat", {
  13088. get: function () {
  13089. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "Range", this._isNull);
  13090. return this.m_numberFormat;
  13091. },
  13092. set: function (value) {
  13093. this.m_numberFormat=value;
  13094. if (setRangePropertiesInBulk(this, "NumberFormat", value)) {
  13095. return;
  13096. }
  13097. this.m_numberFormat=value;
  13098. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  13099. },
  13100. enumerable: true,
  13101. configurable: true
  13102. });
  13103. Object.defineProperty(Range.prototype, "rowCount", {
  13104. get: function () {
  13105. _throwIfNotLoaded("rowCount", this.m_rowCount, "Range", this._isNull);
  13106. return this.m_rowCount;
  13107. },
  13108. enumerable: true,
  13109. configurable: true
  13110. });
  13111. Object.defineProperty(Range.prototype, "rowHidden", {
  13112. get: function () {
  13113. _throwIfNotLoaded("rowHidden", this.m_rowHidden, "Range", this._isNull);
  13114. return this.m_rowHidden;
  13115. },
  13116. set: function (value) {
  13117. this.m_rowHidden=value;
  13118. _createSetPropertyAction(this.context, this, "RowHidden", value);
  13119. },
  13120. enumerable: true,
  13121. configurable: true
  13122. });
  13123. Object.defineProperty(Range.prototype, "rowIndex", {
  13124. get: function () {
  13125. _throwIfNotLoaded("rowIndex", this.m_rowIndex, "Range", this._isNull);
  13126. return this.m_rowIndex;
  13127. },
  13128. enumerable: true,
  13129. configurable: true
  13130. });
  13131. Object.defineProperty(Range.prototype, "text", {
  13132. get: function () {
  13133. _throwIfNotLoaded("text", this.m_text, "Range", this._isNull);
  13134. return this.m_text;
  13135. },
  13136. enumerable: true,
  13137. configurable: true
  13138. });
  13139. Object.defineProperty(Range.prototype, "valueTypes", {
  13140. get: function () {
  13141. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "Range", this._isNull);
  13142. return this.m_valueTypes;
  13143. },
  13144. enumerable: true,
  13145. configurable: true
  13146. });
  13147. Object.defineProperty(Range.prototype, "values", {
  13148. get: function () {
  13149. _throwIfNotLoaded("values", this.m_values, "Range", this._isNull);
  13150. return this.m_values;
  13151. },
  13152. set: function (value) {
  13153. this.m_values=value;
  13154. if (setRangePropertiesInBulk(this, "Values", value)) {
  13155. return;
  13156. }
  13157. this.m_values=value;
  13158. _createSetPropertyAction(this.context, this, "Values", value);
  13159. },
  13160. enumerable: true,
  13161. configurable: true
  13162. });
  13163. Object.defineProperty(Range.prototype, "_ReferenceId", {
  13164. get: function () {
  13165. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId, "Range", this._isNull);
  13166. return this.m__ReferenceId;
  13167. },
  13168. enumerable: true,
  13169. configurable: true
  13170. });
  13171. Range.prototype.clear=function (applyTo) {
  13172. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, [applyTo]);
  13173. };
  13174. Range.prototype.delete=function (shift) {
  13175. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, [shift]);
  13176. };
  13177. Range.prototype.getBoundingRect=function (anotherRange) {
  13178. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetBoundingRect", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  13179. };
  13180. Range.prototype.getCell=function (row, column) {
  13181. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetCell", OfficeExtension.OperationType.Read, [row, column], false, true, null));
  13182. };
  13183. Range.prototype.getColumn=function (column) {
  13184. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumn", OfficeExtension.OperationType.Read, [column], false, true, null));
  13185. };
  13186. Range.prototype.getColumnsAfter=function (count) {
  13187. if (!isExcel1_3OrAbove()) {
  13188. if (count==null) {
  13189. count=1;
  13190. }
  13191. this._ensureInteger(count, "RowsAbove");
  13192. if (count==0) {
  13193. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13194. }
  13195. return this._getAdjacentRange("getColumnsAfter", count, this.getLastColumn(), 0, 1);
  13196. }
  13197. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsAfter", OfficeExtension.OperationType.Read, [count], false, true, null));
  13198. };
  13199. Range.prototype.getColumnsBefore=function (count) {
  13200. if (!isExcel1_3OrAbove()) {
  13201. if (count==null) {
  13202. count=1;
  13203. }
  13204. this._ensureInteger(count, "RowsAbove");
  13205. if (count==0) {
  13206. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13207. }
  13208. return this._getAdjacentRange("getColumnsBefore", count, this.getColumn(0), 0, -1);
  13209. }
  13210. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetColumnsBefore", OfficeExtension.OperationType.Read, [count], false, true, null));
  13211. };
  13212. Range.prototype.getEntireColumn=function () {
  13213. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  13214. };
  13215. Range.prototype.getEntireRow=function () {
  13216. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetEntireRow", OfficeExtension.OperationType.Read, [], false, true, null));
  13217. };
  13218. Range.prototype.getIntersection=function (anotherRange) {
  13219. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetIntersection", OfficeExtension.OperationType.Read, [anotherRange], false, true, null));
  13220. };
  13221. Range.prototype.getLastCell=function () {
  13222. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastCell", OfficeExtension.OperationType.Read, [], false, true, null));
  13223. };
  13224. Range.prototype.getLastColumn=function () {
  13225. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastColumn", OfficeExtension.OperationType.Read, [], false, true, null));
  13226. };
  13227. Range.prototype.getLastRow=function () {
  13228. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetLastRow", OfficeExtension.OperationType.Read, [], false, true, null));
  13229. };
  13230. Range.prototype.getOffsetRange=function (rowOffset, columnOffset) {
  13231. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetOffsetRange", OfficeExtension.OperationType.Read, [rowOffset, columnOffset], false, true, null));
  13232. };
  13233. Range.prototype.getResizedRange=function (deltaRows, deltaColumns) {
  13234. if (!isExcel1_3OrAbove()) {
  13235. this._ensureInteger(deltaRows, "getResizedRange");
  13236. this._ensureInteger(deltaColumns, "getResizedRange");
  13237. var referenceRange=(deltaRows >=0 && deltaColumns >=0) ? this : this.getCell(0, 0);
  13238. return referenceRange.getBoundingRect(this.getLastCell().getOffsetRange(deltaRows, deltaColumns));
  13239. }
  13240. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetResizedRange", OfficeExtension.OperationType.Read, [deltaRows, deltaColumns], false, true, null));
  13241. };
  13242. Range.prototype.getRow=function (row) {
  13243. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRow", OfficeExtension.OperationType.Read, [row], false, true, null));
  13244. };
  13245. Range.prototype.getRowsAbove=function (count) {
  13246. if (!isExcel1_3OrAbove()) {
  13247. if (count==null) {
  13248. count=1;
  13249. }
  13250. this._ensureInteger(count, "RowsAbove");
  13251. if (count==0) {
  13252. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13253. }
  13254. return this._getAdjacentRange("getRowsAbove", count, this.getRow(0), -1, 0);
  13255. }
  13256. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsAbove", OfficeExtension.OperationType.Read, [count], false, true, null));
  13257. };
  13258. Range.prototype.getRowsBelow=function (count) {
  13259. if (!isExcel1_3OrAbove()) {
  13260. if (count==null) {
  13261. count=1;
  13262. }
  13263. this._ensureInteger(count, "RowsAbove");
  13264. if (count==0) {
  13265. throw new OfficeExtension.Utility.throwError(Excel.ErrorCodes.invalidArgument, "count", "RowsAbove");
  13266. }
  13267. return this._getAdjacentRange("getRowsBelow", count, this.getLastRow(), 1, 0);
  13268. }
  13269. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRowsBelow", OfficeExtension.OperationType.Read, [count], false, true, null));
  13270. };
  13271. Range.prototype.getUsedRange=function (valuesOnly) {
  13272. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetUsedRange", OfficeExtension.OperationType.Read, [valuesOnly], false, true, null));
  13273. };
  13274. Range.prototype.getVisibleView=function () {
  13275. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetVisibleView", OfficeExtension.OperationType.Read, [], false, false, null));
  13276. };
  13277. Range.prototype.insert=function (shift) {
  13278. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "Insert", OfficeExtension.OperationType.Default, [shift], false, true, null));
  13279. };
  13280. Range.prototype.merge=function (across) {
  13281. _createMethodAction(this.context, this, "Merge", OfficeExtension.OperationType.Default, [across]);
  13282. };
  13283. Range.prototype.select=function () {
  13284. _createMethodAction(this.context, this, "Select", OfficeExtension.OperationType.Read, []);
  13285. };
  13286. Range.prototype.unmerge=function () {
  13287. _createMethodAction(this.context, this, "Unmerge", OfficeExtension.OperationType.Default, []);
  13288. };
  13289. Range.prototype._KeepReference=function () {
  13290. _createMethodAction(this.context, this, "_KeepReference", OfficeExtension.OperationType.Read, []);
  13291. };
  13292. Range.prototype._ValidateArraySize=function (rows, columns) {
  13293. _createMethodAction(this.context, this, "_ValidateArraySize", OfficeExtension.OperationType.Read, [rows, columns]);
  13294. };
  13295. Range.prototype._handleResult=function (value) {
  13296. _super.prototype._handleResult.call(this, value);
  13297. if (_isNullOrUndefined(value))
  13298. return;
  13299. var obj=value;
  13300. _fixObjectPathIfNecessary(this, obj);
  13301. if (!_isUndefined(obj["Address"])) {
  13302. this.m_address=obj["Address"];
  13303. }
  13304. if (!_isUndefined(obj["AddressLocal"])) {
  13305. this.m_addressLocal=obj["AddressLocal"];
  13306. }
  13307. if (!_isUndefined(obj["CellCount"])) {
  13308. this.m_cellCount=obj["CellCount"];
  13309. }
  13310. if (!_isUndefined(obj["ColumnCount"])) {
  13311. this.m_columnCount=obj["ColumnCount"];
  13312. }
  13313. if (!_isUndefined(obj["ColumnHidden"])) {
  13314. this.m_columnHidden=obj["ColumnHidden"];
  13315. }
  13316. if (!_isUndefined(obj["ColumnIndex"])) {
  13317. this.m_columnIndex=obj["ColumnIndex"];
  13318. }
  13319. if (!_isUndefined(obj["Formulas"])) {
  13320. this.m_formulas=obj["Formulas"];
  13321. }
  13322. if (!_isUndefined(obj["FormulasLocal"])) {
  13323. this.m_formulasLocal=obj["FormulasLocal"];
  13324. }
  13325. if (!_isUndefined(obj["FormulasR1C1"])) {
  13326. this.m_formulasR1C1=obj["FormulasR1C1"];
  13327. }
  13328. if (!_isUndefined(obj["Hidden"])) {
  13329. this.m_hidden=obj["Hidden"];
  13330. }
  13331. if (!_isUndefined(obj["NumberFormat"])) {
  13332. this.m_numberFormat=obj["NumberFormat"];
  13333. }
  13334. if (!_isUndefined(obj["RowCount"])) {
  13335. this.m_rowCount=obj["RowCount"];
  13336. }
  13337. if (!_isUndefined(obj["RowHidden"])) {
  13338. this.m_rowHidden=obj["RowHidden"];
  13339. }
  13340. if (!_isUndefined(obj["RowIndex"])) {
  13341. this.m_rowIndex=obj["RowIndex"];
  13342. }
  13343. if (!_isUndefined(obj["Text"])) {
  13344. this.m_text=obj["Text"];
  13345. }
  13346. if (!_isUndefined(obj["ValueTypes"])) {
  13347. this.m_valueTypes=obj["ValueTypes"];
  13348. }
  13349. if (!_isUndefined(obj["Values"])) {
  13350. this.m_values=obj["Values"];
  13351. }
  13352. if (!_isUndefined(obj["_ReferenceId"])) {
  13353. this.m__ReferenceId=obj["_ReferenceId"];
  13354. }
  13355. _handleNavigationPropertyResults(this, obj, ["format", "Format", "sort", "Sort", "worksheet", "Worksheet"]);
  13356. };
  13357. Range.prototype.load=function (option) {
  13358. _load(this, option);
  13359. return this;
  13360. };
  13361. Range.prototype._handleIdResult=function (value) {
  13362. _super.prototype._handleIdResult.call(this, value);
  13363. if (_isNullOrUndefined(value)) {
  13364. return;
  13365. }
  13366. if (!_isUndefined(value["_ReferenceId"])) {
  13367. this.m__ReferenceId=value["_ReferenceId"];
  13368. }
  13369. };
  13370. Range.prototype.track=function () {
  13371. this.context.trackedObjects.add(this);
  13372. return this;
  13373. };
  13374. Range.prototype.untrack=function () {
  13375. this.context.trackedObjects.remove(this);
  13376. return this;
  13377. };
  13378. Range.prototype.toJSON=function () {
  13379. return {
  13380. "address": this.m_address,
  13381. "addressLocal": this.m_addressLocal,
  13382. "cellCount": this.m_cellCount,
  13383. "columnCount": this.m_columnCount,
  13384. "columnHidden": this.m_columnHidden,
  13385. "columnIndex": this.m_columnIndex,
  13386. "format": this.m_format,
  13387. "formulas": this.m_formulas,
  13388. "formulasLocal": this.m_formulasLocal,
  13389. "formulasR1C1": this.m_formulasR1C1,
  13390. "hidden": this.m_hidden,
  13391. "numberFormat": this.m_numberFormat,
  13392. "rowCount": this.m_rowCount,
  13393. "rowHidden": this.m_rowHidden,
  13394. "rowIndex": this.m_rowIndex,
  13395. "text": this.m_text,
  13396. "values": this.m_values,
  13397. "valueTypes": this.m_valueTypes
  13398. };
  13399. };
  13400. return Range;
  13401. }(OfficeExtension.ClientObject));
  13402. Excel.Range=Range;
  13403. var RangeView=(function (_super) {
  13404. __extends(RangeView, _super);
  13405. function RangeView() {
  13406. _super.apply(this, arguments);
  13407. }
  13408. Object.defineProperty(RangeView.prototype, "rows", {
  13409. get: function () {
  13410. if (!this.m_rows) {
  13411. this.m_rows=new Excel.RangeViewCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  13412. }
  13413. return this.m_rows;
  13414. },
  13415. enumerable: true,
  13416. configurable: true
  13417. });
  13418. Object.defineProperty(RangeView.prototype, "cellAddresses", {
  13419. get: function () {
  13420. _throwIfNotLoaded("cellAddresses", this.m_cellAddresses, "RangeView", this._isNull);
  13421. return this.m_cellAddresses;
  13422. },
  13423. enumerable: true,
  13424. configurable: true
  13425. });
  13426. Object.defineProperty(RangeView.prototype, "columnCount", {
  13427. get: function () {
  13428. _throwIfNotLoaded("columnCount", this.m_columnCount, "RangeView", this._isNull);
  13429. return this.m_columnCount;
  13430. },
  13431. enumerable: true,
  13432. configurable: true
  13433. });
  13434. Object.defineProperty(RangeView.prototype, "formulas", {
  13435. get: function () {
  13436. _throwIfNotLoaded("formulas", this.m_formulas, "RangeView", this._isNull);
  13437. return this.m_formulas;
  13438. },
  13439. set: function (value) {
  13440. this.m_formulas=value;
  13441. _createSetPropertyAction(this.context, this, "Formulas", value);
  13442. },
  13443. enumerable: true,
  13444. configurable: true
  13445. });
  13446. Object.defineProperty(RangeView.prototype, "formulasLocal", {
  13447. get: function () {
  13448. _throwIfNotLoaded("formulasLocal", this.m_formulasLocal, "RangeView", this._isNull);
  13449. return this.m_formulasLocal;
  13450. },
  13451. set: function (value) {
  13452. this.m_formulasLocal=value;
  13453. _createSetPropertyAction(this.context, this, "FormulasLocal", value);
  13454. },
  13455. enumerable: true,
  13456. configurable: true
  13457. });
  13458. Object.defineProperty(RangeView.prototype, "formulasR1C1", {
  13459. get: function () {
  13460. _throwIfNotLoaded("formulasR1C1", this.m_formulasR1C1, "RangeView", this._isNull);
  13461. return this.m_formulasR1C1;
  13462. },
  13463. set: function (value) {
  13464. this.m_formulasR1C1=value;
  13465. _createSetPropertyAction(this.context, this, "FormulasR1C1", value);
  13466. },
  13467. enumerable: true,
  13468. configurable: true
  13469. });
  13470. Object.defineProperty(RangeView.prototype, "index", {
  13471. get: function () {
  13472. _throwIfNotLoaded("index", this.m_index, "RangeView", this._isNull);
  13473. return this.m_index;
  13474. },
  13475. enumerable: true,
  13476. configurable: true
  13477. });
  13478. Object.defineProperty(RangeView.prototype, "numberFormat", {
  13479. get: function () {
  13480. _throwIfNotLoaded("numberFormat", this.m_numberFormat, "RangeView", this._isNull);
  13481. return this.m_numberFormat;
  13482. },
  13483. set: function (value) {
  13484. this.m_numberFormat=value;
  13485. _createSetPropertyAction(this.context, this, "NumberFormat", value);
  13486. },
  13487. enumerable: true,
  13488. configurable: true
  13489. });
  13490. Object.defineProperty(RangeView.prototype, "rowCount", {
  13491. get: function () {
  13492. _throwIfNotLoaded("rowCount", this.m_rowCount, "RangeView", this._isNull);
  13493. return this.m_rowCount;
  13494. },
  13495. enumerable: true,
  13496. configurable: true
  13497. });
  13498. Object.defineProperty(RangeView.prototype, "text", {
  13499. get: function () {
  13500. _throwIfNotLoaded("text", this.m_text, "RangeView", this._isNull);
  13501. return this.m_text;
  13502. },
  13503. enumerable: true,
  13504. configurable: true
  13505. });
  13506. Object.defineProperty(RangeView.prototype, "valueTypes", {
  13507. get: function () {
  13508. _throwIfNotLoaded("valueTypes", this.m_valueTypes, "RangeView", this._isNull);
  13509. return this.m_valueTypes;
  13510. },
  13511. enumerable: true,
  13512. configurable: true
  13513. });
  13514. Object.defineProperty(RangeView.prototype, "values", {
  13515. get: function () {
  13516. _throwIfNotLoaded("values", this.m_values, "RangeView", this._isNull);
  13517. return this.m_values;
  13518. },
  13519. set: function (value) {
  13520. this.m_values=value;
  13521. _createSetPropertyAction(this.context, this, "Values", value);
  13522. },
  13523. enumerable: true,
  13524. configurable: true
  13525. });
  13526. RangeView.prototype.getRange=function () {
  13527. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  13528. };
  13529. RangeView.prototype._handleResult=function (value) {
  13530. _super.prototype._handleResult.call(this, value);
  13531. if (_isNullOrUndefined(value))
  13532. return;
  13533. var obj=value;
  13534. _fixObjectPathIfNecessary(this, obj);
  13535. if (!_isUndefined(obj["CellAddresses"])) {
  13536. this.m_cellAddresses=obj["CellAddresses"];
  13537. }
  13538. if (!_isUndefined(obj["ColumnCount"])) {
  13539. this.m_columnCount=obj["ColumnCount"];
  13540. }
  13541. if (!_isUndefined(obj["Formulas"])) {
  13542. this.m_formulas=obj["Formulas"];
  13543. }
  13544. if (!_isUndefined(obj["FormulasLocal"])) {
  13545. this.m_formulasLocal=obj["FormulasLocal"];
  13546. }
  13547. if (!_isUndefined(obj["FormulasR1C1"])) {
  13548. this.m_formulasR1C1=obj["FormulasR1C1"];
  13549. }
  13550. if (!_isUndefined(obj["Index"])) {
  13551. this.m_index=obj["Index"];
  13552. }
  13553. if (!_isUndefined(obj["NumberFormat"])) {
  13554. this.m_numberFormat=obj["NumberFormat"];
  13555. }
  13556. if (!_isUndefined(obj["RowCount"])) {
  13557. this.m_rowCount=obj["RowCount"];
  13558. }
  13559. if (!_isUndefined(obj["Text"])) {
  13560. this.m_text=obj["Text"];
  13561. }
  13562. if (!_isUndefined(obj["ValueTypes"])) {
  13563. this.m_valueTypes=obj["ValueTypes"];
  13564. }
  13565. if (!_isUndefined(obj["Values"])) {
  13566. this.m_values=obj["Values"];
  13567. }
  13568. _handleNavigationPropertyResults(this, obj, ["rows", "Rows"]);
  13569. };
  13570. RangeView.prototype.load=function (option) {
  13571. _load(this, option);
  13572. return this;
  13573. };
  13574. RangeView.prototype.toJSON=function () {
  13575. return {
  13576. "cellAddresses": this.m_cellAddresses,
  13577. "columnCount": this.m_columnCount,
  13578. "formulas": this.m_formulas,
  13579. "formulasLocal": this.m_formulasLocal,
  13580. "formulasR1C1": this.m_formulasR1C1,
  13581. "index": this.m_index,
  13582. "numberFormat": this.m_numberFormat,
  13583. "rowCount": this.m_rowCount,
  13584. "text": this.m_text,
  13585. "values": this.m_values,
  13586. "valueTypes": this.m_valueTypes
  13587. };
  13588. };
  13589. return RangeView;
  13590. }(OfficeExtension.ClientObject));
  13591. Excel.RangeView=RangeView;
  13592. var RangeViewCollection=(function (_super) {
  13593. __extends(RangeViewCollection, _super);
  13594. function RangeViewCollection() {
  13595. _super.apply(this, arguments);
  13596. }
  13597. Object.defineProperty(RangeViewCollection.prototype, "items", {
  13598. get: function () {
  13599. _throwIfNotLoaded("items", this.m__items, "RangeViewCollection", this._isNull);
  13600. return this.m__items;
  13601. },
  13602. enumerable: true,
  13603. configurable: true
  13604. });
  13605. RangeViewCollection.prototype.getItemAt=function (index) {
  13606. return new Excel.RangeView(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  13607. };
  13608. RangeViewCollection.prototype._handleResult=function (value) {
  13609. _super.prototype._handleResult.call(this, value);
  13610. if (_isNullOrUndefined(value))
  13611. return;
  13612. var obj=value;
  13613. _fixObjectPathIfNecessary(this, obj);
  13614. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13615. this.m__items=[];
  13616. var _data=obj[OfficeExtension.Constants.items];
  13617. for (var i=0; i < _data.length; i++) {
  13618. var _item=new Excel.RangeView(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  13619. _item._handleResult(_data[i]);
  13620. this.m__items.push(_item);
  13621. }
  13622. }
  13623. };
  13624. RangeViewCollection.prototype.load=function (option) {
  13625. _load(this, option);
  13626. return this;
  13627. };
  13628. RangeViewCollection.prototype.toJSON=function () {
  13629. return {};
  13630. };
  13631. return RangeViewCollection;
  13632. }(OfficeExtension.ClientObject));
  13633. Excel.RangeViewCollection=RangeViewCollection;
  13634. var Setting=(function (_super) {
  13635. __extends(Setting, _super);
  13636. function Setting() {
  13637. _super.apply(this, arguments);
  13638. }
  13639. Object.defineProperty(Setting.prototype, "value", {
  13640. get: function () {
  13641. return JSON.parse(this._Value);
  13642. },
  13643. set: function (value) {
  13644. this._Value=JSON.stringify(value);
  13645. },
  13646. enumerable: true,
  13647. configurable: true
  13648. });
  13649. Object.defineProperty(Setting.prototype, "key", {
  13650. get: function () {
  13651. _throwIfNotLoaded("key", this.m_key, "Setting", this._isNull);
  13652. return this.m_key;
  13653. },
  13654. enumerable: true,
  13655. configurable: true
  13656. });
  13657. Object.defineProperty(Setting.prototype, "_Value", {
  13658. get: function () {
  13659. _throwIfNotLoaded("_Value", this.m__Value, "Setting", this._isNull);
  13660. return this.m__Value;
  13661. },
  13662. set: function (value) {
  13663. this.m__Value=value;
  13664. _createSetPropertyAction(this.context, this, "_Value", value);
  13665. },
  13666. enumerable: true,
  13667. configurable: true
  13668. });
  13669. Setting.prototype.delete=function () {
  13670. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13671. };
  13672. Setting.prototype._handleResult=function (value) {
  13673. _super.prototype._handleResult.call(this, value);
  13674. if (_isNullOrUndefined(value))
  13675. return;
  13676. var obj=value;
  13677. _fixObjectPathIfNecessary(this, obj);
  13678. if (!_isUndefined(obj["Key"])) {
  13679. this.m_key=obj["Key"];
  13680. }
  13681. if (!_isUndefined(obj["_Value"])) {
  13682. this.m__Value=obj["_Value"];
  13683. }
  13684. };
  13685. Setting.prototype.load=function (option) {
  13686. _load(this, option);
  13687. return this;
  13688. };
  13689. Setting.prototype.toJSON=function () {
  13690. return {
  13691. "key": this.m_key
  13692. };
  13693. };
  13694. return Setting;
  13695. }(OfficeExtension.ClientObject));
  13696. Excel.Setting=Setting;
  13697. var NamedItemCollection=(function (_super) {
  13698. __extends(NamedItemCollection, _super);
  13699. function NamedItemCollection() {
  13700. _super.apply(this, arguments);
  13701. }
  13702. Object.defineProperty(NamedItemCollection.prototype, "items", {
  13703. get: function () {
  13704. _throwIfNotLoaded("items", this.m__items, "NamedItemCollection", this._isNull);
  13705. return this.m__items;
  13706. },
  13707. enumerable: true,
  13708. configurable: true
  13709. });
  13710. NamedItemCollection.prototype.getItem=function (name) {
  13711. return new Excel.NamedItem(this.context, _createIndexerObjectPath(this.context, this, [name]));
  13712. };
  13713. NamedItemCollection.prototype._handleResult=function (value) {
  13714. _super.prototype._handleResult.call(this, value);
  13715. if (_isNullOrUndefined(value))
  13716. return;
  13717. var obj=value;
  13718. _fixObjectPathIfNecessary(this, obj);
  13719. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  13720. this.m__items=[];
  13721. var _data=obj[OfficeExtension.Constants.items];
  13722. for (var i=0; i < _data.length; i++) {
  13723. var _item=new Excel.NamedItem(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  13724. _item._handleResult(_data[i]);
  13725. this.m__items.push(_item);
  13726. }
  13727. }
  13728. };
  13729. NamedItemCollection.prototype.load=function (option) {
  13730. _load(this, option);
  13731. return this;
  13732. };
  13733. NamedItemCollection.prototype.toJSON=function () {
  13734. return {};
  13735. };
  13736. return NamedItemCollection;
  13737. }(OfficeExtension.ClientObject));
  13738. Excel.NamedItemCollection=NamedItemCollection;
  13739. var NamedItem=(function (_super) {
  13740. __extends(NamedItem, _super);
  13741. function NamedItem() {
  13742. _super.apply(this, arguments);
  13743. }
  13744. Object.defineProperty(NamedItem.prototype, "name", {
  13745. get: function () {
  13746. _throwIfNotLoaded("name", this.m_name, "NamedItem", this._isNull);
  13747. return this.m_name;
  13748. },
  13749. enumerable: true,
  13750. configurable: true
  13751. });
  13752. Object.defineProperty(NamedItem.prototype, "type", {
  13753. get: function () {
  13754. _throwIfNotLoaded("type", this.m_type, "NamedItem", this._isNull);
  13755. return this.m_type;
  13756. },
  13757. enumerable: true,
  13758. configurable: true
  13759. });
  13760. Object.defineProperty(NamedItem.prototype, "value", {
  13761. get: function () {
  13762. _throwIfNotLoaded("value", this.m_value, "NamedItem", this._isNull);
  13763. return this.m_value;
  13764. },
  13765. enumerable: true,
  13766. configurable: true
  13767. });
  13768. Object.defineProperty(NamedItem.prototype, "visible", {
  13769. get: function () {
  13770. _throwIfNotLoaded("visible", this.m_visible, "NamedItem", this._isNull);
  13771. return this.m_visible;
  13772. },
  13773. set: function (value) {
  13774. this.m_visible=value;
  13775. _createSetPropertyAction(this.context, this, "Visible", value);
  13776. },
  13777. enumerable: true,
  13778. configurable: true
  13779. });
  13780. Object.defineProperty(NamedItem.prototype, "_Id", {
  13781. get: function () {
  13782. _throwIfNotLoaded("_Id", this.m__Id, "NamedItem", this._isNull);
  13783. return this.m__Id;
  13784. },
  13785. enumerable: true,
  13786. configurable: true
  13787. });
  13788. NamedItem.prototype.getRange=function () {
  13789. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  13790. };
  13791. NamedItem.prototype._handleResult=function (value) {
  13792. _super.prototype._handleResult.call(this, value);
  13793. if (_isNullOrUndefined(value))
  13794. return;
  13795. var obj=value;
  13796. _fixObjectPathIfNecessary(this, obj);
  13797. if (!_isUndefined(obj["Name"])) {
  13798. this.m_name=obj["Name"];
  13799. }
  13800. if (!_isUndefined(obj["Type"])) {
  13801. this.m_type=obj["Type"];
  13802. }
  13803. if (!_isUndefined(obj["Value"])) {
  13804. this.m_value=obj["Value"];
  13805. }
  13806. if (!_isUndefined(obj["Visible"])) {
  13807. this.m_visible=obj["Visible"];
  13808. }
  13809. if (!_isUndefined(obj["_Id"])) {
  13810. this.m__Id=obj["_Id"];
  13811. }
  13812. };
  13813. NamedItem.prototype.load=function (option) {
  13814. _load(this, option);
  13815. return this;
  13816. };
  13817. NamedItem.prototype._handleIdResult=function (value) {
  13818. _super.prototype._handleIdResult.call(this, value);
  13819. if (_isNullOrUndefined(value)) {
  13820. return;
  13821. }
  13822. if (!_isUndefined(value["_Id"])) {
  13823. this.m__Id=value["_Id"];
  13824. }
  13825. };
  13826. NamedItem.prototype.toJSON=function () {
  13827. return {
  13828. "name": this.m_name,
  13829. "type": this.m_type,
  13830. "value": this.m_value,
  13831. "visible": this.m_visible
  13832. };
  13833. };
  13834. return NamedItem;
  13835. }(OfficeExtension.ClientObject));
  13836. Excel.NamedItem=NamedItem;
  13837. var Binding=(function (_super) {
  13838. __extends(Binding, _super);
  13839. function Binding() {
  13840. _super.apply(this, arguments);
  13841. }
  13842. Object.defineProperty(Binding.prototype, "id", {
  13843. get: function () {
  13844. _throwIfNotLoaded("id", this.m_id, "Binding", this._isNull);
  13845. return this.m_id;
  13846. },
  13847. enumerable: true,
  13848. configurable: true
  13849. });
  13850. Object.defineProperty(Binding.prototype, "type", {
  13851. get: function () {
  13852. _throwIfNotLoaded("type", this.m_type, "Binding", this._isNull);
  13853. return this.m_type;
  13854. },
  13855. enumerable: true,
  13856. configurable: true
  13857. });
  13858. Binding.prototype.delete=function () {
  13859. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  13860. };
  13861. Binding.prototype.getRange=function () {
  13862. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, false, null));
  13863. };
  13864. Binding.prototype.getTable=function () {
  13865. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetTable", OfficeExtension.OperationType.Read, [], false, false, null));
  13866. };
  13867. Binding.prototype.getText=function () {
  13868. var action=_createMethodAction(this.context, this, "GetText", OfficeExtension.OperationType.Read, []);
  13869. var ret=new OfficeExtension.ClientResult();
  13870. _addActionResultHandler(this, action, ret);
  13871. return ret;
  13872. };
  13873. Binding.prototype._handleResult=function (value) {
  13874. _super.prototype._handleResult.call(this, value);
  13875. if (_isNullOrUndefined(value))
  13876. return;
  13877. var obj=value;
  13878. _fixObjectPathIfNecessary(this, obj);
  13879. if (!_isUndefined(obj["Id"])) {
  13880. this.m_id=obj["Id"];
  13881. }
  13882. if (!_isUndefined(obj["Type"])) {
  13883. this.m_type=obj["Type"];
  13884. }
  13885. };
  13886. Binding.prototype.load=function (option) {
  13887. _load(this, option);
  13888. return this;
  13889. };
  13890. Binding.prototype._handleIdResult=function (value) {
  13891. _super.prototype._handleIdResult.call(this, value);
  13892. if (_isNullOrUndefined(value)) {
  13893. return;
  13894. }
  13895. if (!_isUndefined(value["Id"])) {
  13896. this.m_id=value["Id"];
  13897. }
  13898. };
  13899. Object.defineProperty(Binding.prototype, "onDataChanged", {
  13900. get: function () {
  13901. var _this=this;
  13902. if (!this.m_dataChanged) {
  13903. this.m_dataChanged=new OfficeExtension.EventHandlers(this.context, this, "DataChanged", {
  13904. registerFunc: function (handlerCallback) {
  13905. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13906. .then(function (officeBinding) {
  13907. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingDataChanged, handlerCallback, callback); });
  13908. });
  13909. },
  13910. unregisterFunc: function (handlerCallback) {
  13911. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13912. .then(function (officeBinding) {
  13913. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingDataChanged, { handler: handlerCallback }, callback); });
  13914. });
  13915. },
  13916. eventArgsTransformFunc: function (args) {
  13917. var evt={
  13918. binding: _this
  13919. };
  13920. return OfficeExtension.Utility._createPromiseFromResult(evt);
  13921. }
  13922. });
  13923. }
  13924. return this.m_dataChanged;
  13925. },
  13926. enumerable: true,
  13927. configurable: true
  13928. });
  13929. Object.defineProperty(Binding.prototype, "onSelectionChanged", {
  13930. get: function () {
  13931. var _this=this;
  13932. if (!this.m_selectionChanged) {
  13933. this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context, this, "SelectionChanged", {
  13934. registerFunc: function (handlerCallback) {
  13935. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13936. .then(function (officeBinding) {
  13937. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.addHandlerAsync(Office.EventType.BindingSelectionChanged, handlerCallback, callback); });
  13938. });
  13939. },
  13940. unregisterFunc: function (handlerCallback) {
  13941. return OfficeExtension.Utility.promisify(function (callback) { return Office.context.document.bindings.getByIdAsync(_this.id, callback); })
  13942. .then(function (officeBinding) {
  13943. return OfficeExtension.Utility.promisify(function (callback) { return officeBinding.removeHandlerAsync(Office.EventType.BindingSelectionChanged, { handler: handlerCallback }, callback); });
  13944. });
  13945. },
  13946. eventArgsTransformFunc: function (args) {
  13947. var evt={
  13948. binding: _this,
  13949. columnCount: args.columnCount,
  13950. rowCount: args.rowCount,
  13951. startColumn: args.startColumn,
  13952. startRow: args.startRow
  13953. };
  13954. return OfficeExtension.Utility._createPromiseFromResult(evt);
  13955. }
  13956. });
  13957. }
  13958. return this.m_selectionChanged;
  13959. },
  13960. enumerable: true,
  13961. configurable: true
  13962. });
  13963. Binding.prototype.toJSON=function () {
  13964. return {
  13965. "id": this.m_id,
  13966. "type": this.m_type
  13967. };
  13968. };
  13969. return Binding;
  13970. }(OfficeExtension.ClientObject));
  13971. Excel.Binding=Binding;
  13972. var BindingCollection=(function (_super) {
  13973. __extends(BindingCollection, _super);
  13974. function BindingCollection() {
  13975. _super.apply(this, arguments);
  13976. }
  13977. Object.defineProperty(BindingCollection.prototype, "items", {
  13978. get: function () {
  13979. _throwIfNotLoaded("items", this.m__items, "BindingCollection", this._isNull);
  13980. return this.m__items;
  13981. },
  13982. enumerable: true,
  13983. configurable: true
  13984. });
  13985. Object.defineProperty(BindingCollection.prototype, "count", {
  13986. get: function () {
  13987. _throwIfNotLoaded("count", this.m_count, "BindingCollection", this._isNull);
  13988. return this.m_count;
  13989. },
  13990. enumerable: true,
  13991. configurable: true
  13992. });
  13993. BindingCollection.prototype.add=function (range, bindingType, id) {
  13994. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [range, bindingType, id], false, true, null));
  13995. };
  13996. BindingCollection.prototype.addFromNamedItem=function (name, bindingType, id) {
  13997. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromNamedItem", OfficeExtension.OperationType.Default, [name, bindingType, id], false, false, null));
  13998. };
  13999. BindingCollection.prototype.addFromSelection=function (bindingType, id) {
  14000. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "AddFromSelection", OfficeExtension.OperationType.Default, [bindingType, id], false, false, null));
  14001. };
  14002. BindingCollection.prototype.getItem=function (id) {
  14003. return new Excel.Binding(this.context, _createIndexerObjectPath(this.context, this, [id]));
  14004. };
  14005. BindingCollection.prototype.getItemAt=function (index) {
  14006. return new Excel.Binding(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14007. };
  14008. BindingCollection.prototype._handleResult=function (value) {
  14009. _super.prototype._handleResult.call(this, value);
  14010. if (_isNullOrUndefined(value))
  14011. return;
  14012. var obj=value;
  14013. _fixObjectPathIfNecessary(this, obj);
  14014. if (!_isUndefined(obj["Count"])) {
  14015. this.m_count=obj["Count"];
  14016. }
  14017. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14018. this.m__items=[];
  14019. var _data=obj[OfficeExtension.Constants.items];
  14020. for (var i=0; i < _data.length; i++) {
  14021. var _item=new Excel.Binding(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14022. _item._handleResult(_data[i]);
  14023. this.m__items.push(_item);
  14024. }
  14025. }
  14026. };
  14027. BindingCollection.prototype.load=function (option) {
  14028. _load(this, option);
  14029. return this;
  14030. };
  14031. BindingCollection.prototype.toJSON=function () {
  14032. return {
  14033. "count": this.m_count
  14034. };
  14035. };
  14036. return BindingCollection;
  14037. }(OfficeExtension.ClientObject));
  14038. Excel.BindingCollection=BindingCollection;
  14039. var TableCollection=(function (_super) {
  14040. __extends(TableCollection, _super);
  14041. function TableCollection() {
  14042. _super.apply(this, arguments);
  14043. }
  14044. Object.defineProperty(TableCollection.prototype, "items", {
  14045. get: function () {
  14046. _throwIfNotLoaded("items", this.m__items, "TableCollection", this._isNull);
  14047. return this.m__items;
  14048. },
  14049. enumerable: true,
  14050. configurable: true
  14051. });
  14052. Object.defineProperty(TableCollection.prototype, "count", {
  14053. get: function () {
  14054. _throwIfNotLoaded("count", this.m_count, "TableCollection", this._isNull);
  14055. return this.m_count;
  14056. },
  14057. enumerable: true,
  14058. configurable: true
  14059. });
  14060. TableCollection.prototype.add=function (address, hasHeaders) {
  14061. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [address, hasHeaders], false, true, null));
  14062. };
  14063. TableCollection.prototype.getItem=function (key) {
  14064. return new Excel.Table(this.context, _createIndexerObjectPath(this.context, this, [key]));
  14065. };
  14066. TableCollection.prototype.getItemAt=function (index) {
  14067. return new Excel.Table(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14068. };
  14069. TableCollection.prototype._handleResult=function (value) {
  14070. _super.prototype._handleResult.call(this, value);
  14071. if (_isNullOrUndefined(value))
  14072. return;
  14073. var obj=value;
  14074. _fixObjectPathIfNecessary(this, obj);
  14075. if (!_isUndefined(obj["Count"])) {
  14076. this.m_count=obj["Count"];
  14077. }
  14078. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14079. this.m__items=[];
  14080. var _data=obj[OfficeExtension.Constants.items];
  14081. for (var i=0; i < _data.length; i++) {
  14082. var _item=new Excel.Table(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14083. _item._handleResult(_data[i]);
  14084. this.m__items.push(_item);
  14085. }
  14086. }
  14087. };
  14088. TableCollection.prototype.load=function (option) {
  14089. _load(this, option);
  14090. return this;
  14091. };
  14092. TableCollection.prototype.toJSON=function () {
  14093. return {
  14094. "count": this.m_count
  14095. };
  14096. };
  14097. return TableCollection;
  14098. }(OfficeExtension.ClientObject));
  14099. Excel.TableCollection=TableCollection;
  14100. var Table=(function (_super) {
  14101. __extends(Table, _super);
  14102. function Table() {
  14103. _super.apply(this, arguments);
  14104. }
  14105. Object.defineProperty(Table.prototype, "columns", {
  14106. get: function () {
  14107. if (!this.m_columns) {
  14108. this.m_columns=new Excel.TableColumnCollection(this.context, _createPropertyObjectPath(this.context, this, "Columns", true, false));
  14109. }
  14110. return this.m_columns;
  14111. },
  14112. enumerable: true,
  14113. configurable: true
  14114. });
  14115. Object.defineProperty(Table.prototype, "rows", {
  14116. get: function () {
  14117. if (!this.m_rows) {
  14118. this.m_rows=new Excel.TableRowCollection(this.context, _createPropertyObjectPath(this.context, this, "Rows", true, false));
  14119. }
  14120. return this.m_rows;
  14121. },
  14122. enumerable: true,
  14123. configurable: true
  14124. });
  14125. Object.defineProperty(Table.prototype, "sort", {
  14126. get: function () {
  14127. if (!this.m_sort) {
  14128. this.m_sort=new Excel.TableSort(this.context, _createPropertyObjectPath(this.context, this, "Sort", false, false));
  14129. }
  14130. return this.m_sort;
  14131. },
  14132. enumerable: true,
  14133. configurable: true
  14134. });
  14135. Object.defineProperty(Table.prototype, "worksheet", {
  14136. get: function () {
  14137. if (!this.m_worksheet) {
  14138. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  14139. }
  14140. return this.m_worksheet;
  14141. },
  14142. enumerable: true,
  14143. configurable: true
  14144. });
  14145. Object.defineProperty(Table.prototype, "highlightFirstColumn", {
  14146. get: function () {
  14147. _throwIfNotLoaded("highlightFirstColumn", this.m_highlightFirstColumn, "Table", this._isNull);
  14148. return this.m_highlightFirstColumn;
  14149. },
  14150. set: function (value) {
  14151. this.m_highlightFirstColumn=value;
  14152. _createSetPropertyAction(this.context, this, "HighlightFirstColumn", value);
  14153. },
  14154. enumerable: true,
  14155. configurable: true
  14156. });
  14157. Object.defineProperty(Table.prototype, "highlightLastColumn", {
  14158. get: function () {
  14159. _throwIfNotLoaded("highlightLastColumn", this.m_highlightLastColumn, "Table", this._isNull);
  14160. return this.m_highlightLastColumn;
  14161. },
  14162. set: function (value) {
  14163. this.m_highlightLastColumn=value;
  14164. _createSetPropertyAction(this.context, this, "HighlightLastColumn", value);
  14165. },
  14166. enumerable: true,
  14167. configurable: true
  14168. });
  14169. Object.defineProperty(Table.prototype, "id", {
  14170. get: function () {
  14171. _throwIfNotLoaded("id", this.m_id, "Table", this._isNull);
  14172. return this.m_id;
  14173. },
  14174. enumerable: true,
  14175. configurable: true
  14176. });
  14177. Object.defineProperty(Table.prototype, "name", {
  14178. get: function () {
  14179. _throwIfNotLoaded("name", this.m_name, "Table", this._isNull);
  14180. return this.m_name;
  14181. },
  14182. set: function (value) {
  14183. this.m_name=value;
  14184. _createSetPropertyAction(this.context, this, "Name", value);
  14185. },
  14186. enumerable: true,
  14187. configurable: true
  14188. });
  14189. Object.defineProperty(Table.prototype, "showBandedColumns", {
  14190. get: function () {
  14191. _throwIfNotLoaded("showBandedColumns", this.m_showBandedColumns, "Table", this._isNull);
  14192. return this.m_showBandedColumns;
  14193. },
  14194. set: function (value) {
  14195. this.m_showBandedColumns=value;
  14196. _createSetPropertyAction(this.context, this, "ShowBandedColumns", value);
  14197. },
  14198. enumerable: true,
  14199. configurable: true
  14200. });
  14201. Object.defineProperty(Table.prototype, "showBandedRows", {
  14202. get: function () {
  14203. _throwIfNotLoaded("showBandedRows", this.m_showBandedRows, "Table", this._isNull);
  14204. return this.m_showBandedRows;
  14205. },
  14206. set: function (value) {
  14207. this.m_showBandedRows=value;
  14208. _createSetPropertyAction(this.context, this, "ShowBandedRows", value);
  14209. },
  14210. enumerable: true,
  14211. configurable: true
  14212. });
  14213. Object.defineProperty(Table.prototype, "showFilterButton", {
  14214. get: function () {
  14215. _throwIfNotLoaded("showFilterButton", this.m_showFilterButton, "Table", this._isNull);
  14216. return this.m_showFilterButton;
  14217. },
  14218. set: function (value) {
  14219. this.m_showFilterButton=value;
  14220. _createSetPropertyAction(this.context, this, "ShowFilterButton", value);
  14221. },
  14222. enumerable: true,
  14223. configurable: true
  14224. });
  14225. Object.defineProperty(Table.prototype, "showHeaders", {
  14226. get: function () {
  14227. _throwIfNotLoaded("showHeaders", this.m_showHeaders, "Table", this._isNull);
  14228. return this.m_showHeaders;
  14229. },
  14230. set: function (value) {
  14231. this.m_showHeaders=value;
  14232. _createSetPropertyAction(this.context, this, "ShowHeaders", value);
  14233. },
  14234. enumerable: true,
  14235. configurable: true
  14236. });
  14237. Object.defineProperty(Table.prototype, "showTotals", {
  14238. get: function () {
  14239. _throwIfNotLoaded("showTotals", this.m_showTotals, "Table", this._isNull);
  14240. return this.m_showTotals;
  14241. },
  14242. set: function (value) {
  14243. this.m_showTotals=value;
  14244. _createSetPropertyAction(this.context, this, "ShowTotals", value);
  14245. },
  14246. enumerable: true,
  14247. configurable: true
  14248. });
  14249. Object.defineProperty(Table.prototype, "style", {
  14250. get: function () {
  14251. _throwIfNotLoaded("style", this.m_style, "Table", this._isNull);
  14252. return this.m_style;
  14253. },
  14254. set: function (value) {
  14255. this.m_style=value;
  14256. _createSetPropertyAction(this.context, this, "Style", value);
  14257. },
  14258. enumerable: true,
  14259. configurable: true
  14260. });
  14261. Table.prototype.clearFilters=function () {
  14262. _createMethodAction(this.context, this, "ClearFilters", OfficeExtension.OperationType.Default, []);
  14263. };
  14264. Table.prototype.convertToRange=function () {
  14265. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "ConvertToRange", OfficeExtension.OperationType.Default, [], false, true, null));
  14266. };
  14267. Table.prototype.delete=function () {
  14268. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14269. };
  14270. Table.prototype.getDataBodyRange=function () {
  14271. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14272. };
  14273. Table.prototype.getHeaderRowRange=function () {
  14274. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14275. };
  14276. Table.prototype.getRange=function () {
  14277. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14278. };
  14279. Table.prototype.getTotalRowRange=function () {
  14280. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14281. };
  14282. Table.prototype.reapplyFilters=function () {
  14283. _createMethodAction(this.context, this, "ReapplyFilters", OfficeExtension.OperationType.Default, []);
  14284. };
  14285. Table.prototype._handleResult=function (value) {
  14286. _super.prototype._handleResult.call(this, value);
  14287. if (_isNullOrUndefined(value))
  14288. return;
  14289. var obj=value;
  14290. _fixObjectPathIfNecessary(this, obj);
  14291. if (!_isUndefined(obj["HighlightFirstColumn"])) {
  14292. this.m_highlightFirstColumn=obj["HighlightFirstColumn"];
  14293. }
  14294. if (!_isUndefined(obj["HighlightLastColumn"])) {
  14295. this.m_highlightLastColumn=obj["HighlightLastColumn"];
  14296. }
  14297. if (!_isUndefined(obj["Id"])) {
  14298. this.m_id=obj["Id"];
  14299. }
  14300. if (!_isUndefined(obj["Name"])) {
  14301. this.m_name=obj["Name"];
  14302. }
  14303. if (!_isUndefined(obj["ShowBandedColumns"])) {
  14304. this.m_showBandedColumns=obj["ShowBandedColumns"];
  14305. }
  14306. if (!_isUndefined(obj["ShowBandedRows"])) {
  14307. this.m_showBandedRows=obj["ShowBandedRows"];
  14308. }
  14309. if (!_isUndefined(obj["ShowFilterButton"])) {
  14310. this.m_showFilterButton=obj["ShowFilterButton"];
  14311. }
  14312. if (!_isUndefined(obj["ShowHeaders"])) {
  14313. this.m_showHeaders=obj["ShowHeaders"];
  14314. }
  14315. if (!_isUndefined(obj["ShowTotals"])) {
  14316. this.m_showTotals=obj["ShowTotals"];
  14317. }
  14318. if (!_isUndefined(obj["Style"])) {
  14319. this.m_style=obj["Style"];
  14320. }
  14321. _handleNavigationPropertyResults(this, obj, ["columns", "Columns", "rows", "Rows", "sort", "Sort", "worksheet", "Worksheet"]);
  14322. };
  14323. Table.prototype.load=function (option) {
  14324. _load(this, option);
  14325. return this;
  14326. };
  14327. Table.prototype._handleIdResult=function (value) {
  14328. _super.prototype._handleIdResult.call(this, value);
  14329. if (_isNullOrUndefined(value)) {
  14330. return;
  14331. }
  14332. if (!_isUndefined(value["Id"])) {
  14333. this.m_id=value["Id"];
  14334. }
  14335. };
  14336. Table.prototype.toJSON=function () {
  14337. return {
  14338. "highlightFirstColumn": this.m_highlightFirstColumn,
  14339. "highlightLastColumn": this.m_highlightLastColumn,
  14340. "id": this.m_id,
  14341. "name": this.m_name,
  14342. "showBandedColumns": this.m_showBandedColumns,
  14343. "showBandedRows": this.m_showBandedRows,
  14344. "showFilterButton": this.m_showFilterButton,
  14345. "showHeaders": this.m_showHeaders,
  14346. "showTotals": this.m_showTotals,
  14347. "style": this.m_style
  14348. };
  14349. };
  14350. return Table;
  14351. }(OfficeExtension.ClientObject));
  14352. Excel.Table=Table;
  14353. var TableColumnCollection=(function (_super) {
  14354. __extends(TableColumnCollection, _super);
  14355. function TableColumnCollection() {
  14356. _super.apply(this, arguments);
  14357. }
  14358. Object.defineProperty(TableColumnCollection.prototype, "items", {
  14359. get: function () {
  14360. _throwIfNotLoaded("items", this.m__items, "TableColumnCollection", this._isNull);
  14361. return this.m__items;
  14362. },
  14363. enumerable: true,
  14364. configurable: true
  14365. });
  14366. Object.defineProperty(TableColumnCollection.prototype, "count", {
  14367. get: function () {
  14368. _throwIfNotLoaded("count", this.m_count, "TableColumnCollection", this._isNull);
  14369. return this.m_count;
  14370. },
  14371. enumerable: true,
  14372. configurable: true
  14373. });
  14374. TableColumnCollection.prototype.add=function (index, values) {
  14375. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  14376. };
  14377. TableColumnCollection.prototype.getItem=function (key) {
  14378. return new Excel.TableColumn(this.context, _createIndexerObjectPath(this.context, this, [key]));
  14379. };
  14380. TableColumnCollection.prototype.getItemAt=function (index) {
  14381. return new Excel.TableColumn(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14382. };
  14383. TableColumnCollection.prototype._handleResult=function (value) {
  14384. _super.prototype._handleResult.call(this, value);
  14385. if (_isNullOrUndefined(value))
  14386. return;
  14387. var obj=value;
  14388. _fixObjectPathIfNecessary(this, obj);
  14389. if (!_isUndefined(obj["Count"])) {
  14390. this.m_count=obj["Count"];
  14391. }
  14392. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14393. this.m__items=[];
  14394. var _data=obj[OfficeExtension.Constants.items];
  14395. for (var i=0; i < _data.length; i++) {
  14396. var _item=new Excel.TableColumn(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  14397. _item._handleResult(_data[i]);
  14398. this.m__items.push(_item);
  14399. }
  14400. }
  14401. };
  14402. TableColumnCollection.prototype.load=function (option) {
  14403. _load(this, option);
  14404. return this;
  14405. };
  14406. TableColumnCollection.prototype.toJSON=function () {
  14407. return {
  14408. "count": this.m_count
  14409. };
  14410. };
  14411. return TableColumnCollection;
  14412. }(OfficeExtension.ClientObject));
  14413. Excel.TableColumnCollection=TableColumnCollection;
  14414. var TableColumn=(function (_super) {
  14415. __extends(TableColumn, _super);
  14416. function TableColumn() {
  14417. _super.apply(this, arguments);
  14418. }
  14419. Object.defineProperty(TableColumn.prototype, "filter", {
  14420. get: function () {
  14421. if (!this.m_filter) {
  14422. this.m_filter=new Excel.Filter(this.context, _createPropertyObjectPath(this.context, this, "Filter", false, false));
  14423. }
  14424. return this.m_filter;
  14425. },
  14426. enumerable: true,
  14427. configurable: true
  14428. });
  14429. Object.defineProperty(TableColumn.prototype, "id", {
  14430. get: function () {
  14431. _throwIfNotLoaded("id", this.m_id, "TableColumn", this._isNull);
  14432. return this.m_id;
  14433. },
  14434. enumerable: true,
  14435. configurable: true
  14436. });
  14437. Object.defineProperty(TableColumn.prototype, "index", {
  14438. get: function () {
  14439. _throwIfNotLoaded("index", this.m_index, "TableColumn", this._isNull);
  14440. return this.m_index;
  14441. },
  14442. enumerable: true,
  14443. configurable: true
  14444. });
  14445. Object.defineProperty(TableColumn.prototype, "name", {
  14446. get: function () {
  14447. _throwIfNotLoaded("name", this.m_name, "TableColumn", this._isNull);
  14448. return this.m_name;
  14449. },
  14450. enumerable: true,
  14451. configurable: true
  14452. });
  14453. Object.defineProperty(TableColumn.prototype, "values", {
  14454. get: function () {
  14455. _throwIfNotLoaded("values", this.m_values, "TableColumn", this._isNull);
  14456. return this.m_values;
  14457. },
  14458. set: function (value) {
  14459. this.m_values=value;
  14460. _createSetPropertyAction(this.context, this, "Values", value);
  14461. },
  14462. enumerable: true,
  14463. configurable: true
  14464. });
  14465. TableColumn.prototype.delete=function () {
  14466. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14467. };
  14468. TableColumn.prototype.getDataBodyRange=function () {
  14469. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetDataBodyRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14470. };
  14471. TableColumn.prototype.getHeaderRowRange=function () {
  14472. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetHeaderRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14473. };
  14474. TableColumn.prototype.getRange=function () {
  14475. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14476. };
  14477. TableColumn.prototype.getTotalRowRange=function () {
  14478. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetTotalRowRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14479. };
  14480. TableColumn.prototype._handleResult=function (value) {
  14481. _super.prototype._handleResult.call(this, value);
  14482. if (_isNullOrUndefined(value))
  14483. return;
  14484. var obj=value;
  14485. _fixObjectPathIfNecessary(this, obj);
  14486. if (!_isUndefined(obj["Id"])) {
  14487. this.m_id=obj["Id"];
  14488. }
  14489. if (!_isUndefined(obj["Index"])) {
  14490. this.m_index=obj["Index"];
  14491. }
  14492. if (!_isUndefined(obj["Name"])) {
  14493. this.m_name=obj["Name"];
  14494. }
  14495. if (!_isUndefined(obj["Values"])) {
  14496. this.m_values=obj["Values"];
  14497. }
  14498. _handleNavigationPropertyResults(this, obj, ["filter", "Filter"]);
  14499. };
  14500. TableColumn.prototype.load=function (option) {
  14501. _load(this, option);
  14502. return this;
  14503. };
  14504. TableColumn.prototype._handleIdResult=function (value) {
  14505. _super.prototype._handleIdResult.call(this, value);
  14506. if (_isNullOrUndefined(value)) {
  14507. return;
  14508. }
  14509. if (!_isUndefined(value["Id"])) {
  14510. this.m_id=value["Id"];
  14511. }
  14512. };
  14513. TableColumn.prototype.toJSON=function () {
  14514. return {
  14515. "id": this.m_id,
  14516. "index": this.m_index,
  14517. "name": this.m_name,
  14518. "values": this.m_values
  14519. };
  14520. };
  14521. return TableColumn;
  14522. }(OfficeExtension.ClientObject));
  14523. Excel.TableColumn=TableColumn;
  14524. var TableRowCollection=(function (_super) {
  14525. __extends(TableRowCollection, _super);
  14526. function TableRowCollection() {
  14527. _super.apply(this, arguments);
  14528. }
  14529. Object.defineProperty(TableRowCollection.prototype, "items", {
  14530. get: function () {
  14531. _throwIfNotLoaded("items", this.m__items, "TableRowCollection", this._isNull);
  14532. return this.m__items;
  14533. },
  14534. enumerable: true,
  14535. configurable: true
  14536. });
  14537. Object.defineProperty(TableRowCollection.prototype, "count", {
  14538. get: function () {
  14539. _throwIfNotLoaded("count", this.m_count, "TableRowCollection", this._isNull);
  14540. return this.m_count;
  14541. },
  14542. enumerable: true,
  14543. configurable: true
  14544. });
  14545. TableRowCollection.prototype.add=function (index, values) {
  14546. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [index, values], false, true, null));
  14547. };
  14548. TableRowCollection.prototype.getItemAt=function (index) {
  14549. return new Excel.TableRow(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14550. };
  14551. TableRowCollection.prototype._handleResult=function (value) {
  14552. _super.prototype._handleResult.call(this, value);
  14553. if (_isNullOrUndefined(value))
  14554. return;
  14555. var obj=value;
  14556. _fixObjectPathIfNecessary(this, obj);
  14557. if (!_isUndefined(obj["Count"])) {
  14558. this.m_count=obj["Count"];
  14559. }
  14560. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  14561. this.m__items=[];
  14562. var _data=obj[OfficeExtension.Constants.items];
  14563. for (var i=0; i < _data.length; i++) {
  14564. var _item=new Excel.TableRow(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  14565. _item._handleResult(_data[i]);
  14566. this.m__items.push(_item);
  14567. }
  14568. }
  14569. };
  14570. TableRowCollection.prototype.load=function (option) {
  14571. _load(this, option);
  14572. return this;
  14573. };
  14574. TableRowCollection.prototype.toJSON=function () {
  14575. return {
  14576. "count": this.m_count
  14577. };
  14578. };
  14579. return TableRowCollection;
  14580. }(OfficeExtension.ClientObject));
  14581. Excel.TableRowCollection=TableRowCollection;
  14582. var TableRow=(function (_super) {
  14583. __extends(TableRow, _super);
  14584. function TableRow() {
  14585. _super.apply(this, arguments);
  14586. }
  14587. Object.defineProperty(TableRow.prototype, "index", {
  14588. get: function () {
  14589. _throwIfNotLoaded("index", this.m_index, "TableRow", this._isNull);
  14590. return this.m_index;
  14591. },
  14592. enumerable: true,
  14593. configurable: true
  14594. });
  14595. Object.defineProperty(TableRow.prototype, "values", {
  14596. get: function () {
  14597. _throwIfNotLoaded("values", this.m_values, "TableRow", this._isNull);
  14598. return this.m_values;
  14599. },
  14600. set: function (value) {
  14601. this.m_values=value;
  14602. _createSetPropertyAction(this.context, this, "Values", value);
  14603. },
  14604. enumerable: true,
  14605. configurable: true
  14606. });
  14607. TableRow.prototype.delete=function () {
  14608. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  14609. };
  14610. TableRow.prototype.getRange=function () {
  14611. return new Excel.Range(this.context, _createMethodObjectPath(this.context, this, "GetRange", OfficeExtension.OperationType.Read, [], false, true, null));
  14612. };
  14613. TableRow.prototype._handleResult=function (value) {
  14614. _super.prototype._handleResult.call(this, value);
  14615. if (_isNullOrUndefined(value))
  14616. return;
  14617. var obj=value;
  14618. _fixObjectPathIfNecessary(this, obj);
  14619. if (!_isUndefined(obj["Index"])) {
  14620. this.m_index=obj["Index"];
  14621. }
  14622. if (!_isUndefined(obj["Values"])) {
  14623. this.m_values=obj["Values"];
  14624. }
  14625. };
  14626. TableRow.prototype.load=function (option) {
  14627. _load(this, option);
  14628. return this;
  14629. };
  14630. TableRow.prototype.toJSON=function () {
  14631. return {
  14632. "index": this.m_index,
  14633. "values": this.m_values
  14634. };
  14635. };
  14636. return TableRow;
  14637. }(OfficeExtension.ClientObject));
  14638. Excel.TableRow=TableRow;
  14639. var RangeFormat=(function (_super) {
  14640. __extends(RangeFormat, _super);
  14641. function RangeFormat() {
  14642. _super.apply(this, arguments);
  14643. }
  14644. Object.defineProperty(RangeFormat.prototype, "borders", {
  14645. get: function () {
  14646. if (!this.m_borders) {
  14647. this.m_borders=new Excel.RangeBorderCollection(this.context, _createPropertyObjectPath(this.context, this, "Borders", true, false));
  14648. }
  14649. return this.m_borders;
  14650. },
  14651. enumerable: true,
  14652. configurable: true
  14653. });
  14654. Object.defineProperty(RangeFormat.prototype, "fill", {
  14655. get: function () {
  14656. if (!this.m_fill) {
  14657. this.m_fill=new Excel.RangeFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  14658. }
  14659. return this.m_fill;
  14660. },
  14661. enumerable: true,
  14662. configurable: true
  14663. });
  14664. Object.defineProperty(RangeFormat.prototype, "font", {
  14665. get: function () {
  14666. if (!this.m_font) {
  14667. this.m_font=new Excel.RangeFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  14668. }
  14669. return this.m_font;
  14670. },
  14671. enumerable: true,
  14672. configurable: true
  14673. });
  14674. Object.defineProperty(RangeFormat.prototype, "protection", {
  14675. get: function () {
  14676. if (!this.m_protection) {
  14677. this.m_protection=new Excel.FormatProtection(this.context, _createPropertyObjectPath(this.context, this, "Protection", false, false));
  14678. }
  14679. return this.m_protection;
  14680. },
  14681. enumerable: true,
  14682. configurable: true
  14683. });
  14684. Object.defineProperty(RangeFormat.prototype, "columnWidth", {
  14685. get: function () {
  14686. _throwIfNotLoaded("columnWidth", this.m_columnWidth, "RangeFormat", this._isNull);
  14687. return this.m_columnWidth;
  14688. },
  14689. set: function (value) {
  14690. this.m_columnWidth=value;
  14691. _createSetPropertyAction(this.context, this, "ColumnWidth", value);
  14692. },
  14693. enumerable: true,
  14694. configurable: true
  14695. });
  14696. Object.defineProperty(RangeFormat.prototype, "horizontalAlignment", {
  14697. get: function () {
  14698. _throwIfNotLoaded("horizontalAlignment", this.m_horizontalAlignment, "RangeFormat", this._isNull);
  14699. return this.m_horizontalAlignment;
  14700. },
  14701. set: function (value) {
  14702. this.m_horizontalAlignment=value;
  14703. _createSetPropertyAction(this.context, this, "HorizontalAlignment", value);
  14704. },
  14705. enumerable: true,
  14706. configurable: true
  14707. });
  14708. Object.defineProperty(RangeFormat.prototype, "rowHeight", {
  14709. get: function () {
  14710. _throwIfNotLoaded("rowHeight", this.m_rowHeight, "RangeFormat", this._isNull);
  14711. return this.m_rowHeight;
  14712. },
  14713. set: function (value) {
  14714. this.m_rowHeight=value;
  14715. _createSetPropertyAction(this.context, this, "RowHeight", value);
  14716. },
  14717. enumerable: true,
  14718. configurable: true
  14719. });
  14720. Object.defineProperty(RangeFormat.prototype, "verticalAlignment", {
  14721. get: function () {
  14722. _throwIfNotLoaded("verticalAlignment", this.m_verticalAlignment, "RangeFormat", this._isNull);
  14723. return this.m_verticalAlignment;
  14724. },
  14725. set: function (value) {
  14726. this.m_verticalAlignment=value;
  14727. _createSetPropertyAction(this.context, this, "VerticalAlignment", value);
  14728. },
  14729. enumerable: true,
  14730. configurable: true
  14731. });
  14732. Object.defineProperty(RangeFormat.prototype, "wrapText", {
  14733. get: function () {
  14734. _throwIfNotLoaded("wrapText", this.m_wrapText, "RangeFormat", this._isNull);
  14735. return this.m_wrapText;
  14736. },
  14737. set: function (value) {
  14738. this.m_wrapText=value;
  14739. _createSetPropertyAction(this.context, this, "WrapText", value);
  14740. },
  14741. enumerable: true,
  14742. configurable: true
  14743. });
  14744. RangeFormat.prototype.autofitColumns=function () {
  14745. _createMethodAction(this.context, this, "AutofitColumns", OfficeExtension.OperationType.Default, []);
  14746. };
  14747. RangeFormat.prototype.autofitRows=function () {
  14748. _createMethodAction(this.context, this, "AutofitRows", OfficeExtension.OperationType.Default, []);
  14749. };
  14750. RangeFormat.prototype._handleResult=function (value) {
  14751. _super.prototype._handleResult.call(this, value);
  14752. if (_isNullOrUndefined(value))
  14753. return;
  14754. var obj=value;
  14755. _fixObjectPathIfNecessary(this, obj);
  14756. if (!_isUndefined(obj["ColumnWidth"])) {
  14757. this.m_columnWidth=obj["ColumnWidth"];
  14758. }
  14759. if (!_isUndefined(obj["HorizontalAlignment"])) {
  14760. this.m_horizontalAlignment=obj["HorizontalAlignment"];
  14761. }
  14762. if (!_isUndefined(obj["RowHeight"])) {
  14763. this.m_rowHeight=obj["RowHeight"];
  14764. }
  14765. if (!_isUndefined(obj["VerticalAlignment"])) {
  14766. this.m_verticalAlignment=obj["VerticalAlignment"];
  14767. }
  14768. if (!_isUndefined(obj["WrapText"])) {
  14769. this.m_wrapText=obj["WrapText"];
  14770. }
  14771. _handleNavigationPropertyResults(this, obj, ["borders", "Borders", "fill", "Fill", "font", "Font", "protection", "Protection"]);
  14772. };
  14773. RangeFormat.prototype.load=function (option) {
  14774. _load(this, option);
  14775. return this;
  14776. };
  14777. RangeFormat.prototype.toJSON=function () {
  14778. return {
  14779. "columnWidth": this.m_columnWidth,
  14780. "fill": this.m_fill,
  14781. "font": this.m_font,
  14782. "horizontalAlignment": this.m_horizontalAlignment,
  14783. "protection": this.m_protection,
  14784. "rowHeight": this.m_rowHeight,
  14785. "verticalAlignment": this.m_verticalAlignment,
  14786. "wrapText": this.m_wrapText
  14787. };
  14788. };
  14789. return RangeFormat;
  14790. }(OfficeExtension.ClientObject));
  14791. Excel.RangeFormat=RangeFormat;
  14792. var FormatProtection=(function (_super) {
  14793. __extends(FormatProtection, _super);
  14794. function FormatProtection() {
  14795. _super.apply(this, arguments);
  14796. }
  14797. Object.defineProperty(FormatProtection.prototype, "formulaHidden", {
  14798. get: function () {
  14799. _throwIfNotLoaded("formulaHidden", this.m_formulaHidden, "FormatProtection", this._isNull);
  14800. return this.m_formulaHidden;
  14801. },
  14802. set: function (value) {
  14803. this.m_formulaHidden=value;
  14804. _createSetPropertyAction(this.context, this, "FormulaHidden", value);
  14805. },
  14806. enumerable: true,
  14807. configurable: true
  14808. });
  14809. Object.defineProperty(FormatProtection.prototype, "locked", {
  14810. get: function () {
  14811. _throwIfNotLoaded("locked", this.m_locked, "FormatProtection", this._isNull);
  14812. return this.m_locked;
  14813. },
  14814. set: function (value) {
  14815. this.m_locked=value;
  14816. _createSetPropertyAction(this.context, this, "Locked", value);
  14817. },
  14818. enumerable: true,
  14819. configurable: true
  14820. });
  14821. FormatProtection.prototype._handleResult=function (value) {
  14822. _super.prototype._handleResult.call(this, value);
  14823. if (_isNullOrUndefined(value))
  14824. return;
  14825. var obj=value;
  14826. _fixObjectPathIfNecessary(this, obj);
  14827. if (!_isUndefined(obj["FormulaHidden"])) {
  14828. this.m_formulaHidden=obj["FormulaHidden"];
  14829. }
  14830. if (!_isUndefined(obj["Locked"])) {
  14831. this.m_locked=obj["Locked"];
  14832. }
  14833. };
  14834. FormatProtection.prototype.load=function (option) {
  14835. _load(this, option);
  14836. return this;
  14837. };
  14838. FormatProtection.prototype.toJSON=function () {
  14839. return {
  14840. "formulaHidden": this.m_formulaHidden,
  14841. "locked": this.m_locked
  14842. };
  14843. };
  14844. return FormatProtection;
  14845. }(OfficeExtension.ClientObject));
  14846. Excel.FormatProtection=FormatProtection;
  14847. var RangeFill=(function (_super) {
  14848. __extends(RangeFill, _super);
  14849. function RangeFill() {
  14850. _super.apply(this, arguments);
  14851. }
  14852. Object.defineProperty(RangeFill.prototype, "color", {
  14853. get: function () {
  14854. _throwIfNotLoaded("color", this.m_color, "RangeFill", this._isNull);
  14855. return this.m_color;
  14856. },
  14857. set: function (value) {
  14858. this.m_color=value;
  14859. _createSetPropertyAction(this.context, this, "Color", value);
  14860. },
  14861. enumerable: true,
  14862. configurable: true
  14863. });
  14864. RangeFill.prototype.clear=function () {
  14865. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  14866. };
  14867. RangeFill.prototype._handleResult=function (value) {
  14868. _super.prototype._handleResult.call(this, value);
  14869. if (_isNullOrUndefined(value))
  14870. return;
  14871. var obj=value;
  14872. _fixObjectPathIfNecessary(this, obj);
  14873. if (!_isUndefined(obj["Color"])) {
  14874. this.m_color=obj["Color"];
  14875. }
  14876. };
  14877. RangeFill.prototype.load=function (option) {
  14878. _load(this, option);
  14879. return this;
  14880. };
  14881. RangeFill.prototype.toJSON=function () {
  14882. return {
  14883. "color": this.m_color
  14884. };
  14885. };
  14886. return RangeFill;
  14887. }(OfficeExtension.ClientObject));
  14888. Excel.RangeFill=RangeFill;
  14889. var RangeBorder=(function (_super) {
  14890. __extends(RangeBorder, _super);
  14891. function RangeBorder() {
  14892. _super.apply(this, arguments);
  14893. }
  14894. Object.defineProperty(RangeBorder.prototype, "color", {
  14895. get: function () {
  14896. _throwIfNotLoaded("color", this.m_color, "RangeBorder", this._isNull);
  14897. return this.m_color;
  14898. },
  14899. set: function (value) {
  14900. this.m_color=value;
  14901. _createSetPropertyAction(this.context, this, "Color", value);
  14902. },
  14903. enumerable: true,
  14904. configurable: true
  14905. });
  14906. Object.defineProperty(RangeBorder.prototype, "sideIndex", {
  14907. get: function () {
  14908. _throwIfNotLoaded("sideIndex", this.m_sideIndex, "RangeBorder", this._isNull);
  14909. return this.m_sideIndex;
  14910. },
  14911. enumerable: true,
  14912. configurable: true
  14913. });
  14914. Object.defineProperty(RangeBorder.prototype, "style", {
  14915. get: function () {
  14916. _throwIfNotLoaded("style", this.m_style, "RangeBorder", this._isNull);
  14917. return this.m_style;
  14918. },
  14919. set: function (value) {
  14920. this.m_style=value;
  14921. _createSetPropertyAction(this.context, this, "Style", value);
  14922. },
  14923. enumerable: true,
  14924. configurable: true
  14925. });
  14926. Object.defineProperty(RangeBorder.prototype, "weight", {
  14927. get: function () {
  14928. _throwIfNotLoaded("weight", this.m_weight, "RangeBorder", this._isNull);
  14929. return this.m_weight;
  14930. },
  14931. set: function (value) {
  14932. this.m_weight=value;
  14933. _createSetPropertyAction(this.context, this, "Weight", value);
  14934. },
  14935. enumerable: true,
  14936. configurable: true
  14937. });
  14938. RangeBorder.prototype._handleResult=function (value) {
  14939. _super.prototype._handleResult.call(this, value);
  14940. if (_isNullOrUndefined(value))
  14941. return;
  14942. var obj=value;
  14943. _fixObjectPathIfNecessary(this, obj);
  14944. if (!_isUndefined(obj["Color"])) {
  14945. this.m_color=obj["Color"];
  14946. }
  14947. if (!_isUndefined(obj["SideIndex"])) {
  14948. this.m_sideIndex=obj["SideIndex"];
  14949. }
  14950. if (!_isUndefined(obj["Style"])) {
  14951. this.m_style=obj["Style"];
  14952. }
  14953. if (!_isUndefined(obj["Weight"])) {
  14954. this.m_weight=obj["Weight"];
  14955. }
  14956. };
  14957. RangeBorder.prototype.load=function (option) {
  14958. _load(this, option);
  14959. return this;
  14960. };
  14961. RangeBorder.prototype.toJSON=function () {
  14962. return {
  14963. "color": this.m_color,
  14964. "sideIndex": this.m_sideIndex,
  14965. "style": this.m_style,
  14966. "weight": this.m_weight
  14967. };
  14968. };
  14969. return RangeBorder;
  14970. }(OfficeExtension.ClientObject));
  14971. Excel.RangeBorder=RangeBorder;
  14972. var RangeBorderCollection=(function (_super) {
  14973. __extends(RangeBorderCollection, _super);
  14974. function RangeBorderCollection() {
  14975. _super.apply(this, arguments);
  14976. }
  14977. Object.defineProperty(RangeBorderCollection.prototype, "items", {
  14978. get: function () {
  14979. _throwIfNotLoaded("items", this.m__items, "RangeBorderCollection", this._isNull);
  14980. return this.m__items;
  14981. },
  14982. enumerable: true,
  14983. configurable: true
  14984. });
  14985. Object.defineProperty(RangeBorderCollection.prototype, "count", {
  14986. get: function () {
  14987. _throwIfNotLoaded("count", this.m_count, "RangeBorderCollection", this._isNull);
  14988. return this.m_count;
  14989. },
  14990. enumerable: true,
  14991. configurable: true
  14992. });
  14993. RangeBorderCollection.prototype.getItem=function (index) {
  14994. return new Excel.RangeBorder(this.context, _createIndexerObjectPath(this.context, this, [index]));
  14995. };
  14996. RangeBorderCollection.prototype.getItemAt=function (index) {
  14997. return new Excel.RangeBorder(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  14998. };
  14999. RangeBorderCollection.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. if (!_isUndefined(obj["Count"])) {
  15006. this.m_count=obj["Count"];
  15007. }
  15008. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15009. this.m__items=[];
  15010. var _data=obj[OfficeExtension.Constants.items];
  15011. for (var i=0; i < _data.length; i++) {
  15012. var _item=new Excel.RangeBorder(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15013. _item._handleResult(_data[i]);
  15014. this.m__items.push(_item);
  15015. }
  15016. }
  15017. };
  15018. RangeBorderCollection.prototype.load=function (option) {
  15019. _load(this, option);
  15020. return this;
  15021. };
  15022. RangeBorderCollection.prototype.toJSON=function () {
  15023. return {
  15024. "count": this.m_count
  15025. };
  15026. };
  15027. return RangeBorderCollection;
  15028. }(OfficeExtension.ClientObject));
  15029. Excel.RangeBorderCollection=RangeBorderCollection;
  15030. var RangeFont=(function (_super) {
  15031. __extends(RangeFont, _super);
  15032. function RangeFont() {
  15033. _super.apply(this, arguments);
  15034. }
  15035. Object.defineProperty(RangeFont.prototype, "bold", {
  15036. get: function () {
  15037. _throwIfNotLoaded("bold", this.m_bold, "RangeFont", this._isNull);
  15038. return this.m_bold;
  15039. },
  15040. set: function (value) {
  15041. this.m_bold=value;
  15042. _createSetPropertyAction(this.context, this, "Bold", value);
  15043. },
  15044. enumerable: true,
  15045. configurable: true
  15046. });
  15047. Object.defineProperty(RangeFont.prototype, "color", {
  15048. get: function () {
  15049. _throwIfNotLoaded("color", this.m_color, "RangeFont", this._isNull);
  15050. return this.m_color;
  15051. },
  15052. set: function (value) {
  15053. this.m_color=value;
  15054. _createSetPropertyAction(this.context, this, "Color", value);
  15055. },
  15056. enumerable: true,
  15057. configurable: true
  15058. });
  15059. Object.defineProperty(RangeFont.prototype, "italic", {
  15060. get: function () {
  15061. _throwIfNotLoaded("italic", this.m_italic, "RangeFont", this._isNull);
  15062. return this.m_italic;
  15063. },
  15064. set: function (value) {
  15065. this.m_italic=value;
  15066. _createSetPropertyAction(this.context, this, "Italic", value);
  15067. },
  15068. enumerable: true,
  15069. configurable: true
  15070. });
  15071. Object.defineProperty(RangeFont.prototype, "name", {
  15072. get: function () {
  15073. _throwIfNotLoaded("name", this.m_name, "RangeFont", this._isNull);
  15074. return this.m_name;
  15075. },
  15076. set: function (value) {
  15077. this.m_name=value;
  15078. _createSetPropertyAction(this.context, this, "Name", value);
  15079. },
  15080. enumerable: true,
  15081. configurable: true
  15082. });
  15083. Object.defineProperty(RangeFont.prototype, "size", {
  15084. get: function () {
  15085. _throwIfNotLoaded("size", this.m_size, "RangeFont", this._isNull);
  15086. return this.m_size;
  15087. },
  15088. set: function (value) {
  15089. this.m_size=value;
  15090. _createSetPropertyAction(this.context, this, "Size", value);
  15091. },
  15092. enumerable: true,
  15093. configurable: true
  15094. });
  15095. Object.defineProperty(RangeFont.prototype, "underline", {
  15096. get: function () {
  15097. _throwIfNotLoaded("underline", this.m_underline, "RangeFont", this._isNull);
  15098. return this.m_underline;
  15099. },
  15100. set: function (value) {
  15101. this.m_underline=value;
  15102. _createSetPropertyAction(this.context, this, "Underline", value);
  15103. },
  15104. enumerable: true,
  15105. configurable: true
  15106. });
  15107. RangeFont.prototype._handleResult=function (value) {
  15108. _super.prototype._handleResult.call(this, value);
  15109. if (_isNullOrUndefined(value))
  15110. return;
  15111. var obj=value;
  15112. _fixObjectPathIfNecessary(this, obj);
  15113. if (!_isUndefined(obj["Bold"])) {
  15114. this.m_bold=obj["Bold"];
  15115. }
  15116. if (!_isUndefined(obj["Color"])) {
  15117. this.m_color=obj["Color"];
  15118. }
  15119. if (!_isUndefined(obj["Italic"])) {
  15120. this.m_italic=obj["Italic"];
  15121. }
  15122. if (!_isUndefined(obj["Name"])) {
  15123. this.m_name=obj["Name"];
  15124. }
  15125. if (!_isUndefined(obj["Size"])) {
  15126. this.m_size=obj["Size"];
  15127. }
  15128. if (!_isUndefined(obj["Underline"])) {
  15129. this.m_underline=obj["Underline"];
  15130. }
  15131. };
  15132. RangeFont.prototype.load=function (option) {
  15133. _load(this, option);
  15134. return this;
  15135. };
  15136. RangeFont.prototype.toJSON=function () {
  15137. return {
  15138. "bold": this.m_bold,
  15139. "color": this.m_color,
  15140. "italic": this.m_italic,
  15141. "name": this.m_name,
  15142. "size": this.m_size,
  15143. "underline": this.m_underline
  15144. };
  15145. };
  15146. return RangeFont;
  15147. }(OfficeExtension.ClientObject));
  15148. Excel.RangeFont=RangeFont;
  15149. var ChartCollection=(function (_super) {
  15150. __extends(ChartCollection, _super);
  15151. function ChartCollection() {
  15152. _super.apply(this, arguments);
  15153. }
  15154. Object.defineProperty(ChartCollection.prototype, "items", {
  15155. get: function () {
  15156. _throwIfNotLoaded("items", this.m__items, "ChartCollection", this._isNull);
  15157. return this.m__items;
  15158. },
  15159. enumerable: true,
  15160. configurable: true
  15161. });
  15162. Object.defineProperty(ChartCollection.prototype, "count", {
  15163. get: function () {
  15164. _throwIfNotLoaded("count", this.m_count, "ChartCollection", this._isNull);
  15165. return this.m_count;
  15166. },
  15167. enumerable: true,
  15168. configurable: true
  15169. });
  15170. ChartCollection.prototype.add=function (type, sourceData, seriesBy) {
  15171. if (!(sourceData instanceof Range)) {
  15172. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Charts.Add");
  15173. }
  15174. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "Add", OfficeExtension.OperationType.Default, [type, sourceData, seriesBy], false, true, null));
  15175. };
  15176. ChartCollection.prototype.getItem=function (name) {
  15177. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItem", OfficeExtension.OperationType.Read, [name], false, false, null));
  15178. };
  15179. ChartCollection.prototype.getItemAt=function (index) {
  15180. return new Excel.Chart(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15181. };
  15182. ChartCollection.prototype._GetItem=function (key) {
  15183. return new Excel.Chart(this.context, _createIndexerObjectPath(this.context, this, [key]));
  15184. };
  15185. ChartCollection.prototype._handleResult=function (value) {
  15186. _super.prototype._handleResult.call(this, value);
  15187. if (_isNullOrUndefined(value))
  15188. return;
  15189. var obj=value;
  15190. _fixObjectPathIfNecessary(this, obj);
  15191. if (!_isUndefined(obj["Count"])) {
  15192. this.m_count=obj["Count"];
  15193. }
  15194. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15195. this.m__items=[];
  15196. var _data=obj[OfficeExtension.Constants.items];
  15197. for (var i=0; i < _data.length; i++) {
  15198. var _item=new Excel.Chart(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  15199. _item._handleResult(_data[i]);
  15200. this.m__items.push(_item);
  15201. }
  15202. }
  15203. };
  15204. ChartCollection.prototype.load=function (option) {
  15205. _load(this, option);
  15206. return this;
  15207. };
  15208. ChartCollection.prototype.toJSON=function () {
  15209. return {
  15210. "count": this.m_count
  15211. };
  15212. };
  15213. return ChartCollection;
  15214. }(OfficeExtension.ClientObject));
  15215. Excel.ChartCollection=ChartCollection;
  15216. var Chart=(function (_super) {
  15217. __extends(Chart, _super);
  15218. function Chart() {
  15219. _super.apply(this, arguments);
  15220. }
  15221. Object.defineProperty(Chart.prototype, "axes", {
  15222. get: function () {
  15223. if (!this.m_axes) {
  15224. this.m_axes=new Excel.ChartAxes(this.context, _createPropertyObjectPath(this.context, this, "Axes", false, false));
  15225. }
  15226. return this.m_axes;
  15227. },
  15228. enumerable: true,
  15229. configurable: true
  15230. });
  15231. Object.defineProperty(Chart.prototype, "dataLabels", {
  15232. get: function () {
  15233. if (!this.m_dataLabels) {
  15234. this.m_dataLabels=new Excel.ChartDataLabels(this.context, _createPropertyObjectPath(this.context, this, "DataLabels", false, false));
  15235. }
  15236. return this.m_dataLabels;
  15237. },
  15238. enumerable: true,
  15239. configurable: true
  15240. });
  15241. Object.defineProperty(Chart.prototype, "format", {
  15242. get: function () {
  15243. if (!this.m_format) {
  15244. this.m_format=new Excel.ChartAreaFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15245. }
  15246. return this.m_format;
  15247. },
  15248. enumerable: true,
  15249. configurable: true
  15250. });
  15251. Object.defineProperty(Chart.prototype, "legend", {
  15252. get: function () {
  15253. if (!this.m_legend) {
  15254. this.m_legend=new Excel.ChartLegend(this.context, _createPropertyObjectPath(this.context, this, "Legend", false, false));
  15255. }
  15256. return this.m_legend;
  15257. },
  15258. enumerable: true,
  15259. configurable: true
  15260. });
  15261. Object.defineProperty(Chart.prototype, "series", {
  15262. get: function () {
  15263. if (!this.m_series) {
  15264. this.m_series=new Excel.ChartSeriesCollection(this.context, _createPropertyObjectPath(this.context, this, "Series", true, false));
  15265. }
  15266. return this.m_series;
  15267. },
  15268. enumerable: true,
  15269. configurable: true
  15270. });
  15271. Object.defineProperty(Chart.prototype, "title", {
  15272. get: function () {
  15273. if (!this.m_title) {
  15274. this.m_title=new Excel.ChartTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  15275. }
  15276. return this.m_title;
  15277. },
  15278. enumerable: true,
  15279. configurable: true
  15280. });
  15281. Object.defineProperty(Chart.prototype, "worksheet", {
  15282. get: function () {
  15283. if (!this.m_worksheet) {
  15284. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  15285. }
  15286. return this.m_worksheet;
  15287. },
  15288. enumerable: true,
  15289. configurable: true
  15290. });
  15291. Object.defineProperty(Chart.prototype, "height", {
  15292. get: function () {
  15293. _throwIfNotLoaded("height", this.m_height, "Chart", this._isNull);
  15294. return this.m_height;
  15295. },
  15296. set: function (value) {
  15297. this.m_height=value;
  15298. _createSetPropertyAction(this.context, this, "Height", value);
  15299. },
  15300. enumerable: true,
  15301. configurable: true
  15302. });
  15303. Object.defineProperty(Chart.prototype, "left", {
  15304. get: function () {
  15305. _throwIfNotLoaded("left", this.m_left, "Chart", this._isNull);
  15306. return this.m_left;
  15307. },
  15308. set: function (value) {
  15309. this.m_left=value;
  15310. _createSetPropertyAction(this.context, this, "Left", value);
  15311. },
  15312. enumerable: true,
  15313. configurable: true
  15314. });
  15315. Object.defineProperty(Chart.prototype, "name", {
  15316. get: function () {
  15317. _throwIfNotLoaded("name", this.m_name, "Chart", this._isNull);
  15318. return this.m_name;
  15319. },
  15320. set: function (value) {
  15321. this.m_name=value;
  15322. _createSetPropertyAction(this.context, this, "Name", value);
  15323. },
  15324. enumerable: true,
  15325. configurable: true
  15326. });
  15327. Object.defineProperty(Chart.prototype, "top", {
  15328. get: function () {
  15329. _throwIfNotLoaded("top", this.m_top, "Chart", this._isNull);
  15330. return this.m_top;
  15331. },
  15332. set: function (value) {
  15333. this.m_top=value;
  15334. _createSetPropertyAction(this.context, this, "Top", value);
  15335. },
  15336. enumerable: true,
  15337. configurable: true
  15338. });
  15339. Object.defineProperty(Chart.prototype, "width", {
  15340. get: function () {
  15341. _throwIfNotLoaded("width", this.m_width, "Chart", this._isNull);
  15342. return this.m_width;
  15343. },
  15344. set: function (value) {
  15345. this.m_width=value;
  15346. _createSetPropertyAction(this.context, this, "Width", value);
  15347. },
  15348. enumerable: true,
  15349. configurable: true
  15350. });
  15351. Chart.prototype.delete=function () {
  15352. _createMethodAction(this.context, this, "Delete", OfficeExtension.OperationType.Default, []);
  15353. };
  15354. Chart.prototype.getImage=function (width, height, fittingMode) {
  15355. var action=_createMethodAction(this.context, this, "GetImage", OfficeExtension.OperationType.Read, [width, height, fittingMode]);
  15356. var ret=new OfficeExtension.ClientResult();
  15357. _addActionResultHandler(this, action, ret);
  15358. return ret;
  15359. };
  15360. Chart.prototype.setData=function (sourceData, seriesBy) {
  15361. if (!(sourceData instanceof Range)) {
  15362. throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ResourceStrings.invalidArgument, "sourceData", "Chart.setData");
  15363. }
  15364. _createMethodAction(this.context, this, "SetData", OfficeExtension.OperationType.Default, [sourceData, seriesBy]);
  15365. };
  15366. Chart.prototype.setPosition=function (startCell, endCell) {
  15367. _createMethodAction(this.context, this, "SetPosition", OfficeExtension.OperationType.Default, [startCell, endCell]);
  15368. };
  15369. Chart.prototype._handleResult=function (value) {
  15370. _super.prototype._handleResult.call(this, value);
  15371. if (_isNullOrUndefined(value))
  15372. return;
  15373. var obj=value;
  15374. _fixObjectPathIfNecessary(this, obj);
  15375. if (!_isUndefined(obj["Height"])) {
  15376. this.m_height=obj["Height"];
  15377. }
  15378. if (!_isUndefined(obj["Left"])) {
  15379. this.m_left=obj["Left"];
  15380. }
  15381. if (!_isUndefined(obj["Name"])) {
  15382. this.m_name=obj["Name"];
  15383. }
  15384. if (!_isUndefined(obj["Top"])) {
  15385. this.m_top=obj["Top"];
  15386. }
  15387. if (!_isUndefined(obj["Width"])) {
  15388. this.m_width=obj["Width"];
  15389. }
  15390. _handleNavigationPropertyResults(this, obj, ["axes", "Axes", "dataLabels", "DataLabels", "format", "Format", "legend", "Legend", "series", "Series", "title", "Title", "worksheet", "Worksheet"]);
  15391. };
  15392. Chart.prototype.load=function (option) {
  15393. _load(this, option);
  15394. return this;
  15395. };
  15396. Chart.prototype.toJSON=function () {
  15397. return {
  15398. "axes": this.m_axes,
  15399. "dataLabels": this.m_dataLabels,
  15400. "format": this.m_format,
  15401. "height": this.m_height,
  15402. "left": this.m_left,
  15403. "legend": this.m_legend,
  15404. "name": this.m_name,
  15405. "title": this.m_title,
  15406. "top": this.m_top,
  15407. "width": this.m_width
  15408. };
  15409. };
  15410. return Chart;
  15411. }(OfficeExtension.ClientObject));
  15412. Excel.Chart=Chart;
  15413. var ChartAreaFormat=(function (_super) {
  15414. __extends(ChartAreaFormat, _super);
  15415. function ChartAreaFormat() {
  15416. _super.apply(this, arguments);
  15417. }
  15418. Object.defineProperty(ChartAreaFormat.prototype, "fill", {
  15419. get: function () {
  15420. if (!this.m_fill) {
  15421. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15422. }
  15423. return this.m_fill;
  15424. },
  15425. enumerable: true,
  15426. configurable: true
  15427. });
  15428. Object.defineProperty(ChartAreaFormat.prototype, "font", {
  15429. get: function () {
  15430. if (!this.m_font) {
  15431. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  15432. }
  15433. return this.m_font;
  15434. },
  15435. enumerable: true,
  15436. configurable: true
  15437. });
  15438. ChartAreaFormat.prototype._handleResult=function (value) {
  15439. _super.prototype._handleResult.call(this, value);
  15440. if (_isNullOrUndefined(value))
  15441. return;
  15442. var obj=value;
  15443. _fixObjectPathIfNecessary(this, obj);
  15444. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  15445. };
  15446. ChartAreaFormat.prototype.load=function (option) {
  15447. _load(this, option);
  15448. return this;
  15449. };
  15450. ChartAreaFormat.prototype.toJSON=function () {
  15451. return {
  15452. "fill": this.m_fill,
  15453. "font": this.m_font
  15454. };
  15455. };
  15456. return ChartAreaFormat;
  15457. }(OfficeExtension.ClientObject));
  15458. Excel.ChartAreaFormat=ChartAreaFormat;
  15459. var ChartSeriesCollection=(function (_super) {
  15460. __extends(ChartSeriesCollection, _super);
  15461. function ChartSeriesCollection() {
  15462. _super.apply(this, arguments);
  15463. }
  15464. Object.defineProperty(ChartSeriesCollection.prototype, "items", {
  15465. get: function () {
  15466. _throwIfNotLoaded("items", this.m__items, "ChartSeriesCollection", this._isNull);
  15467. return this.m__items;
  15468. },
  15469. enumerable: true,
  15470. configurable: true
  15471. });
  15472. Object.defineProperty(ChartSeriesCollection.prototype, "count", {
  15473. get: function () {
  15474. _throwIfNotLoaded("count", this.m_count, "ChartSeriesCollection", this._isNull);
  15475. return this.m_count;
  15476. },
  15477. enumerable: true,
  15478. configurable: true
  15479. });
  15480. ChartSeriesCollection.prototype.getItemAt=function (index) {
  15481. return new Excel.ChartSeries(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15482. };
  15483. ChartSeriesCollection.prototype._handleResult=function (value) {
  15484. _super.prototype._handleResult.call(this, value);
  15485. if (_isNullOrUndefined(value))
  15486. return;
  15487. var obj=value;
  15488. _fixObjectPathIfNecessary(this, obj);
  15489. if (!_isUndefined(obj["Count"])) {
  15490. this.m_count=obj["Count"];
  15491. }
  15492. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15493. this.m__items=[];
  15494. var _data=obj[OfficeExtension.Constants.items];
  15495. for (var i=0; i < _data.length; i++) {
  15496. var _item=new Excel.ChartSeries(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  15497. _item._handleResult(_data[i]);
  15498. this.m__items.push(_item);
  15499. }
  15500. }
  15501. };
  15502. ChartSeriesCollection.prototype.load=function (option) {
  15503. _load(this, option);
  15504. return this;
  15505. };
  15506. ChartSeriesCollection.prototype.toJSON=function () {
  15507. return {
  15508. "count": this.m_count
  15509. };
  15510. };
  15511. return ChartSeriesCollection;
  15512. }(OfficeExtension.ClientObject));
  15513. Excel.ChartSeriesCollection=ChartSeriesCollection;
  15514. var ChartSeries=(function (_super) {
  15515. __extends(ChartSeries, _super);
  15516. function ChartSeries() {
  15517. _super.apply(this, arguments);
  15518. }
  15519. Object.defineProperty(ChartSeries.prototype, "format", {
  15520. get: function () {
  15521. if (!this.m_format) {
  15522. this.m_format=new Excel.ChartSeriesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15523. }
  15524. return this.m_format;
  15525. },
  15526. enumerable: true,
  15527. configurable: true
  15528. });
  15529. Object.defineProperty(ChartSeries.prototype, "points", {
  15530. get: function () {
  15531. if (!this.m_points) {
  15532. this.m_points=new Excel.ChartPointsCollection(this.context, _createPropertyObjectPath(this.context, this, "Points", true, false));
  15533. }
  15534. return this.m_points;
  15535. },
  15536. enumerable: true,
  15537. configurable: true
  15538. });
  15539. Object.defineProperty(ChartSeries.prototype, "name", {
  15540. get: function () {
  15541. _throwIfNotLoaded("name", this.m_name, "ChartSeries", this._isNull);
  15542. return this.m_name;
  15543. },
  15544. set: function (value) {
  15545. this.m_name=value;
  15546. _createSetPropertyAction(this.context, this, "Name", value);
  15547. },
  15548. enumerable: true,
  15549. configurable: true
  15550. });
  15551. ChartSeries.prototype._handleResult=function (value) {
  15552. _super.prototype._handleResult.call(this, value);
  15553. if (_isNullOrUndefined(value))
  15554. return;
  15555. var obj=value;
  15556. _fixObjectPathIfNecessary(this, obj);
  15557. if (!_isUndefined(obj["Name"])) {
  15558. this.m_name=obj["Name"];
  15559. }
  15560. _handleNavigationPropertyResults(this, obj, ["format", "Format", "points", "Points"]);
  15561. };
  15562. ChartSeries.prototype.load=function (option) {
  15563. _load(this, option);
  15564. return this;
  15565. };
  15566. ChartSeries.prototype.toJSON=function () {
  15567. return {
  15568. "format": this.m_format,
  15569. "name": this.m_name
  15570. };
  15571. };
  15572. return ChartSeries;
  15573. }(OfficeExtension.ClientObject));
  15574. Excel.ChartSeries=ChartSeries;
  15575. var ChartSeriesFormat=(function (_super) {
  15576. __extends(ChartSeriesFormat, _super);
  15577. function ChartSeriesFormat() {
  15578. _super.apply(this, arguments);
  15579. }
  15580. Object.defineProperty(ChartSeriesFormat.prototype, "fill", {
  15581. get: function () {
  15582. if (!this.m_fill) {
  15583. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15584. }
  15585. return this.m_fill;
  15586. },
  15587. enumerable: true,
  15588. configurable: true
  15589. });
  15590. Object.defineProperty(ChartSeriesFormat.prototype, "line", {
  15591. get: function () {
  15592. if (!this.m_line) {
  15593. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  15594. }
  15595. return this.m_line;
  15596. },
  15597. enumerable: true,
  15598. configurable: true
  15599. });
  15600. ChartSeriesFormat.prototype._handleResult=function (value) {
  15601. _super.prototype._handleResult.call(this, value);
  15602. if (_isNullOrUndefined(value))
  15603. return;
  15604. var obj=value;
  15605. _fixObjectPathIfNecessary(this, obj);
  15606. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "line", "Line"]);
  15607. };
  15608. ChartSeriesFormat.prototype.load=function (option) {
  15609. _load(this, option);
  15610. return this;
  15611. };
  15612. ChartSeriesFormat.prototype.toJSON=function () {
  15613. return {
  15614. "fill": this.m_fill,
  15615. "line": this.m_line
  15616. };
  15617. };
  15618. return ChartSeriesFormat;
  15619. }(OfficeExtension.ClientObject));
  15620. Excel.ChartSeriesFormat=ChartSeriesFormat;
  15621. var ChartPointsCollection=(function (_super) {
  15622. __extends(ChartPointsCollection, _super);
  15623. function ChartPointsCollection() {
  15624. _super.apply(this, arguments);
  15625. }
  15626. Object.defineProperty(ChartPointsCollection.prototype, "items", {
  15627. get: function () {
  15628. _throwIfNotLoaded("items", this.m__items, "ChartPointsCollection", this._isNull);
  15629. return this.m__items;
  15630. },
  15631. enumerable: true,
  15632. configurable: true
  15633. });
  15634. Object.defineProperty(ChartPointsCollection.prototype, "count", {
  15635. get: function () {
  15636. _throwIfNotLoaded("count", this.m_count, "ChartPointsCollection", this._isNull);
  15637. return this.m_count;
  15638. },
  15639. enumerable: true,
  15640. configurable: true
  15641. });
  15642. ChartPointsCollection.prototype.getItemAt=function (index) {
  15643. return new Excel.ChartPoint(this.context, _createMethodObjectPath(this.context, this, "GetItemAt", OfficeExtension.OperationType.Read, [index], false, false, null));
  15644. };
  15645. ChartPointsCollection.prototype._handleResult=function (value) {
  15646. _super.prototype._handleResult.call(this, value);
  15647. if (_isNullOrUndefined(value))
  15648. return;
  15649. var obj=value;
  15650. _fixObjectPathIfNecessary(this, obj);
  15651. if (!_isUndefined(obj["Count"])) {
  15652. this.m_count=obj["Count"];
  15653. }
  15654. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  15655. this.m__items=[];
  15656. var _data=obj[OfficeExtension.Constants.items];
  15657. for (var i=0; i < _data.length; i++) {
  15658. var _item=new Excel.ChartPoint(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(false, this.context, this, _data[i], i));
  15659. _item._handleResult(_data[i]);
  15660. this.m__items.push(_item);
  15661. }
  15662. }
  15663. };
  15664. ChartPointsCollection.prototype.load=function (option) {
  15665. _load(this, option);
  15666. return this;
  15667. };
  15668. ChartPointsCollection.prototype.toJSON=function () {
  15669. return {
  15670. "count": this.m_count
  15671. };
  15672. };
  15673. return ChartPointsCollection;
  15674. }(OfficeExtension.ClientObject));
  15675. Excel.ChartPointsCollection=ChartPointsCollection;
  15676. var ChartPoint=(function (_super) {
  15677. __extends(ChartPoint, _super);
  15678. function ChartPoint() {
  15679. _super.apply(this, arguments);
  15680. }
  15681. Object.defineProperty(ChartPoint.prototype, "format", {
  15682. get: function () {
  15683. if (!this.m_format) {
  15684. this.m_format=new Excel.ChartPointFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15685. }
  15686. return this.m_format;
  15687. },
  15688. enumerable: true,
  15689. configurable: true
  15690. });
  15691. Object.defineProperty(ChartPoint.prototype, "value", {
  15692. get: function () {
  15693. _throwIfNotLoaded("value", this.m_value, "ChartPoint", this._isNull);
  15694. return this.m_value;
  15695. },
  15696. enumerable: true,
  15697. configurable: true
  15698. });
  15699. ChartPoint.prototype._handleResult=function (value) {
  15700. _super.prototype._handleResult.call(this, value);
  15701. if (_isNullOrUndefined(value))
  15702. return;
  15703. var obj=value;
  15704. _fixObjectPathIfNecessary(this, obj);
  15705. if (!_isUndefined(obj["Value"])) {
  15706. this.m_value=obj["Value"];
  15707. }
  15708. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  15709. };
  15710. ChartPoint.prototype.load=function (option) {
  15711. _load(this, option);
  15712. return this;
  15713. };
  15714. ChartPoint.prototype.toJSON=function () {
  15715. return {
  15716. "format": this.m_format,
  15717. "value": this.m_value
  15718. };
  15719. };
  15720. return ChartPoint;
  15721. }(OfficeExtension.ClientObject));
  15722. Excel.ChartPoint=ChartPoint;
  15723. var ChartPointFormat=(function (_super) {
  15724. __extends(ChartPointFormat, _super);
  15725. function ChartPointFormat() {
  15726. _super.apply(this, arguments);
  15727. }
  15728. Object.defineProperty(ChartPointFormat.prototype, "fill", {
  15729. get: function () {
  15730. if (!this.m_fill) {
  15731. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  15732. }
  15733. return this.m_fill;
  15734. },
  15735. enumerable: true,
  15736. configurable: true
  15737. });
  15738. ChartPointFormat.prototype._handleResult=function (value) {
  15739. _super.prototype._handleResult.call(this, value);
  15740. if (_isNullOrUndefined(value))
  15741. return;
  15742. var obj=value;
  15743. _fixObjectPathIfNecessary(this, obj);
  15744. _handleNavigationPropertyResults(this, obj, ["fill", "Fill"]);
  15745. };
  15746. ChartPointFormat.prototype.load=function (option) {
  15747. _load(this, option);
  15748. return this;
  15749. };
  15750. ChartPointFormat.prototype.toJSON=function () {
  15751. return {
  15752. "fill": this.m_fill
  15753. };
  15754. };
  15755. return ChartPointFormat;
  15756. }(OfficeExtension.ClientObject));
  15757. Excel.ChartPointFormat=ChartPointFormat;
  15758. var ChartAxes=(function (_super) {
  15759. __extends(ChartAxes, _super);
  15760. function ChartAxes() {
  15761. _super.apply(this, arguments);
  15762. }
  15763. Object.defineProperty(ChartAxes.prototype, "categoryAxis", {
  15764. get: function () {
  15765. if (!this.m_categoryAxis) {
  15766. this.m_categoryAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "CategoryAxis", false, false));
  15767. }
  15768. return this.m_categoryAxis;
  15769. },
  15770. enumerable: true,
  15771. configurable: true
  15772. });
  15773. Object.defineProperty(ChartAxes.prototype, "seriesAxis", {
  15774. get: function () {
  15775. if (!this.m_seriesAxis) {
  15776. this.m_seriesAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "SeriesAxis", false, false));
  15777. }
  15778. return this.m_seriesAxis;
  15779. },
  15780. enumerable: true,
  15781. configurable: true
  15782. });
  15783. Object.defineProperty(ChartAxes.prototype, "valueAxis", {
  15784. get: function () {
  15785. if (!this.m_valueAxis) {
  15786. this.m_valueAxis=new Excel.ChartAxis(this.context, _createPropertyObjectPath(this.context, this, "ValueAxis", false, false));
  15787. }
  15788. return this.m_valueAxis;
  15789. },
  15790. enumerable: true,
  15791. configurable: true
  15792. });
  15793. ChartAxes.prototype._handleResult=function (value) {
  15794. _super.prototype._handleResult.call(this, value);
  15795. if (_isNullOrUndefined(value))
  15796. return;
  15797. var obj=value;
  15798. _fixObjectPathIfNecessary(this, obj);
  15799. _handleNavigationPropertyResults(this, obj, ["categoryAxis", "CategoryAxis", "seriesAxis", "SeriesAxis", "valueAxis", "ValueAxis"]);
  15800. };
  15801. ChartAxes.prototype.load=function (option) {
  15802. _load(this, option);
  15803. return this;
  15804. };
  15805. ChartAxes.prototype.toJSON=function () {
  15806. return {
  15807. "categoryAxis": this.m_categoryAxis,
  15808. "seriesAxis": this.m_seriesAxis,
  15809. "valueAxis": this.m_valueAxis
  15810. };
  15811. };
  15812. return ChartAxes;
  15813. }(OfficeExtension.ClientObject));
  15814. Excel.ChartAxes=ChartAxes;
  15815. var ChartAxis=(function (_super) {
  15816. __extends(ChartAxis, _super);
  15817. function ChartAxis() {
  15818. _super.apply(this, arguments);
  15819. }
  15820. Object.defineProperty(ChartAxis.prototype, "format", {
  15821. get: function () {
  15822. if (!this.m_format) {
  15823. this.m_format=new Excel.ChartAxisFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  15824. }
  15825. return this.m_format;
  15826. },
  15827. enumerable: true,
  15828. configurable: true
  15829. });
  15830. Object.defineProperty(ChartAxis.prototype, "majorGridlines", {
  15831. get: function () {
  15832. if (!this.m_majorGridlines) {
  15833. this.m_majorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MajorGridlines", false, false));
  15834. }
  15835. return this.m_majorGridlines;
  15836. },
  15837. enumerable: true,
  15838. configurable: true
  15839. });
  15840. Object.defineProperty(ChartAxis.prototype, "minorGridlines", {
  15841. get: function () {
  15842. if (!this.m_minorGridlines) {
  15843. this.m_minorGridlines=new Excel.ChartGridlines(this.context, _createPropertyObjectPath(this.context, this, "MinorGridlines", false, false));
  15844. }
  15845. return this.m_minorGridlines;
  15846. },
  15847. enumerable: true,
  15848. configurable: true
  15849. });
  15850. Object.defineProperty(ChartAxis.prototype, "title", {
  15851. get: function () {
  15852. if (!this.m_title) {
  15853. this.m_title=new Excel.ChartAxisTitle(this.context, _createPropertyObjectPath(this.context, this, "Title", false, false));
  15854. }
  15855. return this.m_title;
  15856. },
  15857. enumerable: true,
  15858. configurable: true
  15859. });
  15860. Object.defineProperty(ChartAxis.prototype, "majorUnit", {
  15861. get: function () {
  15862. _throwIfNotLoaded("majorUnit", this.m_majorUnit, "ChartAxis", this._isNull);
  15863. return this.m_majorUnit;
  15864. },
  15865. set: function (value) {
  15866. this.m_majorUnit=value;
  15867. _createSetPropertyAction(this.context, this, "MajorUnit", value);
  15868. },
  15869. enumerable: true,
  15870. configurable: true
  15871. });
  15872. Object.defineProperty(ChartAxis.prototype, "maximum", {
  15873. get: function () {
  15874. _throwIfNotLoaded("maximum", this.m_maximum, "ChartAxis", this._isNull);
  15875. return this.m_maximum;
  15876. },
  15877. set: function (value) {
  15878. this.m_maximum=value;
  15879. _createSetPropertyAction(this.context, this, "Maximum", value);
  15880. },
  15881. enumerable: true,
  15882. configurable: true
  15883. });
  15884. Object.defineProperty(ChartAxis.prototype, "minimum", {
  15885. get: function () {
  15886. _throwIfNotLoaded("minimum", this.m_minimum, "ChartAxis", this._isNull);
  15887. return this.m_minimum;
  15888. },
  15889. set: function (value) {
  15890. this.m_minimum=value;
  15891. _createSetPropertyAction(this.context, this, "Minimum", value);
  15892. },
  15893. enumerable: true,
  15894. configurable: true
  15895. });
  15896. Object.defineProperty(ChartAxis.prototype, "minorUnit", {
  15897. get: function () {
  15898. _throwIfNotLoaded("minorUnit", this.m_minorUnit, "ChartAxis", this._isNull);
  15899. return this.m_minorUnit;
  15900. },
  15901. set: function (value) {
  15902. this.m_minorUnit=value;
  15903. _createSetPropertyAction(this.context, this, "MinorUnit", value);
  15904. },
  15905. enumerable: true,
  15906. configurable: true
  15907. });
  15908. ChartAxis.prototype._handleResult=function (value) {
  15909. _super.prototype._handleResult.call(this, value);
  15910. if (_isNullOrUndefined(value))
  15911. return;
  15912. var obj=value;
  15913. _fixObjectPathIfNecessary(this, obj);
  15914. if (!_isUndefined(obj["MajorUnit"])) {
  15915. this.m_majorUnit=obj["MajorUnit"];
  15916. }
  15917. if (!_isUndefined(obj["Maximum"])) {
  15918. this.m_maximum=obj["Maximum"];
  15919. }
  15920. if (!_isUndefined(obj["Minimum"])) {
  15921. this.m_minimum=obj["Minimum"];
  15922. }
  15923. if (!_isUndefined(obj["MinorUnit"])) {
  15924. this.m_minorUnit=obj["MinorUnit"];
  15925. }
  15926. _handleNavigationPropertyResults(this, obj, ["format", "Format", "majorGridlines", "MajorGridlines", "minorGridlines", "MinorGridlines", "title", "Title"]);
  15927. };
  15928. ChartAxis.prototype.load=function (option) {
  15929. _load(this, option);
  15930. return this;
  15931. };
  15932. ChartAxis.prototype.toJSON=function () {
  15933. return {
  15934. "format": this.m_format,
  15935. "majorGridlines": this.m_majorGridlines,
  15936. "majorUnit": this.m_majorUnit,
  15937. "maximum": this.m_maximum,
  15938. "minimum": this.m_minimum,
  15939. "minorGridlines": this.m_minorGridlines,
  15940. "minorUnit": this.m_minorUnit,
  15941. "title": this.m_title
  15942. };
  15943. };
  15944. return ChartAxis;
  15945. }(OfficeExtension.ClientObject));
  15946. Excel.ChartAxis=ChartAxis;
  15947. var ChartAxisFormat=(function (_super) {
  15948. __extends(ChartAxisFormat, _super);
  15949. function ChartAxisFormat() {
  15950. _super.apply(this, arguments);
  15951. }
  15952. Object.defineProperty(ChartAxisFormat.prototype, "font", {
  15953. get: function () {
  15954. if (!this.m_font) {
  15955. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  15956. }
  15957. return this.m_font;
  15958. },
  15959. enumerable: true,
  15960. configurable: true
  15961. });
  15962. Object.defineProperty(ChartAxisFormat.prototype, "line", {
  15963. get: function () {
  15964. if (!this.m_line) {
  15965. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  15966. }
  15967. return this.m_line;
  15968. },
  15969. enumerable: true,
  15970. configurable: true
  15971. });
  15972. ChartAxisFormat.prototype._handleResult=function (value) {
  15973. _super.prototype._handleResult.call(this, value);
  15974. if (_isNullOrUndefined(value))
  15975. return;
  15976. var obj=value;
  15977. _fixObjectPathIfNecessary(this, obj);
  15978. _handleNavigationPropertyResults(this, obj, ["font", "Font", "line", "Line"]);
  15979. };
  15980. ChartAxisFormat.prototype.load=function (option) {
  15981. _load(this, option);
  15982. return this;
  15983. };
  15984. ChartAxisFormat.prototype.toJSON=function () {
  15985. return {
  15986. "font": this.m_font,
  15987. "line": this.m_line
  15988. };
  15989. };
  15990. return ChartAxisFormat;
  15991. }(OfficeExtension.ClientObject));
  15992. Excel.ChartAxisFormat=ChartAxisFormat;
  15993. var ChartAxisTitle=(function (_super) {
  15994. __extends(ChartAxisTitle, _super);
  15995. function ChartAxisTitle() {
  15996. _super.apply(this, arguments);
  15997. }
  15998. Object.defineProperty(ChartAxisTitle.prototype, "format", {
  15999. get: function () {
  16000. if (!this.m_format) {
  16001. this.m_format=new Excel.ChartAxisTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16002. }
  16003. return this.m_format;
  16004. },
  16005. enumerable: true,
  16006. configurable: true
  16007. });
  16008. Object.defineProperty(ChartAxisTitle.prototype, "text", {
  16009. get: function () {
  16010. _throwIfNotLoaded("text", this.m_text, "ChartAxisTitle", this._isNull);
  16011. return this.m_text;
  16012. },
  16013. set: function (value) {
  16014. this.m_text=value;
  16015. _createSetPropertyAction(this.context, this, "Text", value);
  16016. },
  16017. enumerable: true,
  16018. configurable: true
  16019. });
  16020. Object.defineProperty(ChartAxisTitle.prototype, "visible", {
  16021. get: function () {
  16022. _throwIfNotLoaded("visible", this.m_visible, "ChartAxisTitle", this._isNull);
  16023. return this.m_visible;
  16024. },
  16025. set: function (value) {
  16026. this.m_visible=value;
  16027. _createSetPropertyAction(this.context, this, "Visible", value);
  16028. },
  16029. enumerable: true,
  16030. configurable: true
  16031. });
  16032. ChartAxisTitle.prototype._handleResult=function (value) {
  16033. _super.prototype._handleResult.call(this, value);
  16034. if (_isNullOrUndefined(value))
  16035. return;
  16036. var obj=value;
  16037. _fixObjectPathIfNecessary(this, obj);
  16038. if (!_isUndefined(obj["Text"])) {
  16039. this.m_text=obj["Text"];
  16040. }
  16041. if (!_isUndefined(obj["Visible"])) {
  16042. this.m_visible=obj["Visible"];
  16043. }
  16044. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16045. };
  16046. ChartAxisTitle.prototype.load=function (option) {
  16047. _load(this, option);
  16048. return this;
  16049. };
  16050. ChartAxisTitle.prototype.toJSON=function () {
  16051. return {
  16052. "format": this.m_format,
  16053. "text": this.m_text,
  16054. "visible": this.m_visible
  16055. };
  16056. };
  16057. return ChartAxisTitle;
  16058. }(OfficeExtension.ClientObject));
  16059. Excel.ChartAxisTitle=ChartAxisTitle;
  16060. var ChartAxisTitleFormat=(function (_super) {
  16061. __extends(ChartAxisTitleFormat, _super);
  16062. function ChartAxisTitleFormat() {
  16063. _super.apply(this, arguments);
  16064. }
  16065. Object.defineProperty(ChartAxisTitleFormat.prototype, "font", {
  16066. get: function () {
  16067. if (!this.m_font) {
  16068. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16069. }
  16070. return this.m_font;
  16071. },
  16072. enumerable: true,
  16073. configurable: true
  16074. });
  16075. ChartAxisTitleFormat.prototype._handleResult=function (value) {
  16076. _super.prototype._handleResult.call(this, value);
  16077. if (_isNullOrUndefined(value))
  16078. return;
  16079. var obj=value;
  16080. _fixObjectPathIfNecessary(this, obj);
  16081. _handleNavigationPropertyResults(this, obj, ["font", "Font"]);
  16082. };
  16083. ChartAxisTitleFormat.prototype.load=function (option) {
  16084. _load(this, option);
  16085. return this;
  16086. };
  16087. ChartAxisTitleFormat.prototype.toJSON=function () {
  16088. return {
  16089. "font": this.m_font
  16090. };
  16091. };
  16092. return ChartAxisTitleFormat;
  16093. }(OfficeExtension.ClientObject));
  16094. Excel.ChartAxisTitleFormat=ChartAxisTitleFormat;
  16095. var ChartDataLabels=(function (_super) {
  16096. __extends(ChartDataLabels, _super);
  16097. function ChartDataLabels() {
  16098. _super.apply(this, arguments);
  16099. }
  16100. Object.defineProperty(ChartDataLabels.prototype, "format", {
  16101. get: function () {
  16102. if (!this.m_format) {
  16103. this.m_format=new Excel.ChartDataLabelFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16104. }
  16105. return this.m_format;
  16106. },
  16107. enumerable: true,
  16108. configurable: true
  16109. });
  16110. Object.defineProperty(ChartDataLabels.prototype, "position", {
  16111. get: function () {
  16112. _throwIfNotLoaded("position", this.m_position, "ChartDataLabels", this._isNull);
  16113. return this.m_position;
  16114. },
  16115. set: function (value) {
  16116. this.m_position=value;
  16117. _createSetPropertyAction(this.context, this, "Position", value);
  16118. },
  16119. enumerable: true,
  16120. configurable: true
  16121. });
  16122. Object.defineProperty(ChartDataLabels.prototype, "separator", {
  16123. get: function () {
  16124. _throwIfNotLoaded("separator", this.m_separator, "ChartDataLabels", this._isNull);
  16125. return this.m_separator;
  16126. },
  16127. set: function (value) {
  16128. this.m_separator=value;
  16129. _createSetPropertyAction(this.context, this, "Separator", value);
  16130. },
  16131. enumerable: true,
  16132. configurable: true
  16133. });
  16134. Object.defineProperty(ChartDataLabels.prototype, "showBubbleSize", {
  16135. get: function () {
  16136. _throwIfNotLoaded("showBubbleSize", this.m_showBubbleSize, "ChartDataLabels", this._isNull);
  16137. return this.m_showBubbleSize;
  16138. },
  16139. set: function (value) {
  16140. this.m_showBubbleSize=value;
  16141. _createSetPropertyAction(this.context, this, "ShowBubbleSize", value);
  16142. },
  16143. enumerable: true,
  16144. configurable: true
  16145. });
  16146. Object.defineProperty(ChartDataLabels.prototype, "showCategoryName", {
  16147. get: function () {
  16148. _throwIfNotLoaded("showCategoryName", this.m_showCategoryName, "ChartDataLabels", this._isNull);
  16149. return this.m_showCategoryName;
  16150. },
  16151. set: function (value) {
  16152. this.m_showCategoryName=value;
  16153. _createSetPropertyAction(this.context, this, "ShowCategoryName", value);
  16154. },
  16155. enumerable: true,
  16156. configurable: true
  16157. });
  16158. Object.defineProperty(ChartDataLabels.prototype, "showLegendKey", {
  16159. get: function () {
  16160. _throwIfNotLoaded("showLegendKey", this.m_showLegendKey, "ChartDataLabels", this._isNull);
  16161. return this.m_showLegendKey;
  16162. },
  16163. set: function (value) {
  16164. this.m_showLegendKey=value;
  16165. _createSetPropertyAction(this.context, this, "ShowLegendKey", value);
  16166. },
  16167. enumerable: true,
  16168. configurable: true
  16169. });
  16170. Object.defineProperty(ChartDataLabels.prototype, "showPercentage", {
  16171. get: function () {
  16172. _throwIfNotLoaded("showPercentage", this.m_showPercentage, "ChartDataLabels", this._isNull);
  16173. return this.m_showPercentage;
  16174. },
  16175. set: function (value) {
  16176. this.m_showPercentage=value;
  16177. _createSetPropertyAction(this.context, this, "ShowPercentage", value);
  16178. },
  16179. enumerable: true,
  16180. configurable: true
  16181. });
  16182. Object.defineProperty(ChartDataLabels.prototype, "showSeriesName", {
  16183. get: function () {
  16184. _throwIfNotLoaded("showSeriesName", this.m_showSeriesName, "ChartDataLabels", this._isNull);
  16185. return this.m_showSeriesName;
  16186. },
  16187. set: function (value) {
  16188. this.m_showSeriesName=value;
  16189. _createSetPropertyAction(this.context, this, "ShowSeriesName", value);
  16190. },
  16191. enumerable: true,
  16192. configurable: true
  16193. });
  16194. Object.defineProperty(ChartDataLabels.prototype, "showValue", {
  16195. get: function () {
  16196. _throwIfNotLoaded("showValue", this.m_showValue, "ChartDataLabels", this._isNull);
  16197. return this.m_showValue;
  16198. },
  16199. set: function (value) {
  16200. this.m_showValue=value;
  16201. _createSetPropertyAction(this.context, this, "ShowValue", value);
  16202. },
  16203. enumerable: true,
  16204. configurable: true
  16205. });
  16206. ChartDataLabels.prototype._handleResult=function (value) {
  16207. _super.prototype._handleResult.call(this, value);
  16208. if (_isNullOrUndefined(value))
  16209. return;
  16210. var obj=value;
  16211. _fixObjectPathIfNecessary(this, obj);
  16212. if (!_isUndefined(obj["Position"])) {
  16213. this.m_position=obj["Position"];
  16214. }
  16215. if (!_isUndefined(obj["Separator"])) {
  16216. this.m_separator=obj["Separator"];
  16217. }
  16218. if (!_isUndefined(obj["ShowBubbleSize"])) {
  16219. this.m_showBubbleSize=obj["ShowBubbleSize"];
  16220. }
  16221. if (!_isUndefined(obj["ShowCategoryName"])) {
  16222. this.m_showCategoryName=obj["ShowCategoryName"];
  16223. }
  16224. if (!_isUndefined(obj["ShowLegendKey"])) {
  16225. this.m_showLegendKey=obj["ShowLegendKey"];
  16226. }
  16227. if (!_isUndefined(obj["ShowPercentage"])) {
  16228. this.m_showPercentage=obj["ShowPercentage"];
  16229. }
  16230. if (!_isUndefined(obj["ShowSeriesName"])) {
  16231. this.m_showSeriesName=obj["ShowSeriesName"];
  16232. }
  16233. if (!_isUndefined(obj["ShowValue"])) {
  16234. this.m_showValue=obj["ShowValue"];
  16235. }
  16236. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16237. };
  16238. ChartDataLabels.prototype.load=function (option) {
  16239. _load(this, option);
  16240. return this;
  16241. };
  16242. ChartDataLabels.prototype.toJSON=function () {
  16243. return {
  16244. "format": this.m_format,
  16245. "position": this.m_position,
  16246. "separator": this.m_separator,
  16247. "showBubbleSize": this.m_showBubbleSize,
  16248. "showCategoryName": this.m_showCategoryName,
  16249. "showLegendKey": this.m_showLegendKey,
  16250. "showPercentage": this.m_showPercentage,
  16251. "showSeriesName": this.m_showSeriesName,
  16252. "showValue": this.m_showValue
  16253. };
  16254. };
  16255. return ChartDataLabels;
  16256. }(OfficeExtension.ClientObject));
  16257. Excel.ChartDataLabels=ChartDataLabels;
  16258. var ChartDataLabelFormat=(function (_super) {
  16259. __extends(ChartDataLabelFormat, _super);
  16260. function ChartDataLabelFormat() {
  16261. _super.apply(this, arguments);
  16262. }
  16263. Object.defineProperty(ChartDataLabelFormat.prototype, "fill", {
  16264. get: function () {
  16265. if (!this.m_fill) {
  16266. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16267. }
  16268. return this.m_fill;
  16269. },
  16270. enumerable: true,
  16271. configurable: true
  16272. });
  16273. Object.defineProperty(ChartDataLabelFormat.prototype, "font", {
  16274. get: function () {
  16275. if (!this.m_font) {
  16276. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16277. }
  16278. return this.m_font;
  16279. },
  16280. enumerable: true,
  16281. configurable: true
  16282. });
  16283. ChartDataLabelFormat.prototype._handleResult=function (value) {
  16284. _super.prototype._handleResult.call(this, value);
  16285. if (_isNullOrUndefined(value))
  16286. return;
  16287. var obj=value;
  16288. _fixObjectPathIfNecessary(this, obj);
  16289. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16290. };
  16291. ChartDataLabelFormat.prototype.load=function (option) {
  16292. _load(this, option);
  16293. return this;
  16294. };
  16295. ChartDataLabelFormat.prototype.toJSON=function () {
  16296. return {
  16297. "fill": this.m_fill,
  16298. "font": this.m_font
  16299. };
  16300. };
  16301. return ChartDataLabelFormat;
  16302. }(OfficeExtension.ClientObject));
  16303. Excel.ChartDataLabelFormat=ChartDataLabelFormat;
  16304. var ChartGridlines=(function (_super) {
  16305. __extends(ChartGridlines, _super);
  16306. function ChartGridlines() {
  16307. _super.apply(this, arguments);
  16308. }
  16309. Object.defineProperty(ChartGridlines.prototype, "format", {
  16310. get: function () {
  16311. if (!this.m_format) {
  16312. this.m_format=new Excel.ChartGridlinesFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16313. }
  16314. return this.m_format;
  16315. },
  16316. enumerable: true,
  16317. configurable: true
  16318. });
  16319. Object.defineProperty(ChartGridlines.prototype, "visible", {
  16320. get: function () {
  16321. _throwIfNotLoaded("visible", this.m_visible, "ChartGridlines", this._isNull);
  16322. return this.m_visible;
  16323. },
  16324. set: function (value) {
  16325. this.m_visible=value;
  16326. _createSetPropertyAction(this.context, this, "Visible", value);
  16327. },
  16328. enumerable: true,
  16329. configurable: true
  16330. });
  16331. ChartGridlines.prototype._handleResult=function (value) {
  16332. _super.prototype._handleResult.call(this, value);
  16333. if (_isNullOrUndefined(value))
  16334. return;
  16335. var obj=value;
  16336. _fixObjectPathIfNecessary(this, obj);
  16337. if (!_isUndefined(obj["Visible"])) {
  16338. this.m_visible=obj["Visible"];
  16339. }
  16340. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16341. };
  16342. ChartGridlines.prototype.load=function (option) {
  16343. _load(this, option);
  16344. return this;
  16345. };
  16346. ChartGridlines.prototype.toJSON=function () {
  16347. return {
  16348. "format": this.m_format,
  16349. "visible": this.m_visible
  16350. };
  16351. };
  16352. return ChartGridlines;
  16353. }(OfficeExtension.ClientObject));
  16354. Excel.ChartGridlines=ChartGridlines;
  16355. var ChartGridlinesFormat=(function (_super) {
  16356. __extends(ChartGridlinesFormat, _super);
  16357. function ChartGridlinesFormat() {
  16358. _super.apply(this, arguments);
  16359. }
  16360. Object.defineProperty(ChartGridlinesFormat.prototype, "line", {
  16361. get: function () {
  16362. if (!this.m_line) {
  16363. this.m_line=new Excel.ChartLineFormat(this.context, _createPropertyObjectPath(this.context, this, "Line", false, false));
  16364. }
  16365. return this.m_line;
  16366. },
  16367. enumerable: true,
  16368. configurable: true
  16369. });
  16370. ChartGridlinesFormat.prototype._handleResult=function (value) {
  16371. _super.prototype._handleResult.call(this, value);
  16372. if (_isNullOrUndefined(value))
  16373. return;
  16374. var obj=value;
  16375. _fixObjectPathIfNecessary(this, obj);
  16376. _handleNavigationPropertyResults(this, obj, ["line", "Line"]);
  16377. };
  16378. ChartGridlinesFormat.prototype.load=function (option) {
  16379. _load(this, option);
  16380. return this;
  16381. };
  16382. ChartGridlinesFormat.prototype.toJSON=function () {
  16383. return {
  16384. "line": this.m_line
  16385. };
  16386. };
  16387. return ChartGridlinesFormat;
  16388. }(OfficeExtension.ClientObject));
  16389. Excel.ChartGridlinesFormat=ChartGridlinesFormat;
  16390. var ChartLegend=(function (_super) {
  16391. __extends(ChartLegend, _super);
  16392. function ChartLegend() {
  16393. _super.apply(this, arguments);
  16394. }
  16395. Object.defineProperty(ChartLegend.prototype, "format", {
  16396. get: function () {
  16397. if (!this.m_format) {
  16398. this.m_format=new Excel.ChartLegendFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16399. }
  16400. return this.m_format;
  16401. },
  16402. enumerable: true,
  16403. configurable: true
  16404. });
  16405. Object.defineProperty(ChartLegend.prototype, "overlay", {
  16406. get: function () {
  16407. _throwIfNotLoaded("overlay", this.m_overlay, "ChartLegend", this._isNull);
  16408. return this.m_overlay;
  16409. },
  16410. set: function (value) {
  16411. this.m_overlay=value;
  16412. _createSetPropertyAction(this.context, this, "Overlay", value);
  16413. },
  16414. enumerable: true,
  16415. configurable: true
  16416. });
  16417. Object.defineProperty(ChartLegend.prototype, "position", {
  16418. get: function () {
  16419. _throwIfNotLoaded("position", this.m_position, "ChartLegend", this._isNull);
  16420. return this.m_position;
  16421. },
  16422. set: function (value) {
  16423. this.m_position=value;
  16424. _createSetPropertyAction(this.context, this, "Position", value);
  16425. },
  16426. enumerable: true,
  16427. configurable: true
  16428. });
  16429. Object.defineProperty(ChartLegend.prototype, "visible", {
  16430. get: function () {
  16431. _throwIfNotLoaded("visible", this.m_visible, "ChartLegend", this._isNull);
  16432. return this.m_visible;
  16433. },
  16434. set: function (value) {
  16435. this.m_visible=value;
  16436. _createSetPropertyAction(this.context, this, "Visible", value);
  16437. },
  16438. enumerable: true,
  16439. configurable: true
  16440. });
  16441. ChartLegend.prototype._handleResult=function (value) {
  16442. _super.prototype._handleResult.call(this, value);
  16443. if (_isNullOrUndefined(value))
  16444. return;
  16445. var obj=value;
  16446. _fixObjectPathIfNecessary(this, obj);
  16447. if (!_isUndefined(obj["Overlay"])) {
  16448. this.m_overlay=obj["Overlay"];
  16449. }
  16450. if (!_isUndefined(obj["Position"])) {
  16451. this.m_position=obj["Position"];
  16452. }
  16453. if (!_isUndefined(obj["Visible"])) {
  16454. this.m_visible=obj["Visible"];
  16455. }
  16456. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16457. };
  16458. ChartLegend.prototype.load=function (option) {
  16459. _load(this, option);
  16460. return this;
  16461. };
  16462. ChartLegend.prototype.toJSON=function () {
  16463. return {
  16464. "format": this.m_format,
  16465. "overlay": this.m_overlay,
  16466. "position": this.m_position,
  16467. "visible": this.m_visible
  16468. };
  16469. };
  16470. return ChartLegend;
  16471. }(OfficeExtension.ClientObject));
  16472. Excel.ChartLegend=ChartLegend;
  16473. var ChartLegendFormat=(function (_super) {
  16474. __extends(ChartLegendFormat, _super);
  16475. function ChartLegendFormat() {
  16476. _super.apply(this, arguments);
  16477. }
  16478. Object.defineProperty(ChartLegendFormat.prototype, "fill", {
  16479. get: function () {
  16480. if (!this.m_fill) {
  16481. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16482. }
  16483. return this.m_fill;
  16484. },
  16485. enumerable: true,
  16486. configurable: true
  16487. });
  16488. Object.defineProperty(ChartLegendFormat.prototype, "font", {
  16489. get: function () {
  16490. if (!this.m_font) {
  16491. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16492. }
  16493. return this.m_font;
  16494. },
  16495. enumerable: true,
  16496. configurable: true
  16497. });
  16498. ChartLegendFormat.prototype._handleResult=function (value) {
  16499. _super.prototype._handleResult.call(this, value);
  16500. if (_isNullOrUndefined(value))
  16501. return;
  16502. var obj=value;
  16503. _fixObjectPathIfNecessary(this, obj);
  16504. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16505. };
  16506. ChartLegendFormat.prototype.load=function (option) {
  16507. _load(this, option);
  16508. return this;
  16509. };
  16510. ChartLegendFormat.prototype.toJSON=function () {
  16511. return {
  16512. "fill": this.m_fill,
  16513. "font": this.m_font
  16514. };
  16515. };
  16516. return ChartLegendFormat;
  16517. }(OfficeExtension.ClientObject));
  16518. Excel.ChartLegendFormat=ChartLegendFormat;
  16519. var ChartTitle=(function (_super) {
  16520. __extends(ChartTitle, _super);
  16521. function ChartTitle() {
  16522. _super.apply(this, arguments);
  16523. }
  16524. Object.defineProperty(ChartTitle.prototype, "format", {
  16525. get: function () {
  16526. if (!this.m_format) {
  16527. this.m_format=new Excel.ChartTitleFormat(this.context, _createPropertyObjectPath(this.context, this, "Format", false, false));
  16528. }
  16529. return this.m_format;
  16530. },
  16531. enumerable: true,
  16532. configurable: true
  16533. });
  16534. Object.defineProperty(ChartTitle.prototype, "overlay", {
  16535. get: function () {
  16536. _throwIfNotLoaded("overlay", this.m_overlay, "ChartTitle", this._isNull);
  16537. return this.m_overlay;
  16538. },
  16539. set: function (value) {
  16540. this.m_overlay=value;
  16541. _createSetPropertyAction(this.context, this, "Overlay", value);
  16542. },
  16543. enumerable: true,
  16544. configurable: true
  16545. });
  16546. Object.defineProperty(ChartTitle.prototype, "text", {
  16547. get: function () {
  16548. _throwIfNotLoaded("text", this.m_text, "ChartTitle", this._isNull);
  16549. return this.m_text;
  16550. },
  16551. set: function (value) {
  16552. this.m_text=value;
  16553. _createSetPropertyAction(this.context, this, "Text", value);
  16554. },
  16555. enumerable: true,
  16556. configurable: true
  16557. });
  16558. Object.defineProperty(ChartTitle.prototype, "visible", {
  16559. get: function () {
  16560. _throwIfNotLoaded("visible", this.m_visible, "ChartTitle", this._isNull);
  16561. return this.m_visible;
  16562. },
  16563. set: function (value) {
  16564. this.m_visible=value;
  16565. _createSetPropertyAction(this.context, this, "Visible", value);
  16566. },
  16567. enumerable: true,
  16568. configurable: true
  16569. });
  16570. ChartTitle.prototype._handleResult=function (value) {
  16571. _super.prototype._handleResult.call(this, value);
  16572. if (_isNullOrUndefined(value))
  16573. return;
  16574. var obj=value;
  16575. _fixObjectPathIfNecessary(this, obj);
  16576. if (!_isUndefined(obj["Overlay"])) {
  16577. this.m_overlay=obj["Overlay"];
  16578. }
  16579. if (!_isUndefined(obj["Text"])) {
  16580. this.m_text=obj["Text"];
  16581. }
  16582. if (!_isUndefined(obj["Visible"])) {
  16583. this.m_visible=obj["Visible"];
  16584. }
  16585. _handleNavigationPropertyResults(this, obj, ["format", "Format"]);
  16586. };
  16587. ChartTitle.prototype.load=function (option) {
  16588. _load(this, option);
  16589. return this;
  16590. };
  16591. ChartTitle.prototype.toJSON=function () {
  16592. return {
  16593. "format": this.m_format,
  16594. "overlay": this.m_overlay,
  16595. "text": this.m_text,
  16596. "visible": this.m_visible
  16597. };
  16598. };
  16599. return ChartTitle;
  16600. }(OfficeExtension.ClientObject));
  16601. Excel.ChartTitle=ChartTitle;
  16602. var ChartTitleFormat=(function (_super) {
  16603. __extends(ChartTitleFormat, _super);
  16604. function ChartTitleFormat() {
  16605. _super.apply(this, arguments);
  16606. }
  16607. Object.defineProperty(ChartTitleFormat.prototype, "fill", {
  16608. get: function () {
  16609. if (!this.m_fill) {
  16610. this.m_fill=new Excel.ChartFill(this.context, _createPropertyObjectPath(this.context, this, "Fill", false, false));
  16611. }
  16612. return this.m_fill;
  16613. },
  16614. enumerable: true,
  16615. configurable: true
  16616. });
  16617. Object.defineProperty(ChartTitleFormat.prototype, "font", {
  16618. get: function () {
  16619. if (!this.m_font) {
  16620. this.m_font=new Excel.ChartFont(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  16621. }
  16622. return this.m_font;
  16623. },
  16624. enumerable: true,
  16625. configurable: true
  16626. });
  16627. ChartTitleFormat.prototype._handleResult=function (value) {
  16628. _super.prototype._handleResult.call(this, value);
  16629. if (_isNullOrUndefined(value))
  16630. return;
  16631. var obj=value;
  16632. _fixObjectPathIfNecessary(this, obj);
  16633. _handleNavigationPropertyResults(this, obj, ["fill", "Fill", "font", "Font"]);
  16634. };
  16635. ChartTitleFormat.prototype.load=function (option) {
  16636. _load(this, option);
  16637. return this;
  16638. };
  16639. ChartTitleFormat.prototype.toJSON=function () {
  16640. return {
  16641. "fill": this.m_fill,
  16642. "font": this.m_font
  16643. };
  16644. };
  16645. return ChartTitleFormat;
  16646. }(OfficeExtension.ClientObject));
  16647. Excel.ChartTitleFormat=ChartTitleFormat;
  16648. var ChartFill=(function (_super) {
  16649. __extends(ChartFill, _super);
  16650. function ChartFill() {
  16651. _super.apply(this, arguments);
  16652. }
  16653. ChartFill.prototype.load=function (option) {
  16654. _load(this, option);
  16655. return this;
  16656. };
  16657. ChartFill.prototype.clear=function () {
  16658. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16659. };
  16660. ChartFill.prototype.setSolidColor=function (color) {
  16661. _createMethodAction(this.context, this, "SetSolidColor", OfficeExtension.OperationType.Default, [color]);
  16662. };
  16663. ChartFill.prototype._handleResult=function (value) {
  16664. _super.prototype._handleResult.call(this, value);
  16665. if (_isNullOrUndefined(value))
  16666. return;
  16667. var obj=value;
  16668. _fixObjectPathIfNecessary(this, obj);
  16669. };
  16670. ChartFill.prototype.toJSON=function () {
  16671. return {};
  16672. };
  16673. return ChartFill;
  16674. }(OfficeExtension.ClientObject));
  16675. Excel.ChartFill=ChartFill;
  16676. var ChartLineFormat=(function (_super) {
  16677. __extends(ChartLineFormat, _super);
  16678. function ChartLineFormat() {
  16679. _super.apply(this, arguments);
  16680. }
  16681. Object.defineProperty(ChartLineFormat.prototype, "color", {
  16682. get: function () {
  16683. _throwIfNotLoaded("color", this.m_color, "ChartLineFormat", this._isNull);
  16684. return this.m_color;
  16685. },
  16686. set: function (value) {
  16687. this.m_color=value;
  16688. _createSetPropertyAction(this.context, this, "Color", value);
  16689. },
  16690. enumerable: true,
  16691. configurable: true
  16692. });
  16693. ChartLineFormat.prototype.clear=function () {
  16694. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16695. };
  16696. ChartLineFormat.prototype._handleResult=function (value) {
  16697. _super.prototype._handleResult.call(this, value);
  16698. if (_isNullOrUndefined(value))
  16699. return;
  16700. var obj=value;
  16701. _fixObjectPathIfNecessary(this, obj);
  16702. if (!_isUndefined(obj["Color"])) {
  16703. this.m_color=obj["Color"];
  16704. }
  16705. };
  16706. ChartLineFormat.prototype.load=function (option) {
  16707. _load(this, option);
  16708. return this;
  16709. };
  16710. ChartLineFormat.prototype.toJSON=function () {
  16711. return {
  16712. "color": this.m_color
  16713. };
  16714. };
  16715. return ChartLineFormat;
  16716. }(OfficeExtension.ClientObject));
  16717. Excel.ChartLineFormat=ChartLineFormat;
  16718. var ChartFont=(function (_super) {
  16719. __extends(ChartFont, _super);
  16720. function ChartFont() {
  16721. _super.apply(this, arguments);
  16722. }
  16723. Object.defineProperty(ChartFont.prototype, "bold", {
  16724. get: function () {
  16725. _throwIfNotLoaded("bold", this.m_bold, "ChartFont", this._isNull);
  16726. return this.m_bold;
  16727. },
  16728. set: function (value) {
  16729. this.m_bold=value;
  16730. _createSetPropertyAction(this.context, this, "Bold", value);
  16731. },
  16732. enumerable: true,
  16733. configurable: true
  16734. });
  16735. Object.defineProperty(ChartFont.prototype, "color", {
  16736. get: function () {
  16737. _throwIfNotLoaded("color", this.m_color, "ChartFont", this._isNull);
  16738. return this.m_color;
  16739. },
  16740. set: function (value) {
  16741. this.m_color=value;
  16742. _createSetPropertyAction(this.context, this, "Color", value);
  16743. },
  16744. enumerable: true,
  16745. configurable: true
  16746. });
  16747. Object.defineProperty(ChartFont.prototype, "italic", {
  16748. get: function () {
  16749. _throwIfNotLoaded("italic", this.m_italic, "ChartFont", this._isNull);
  16750. return this.m_italic;
  16751. },
  16752. set: function (value) {
  16753. this.m_italic=value;
  16754. _createSetPropertyAction(this.context, this, "Italic", value);
  16755. },
  16756. enumerable: true,
  16757. configurable: true
  16758. });
  16759. Object.defineProperty(ChartFont.prototype, "name", {
  16760. get: function () {
  16761. _throwIfNotLoaded("name", this.m_name, "ChartFont", this._isNull);
  16762. return this.m_name;
  16763. },
  16764. set: function (value) {
  16765. this.m_name=value;
  16766. _createSetPropertyAction(this.context, this, "Name", value);
  16767. },
  16768. enumerable: true,
  16769. configurable: true
  16770. });
  16771. Object.defineProperty(ChartFont.prototype, "size", {
  16772. get: function () {
  16773. _throwIfNotLoaded("size", this.m_size, "ChartFont", this._isNull);
  16774. return this.m_size;
  16775. },
  16776. set: function (value) {
  16777. this.m_size=value;
  16778. _createSetPropertyAction(this.context, this, "Size", value);
  16779. },
  16780. enumerable: true,
  16781. configurable: true
  16782. });
  16783. Object.defineProperty(ChartFont.prototype, "underline", {
  16784. get: function () {
  16785. _throwIfNotLoaded("underline", this.m_underline, "ChartFont", this._isNull);
  16786. return this.m_underline;
  16787. },
  16788. set: function (value) {
  16789. this.m_underline=value;
  16790. _createSetPropertyAction(this.context, this, "Underline", value);
  16791. },
  16792. enumerable: true,
  16793. configurable: true
  16794. });
  16795. ChartFont.prototype._handleResult=function (value) {
  16796. _super.prototype._handleResult.call(this, value);
  16797. if (_isNullOrUndefined(value))
  16798. return;
  16799. var obj=value;
  16800. _fixObjectPathIfNecessary(this, obj);
  16801. if (!_isUndefined(obj["Bold"])) {
  16802. this.m_bold=obj["Bold"];
  16803. }
  16804. if (!_isUndefined(obj["Color"])) {
  16805. this.m_color=obj["Color"];
  16806. }
  16807. if (!_isUndefined(obj["Italic"])) {
  16808. this.m_italic=obj["Italic"];
  16809. }
  16810. if (!_isUndefined(obj["Name"])) {
  16811. this.m_name=obj["Name"];
  16812. }
  16813. if (!_isUndefined(obj["Size"])) {
  16814. this.m_size=obj["Size"];
  16815. }
  16816. if (!_isUndefined(obj["Underline"])) {
  16817. this.m_underline=obj["Underline"];
  16818. }
  16819. };
  16820. ChartFont.prototype.load=function (option) {
  16821. _load(this, option);
  16822. return this;
  16823. };
  16824. ChartFont.prototype.toJSON=function () {
  16825. return {
  16826. "bold": this.m_bold,
  16827. "color": this.m_color,
  16828. "italic": this.m_italic,
  16829. "name": this.m_name,
  16830. "size": this.m_size,
  16831. "underline": this.m_underline
  16832. };
  16833. };
  16834. return ChartFont;
  16835. }(OfficeExtension.ClientObject));
  16836. Excel.ChartFont=ChartFont;
  16837. var RangeSort=(function (_super) {
  16838. __extends(RangeSort, _super);
  16839. function RangeSort() {
  16840. _super.apply(this, arguments);
  16841. }
  16842. RangeSort.prototype.apply=function (fields, matchCase, hasHeaders, orientation, method) {
  16843. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, hasHeaders, orientation, method]);
  16844. };
  16845. RangeSort.prototype._handleResult=function (value) {
  16846. _super.prototype._handleResult.call(this, value);
  16847. if (_isNullOrUndefined(value))
  16848. return;
  16849. var obj=value;
  16850. _fixObjectPathIfNecessary(this, obj);
  16851. };
  16852. RangeSort.prototype.toJSON=function () {
  16853. return {};
  16854. };
  16855. return RangeSort;
  16856. }(OfficeExtension.ClientObject));
  16857. Excel.RangeSort=RangeSort;
  16858. var TableSort=(function (_super) {
  16859. __extends(TableSort, _super);
  16860. function TableSort() {
  16861. _super.apply(this, arguments);
  16862. }
  16863. Object.defineProperty(TableSort.prototype, "fields", {
  16864. get: function () {
  16865. _throwIfNotLoaded("fields", this.m_fields, "TableSort", this._isNull);
  16866. return this.m_fields;
  16867. },
  16868. enumerable: true,
  16869. configurable: true
  16870. });
  16871. Object.defineProperty(TableSort.prototype, "matchCase", {
  16872. get: function () {
  16873. _throwIfNotLoaded("matchCase", this.m_matchCase, "TableSort", this._isNull);
  16874. return this.m_matchCase;
  16875. },
  16876. enumerable: true,
  16877. configurable: true
  16878. });
  16879. Object.defineProperty(TableSort.prototype, "method", {
  16880. get: function () {
  16881. _throwIfNotLoaded("method", this.m_method, "TableSort", this._isNull);
  16882. return this.m_method;
  16883. },
  16884. enumerable: true,
  16885. configurable: true
  16886. });
  16887. TableSort.prototype.apply=function (fields, matchCase, method) {
  16888. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [fields, matchCase, method]);
  16889. };
  16890. TableSort.prototype.clear=function () {
  16891. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16892. };
  16893. TableSort.prototype.reapply=function () {
  16894. _createMethodAction(this.context, this, "Reapply", OfficeExtension.OperationType.Default, []);
  16895. };
  16896. TableSort.prototype._handleResult=function (value) {
  16897. _super.prototype._handleResult.call(this, value);
  16898. if (_isNullOrUndefined(value))
  16899. return;
  16900. var obj=value;
  16901. _fixObjectPathIfNecessary(this, obj);
  16902. if (!_isUndefined(obj["Fields"])) {
  16903. this.m_fields=obj["Fields"];
  16904. }
  16905. if (!_isUndefined(obj["MatchCase"])) {
  16906. this.m_matchCase=obj["MatchCase"];
  16907. }
  16908. if (!_isUndefined(obj["Method"])) {
  16909. this.m_method=obj["Method"];
  16910. }
  16911. };
  16912. TableSort.prototype.load=function (option) {
  16913. _load(this, option);
  16914. return this;
  16915. };
  16916. TableSort.prototype.toJSON=function () {
  16917. return {
  16918. "fields": this.m_fields,
  16919. "matchCase": this.m_matchCase,
  16920. "method": this.m_method
  16921. };
  16922. };
  16923. return TableSort;
  16924. }(OfficeExtension.ClientObject));
  16925. Excel.TableSort=TableSort;
  16926. var Filter=(function (_super) {
  16927. __extends(Filter, _super);
  16928. function Filter() {
  16929. _super.apply(this, arguments);
  16930. }
  16931. Object.defineProperty(Filter.prototype, "criteria", {
  16932. get: function () {
  16933. _throwIfNotLoaded("criteria", this.m_criteria, "Filter", this._isNull);
  16934. return this.m_criteria;
  16935. },
  16936. enumerable: true,
  16937. configurable: true
  16938. });
  16939. Filter.prototype.apply=function (criteria) {
  16940. _createMethodAction(this.context, this, "Apply", OfficeExtension.OperationType.Default, [criteria]);
  16941. };
  16942. Filter.prototype.applyBottomItemsFilter=function (count) {
  16943. _createMethodAction(this.context, this, "ApplyBottomItemsFilter", OfficeExtension.OperationType.Default, [count]);
  16944. };
  16945. Filter.prototype.applyBottomPercentFilter=function (percent) {
  16946. _createMethodAction(this.context, this, "ApplyBottomPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  16947. };
  16948. Filter.prototype.applyCellColorFilter=function (color) {
  16949. _createMethodAction(this.context, this, "ApplyCellColorFilter", OfficeExtension.OperationType.Default, [color]);
  16950. };
  16951. Filter.prototype.applyCustomFilter=function (criteria1, criteria2, oper) {
  16952. _createMethodAction(this.context, this, "ApplyCustomFilter", OfficeExtension.OperationType.Default, [criteria1, criteria2, oper]);
  16953. };
  16954. Filter.prototype.applyDynamicFilter=function (criteria) {
  16955. _createMethodAction(this.context, this, "ApplyDynamicFilter", OfficeExtension.OperationType.Default, [criteria]);
  16956. };
  16957. Filter.prototype.applyFontColorFilter=function (color) {
  16958. _createMethodAction(this.context, this, "ApplyFontColorFilter", OfficeExtension.OperationType.Default, [color]);
  16959. };
  16960. Filter.prototype.applyIconFilter=function (icon) {
  16961. _createMethodAction(this.context, this, "ApplyIconFilter", OfficeExtension.OperationType.Default, [icon]);
  16962. };
  16963. Filter.prototype.applyTopItemsFilter=function (count) {
  16964. _createMethodAction(this.context, this, "ApplyTopItemsFilter", OfficeExtension.OperationType.Default, [count]);
  16965. };
  16966. Filter.prototype.applyTopPercentFilter=function (percent) {
  16967. _createMethodAction(this.context, this, "ApplyTopPercentFilter", OfficeExtension.OperationType.Default, [percent]);
  16968. };
  16969. Filter.prototype.applyValuesFilter=function (values) {
  16970. _createMethodAction(this.context, this, "ApplyValuesFilter", OfficeExtension.OperationType.Default, [values]);
  16971. };
  16972. Filter.prototype.clear=function () {
  16973. _createMethodAction(this.context, this, "Clear", OfficeExtension.OperationType.Default, []);
  16974. };
  16975. Filter.prototype._handleResult=function (value) {
  16976. _super.prototype._handleResult.call(this, value);
  16977. if (_isNullOrUndefined(value))
  16978. return;
  16979. var obj=value;
  16980. _fixObjectPathIfNecessary(this, obj);
  16981. if (!_isUndefined(obj["Criteria"])) {
  16982. this.m_criteria=obj["Criteria"];
  16983. }
  16984. };
  16985. Filter.prototype.load=function (option) {
  16986. _load(this, option);
  16987. return this;
  16988. };
  16989. Filter.prototype.toJSON=function () {
  16990. return {
  16991. "criteria": this.m_criteria
  16992. };
  16993. };
  16994. return Filter;
  16995. }(OfficeExtension.ClientObject));
  16996. Excel.Filter=Filter;
  16997. var _V1Api=(function (_super) {
  16998. __extends(_V1Api, _super);
  16999. function _V1Api() {
  17000. _super.apply(this, arguments);
  17001. }
  17002. _V1Api.prototype.bindingAddColumns=function (input) {
  17003. var action=_createMethodAction(this.context, this, "BindingAddColumns", OfficeExtension.OperationType.Default, [input]);
  17004. var ret=new OfficeExtension.ClientResult();
  17005. _addActionResultHandler(this, action, ret);
  17006. return ret;
  17007. };
  17008. _V1Api.prototype.bindingAddFromNamedItem=function (input) {
  17009. var action=_createMethodAction(this.context, this, "BindingAddFromNamedItem", OfficeExtension.OperationType.Read, [input]);
  17010. var ret=new OfficeExtension.ClientResult();
  17011. _addActionResultHandler(this, action, ret);
  17012. return ret;
  17013. };
  17014. _V1Api.prototype.bindingAddFromPrompt=function (input) {
  17015. var action=_createMethodAction(this.context, this, "BindingAddFromPrompt", OfficeExtension.OperationType.Read, [input]);
  17016. var ret=new OfficeExtension.ClientResult();
  17017. _addActionResultHandler(this, action, ret);
  17018. return ret;
  17019. };
  17020. _V1Api.prototype.bindingAddFromSelection=function (input) {
  17021. var action=_createMethodAction(this.context, this, "BindingAddFromSelection", OfficeExtension.OperationType.Read, [input]);
  17022. var ret=new OfficeExtension.ClientResult();
  17023. _addActionResultHandler(this, action, ret);
  17024. return ret;
  17025. };
  17026. _V1Api.prototype.bindingAddRows=function (input) {
  17027. var action=_createMethodAction(this.context, this, "BindingAddRows", OfficeExtension.OperationType.Default, [input]);
  17028. var ret=new OfficeExtension.ClientResult();
  17029. _addActionResultHandler(this, action, ret);
  17030. return ret;
  17031. };
  17032. _V1Api.prototype.bindingClearFormats=function (input) {
  17033. var action=_createMethodAction(this.context, this, "BindingClearFormats", OfficeExtension.OperationType.Default, [input]);
  17034. var ret=new OfficeExtension.ClientResult();
  17035. _addActionResultHandler(this, action, ret);
  17036. return ret;
  17037. };
  17038. _V1Api.prototype.bindingDeleteAllDataValues=function (input) {
  17039. var action=_createMethodAction(this.context, this, "BindingDeleteAllDataValues", OfficeExtension.OperationType.Default, [input]);
  17040. var ret=new OfficeExtension.ClientResult();
  17041. _addActionResultHandler(this, action, ret);
  17042. return ret;
  17043. };
  17044. _V1Api.prototype.bindingGetAll=function () {
  17045. var action=_createMethodAction(this.context, this, "BindingGetAll", OfficeExtension.OperationType.Read, []);
  17046. var ret=new OfficeExtension.ClientResult();
  17047. _addActionResultHandler(this, action, ret);
  17048. return ret;
  17049. };
  17050. _V1Api.prototype.bindingGetById=function (input) {
  17051. var action=_createMethodAction(this.context, this, "BindingGetById", OfficeExtension.OperationType.Read, [input]);
  17052. var ret=new OfficeExtension.ClientResult();
  17053. _addActionResultHandler(this, action, ret);
  17054. return ret;
  17055. };
  17056. _V1Api.prototype.bindingGetData=function (input) {
  17057. var action=_createMethodAction(this.context, this, "BindingGetData", OfficeExtension.OperationType.Read, [input]);
  17058. var ret=new OfficeExtension.ClientResult();
  17059. _addActionResultHandler(this, action, ret);
  17060. return ret;
  17061. };
  17062. _V1Api.prototype.bindingReleaseById=function (input) {
  17063. var action=_createMethodAction(this.context, this, "BindingReleaseById", OfficeExtension.OperationType.Read, [input]);
  17064. var ret=new OfficeExtension.ClientResult();
  17065. _addActionResultHandler(this, action, ret);
  17066. return ret;
  17067. };
  17068. _V1Api.prototype.bindingSetData=function (input) {
  17069. var action=_createMethodAction(this.context, this, "BindingSetData", OfficeExtension.OperationType.Default, [input]);
  17070. var ret=new OfficeExtension.ClientResult();
  17071. _addActionResultHandler(this, action, ret);
  17072. return ret;
  17073. };
  17074. _V1Api.prototype.bindingSetFormats=function (input) {
  17075. var action=_createMethodAction(this.context, this, "BindingSetFormats", OfficeExtension.OperationType.Default, [input]);
  17076. var ret=new OfficeExtension.ClientResult();
  17077. _addActionResultHandler(this, action, ret);
  17078. return ret;
  17079. };
  17080. _V1Api.prototype.bindingSetTableOptions=function (input) {
  17081. var action=_createMethodAction(this.context, this, "BindingSetTableOptions", OfficeExtension.OperationType.Default, [input]);
  17082. var ret=new OfficeExtension.ClientResult();
  17083. _addActionResultHandler(this, action, ret);
  17084. return ret;
  17085. };
  17086. _V1Api.prototype.getSelectedData=function (input) {
  17087. var action=_createMethodAction(this.context, this, "GetSelectedData", OfficeExtension.OperationType.Read, [input]);
  17088. var ret=new OfficeExtension.ClientResult();
  17089. _addActionResultHandler(this, action, ret);
  17090. return ret;
  17091. };
  17092. _V1Api.prototype.gotoById=function (input) {
  17093. var action=_createMethodAction(this.context, this, "GotoById", OfficeExtension.OperationType.Read, [input]);
  17094. var ret=new OfficeExtension.ClientResult();
  17095. _addActionResultHandler(this, action, ret);
  17096. return ret;
  17097. };
  17098. _V1Api.prototype.setSelectedData=function (input) {
  17099. var action=_createMethodAction(this.context, this, "SetSelectedData", OfficeExtension.OperationType.Default, [input]);
  17100. var ret=new OfficeExtension.ClientResult();
  17101. _addActionResultHandler(this, action, ret);
  17102. return ret;
  17103. };
  17104. _V1Api.prototype._handleResult=function (value) {
  17105. _super.prototype._handleResult.call(this, value);
  17106. if (_isNullOrUndefined(value))
  17107. return;
  17108. var obj=value;
  17109. _fixObjectPathIfNecessary(this, obj);
  17110. };
  17111. _V1Api.prototype.toJSON=function () {
  17112. return {};
  17113. };
  17114. return _V1Api;
  17115. }(OfficeExtension.ClientObject));
  17116. Excel._V1Api=_V1Api;
  17117. var PivotTableCollection=(function (_super) {
  17118. __extends(PivotTableCollection, _super);
  17119. function PivotTableCollection() {
  17120. _super.apply(this, arguments);
  17121. }
  17122. Object.defineProperty(PivotTableCollection.prototype, "items", {
  17123. get: function () {
  17124. _throwIfNotLoaded("items", this.m__items, "PivotTableCollection", this._isNull);
  17125. return this.m__items;
  17126. },
  17127. enumerable: true,
  17128. configurable: true
  17129. });
  17130. PivotTableCollection.prototype.getItem=function (name) {
  17131. return new Excel.PivotTable(this.context, _createIndexerObjectPath(this.context, this, [name]));
  17132. };
  17133. PivotTableCollection.prototype.refreshAll=function () {
  17134. _createMethodAction(this.context, this, "RefreshAll", OfficeExtension.OperationType.Default, []);
  17135. };
  17136. PivotTableCollection.prototype._handleResult=function (value) {
  17137. _super.prototype._handleResult.call(this, value);
  17138. if (_isNullOrUndefined(value))
  17139. return;
  17140. var obj=value;
  17141. _fixObjectPathIfNecessary(this, obj);
  17142. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  17143. this.m__items=[];
  17144. var _data=obj[OfficeExtension.Constants.items];
  17145. for (var i=0; i < _data.length; i++) {
  17146. var _item=new Excel.PivotTable(this.context, _createChildItemObjectPathUsingIndexerOrGetItemAt(true, this.context, this, _data[i], i));
  17147. _item._handleResult(_data[i]);
  17148. this.m__items.push(_item);
  17149. }
  17150. }
  17151. };
  17152. PivotTableCollection.prototype.load=function (option) {
  17153. _load(this, option);
  17154. return this;
  17155. };
  17156. PivotTableCollection.prototype.toJSON=function () {
  17157. return {};
  17158. };
  17159. return PivotTableCollection;
  17160. }(OfficeExtension.ClientObject));
  17161. Excel.PivotTableCollection=PivotTableCollection;
  17162. var PivotTable=(function (_super) {
  17163. __extends(PivotTable, _super);
  17164. function PivotTable() {
  17165. _super.apply(this, arguments);
  17166. }
  17167. Object.defineProperty(PivotTable.prototype, "worksheet", {
  17168. get: function () {
  17169. if (!this.m_worksheet) {
  17170. this.m_worksheet=new Excel.Worksheet(this.context, _createPropertyObjectPath(this.context, this, "Worksheet", false, false));
  17171. }
  17172. return this.m_worksheet;
  17173. },
  17174. enumerable: true,
  17175. configurable: true
  17176. });
  17177. Object.defineProperty(PivotTable.prototype, "name", {
  17178. get: function () {
  17179. _throwIfNotLoaded("name", this.m_name, "PivotTable", this._isNull);
  17180. return this.m_name;
  17181. },
  17182. set: function (value) {
  17183. this.m_name=value;
  17184. _createSetPropertyAction(this.context, this, "Name", value);
  17185. },
  17186. enumerable: true,
  17187. configurable: true
  17188. });
  17189. PivotTable.prototype.refresh=function () {
  17190. _createMethodAction(this.context, this, "Refresh", OfficeExtension.OperationType.Default, []);
  17191. };
  17192. PivotTable.prototype._handleResult=function (value) {
  17193. _super.prototype._handleResult.call(this, value);
  17194. if (_isNullOrUndefined(value))
  17195. return;
  17196. var obj=value;
  17197. _fixObjectPathIfNecessary(this, obj);
  17198. if (!_isUndefined(obj["Name"])) {
  17199. this.m_name=obj["Name"];
  17200. }
  17201. _handleNavigationPropertyResults(this, obj, ["worksheet", "Worksheet"]);
  17202. };
  17203. PivotTable.prototype.load=function (option) {
  17204. _load(this, option);
  17205. return this;
  17206. };
  17207. PivotTable.prototype.toJSON=function () {
  17208. return {
  17209. "name": this.m_name
  17210. };
  17211. };
  17212. return PivotTable;
  17213. }(OfficeExtension.ClientObject));
  17214. Excel.PivotTable=PivotTable;
  17215. var BindingType;
  17216. (function (BindingType) {
  17217. BindingType.range="Range";
  17218. BindingType.table="Table";
  17219. BindingType.text="Text";
  17220. })(BindingType=Excel.BindingType || (Excel.BindingType={}));
  17221. var BorderIndex;
  17222. (function (BorderIndex) {
  17223. BorderIndex.edgeTop="EdgeTop";
  17224. BorderIndex.edgeBottom="EdgeBottom";
  17225. BorderIndex.edgeLeft="EdgeLeft";
  17226. BorderIndex.edgeRight="EdgeRight";
  17227. BorderIndex.insideVertical="InsideVertical";
  17228. BorderIndex.insideHorizontal="InsideHorizontal";
  17229. BorderIndex.diagonalDown="DiagonalDown";
  17230. BorderIndex.diagonalUp="DiagonalUp";
  17231. })(BorderIndex=Excel.BorderIndex || (Excel.BorderIndex={}));
  17232. var BorderLineStyle;
  17233. (function (BorderLineStyle) {
  17234. BorderLineStyle.none="None";
  17235. BorderLineStyle.continuous="Continuous";
  17236. BorderLineStyle.dash="Dash";
  17237. BorderLineStyle.dashDot="DashDot";
  17238. BorderLineStyle.dashDotDot="DashDotDot";
  17239. BorderLineStyle.dot="Dot";
  17240. BorderLineStyle.double="Double";
  17241. BorderLineStyle.slantDashDot="SlantDashDot";
  17242. })(BorderLineStyle=Excel.BorderLineStyle || (Excel.BorderLineStyle={}));
  17243. var BorderWeight;
  17244. (function (BorderWeight) {
  17245. BorderWeight.hairline="Hairline";
  17246. BorderWeight.thin="Thin";
  17247. BorderWeight.medium="Medium";
  17248. BorderWeight.thick="Thick";
  17249. })(BorderWeight=Excel.BorderWeight || (Excel.BorderWeight={}));
  17250. var CalculationMode;
  17251. (function (CalculationMode) {
  17252. CalculationMode.automatic="Automatic";
  17253. CalculationMode.automaticExceptTables="AutomaticExceptTables";
  17254. CalculationMode.manual="Manual";
  17255. })(CalculationMode=Excel.CalculationMode || (Excel.CalculationMode={}));
  17256. var CalculationType;
  17257. (function (CalculationType) {
  17258. CalculationType.recalculate="Recalculate";
  17259. CalculationType.full="Full";
  17260. CalculationType.fullRebuild="FullRebuild";
  17261. })(CalculationType=Excel.CalculationType || (Excel.CalculationType={}));
  17262. var ClearApplyTo;
  17263. (function (ClearApplyTo) {
  17264. ClearApplyTo.all="All";
  17265. ClearApplyTo.formats="Formats";
  17266. ClearApplyTo.contents="Contents";
  17267. })(ClearApplyTo=Excel.ClearApplyTo || (Excel.ClearApplyTo={}));
  17268. var ChartDataLabelPosition;
  17269. (function (ChartDataLabelPosition) {
  17270. ChartDataLabelPosition.invalid="Invalid";
  17271. ChartDataLabelPosition.none="None";
  17272. ChartDataLabelPosition.center="Center";
  17273. ChartDataLabelPosition.insideEnd="InsideEnd";
  17274. ChartDataLabelPosition.insideBase="InsideBase";
  17275. ChartDataLabelPosition.outsideEnd="OutsideEnd";
  17276. ChartDataLabelPosition.left="Left";
  17277. ChartDataLabelPosition.right="Right";
  17278. ChartDataLabelPosition.top="Top";
  17279. ChartDataLabelPosition.bottom="Bottom";
  17280. ChartDataLabelPosition.bestFit="BestFit";
  17281. ChartDataLabelPosition.callout="Callout";
  17282. })(ChartDataLabelPosition=Excel.ChartDataLabelPosition || (Excel.ChartDataLabelPosition={}));
  17283. var ChartLegendPosition;
  17284. (function (ChartLegendPosition) {
  17285. ChartLegendPosition.invalid="Invalid";
  17286. ChartLegendPosition.top="Top";
  17287. ChartLegendPosition.bottom="Bottom";
  17288. ChartLegendPosition.left="Left";
  17289. ChartLegendPosition.right="Right";
  17290. ChartLegendPosition.corner="Corner";
  17291. ChartLegendPosition.custom="Custom";
  17292. })(ChartLegendPosition=Excel.ChartLegendPosition || (Excel.ChartLegendPosition={}));
  17293. var ChartSeriesBy;
  17294. (function (ChartSeriesBy) {
  17295. ChartSeriesBy.auto="Auto";
  17296. ChartSeriesBy.columns="Columns";
  17297. ChartSeriesBy.rows="Rows";
  17298. })(ChartSeriesBy=Excel.ChartSeriesBy || (Excel.ChartSeriesBy={}));
  17299. var ChartType;
  17300. (function (ChartType) {
  17301. ChartType.invalid="Invalid";
  17302. ChartType.columnClustered="ColumnClustered";
  17303. ChartType.columnStacked="ColumnStacked";
  17304. ChartType.columnStacked100="ColumnStacked100";
  17305. ChartType._3DColumnClustered="3DColumnClustered";
  17306. ChartType._3DColumnStacked="3DColumnStacked";
  17307. ChartType._3DColumnStacked100="3DColumnStacked100";
  17308. ChartType.barClustered="BarClustered";
  17309. ChartType.barStacked="BarStacked";
  17310. ChartType.barStacked100="BarStacked100";
  17311. ChartType._3DBarClustered="3DBarClustered";
  17312. ChartType._3DBarStacked="3DBarStacked";
  17313. ChartType._3DBarStacked100="3DBarStacked100";
  17314. ChartType.lineStacked="LineStacked";
  17315. ChartType.lineStacked100="LineStacked100";
  17316. ChartType.lineMarkers="LineMarkers";
  17317. ChartType.lineMarkersStacked="LineMarkersStacked";
  17318. ChartType.lineMarkersStacked100="LineMarkersStacked100";
  17319. ChartType.pieOfPie="PieOfPie";
  17320. ChartType.pieExploded="PieExploded";
  17321. ChartType._3DPieExploded="3DPieExploded";
  17322. ChartType.barOfPie="BarOfPie";
  17323. ChartType.xyscatterSmooth="XYScatterSmooth";
  17324. ChartType.xyscatterSmoothNoMarkers="XYScatterSmoothNoMarkers";
  17325. ChartType.xyscatterLines="XYScatterLines";
  17326. ChartType.xyscatterLinesNoMarkers="XYScatterLinesNoMarkers";
  17327. ChartType.areaStacked="AreaStacked";
  17328. ChartType.areaStacked100="AreaStacked100";
  17329. ChartType._3DAreaStacked="3DAreaStacked";
  17330. ChartType._3DAreaStacked100="3DAreaStacked100";
  17331. ChartType.doughnutExploded="DoughnutExploded";
  17332. ChartType.radarMarkers="RadarMarkers";
  17333. ChartType.radarFilled="RadarFilled";
  17334. ChartType.surface="Surface";
  17335. ChartType.surfaceWireframe="SurfaceWireframe";
  17336. ChartType.surfaceTopView="SurfaceTopView";
  17337. ChartType.surfaceTopViewWireframe="SurfaceTopViewWireframe";
  17338. ChartType.bubble="Bubble";
  17339. ChartType.bubble3DEffect="Bubble3DEffect";
  17340. ChartType.stockHLC="StockHLC";
  17341. ChartType.stockOHLC="StockOHLC";
  17342. ChartType.stockVHLC="StockVHLC";
  17343. ChartType.stockVOHLC="StockVOHLC";
  17344. ChartType.cylinderColClustered="CylinderColClustered";
  17345. ChartType.cylinderColStacked="CylinderColStacked";
  17346. ChartType.cylinderColStacked100="CylinderColStacked100";
  17347. ChartType.cylinderBarClustered="CylinderBarClustered";
  17348. ChartType.cylinderBarStacked="CylinderBarStacked";
  17349. ChartType.cylinderBarStacked100="CylinderBarStacked100";
  17350. ChartType.cylinderCol="CylinderCol";
  17351. ChartType.coneColClustered="ConeColClustered";
  17352. ChartType.coneColStacked="ConeColStacked";
  17353. ChartType.coneColStacked100="ConeColStacked100";
  17354. ChartType.coneBarClustered="ConeBarClustered";
  17355. ChartType.coneBarStacked="ConeBarStacked";
  17356. ChartType.coneBarStacked100="ConeBarStacked100";
  17357. ChartType.coneCol="ConeCol";
  17358. ChartType.pyramidColClustered="PyramidColClustered";
  17359. ChartType.pyramidColStacked="PyramidColStacked";
  17360. ChartType.pyramidColStacked100="PyramidColStacked100";
  17361. ChartType.pyramidBarClustered="PyramidBarClustered";
  17362. ChartType.pyramidBarStacked="PyramidBarStacked";
  17363. ChartType.pyramidBarStacked100="PyramidBarStacked100";
  17364. ChartType.pyramidCol="PyramidCol";
  17365. ChartType._3DColumn="3DColumn";
  17366. ChartType.line="Line";
  17367. ChartType._3DLine="3DLine";
  17368. ChartType._3DPie="3DPie";
  17369. ChartType.pie="Pie";
  17370. ChartType.xyscatter="XYScatter";
  17371. ChartType._3DArea="3DArea";
  17372. ChartType.area="Area";
  17373. ChartType.doughnut="Doughnut";
  17374. ChartType.radar="Radar";
  17375. })(ChartType=Excel.ChartType || (Excel.ChartType={}));
  17376. var ChartUnderlineStyle;
  17377. (function (ChartUnderlineStyle) {
  17378. ChartUnderlineStyle.none="None";
  17379. ChartUnderlineStyle.single="Single";
  17380. })(ChartUnderlineStyle=Excel.ChartUnderlineStyle || (Excel.ChartUnderlineStyle={}));
  17381. var DeleteShiftDirection;
  17382. (function (DeleteShiftDirection) {
  17383. DeleteShiftDirection.up="Up";
  17384. DeleteShiftDirection.left="Left";
  17385. })(DeleteShiftDirection=Excel.DeleteShiftDirection || (Excel.DeleteShiftDirection={}));
  17386. var DynamicFilterCriteria;
  17387. (function (DynamicFilterCriteria) {
  17388. DynamicFilterCriteria.unknown="Unknown";
  17389. DynamicFilterCriteria.aboveAverage="AboveAverage";
  17390. DynamicFilterCriteria.allDatesInPeriodApril="AllDatesInPeriodApril";
  17391. DynamicFilterCriteria.allDatesInPeriodAugust="AllDatesInPeriodAugust";
  17392. DynamicFilterCriteria.allDatesInPeriodDecember="AllDatesInPeriodDecember";
  17393. DynamicFilterCriteria.allDatesInPeriodFebruray="AllDatesInPeriodFebruray";
  17394. DynamicFilterCriteria.allDatesInPeriodJanuary="AllDatesInPeriodJanuary";
  17395. DynamicFilterCriteria.allDatesInPeriodJuly="AllDatesInPeriodJuly";
  17396. DynamicFilterCriteria.allDatesInPeriodJune="AllDatesInPeriodJune";
  17397. DynamicFilterCriteria.allDatesInPeriodMarch="AllDatesInPeriodMarch";
  17398. DynamicFilterCriteria.allDatesInPeriodMay="AllDatesInPeriodMay";
  17399. DynamicFilterCriteria.allDatesInPeriodNovember="AllDatesInPeriodNovember";
  17400. DynamicFilterCriteria.allDatesInPeriodOctober="AllDatesInPeriodOctober";
  17401. DynamicFilterCriteria.allDatesInPeriodQuarter1="AllDatesInPeriodQuarter1";
  17402. DynamicFilterCriteria.allDatesInPeriodQuarter2="AllDatesInPeriodQuarter2";
  17403. DynamicFilterCriteria.allDatesInPeriodQuarter3="AllDatesInPeriodQuarter3";
  17404. DynamicFilterCriteria.allDatesInPeriodQuarter4="AllDatesInPeriodQuarter4";
  17405. DynamicFilterCriteria.allDatesInPeriodSeptember="AllDatesInPeriodSeptember";
  17406. DynamicFilterCriteria.belowAverage="BelowAverage";
  17407. DynamicFilterCriteria.lastMonth="LastMonth";
  17408. DynamicFilterCriteria.lastQuarter="LastQuarter";
  17409. DynamicFilterCriteria.lastWeek="LastWeek";
  17410. DynamicFilterCriteria.lastYear="LastYear";
  17411. DynamicFilterCriteria.nextMonth="NextMonth";
  17412. DynamicFilterCriteria.nextQuarter="NextQuarter";
  17413. DynamicFilterCriteria.nextWeek="NextWeek";
  17414. DynamicFilterCriteria.nextYear="NextYear";
  17415. DynamicFilterCriteria.thisMonth="ThisMonth";
  17416. DynamicFilterCriteria.thisQuarter="ThisQuarter";
  17417. DynamicFilterCriteria.thisWeek="ThisWeek";
  17418. DynamicFilterCriteria.thisYear="ThisYear";
  17419. DynamicFilterCriteria.today="Today";
  17420. DynamicFilterCriteria.tomorrow="Tomorrow";
  17421. DynamicFilterCriteria.yearToDate="YearToDate";
  17422. DynamicFilterCriteria.yesterday="Yesterday";
  17423. })(DynamicFilterCriteria=Excel.DynamicFilterCriteria || (Excel.DynamicFilterCriteria={}));
  17424. var FilterDatetimeSpecificity;
  17425. (function (FilterDatetimeSpecificity) {
  17426. FilterDatetimeSpecificity.year="Year";
  17427. FilterDatetimeSpecificity.month="Month";
  17428. FilterDatetimeSpecificity.day="Day";
  17429. FilterDatetimeSpecificity.hour="Hour";
  17430. FilterDatetimeSpecificity.minute="Minute";
  17431. FilterDatetimeSpecificity.second="Second";
  17432. })(FilterDatetimeSpecificity=Excel.FilterDatetimeSpecificity || (Excel.FilterDatetimeSpecificity={}));
  17433. var FilterOn;
  17434. (function (FilterOn) {
  17435. FilterOn.bottomItems="BottomItems";
  17436. FilterOn.bottomPercent="BottomPercent";
  17437. FilterOn.cellColor="CellColor";
  17438. FilterOn.dynamic="Dynamic";
  17439. FilterOn.fontColor="FontColor";
  17440. FilterOn.values="Values";
  17441. FilterOn.topItems="TopItems";
  17442. FilterOn.topPercent="TopPercent";
  17443. FilterOn.icon="Icon";
  17444. FilterOn.custom="Custom";
  17445. })(FilterOn=Excel.FilterOn || (Excel.FilterOn={}));
  17446. var FilterOperator;
  17447. (function (FilterOperator) {
  17448. FilterOperator.and="And";
  17449. FilterOperator.or="Or";
  17450. })(FilterOperator=Excel.FilterOperator || (Excel.FilterOperator={}));
  17451. var HorizontalAlignment;
  17452. (function (HorizontalAlignment) {
  17453. HorizontalAlignment.general="General";
  17454. HorizontalAlignment.left="Left";
  17455. HorizontalAlignment.center="Center";
  17456. HorizontalAlignment.right="Right";
  17457. HorizontalAlignment.fill="Fill";
  17458. HorizontalAlignment.justify="Justify";
  17459. HorizontalAlignment.centerAcrossSelection="CenterAcrossSelection";
  17460. HorizontalAlignment.distributed="Distributed";
  17461. })(HorizontalAlignment=Excel.HorizontalAlignment || (Excel.HorizontalAlignment={}));
  17462. var IconSet;
  17463. (function (IconSet) {
  17464. IconSet.invalid="Invalid";
  17465. IconSet.threeArrows="ThreeArrows";
  17466. IconSet.threeArrowsGray="ThreeArrowsGray";
  17467. IconSet.threeFlags="ThreeFlags";
  17468. IconSet.threeTrafficLights1="ThreeTrafficLights1";
  17469. IconSet.threeTrafficLights2="ThreeTrafficLights2";
  17470. IconSet.threeSigns="ThreeSigns";
  17471. IconSet.threeSymbols="ThreeSymbols";
  17472. IconSet.threeSymbols2="ThreeSymbols2";
  17473. IconSet.fourArrows="FourArrows";
  17474. IconSet.fourArrowsGray="FourArrowsGray";
  17475. IconSet.fourRedToBlack="FourRedToBlack";
  17476. IconSet.fourRating="FourRating";
  17477. IconSet.fourTrafficLights="FourTrafficLights";
  17478. IconSet.fiveArrows="FiveArrows";
  17479. IconSet.fiveArrowsGray="FiveArrowsGray";
  17480. IconSet.fiveRating="FiveRating";
  17481. IconSet.fiveQuarters="FiveQuarters";
  17482. IconSet.threeStars="ThreeStars";
  17483. IconSet.threeTriangles="ThreeTriangles";
  17484. IconSet.fiveBoxes="FiveBoxes";
  17485. })(IconSet=Excel.IconSet || (Excel.IconSet={}));
  17486. var ImageFittingMode;
  17487. (function (ImageFittingMode) {
  17488. ImageFittingMode.fit="Fit";
  17489. ImageFittingMode.fitAndCenter="FitAndCenter";
  17490. ImageFittingMode.fill="Fill";
  17491. })(ImageFittingMode=Excel.ImageFittingMode || (Excel.ImageFittingMode={}));
  17492. var InsertShiftDirection;
  17493. (function (InsertShiftDirection) {
  17494. InsertShiftDirection.down="Down";
  17495. InsertShiftDirection.right="Right";
  17496. })(InsertShiftDirection=Excel.InsertShiftDirection || (Excel.InsertShiftDirection={}));
  17497. var NamedItemType;
  17498. (function (NamedItemType) {
  17499. NamedItemType.string="String";
  17500. NamedItemType.integer="Integer";
  17501. NamedItemType.double="Double";
  17502. NamedItemType.boolean="Boolean";
  17503. NamedItemType.range="Range";
  17504. })(NamedItemType=Excel.NamedItemType || (Excel.NamedItemType={}));
  17505. var RangeUnderlineStyle;
  17506. (function (RangeUnderlineStyle) {
  17507. RangeUnderlineStyle.none="None";
  17508. RangeUnderlineStyle.single="Single";
  17509. RangeUnderlineStyle.double="Double";
  17510. RangeUnderlineStyle.singleAccountant="SingleAccountant";
  17511. RangeUnderlineStyle.doubleAccountant="DoubleAccountant";
  17512. })(RangeUnderlineStyle=Excel.RangeUnderlineStyle || (Excel.RangeUnderlineStyle={}));
  17513. var SheetVisibility;
  17514. (function (SheetVisibility) {
  17515. SheetVisibility.visible="Visible";
  17516. SheetVisibility.hidden="Hidden";
  17517. SheetVisibility.veryHidden="VeryHidden";
  17518. })(SheetVisibility=Excel.SheetVisibility || (Excel.SheetVisibility={}));
  17519. var RangeValueType;
  17520. (function (RangeValueType) {
  17521. RangeValueType.unknown="Unknown";
  17522. RangeValueType.empty="Empty";
  17523. RangeValueType.string="String";
  17524. RangeValueType.integer="Integer";
  17525. RangeValueType.double="Double";
  17526. RangeValueType.boolean="Boolean";
  17527. RangeValueType.error="Error";
  17528. })(RangeValueType=Excel.RangeValueType || (Excel.RangeValueType={}));
  17529. var SortOrientation;
  17530. (function (SortOrientation) {
  17531. SortOrientation.rows="Rows";
  17532. SortOrientation.columns="Columns";
  17533. })(SortOrientation=Excel.SortOrientation || (Excel.SortOrientation={}));
  17534. var SortOn;
  17535. (function (SortOn) {
  17536. SortOn.value="Value";
  17537. SortOn.cellColor="CellColor";
  17538. SortOn.fontColor="FontColor";
  17539. SortOn.icon="Icon";
  17540. })(SortOn=Excel.SortOn || (Excel.SortOn={}));
  17541. var SortDataOption;
  17542. (function (SortDataOption) {
  17543. SortDataOption.normal="Normal";
  17544. SortDataOption.textAsNumber="TextAsNumber";
  17545. })(SortDataOption=Excel.SortDataOption || (Excel.SortDataOption={}));
  17546. var SortMethod;
  17547. (function (SortMethod) {
  17548. SortMethod.pinYin="PinYin";
  17549. SortMethod.strokeCount="StrokeCount";
  17550. })(SortMethod=Excel.SortMethod || (Excel.SortMethod={}));
  17551. var VerticalAlignment;
  17552. (function (VerticalAlignment) {
  17553. VerticalAlignment.top="Top";
  17554. VerticalAlignment.center="Center";
  17555. VerticalAlignment.bottom="Bottom";
  17556. VerticalAlignment.justify="Justify";
  17557. VerticalAlignment.distributed="Distributed";
  17558. })(VerticalAlignment=Excel.VerticalAlignment || (Excel.VerticalAlignment={}));
  17559. var FunctionResult=(function (_super) {
  17560. __extends(FunctionResult, _super);
  17561. function FunctionResult() {
  17562. _super.apply(this, arguments);
  17563. }
  17564. Object.defineProperty(FunctionResult.prototype, "error", {
  17565. get: function () {
  17566. _throwIfNotLoaded("error", this.m_error, "FunctionResult", this._isNull);
  17567. return this.m_error;
  17568. },
  17569. enumerable: true,
  17570. configurable: true
  17571. });
  17572. Object.defineProperty(FunctionResult.prototype, "value", {
  17573. get: function () {
  17574. _throwIfNotLoaded("value", this.m_value, "FunctionResult", this._isNull);
  17575. return this.m_value;
  17576. },
  17577. enumerable: true,
  17578. configurable: true
  17579. });
  17580. FunctionResult.prototype._handleResult=function (value) {
  17581. _super.prototype._handleResult.call(this, value);
  17582. if (_isNullOrUndefined(value))
  17583. return;
  17584. var obj=value;
  17585. _fixObjectPathIfNecessary(this, obj);
  17586. if (!_isUndefined(obj["Error"])) {
  17587. this.m_error=obj["Error"];
  17588. }
  17589. if (!_isUndefined(obj["Value"])) {
  17590. this.m_value=obj["Value"];
  17591. }
  17592. };
  17593. FunctionResult.prototype.load=function (option) {
  17594. _load(this, option);
  17595. return this;
  17596. };
  17597. FunctionResult.prototype.toJSON=function () {
  17598. return {
  17599. "error": this.m_error,
  17600. "value": this.m_value
  17601. };
  17602. };
  17603. return FunctionResult;
  17604. }(OfficeExtension.ClientObject));
  17605. Excel.FunctionResult=FunctionResult;
  17606. var Functions=(function (_super) {
  17607. __extends(Functions, _super);
  17608. function Functions() {
  17609. _super.apply(this, arguments);
  17610. }
  17611. Functions.prototype.abs=function (number) {
  17612. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Abs", OfficeExtension.OperationType.Default, [number], false, true, null));
  17613. };
  17614. Functions.prototype.accrInt=function (issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod) {
  17615. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrInt", OfficeExtension.OperationType.Default, [issue, firstInterest, settlement, rate, par, frequency, basis, calcMethod], false, true, null));
  17616. };
  17617. Functions.prototype.accrIntM=function (issue, settlement, rate, par, basis) {
  17618. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AccrIntM", OfficeExtension.OperationType.Default, [issue, settlement, rate, par, basis], false, true, null));
  17619. };
  17620. Functions.prototype.acos=function (number) {
  17621. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acos", OfficeExtension.OperationType.Default, [number], false, true, null));
  17622. };
  17623. Functions.prototype.acosh=function (number) {
  17624. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17625. };
  17626. Functions.prototype.acot=function (number) {
  17627. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acot", OfficeExtension.OperationType.Default, [number], false, true, null));
  17628. };
  17629. Functions.prototype.acoth=function (number) {
  17630. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Acoth", OfficeExtension.OperationType.Default, [number], false, true, null));
  17631. };
  17632. Functions.prototype.amorDegrc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  17633. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorDegrc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  17634. };
  17635. Functions.prototype.amorLinc=function (cost, datePurchased, firstPeriod, salvage, period, rate, basis) {
  17636. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AmorLinc", OfficeExtension.OperationType.Default, [cost, datePurchased, firstPeriod, salvage, period, rate, basis], false, true, null));
  17637. };
  17638. Functions.prototype.and=function () {
  17639. var values=[];
  17640. for (var _i=0; _i < arguments.length; _i++) {
  17641. values[_i - 0]=arguments[_i];
  17642. }
  17643. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "And", OfficeExtension.OperationType.Default, [values], false, true, null));
  17644. };
  17645. Functions.prototype.arabic=function (text) {
  17646. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Arabic", OfficeExtension.OperationType.Default, [text], false, true, null));
  17647. };
  17648. Functions.prototype.areas=function (reference) {
  17649. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Areas", OfficeExtension.OperationType.Default, [reference], false, true, null));
  17650. };
  17651. Functions.prototype.asc=function (text) {
  17652. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asc", OfficeExtension.OperationType.Default, [text], false, true, null));
  17653. };
  17654. Functions.prototype.asin=function (number) {
  17655. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asin", OfficeExtension.OperationType.Default, [number], false, true, null));
  17656. };
  17657. Functions.prototype.asinh=function (number) {
  17658. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Asinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17659. };
  17660. Functions.prototype.atan=function (number) {
  17661. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan", OfficeExtension.OperationType.Default, [number], false, true, null));
  17662. };
  17663. Functions.prototype.atan2=function (xNum, yNum) {
  17664. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atan2", OfficeExtension.OperationType.Default, [xNum, yNum], false, true, null));
  17665. };
  17666. Functions.prototype.atanh=function (number) {
  17667. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Atanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17668. };
  17669. Functions.prototype.aveDev=function () {
  17670. var values=[];
  17671. for (var _i=0; _i < arguments.length; _i++) {
  17672. values[_i - 0]=arguments[_i];
  17673. }
  17674. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AveDev", OfficeExtension.OperationType.Default, [values], false, true, null));
  17675. };
  17676. Functions.prototype.average=function () {
  17677. var values=[];
  17678. for (var _i=0; _i < arguments.length; _i++) {
  17679. values[_i - 0]=arguments[_i];
  17680. }
  17681. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Average", OfficeExtension.OperationType.Default, [values], false, true, null));
  17682. };
  17683. Functions.prototype.averageA=function () {
  17684. var values=[];
  17685. for (var _i=0; _i < arguments.length; _i++) {
  17686. values[_i - 0]=arguments[_i];
  17687. }
  17688. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageA", OfficeExtension.OperationType.Default, [values], false, true, null));
  17689. };
  17690. Functions.prototype.averageIf=function (range, criteria, averageRange) {
  17691. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIf", OfficeExtension.OperationType.Default, [range, criteria, averageRange], false, true, null));
  17692. };
  17693. Functions.prototype.averageIfs=function (averageRange) {
  17694. var values=[];
  17695. for (var _i=1; _i < arguments.length; _i++) {
  17696. values[_i - 1]=arguments[_i];
  17697. }
  17698. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "AverageIfs", OfficeExtension.OperationType.Default, [averageRange, values], false, true, null));
  17699. };
  17700. Functions.prototype.bahtText=function (number) {
  17701. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BahtText", OfficeExtension.OperationType.Default, [number], false, true, null));
  17702. };
  17703. Functions.prototype.base=function (number, radix, minLength) {
  17704. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Base", OfficeExtension.OperationType.Default, [number, radix, minLength], false, true, null));
  17705. };
  17706. Functions.prototype.besselI=function (x, n) {
  17707. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselI", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17708. };
  17709. Functions.prototype.besselJ=function (x, n) {
  17710. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselJ", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17711. };
  17712. Functions.prototype.besselK=function (x, n) {
  17713. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselK", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17714. };
  17715. Functions.prototype.besselY=function (x, n) {
  17716. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "BesselY", OfficeExtension.OperationType.Default, [x, n], false, true, null));
  17717. };
  17718. Functions.prototype.beta_Dist=function (x, alpha, beta, cumulative, A, B) {
  17719. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative, A, B], false, true, null));
  17720. };
  17721. Functions.prototype.beta_Inv=function (probability, alpha, beta, A, B) {
  17722. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Beta_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta, A, B], false, true, null));
  17723. };
  17724. Functions.prototype.bin2Dec=function (number) {
  17725. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  17726. };
  17727. Functions.prototype.bin2Hex=function (number, places) {
  17728. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17729. };
  17730. Functions.prototype.bin2Oct=function (number, places) {
  17731. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bin2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17732. };
  17733. Functions.prototype.binom_Dist=function (numberS, trials, probabilityS, cumulative) {
  17734. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist", OfficeExtension.OperationType.Default, [numberS, trials, probabilityS, cumulative], false, true, null));
  17735. };
  17736. Functions.prototype.binom_Dist_Range=function (trials, probabilityS, numberS, numberS2) {
  17737. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Dist_Range", OfficeExtension.OperationType.Default, [trials, probabilityS, numberS, numberS2], false, true, null));
  17738. };
  17739. Functions.prototype.binom_Inv=function (trials, probabilityS, alpha) {
  17740. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Binom_Inv", OfficeExtension.OperationType.Default, [trials, probabilityS, alpha], false, true, null));
  17741. };
  17742. Functions.prototype.bitand=function (number1, number2) {
  17743. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitand", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17744. };
  17745. Functions.prototype.bitlshift=function (number, shiftAmount) {
  17746. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitlshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  17747. };
  17748. Functions.prototype.bitor=function (number1, number2) {
  17749. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17750. };
  17751. Functions.prototype.bitrshift=function (number, shiftAmount) {
  17752. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitrshift", OfficeExtension.OperationType.Default, [number, shiftAmount], false, true, null));
  17753. };
  17754. Functions.prototype.bitxor=function (number1, number2) {
  17755. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Bitxor", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17756. };
  17757. Functions.prototype.ceiling_Math=function (number, significance, mode) {
  17758. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  17759. };
  17760. Functions.prototype.ceiling_Precise=function (number, significance) {
  17761. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ceiling_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  17762. };
  17763. Functions.prototype.char=function (number) {
  17764. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Char", OfficeExtension.OperationType.Default, [number], false, true, null));
  17765. };
  17766. Functions.prototype.chiSq_Dist=function (x, degFreedom, cumulative) {
  17767. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  17768. };
  17769. Functions.prototype.chiSq_Dist_RT=function (x, degFreedom) {
  17770. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  17771. };
  17772. Functions.prototype.chiSq_Inv=function (probability, degFreedom) {
  17773. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  17774. };
  17775. Functions.prototype.chiSq_Inv_RT=function (probability, degFreedom) {
  17776. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ChiSq_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  17777. };
  17778. Functions.prototype.choose=function (indexNum) {
  17779. var values=[];
  17780. for (var _i=1; _i < arguments.length; _i++) {
  17781. values[_i - 1]=arguments[_i];
  17782. }
  17783. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Choose", OfficeExtension.OperationType.Default, [indexNum, values], false, true, null));
  17784. };
  17785. Functions.prototype.clean=function (text) {
  17786. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Clean", OfficeExtension.OperationType.Default, [text], false, true, null));
  17787. };
  17788. Functions.prototype.code=function (text) {
  17789. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Code", OfficeExtension.OperationType.Default, [text], false, true, null));
  17790. };
  17791. Functions.prototype.columns=function (array) {
  17792. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Columns", OfficeExtension.OperationType.Default, [array], false, true, null));
  17793. };
  17794. Functions.prototype.combin=function (number, numberChosen) {
  17795. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combin", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  17796. };
  17797. Functions.prototype.combina=function (number, numberChosen) {
  17798. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Combina", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  17799. };
  17800. Functions.prototype.complex=function (realNum, iNum, suffix) {
  17801. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Complex", OfficeExtension.OperationType.Default, [realNum, iNum, suffix], false, true, null));
  17802. };
  17803. Functions.prototype.concatenate=function () {
  17804. var values=[];
  17805. for (var _i=0; _i < arguments.length; _i++) {
  17806. values[_i - 0]=arguments[_i];
  17807. }
  17808. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Concatenate", OfficeExtension.OperationType.Default, [values], false, true, null));
  17809. };
  17810. Functions.prototype.confidence_Norm=function (alpha, standardDev, size) {
  17811. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_Norm", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  17812. };
  17813. Functions.prototype.confidence_T=function (alpha, standardDev, size) {
  17814. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Confidence_T", OfficeExtension.OperationType.Default, [alpha, standardDev, size], false, true, null));
  17815. };
  17816. Functions.prototype.convert=function (number, fromUnit, toUnit) {
  17817. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Convert", OfficeExtension.OperationType.Default, [number, fromUnit, toUnit], false, true, null));
  17818. };
  17819. Functions.prototype.cos=function (number) {
  17820. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cos", OfficeExtension.OperationType.Default, [number], false, true, null));
  17821. };
  17822. Functions.prototype.cosh=function (number) {
  17823. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cosh", OfficeExtension.OperationType.Default, [number], false, true, null));
  17824. };
  17825. Functions.prototype.cot=function (number) {
  17826. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Cot", OfficeExtension.OperationType.Default, [number], false, true, null));
  17827. };
  17828. Functions.prototype.coth=function (number) {
  17829. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Coth", OfficeExtension.OperationType.Default, [number], false, true, null));
  17830. };
  17831. Functions.prototype.count=function () {
  17832. var values=[];
  17833. for (var _i=0; _i < arguments.length; _i++) {
  17834. values[_i - 0]=arguments[_i];
  17835. }
  17836. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Count", OfficeExtension.OperationType.Default, [values], false, true, null));
  17837. };
  17838. Functions.prototype.countA=function () {
  17839. var values=[];
  17840. for (var _i=0; _i < arguments.length; _i++) {
  17841. values[_i - 0]=arguments[_i];
  17842. }
  17843. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountA", OfficeExtension.OperationType.Default, [values], false, true, null));
  17844. };
  17845. Functions.prototype.countBlank=function (range) {
  17846. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountBlank", OfficeExtension.OperationType.Default, [range], false, true, null));
  17847. };
  17848. Functions.prototype.countIf=function (range, criteria) {
  17849. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIf", OfficeExtension.OperationType.Default, [range, criteria], false, true, null));
  17850. };
  17851. Functions.prototype.countIfs=function () {
  17852. var values=[];
  17853. for (var _i=0; _i < arguments.length; _i++) {
  17854. values[_i - 0]=arguments[_i];
  17855. }
  17856. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CountIfs", OfficeExtension.OperationType.Default, [values], false, true, null));
  17857. };
  17858. Functions.prototype.coupDayBs=function (settlement, maturity, frequency, basis) {
  17859. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDayBs", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17860. };
  17861. Functions.prototype.coupDays=function (settlement, maturity, frequency, basis) {
  17862. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDays", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17863. };
  17864. Functions.prototype.coupDaysNc=function (settlement, maturity, frequency, basis) {
  17865. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupDaysNc", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17866. };
  17867. Functions.prototype.coupNcd=function (settlement, maturity, frequency, basis) {
  17868. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17869. };
  17870. Functions.prototype.coupNum=function (settlement, maturity, frequency, basis) {
  17871. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupNum", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17872. };
  17873. Functions.prototype.coupPcd=function (settlement, maturity, frequency, basis) {
  17874. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CoupPcd", OfficeExtension.OperationType.Default, [settlement, maturity, frequency, basis], false, true, null));
  17875. };
  17876. Functions.prototype.csc=function (number) {
  17877. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csc", OfficeExtension.OperationType.Default, [number], false, true, null));
  17878. };
  17879. Functions.prototype.csch=function (number) {
  17880. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Csch", OfficeExtension.OperationType.Default, [number], false, true, null));
  17881. };
  17882. Functions.prototype.cumIPmt=function (rate, nper, pv, startPeriod, endPeriod, type) {
  17883. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumIPmt", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  17884. };
  17885. Functions.prototype.cumPrinc=function (rate, nper, pv, startPeriod, endPeriod, type) {
  17886. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "CumPrinc", OfficeExtension.OperationType.Default, [rate, nper, pv, startPeriod, endPeriod, type], false, true, null));
  17887. };
  17888. Functions.prototype.daverage=function (database, field, criteria) {
  17889. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DAverage", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17890. };
  17891. Functions.prototype.dcount=function (database, field, criteria) {
  17892. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCount", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17893. };
  17894. Functions.prototype.dcountA=function (database, field, criteria) {
  17895. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DCountA", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17896. };
  17897. Functions.prototype.dget=function (database, field, criteria) {
  17898. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DGet", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17899. };
  17900. Functions.prototype.dmax=function (database, field, criteria) {
  17901. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMax", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17902. };
  17903. Functions.prototype.dmin=function (database, field, criteria) {
  17904. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DMin", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17905. };
  17906. Functions.prototype.dproduct=function (database, field, criteria) {
  17907. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DProduct", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17908. };
  17909. Functions.prototype.dstDev=function (database, field, criteria) {
  17910. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDev", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17911. };
  17912. Functions.prototype.dstDevP=function (database, field, criteria) {
  17913. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DStDevP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17914. };
  17915. Functions.prototype.dsum=function (database, field, criteria) {
  17916. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DSum", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17917. };
  17918. Functions.prototype.dvar=function (database, field, criteria) {
  17919. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVar", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17920. };
  17921. Functions.prototype.dvarP=function (database, field, criteria) {
  17922. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DVarP", OfficeExtension.OperationType.Default, [database, field, criteria], false, true, null));
  17923. };
  17924. Functions.prototype.date=function (year, month, day) {
  17925. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Date", OfficeExtension.OperationType.Default, [year, month, day], false, true, null));
  17926. };
  17927. Functions.prototype.datevalue=function (dateText) {
  17928. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Datevalue", OfficeExtension.OperationType.Default, [dateText], false, true, null));
  17929. };
  17930. Functions.prototype.day=function (serialNumber) {
  17931. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Day", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  17932. };
  17933. Functions.prototype.days=function (endDate, startDate) {
  17934. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days", OfficeExtension.OperationType.Default, [endDate, startDate], false, true, null));
  17935. };
  17936. Functions.prototype.days360=function (startDate, endDate, method) {
  17937. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Days360", OfficeExtension.OperationType.Default, [startDate, endDate, method], false, true, null));
  17938. };
  17939. Functions.prototype.db=function (cost, salvage, life, period, month) {
  17940. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Db", OfficeExtension.OperationType.Default, [cost, salvage, life, period, month], false, true, null));
  17941. };
  17942. Functions.prototype.dbcs=function (text) {
  17943. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dbcs", OfficeExtension.OperationType.Default, [text], false, true, null));
  17944. };
  17945. Functions.prototype.ddb=function (cost, salvage, life, period, factor) {
  17946. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ddb", OfficeExtension.OperationType.Default, [cost, salvage, life, period, factor], false, true, null));
  17947. };
  17948. Functions.prototype.dec2Bin=function (number, places) {
  17949. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17950. };
  17951. Functions.prototype.dec2Hex=function (number, places) {
  17952. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17953. };
  17954. Functions.prototype.dec2Oct=function (number, places) {
  17955. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dec2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  17956. };
  17957. Functions.prototype.decimal=function (number, radix) {
  17958. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Decimal", OfficeExtension.OperationType.Default, [number, radix], false, true, null));
  17959. };
  17960. Functions.prototype.degrees=function (angle) {
  17961. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Degrees", OfficeExtension.OperationType.Default, [angle], false, true, null));
  17962. };
  17963. Functions.prototype.delta=function (number1, number2) {
  17964. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Delta", OfficeExtension.OperationType.Default, [number1, number2], false, true, null));
  17965. };
  17966. Functions.prototype.devSq=function () {
  17967. var values=[];
  17968. for (var _i=0; _i < arguments.length; _i++) {
  17969. values[_i - 0]=arguments[_i];
  17970. }
  17971. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DevSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  17972. };
  17973. Functions.prototype.disc=function (settlement, maturity, pr, redemption, basis) {
  17974. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Disc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  17975. };
  17976. Functions.prototype.dollar=function (number, decimals) {
  17977. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Dollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  17978. };
  17979. Functions.prototype.dollarDe=function (fractionalDollar, fraction) {
  17980. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarDe", OfficeExtension.OperationType.Default, [fractionalDollar, fraction], false, true, null));
  17981. };
  17982. Functions.prototype.dollarFr=function (decimalDollar, fraction) {
  17983. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "DollarFr", OfficeExtension.OperationType.Default, [decimalDollar, fraction], false, true, null));
  17984. };
  17985. Functions.prototype.duration=function (settlement, maturity, coupon, yld, frequency, basis) {
  17986. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Duration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  17987. };
  17988. Functions.prototype.ecma_Ceiling=function (number, significance) {
  17989. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ECMA_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  17990. };
  17991. Functions.prototype.edate=function (startDate, months) {
  17992. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EDate", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  17993. };
  17994. Functions.prototype.effect=function (nominalRate, npery) {
  17995. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Effect", OfficeExtension.OperationType.Default, [nominalRate, npery], false, true, null));
  17996. };
  17997. Functions.prototype.eoMonth=function (startDate, months) {
  17998. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "EoMonth", OfficeExtension.OperationType.Default, [startDate, months], false, true, null));
  17999. };
  18000. Functions.prototype.erf=function (lowerLimit, upperLimit) {
  18001. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf", OfficeExtension.OperationType.Default, [lowerLimit, upperLimit], false, true, null));
  18002. };
  18003. Functions.prototype.erfC=function (x) {
  18004. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC", OfficeExtension.OperationType.Default, [x], false, true, null));
  18005. };
  18006. Functions.prototype.erfC_Precise=function (X) {
  18007. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ErfC_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  18008. };
  18009. Functions.prototype.erf_Precise=function (X) {
  18010. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Erf_Precise", OfficeExtension.OperationType.Default, [X], false, true, null));
  18011. };
  18012. Functions.prototype.error_Type=function (errorVal) {
  18013. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Error_Type", OfficeExtension.OperationType.Default, [errorVal], false, true, null));
  18014. };
  18015. Functions.prototype.even=function (number) {
  18016. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Even", OfficeExtension.OperationType.Default, [number], false, true, null));
  18017. };
  18018. Functions.prototype.exact=function (text1, text2) {
  18019. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exact", OfficeExtension.OperationType.Default, [text1, text2], false, true, null));
  18020. };
  18021. Functions.prototype.exp=function (number) {
  18022. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Exp", OfficeExtension.OperationType.Default, [number], false, true, null));
  18023. };
  18024. Functions.prototype.expon_Dist=function (x, lambda, cumulative) {
  18025. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Expon_Dist", OfficeExtension.OperationType.Default, [x, lambda, cumulative], false, true, null));
  18026. };
  18027. Functions.prototype.fvschedule=function (principal, schedule) {
  18028. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FVSchedule", OfficeExtension.OperationType.Default, [principal, schedule], false, true, null));
  18029. };
  18030. Functions.prototype.f_Dist=function (x, degFreedom1, degFreedom2, cumulative) {
  18031. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2, cumulative], false, true, null));
  18032. };
  18033. Functions.prototype.f_Dist_RT=function (x, degFreedom1, degFreedom2) {
  18034. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom1, degFreedom2], false, true, null));
  18035. };
  18036. Functions.prototype.f_Inv=function (probability, degFreedom1, degFreedom2) {
  18037. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  18038. };
  18039. Functions.prototype.f_Inv_RT=function (probability, degFreedom1, degFreedom2) {
  18040. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "F_Inv_RT", OfficeExtension.OperationType.Default, [probability, degFreedom1, degFreedom2], false, true, null));
  18041. };
  18042. Functions.prototype.fact=function (number) {
  18043. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fact", OfficeExtension.OperationType.Default, [number], false, true, null));
  18044. };
  18045. Functions.prototype.factDouble=function (number) {
  18046. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FactDouble", OfficeExtension.OperationType.Default, [number], false, true, null));
  18047. };
  18048. Functions.prototype.false=function () {
  18049. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "False", OfficeExtension.OperationType.Default, [], false, true, null));
  18050. };
  18051. Functions.prototype.find=function (findText, withinText, startNum) {
  18052. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Find", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  18053. };
  18054. Functions.prototype.findB=function (findText, withinText, startNum) {
  18055. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FindB", OfficeExtension.OperationType.Default, [findText, withinText, startNum], false, true, null));
  18056. };
  18057. Functions.prototype.fisher=function (x) {
  18058. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fisher", OfficeExtension.OperationType.Default, [x], false, true, null));
  18059. };
  18060. Functions.prototype.fisherInv=function (y) {
  18061. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "FisherInv", OfficeExtension.OperationType.Default, [y], false, true, null));
  18062. };
  18063. Functions.prototype.fixed=function (number, decimals, noCommas) {
  18064. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fixed", OfficeExtension.OperationType.Default, [number, decimals, noCommas], false, true, null));
  18065. };
  18066. Functions.prototype.floor_Math=function (number, significance, mode) {
  18067. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Math", OfficeExtension.OperationType.Default, [number, significance, mode], false, true, null));
  18068. };
  18069. Functions.prototype.floor_Precise=function (number, significance) {
  18070. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Floor_Precise", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  18071. };
  18072. Functions.prototype.fv=function (rate, nper, pmt, pv, type) {
  18073. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Fv", OfficeExtension.OperationType.Default, [rate, nper, pmt, pv, type], false, true, null));
  18074. };
  18075. Functions.prototype.gamma=function (x) {
  18076. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma", OfficeExtension.OperationType.Default, [x], false, true, null));
  18077. };
  18078. Functions.prototype.gammaLn=function (x) {
  18079. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn", OfficeExtension.OperationType.Default, [x], false, true, null));
  18080. };
  18081. Functions.prototype.gammaLn_Precise=function (x) {
  18082. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GammaLn_Precise", OfficeExtension.OperationType.Default, [x], false, true, null));
  18083. };
  18084. Functions.prototype.gamma_Dist=function (x, alpha, beta, cumulative) {
  18085. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  18086. };
  18087. Functions.prototype.gamma_Inv=function (probability, alpha, beta) {
  18088. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gamma_Inv", OfficeExtension.OperationType.Default, [probability, alpha, beta], false, true, null));
  18089. };
  18090. Functions.prototype.gauss=function (x) {
  18091. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gauss", OfficeExtension.OperationType.Default, [x], false, true, null));
  18092. };
  18093. Functions.prototype.gcd=function () {
  18094. var values=[];
  18095. for (var _i=0; _i < arguments.length; _i++) {
  18096. values[_i - 0]=arguments[_i];
  18097. }
  18098. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Gcd", OfficeExtension.OperationType.Default, [values], false, true, null));
  18099. };
  18100. Functions.prototype.geStep=function (number, step) {
  18101. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeStep", OfficeExtension.OperationType.Default, [number, step], false, true, null));
  18102. };
  18103. Functions.prototype.geoMean=function () {
  18104. var values=[];
  18105. for (var _i=0; _i < arguments.length; _i++) {
  18106. values[_i - 0]=arguments[_i];
  18107. }
  18108. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "GeoMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  18109. };
  18110. Functions.prototype.hlookup=function (lookupValue, tableArray, rowIndexNum, rangeLookup) {
  18111. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, rowIndexNum, rangeLookup], false, true, null));
  18112. };
  18113. Functions.prototype.harMean=function () {
  18114. var values=[];
  18115. for (var _i=0; _i < arguments.length; _i++) {
  18116. values[_i - 0]=arguments[_i];
  18117. }
  18118. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HarMean", OfficeExtension.OperationType.Default, [values], false, true, null));
  18119. };
  18120. Functions.prototype.hex2Bin=function (number, places) {
  18121. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18122. };
  18123. Functions.prototype.hex2Dec=function (number) {
  18124. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18125. };
  18126. Functions.prototype.hex2Oct=function (number, places) {
  18127. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hex2Oct", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18128. };
  18129. Functions.prototype.hour=function (serialNumber) {
  18130. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hour", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18131. };
  18132. Functions.prototype.hypGeom_Dist=function (sampleS, numberSample, populationS, numberPop, cumulative) {
  18133. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "HypGeom_Dist", OfficeExtension.OperationType.Default, [sampleS, numberSample, populationS, numberPop, cumulative], false, true, null));
  18134. };
  18135. Functions.prototype.hyperlink=function (linkLocation, friendlyName) {
  18136. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Hyperlink", OfficeExtension.OperationType.Default, [linkLocation, friendlyName], false, true, null));
  18137. };
  18138. Functions.prototype.iso_Ceiling=function (number, significance) {
  18139. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ISO_Ceiling", OfficeExtension.OperationType.Default, [number, significance], false, true, null));
  18140. };
  18141. Functions.prototype.if=function (logicalTest, valueIfTrue, valueIfFalse) {
  18142. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "If", OfficeExtension.OperationType.Default, [logicalTest, valueIfTrue, valueIfFalse], false, true, null));
  18143. };
  18144. Functions.prototype.imAbs=function (inumber) {
  18145. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImAbs", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18146. };
  18147. Functions.prototype.imArgument=function (inumber) {
  18148. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImArgument", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18149. };
  18150. Functions.prototype.imConjugate=function (inumber) {
  18151. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImConjugate", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18152. };
  18153. Functions.prototype.imCos=function (inumber) {
  18154. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCos", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18155. };
  18156. Functions.prototype.imCosh=function (inumber) {
  18157. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCosh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18158. };
  18159. Functions.prototype.imCot=function (inumber) {
  18160. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCot", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18161. };
  18162. Functions.prototype.imCsc=function (inumber) {
  18163. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsc", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18164. };
  18165. Functions.prototype.imCsch=function (inumber) {
  18166. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImCsch", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18167. };
  18168. Functions.prototype.imDiv=function (inumber1, inumber2) {
  18169. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImDiv", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  18170. };
  18171. Functions.prototype.imExp=function (inumber) {
  18172. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImExp", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18173. };
  18174. Functions.prototype.imLn=function (inumber) {
  18175. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLn", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18176. };
  18177. Functions.prototype.imLog10=function (inumber) {
  18178. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog10", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18179. };
  18180. Functions.prototype.imLog2=function (inumber) {
  18181. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImLog2", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18182. };
  18183. Functions.prototype.imPower=function (inumber, number) {
  18184. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImPower", OfficeExtension.OperationType.Default, [inumber, number], false, true, null));
  18185. };
  18186. Functions.prototype.imProduct=function () {
  18187. var values=[];
  18188. for (var _i=0; _i < arguments.length; _i++) {
  18189. values[_i - 0]=arguments[_i];
  18190. }
  18191. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImProduct", OfficeExtension.OperationType.Default, [values], false, true, null));
  18192. };
  18193. Functions.prototype.imReal=function (inumber) {
  18194. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImReal", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18195. };
  18196. Functions.prototype.imSec=function (inumber) {
  18197. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSec", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18198. };
  18199. Functions.prototype.imSech=function (inumber) {
  18200. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSech", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18201. };
  18202. Functions.prototype.imSin=function (inumber) {
  18203. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSin", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18204. };
  18205. Functions.prototype.imSinh=function (inumber) {
  18206. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSinh", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18207. };
  18208. Functions.prototype.imSqrt=function (inumber) {
  18209. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSqrt", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18210. };
  18211. Functions.prototype.imSub=function (inumber1, inumber2) {
  18212. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSub", OfficeExtension.OperationType.Default, [inumber1, inumber2], false, true, null));
  18213. };
  18214. Functions.prototype.imSum=function () {
  18215. var values=[];
  18216. for (var _i=0; _i < arguments.length; _i++) {
  18217. values[_i - 0]=arguments[_i];
  18218. }
  18219. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImSum", OfficeExtension.OperationType.Default, [values], false, true, null));
  18220. };
  18221. Functions.prototype.imTan=function (inumber) {
  18222. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ImTan", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18223. };
  18224. Functions.prototype.imaginary=function (inumber) {
  18225. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Imaginary", OfficeExtension.OperationType.Default, [inumber], false, true, null));
  18226. };
  18227. Functions.prototype.int=function (number) {
  18228. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Int", OfficeExtension.OperationType.Default, [number], false, true, null));
  18229. };
  18230. Functions.prototype.intRate=function (settlement, maturity, investment, redemption, basis) {
  18231. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IntRate", OfficeExtension.OperationType.Default, [settlement, maturity, investment, redemption, basis], false, true, null));
  18232. };
  18233. Functions.prototype.ipmt=function (rate, per, nper, pv, fv, type) {
  18234. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ipmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  18235. };
  18236. Functions.prototype.irr=function (values, guess) {
  18237. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Irr", OfficeExtension.OperationType.Default, [values, guess], false, true, null));
  18238. };
  18239. Functions.prototype.isErr=function (value) {
  18240. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsErr", OfficeExtension.OperationType.Default, [value], false, true, null));
  18241. };
  18242. Functions.prototype.isError=function (value) {
  18243. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsError", OfficeExtension.OperationType.Default, [value], false, true, null));
  18244. };
  18245. Functions.prototype.isEven=function (number) {
  18246. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsEven", OfficeExtension.OperationType.Default, [number], false, true, null));
  18247. };
  18248. Functions.prototype.isFormula=function (reference) {
  18249. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsFormula", OfficeExtension.OperationType.Default, [reference], false, true, null));
  18250. };
  18251. Functions.prototype.isLogical=function (value) {
  18252. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsLogical", OfficeExtension.OperationType.Default, [value], false, true, null));
  18253. };
  18254. Functions.prototype.isNA=function (value) {
  18255. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNA", OfficeExtension.OperationType.Default, [value], false, true, null));
  18256. };
  18257. Functions.prototype.isNonText=function (value) {
  18258. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNonText", OfficeExtension.OperationType.Default, [value], false, true, null));
  18259. };
  18260. Functions.prototype.isNumber=function (value) {
  18261. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsNumber", OfficeExtension.OperationType.Default, [value], false, true, null));
  18262. };
  18263. Functions.prototype.isOdd=function (number) {
  18264. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsOdd", OfficeExtension.OperationType.Default, [number], false, true, null));
  18265. };
  18266. Functions.prototype.isText=function (value) {
  18267. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsText", OfficeExtension.OperationType.Default, [value], false, true, null));
  18268. };
  18269. Functions.prototype.isoWeekNum=function (date) {
  18270. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "IsoWeekNum", OfficeExtension.OperationType.Default, [date], false, true, null));
  18271. };
  18272. Functions.prototype.ispmt=function (rate, per, nper, pv) {
  18273. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ispmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv], false, true, null));
  18274. };
  18275. Functions.prototype.isref=function (value) {
  18276. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Isref", OfficeExtension.OperationType.Default, [value], false, true, null));
  18277. };
  18278. Functions.prototype.kurt=function () {
  18279. var values=[];
  18280. for (var _i=0; _i < arguments.length; _i++) {
  18281. values[_i - 0]=arguments[_i];
  18282. }
  18283. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Kurt", OfficeExtension.OperationType.Default, [values], false, true, null));
  18284. };
  18285. Functions.prototype.large=function (array, k) {
  18286. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Large", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18287. };
  18288. Functions.prototype.lcm=function () {
  18289. var values=[];
  18290. for (var _i=0; _i < arguments.length; _i++) {
  18291. values[_i - 0]=arguments[_i];
  18292. }
  18293. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lcm", OfficeExtension.OperationType.Default, [values], false, true, null));
  18294. };
  18295. Functions.prototype.left=function (text, numChars) {
  18296. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Left", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  18297. };
  18298. Functions.prototype.leftb=function (text, numBytes) {
  18299. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Leftb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  18300. };
  18301. Functions.prototype.len=function (text) {
  18302. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Len", OfficeExtension.OperationType.Default, [text], false, true, null));
  18303. };
  18304. Functions.prototype.lenb=function (text) {
  18305. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lenb", OfficeExtension.OperationType.Default, [text], false, true, null));
  18306. };
  18307. Functions.prototype.ln=function (number) {
  18308. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ln", OfficeExtension.OperationType.Default, [number], false, true, null));
  18309. };
  18310. Functions.prototype.log=function (number, base) {
  18311. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log", OfficeExtension.OperationType.Default, [number, base], false, true, null));
  18312. };
  18313. Functions.prototype.log10=function (number) {
  18314. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Log10", OfficeExtension.OperationType.Default, [number], false, true, null));
  18315. };
  18316. Functions.prototype.logNorm_Dist=function (x, mean, standardDev, cumulative) {
  18317. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  18318. };
  18319. Functions.prototype.logNorm_Inv=function (probability, mean, standardDev) {
  18320. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "LogNorm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  18321. };
  18322. Functions.prototype.lookup=function (lookupValue, lookupVector, resultVector) {
  18323. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lookup", OfficeExtension.OperationType.Default, [lookupValue, lookupVector, resultVector], false, true, null));
  18324. };
  18325. Functions.prototype.lower=function (text) {
  18326. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Lower", OfficeExtension.OperationType.Default, [text], false, true, null));
  18327. };
  18328. Functions.prototype.mduration=function (settlement, maturity, coupon, yld, frequency, basis) {
  18329. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MDuration", OfficeExtension.OperationType.Default, [settlement, maturity, coupon, yld, frequency, basis], false, true, null));
  18330. };
  18331. Functions.prototype.mirr=function (values, financeRate, reinvestRate) {
  18332. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MIrr", OfficeExtension.OperationType.Default, [values, financeRate, reinvestRate], false, true, null));
  18333. };
  18334. Functions.prototype.mround=function (number, multiple) {
  18335. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MRound", OfficeExtension.OperationType.Default, [number, multiple], false, true, null));
  18336. };
  18337. Functions.prototype.match=function (lookupValue, lookupArray, matchType) {
  18338. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Match", OfficeExtension.OperationType.Default, [lookupValue, lookupArray, matchType], false, true, null));
  18339. };
  18340. Functions.prototype.max=function () {
  18341. var values=[];
  18342. for (var _i=0; _i < arguments.length; _i++) {
  18343. values[_i - 0]=arguments[_i];
  18344. }
  18345. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Max", OfficeExtension.OperationType.Default, [values], false, true, null));
  18346. };
  18347. Functions.prototype.maxA=function () {
  18348. var values=[];
  18349. for (var _i=0; _i < arguments.length; _i++) {
  18350. values[_i - 0]=arguments[_i];
  18351. }
  18352. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MaxA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18353. };
  18354. Functions.prototype.median=function () {
  18355. var values=[];
  18356. for (var _i=0; _i < arguments.length; _i++) {
  18357. values[_i - 0]=arguments[_i];
  18358. }
  18359. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Median", OfficeExtension.OperationType.Default, [values], false, true, null));
  18360. };
  18361. Functions.prototype.mid=function (text, startNum, numChars) {
  18362. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mid", OfficeExtension.OperationType.Default, [text, startNum, numChars], false, true, null));
  18363. };
  18364. Functions.prototype.midb=function (text, startNum, numBytes) {
  18365. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Midb", OfficeExtension.OperationType.Default, [text, startNum, numBytes], false, true, null));
  18366. };
  18367. Functions.prototype.min=function () {
  18368. var values=[];
  18369. for (var _i=0; _i < arguments.length; _i++) {
  18370. values[_i - 0]=arguments[_i];
  18371. }
  18372. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Min", OfficeExtension.OperationType.Default, [values], false, true, null));
  18373. };
  18374. Functions.prototype.minA=function () {
  18375. var values=[];
  18376. for (var _i=0; _i < arguments.length; _i++) {
  18377. values[_i - 0]=arguments[_i];
  18378. }
  18379. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MinA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18380. };
  18381. Functions.prototype.minute=function (serialNumber) {
  18382. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Minute", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18383. };
  18384. Functions.prototype.mod=function (number, divisor) {
  18385. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Mod", OfficeExtension.OperationType.Default, [number, divisor], false, true, null));
  18386. };
  18387. Functions.prototype.month=function (serialNumber) {
  18388. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Month", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18389. };
  18390. Functions.prototype.multiNomial=function () {
  18391. var values=[];
  18392. for (var _i=0; _i < arguments.length; _i++) {
  18393. values[_i - 0]=arguments[_i];
  18394. }
  18395. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "MultiNomial", OfficeExtension.OperationType.Default, [values], false, true, null));
  18396. };
  18397. Functions.prototype.n=function (value) {
  18398. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "N", OfficeExtension.OperationType.Default, [value], false, true, null));
  18399. };
  18400. Functions.prototype.nper=function (rate, pmt, pv, fv, type) {
  18401. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NPer", OfficeExtension.OperationType.Default, [rate, pmt, pv, fv, type], false, true, null));
  18402. };
  18403. Functions.prototype.na=function () {
  18404. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Na", OfficeExtension.OperationType.Default, [], false, true, null));
  18405. };
  18406. Functions.prototype.negBinom_Dist=function (numberF, numberS, probabilityS, cumulative) {
  18407. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NegBinom_Dist", OfficeExtension.OperationType.Default, [numberF, numberS, probabilityS, cumulative], false, true, null));
  18408. };
  18409. Functions.prototype.networkDays=function (startDate, endDate, holidays) {
  18410. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays", OfficeExtension.OperationType.Default, [startDate, endDate, holidays], false, true, null));
  18411. };
  18412. Functions.prototype.networkDays_Intl=function (startDate, endDate, weekend, holidays) {
  18413. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NetworkDays_Intl", OfficeExtension.OperationType.Default, [startDate, endDate, weekend, holidays], false, true, null));
  18414. };
  18415. Functions.prototype.nominal=function (effectRate, npery) {
  18416. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Nominal", OfficeExtension.OperationType.Default, [effectRate, npery], false, true, null));
  18417. };
  18418. Functions.prototype.norm_Dist=function (x, mean, standardDev, cumulative) {
  18419. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Dist", OfficeExtension.OperationType.Default, [x, mean, standardDev, cumulative], false, true, null));
  18420. };
  18421. Functions.prototype.norm_Inv=function (probability, mean, standardDev) {
  18422. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_Inv", OfficeExtension.OperationType.Default, [probability, mean, standardDev], false, true, null));
  18423. };
  18424. Functions.prototype.norm_S_Dist=function (z, cumulative) {
  18425. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Dist", OfficeExtension.OperationType.Default, [z, cumulative], false, true, null));
  18426. };
  18427. Functions.prototype.norm_S_Inv=function (probability) {
  18428. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Norm_S_Inv", OfficeExtension.OperationType.Default, [probability], false, true, null));
  18429. };
  18430. Functions.prototype.not=function (logical) {
  18431. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Not", OfficeExtension.OperationType.Default, [logical], false, true, null));
  18432. };
  18433. Functions.prototype.now=function () {
  18434. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Now", OfficeExtension.OperationType.Default, [], false, true, null));
  18435. };
  18436. Functions.prototype.npv=function (rate) {
  18437. var values=[];
  18438. for (var _i=1; _i < arguments.length; _i++) {
  18439. values[_i - 1]=arguments[_i];
  18440. }
  18441. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Npv", OfficeExtension.OperationType.Default, [rate, values], false, true, null));
  18442. };
  18443. Functions.prototype.numberValue=function (text, decimalSeparator, groupSeparator) {
  18444. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "NumberValue", OfficeExtension.OperationType.Default, [text, decimalSeparator, groupSeparator], false, true, null));
  18445. };
  18446. Functions.prototype.oct2Bin=function (number, places) {
  18447. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Bin", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18448. };
  18449. Functions.prototype.oct2Dec=function (number) {
  18450. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Dec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18451. };
  18452. Functions.prototype.oct2Hex=function (number, places) {
  18453. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Oct2Hex", OfficeExtension.OperationType.Default, [number, places], false, true, null));
  18454. };
  18455. Functions.prototype.odd=function (number) {
  18456. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Odd", OfficeExtension.OperationType.Default, [number], false, true, null));
  18457. };
  18458. Functions.prototype.oddFPrice=function (settlement, maturity, issue, firstCoupon, rate, yld, redemption, frequency, basis) {
  18459. 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));
  18460. };
  18461. Functions.prototype.oddFYield=function (settlement, maturity, issue, firstCoupon, rate, pr, redemption, frequency, basis) {
  18462. 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));
  18463. };
  18464. Functions.prototype.oddLPrice=function (settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis) {
  18465. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLPrice", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, yld, redemption, frequency, basis], false, true, null));
  18466. };
  18467. Functions.prototype.oddLYield=function (settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis) {
  18468. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "OddLYield", OfficeExtension.OperationType.Default, [settlement, maturity, lastInterest, rate, pr, redemption, frequency, basis], false, true, null));
  18469. };
  18470. Functions.prototype.or=function () {
  18471. var values=[];
  18472. for (var _i=0; _i < arguments.length; _i++) {
  18473. values[_i - 0]=arguments[_i];
  18474. }
  18475. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Or", OfficeExtension.OperationType.Default, [values], false, true, null));
  18476. };
  18477. Functions.prototype.pduration=function (rate, pv, fv) {
  18478. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PDuration", OfficeExtension.OperationType.Default, [rate, pv, fv], false, true, null));
  18479. };
  18480. Functions.prototype.percentRank_Exc=function (array, x, significance) {
  18481. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Exc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  18482. };
  18483. Functions.prototype.percentRank_Inc=function (array, x, significance) {
  18484. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PercentRank_Inc", OfficeExtension.OperationType.Default, [array, x, significance], false, true, null));
  18485. };
  18486. Functions.prototype.percentile_Exc=function (array, k) {
  18487. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Exc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18488. };
  18489. Functions.prototype.percentile_Inc=function (array, k) {
  18490. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Percentile_Inc", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18491. };
  18492. Functions.prototype.permut=function (number, numberChosen) {
  18493. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permut", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  18494. };
  18495. Functions.prototype.permutationa=function (number, numberChosen) {
  18496. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Permutationa", OfficeExtension.OperationType.Default, [number, numberChosen], false, true, null));
  18497. };
  18498. Functions.prototype.phi=function (x) {
  18499. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Phi", OfficeExtension.OperationType.Default, [x], false, true, null));
  18500. };
  18501. Functions.prototype.pi=function () {
  18502. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pi", OfficeExtension.OperationType.Default, [], false, true, null));
  18503. };
  18504. Functions.prototype.pmt=function (rate, nper, pv, fv, type) {
  18505. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pmt", OfficeExtension.OperationType.Default, [rate, nper, pv, fv, type], false, true, null));
  18506. };
  18507. Functions.prototype.poisson_Dist=function (x, mean, cumulative) {
  18508. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Poisson_Dist", OfficeExtension.OperationType.Default, [x, mean, cumulative], false, true, null));
  18509. };
  18510. Functions.prototype.power=function (number, power) {
  18511. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Power", OfficeExtension.OperationType.Default, [number, power], false, true, null));
  18512. };
  18513. Functions.prototype.ppmt=function (rate, per, nper, pv, fv, type) {
  18514. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Ppmt", OfficeExtension.OperationType.Default, [rate, per, nper, pv, fv, type], false, true, null));
  18515. };
  18516. Functions.prototype.price=function (settlement, maturity, rate, yld, redemption, frequency, basis) {
  18517. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Price", OfficeExtension.OperationType.Default, [settlement, maturity, rate, yld, redemption, frequency, basis], false, true, null));
  18518. };
  18519. Functions.prototype.priceDisc=function (settlement, maturity, discount, redemption, basis) {
  18520. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceDisc", OfficeExtension.OperationType.Default, [settlement, maturity, discount, redemption, basis], false, true, null));
  18521. };
  18522. Functions.prototype.priceMat=function (settlement, maturity, issue, rate, yld, basis) {
  18523. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "PriceMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, yld, basis], false, true, null));
  18524. };
  18525. Functions.prototype.product=function () {
  18526. var values=[];
  18527. for (var _i=0; _i < arguments.length; _i++) {
  18528. values[_i - 0]=arguments[_i];
  18529. }
  18530. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Product", OfficeExtension.OperationType.Default, [values], false, true, null));
  18531. };
  18532. Functions.prototype.proper=function (text) {
  18533. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Proper", OfficeExtension.OperationType.Default, [text], false, true, null));
  18534. };
  18535. Functions.prototype.pv=function (rate, nper, pmt, fv, type) {
  18536. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Pv", OfficeExtension.OperationType.Default, [rate, nper, pmt, fv, type], false, true, null));
  18537. };
  18538. Functions.prototype.quartile_Exc=function (array, quart) {
  18539. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Exc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  18540. };
  18541. Functions.prototype.quartile_Inc=function (array, quart) {
  18542. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quartile_Inc", OfficeExtension.OperationType.Default, [array, quart], false, true, null));
  18543. };
  18544. Functions.prototype.quotient=function (numerator, denominator) {
  18545. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Quotient", OfficeExtension.OperationType.Default, [numerator, denominator], false, true, null));
  18546. };
  18547. Functions.prototype.radians=function (angle) {
  18548. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Radians", OfficeExtension.OperationType.Default, [angle], false, true, null));
  18549. };
  18550. Functions.prototype.rand=function () {
  18551. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rand", OfficeExtension.OperationType.Default, [], false, true, null));
  18552. };
  18553. Functions.prototype.randBetween=function (bottom, top) {
  18554. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RandBetween", OfficeExtension.OperationType.Default, [bottom, top], false, true, null));
  18555. };
  18556. Functions.prototype.rank_Avg=function (number, ref, order) {
  18557. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Avg", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  18558. };
  18559. Functions.prototype.rank_Eq=function (number, ref, order) {
  18560. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rank_Eq", OfficeExtension.OperationType.Default, [number, ref, order], false, true, null));
  18561. };
  18562. Functions.prototype.rate=function (nper, pmt, pv, fv, type, guess) {
  18563. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rate", OfficeExtension.OperationType.Default, [nper, pmt, pv, fv, type, guess], false, true, null));
  18564. };
  18565. Functions.prototype.received=function (settlement, maturity, investment, discount, basis) {
  18566. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Received", OfficeExtension.OperationType.Default, [settlement, maturity, investment, discount, basis], false, true, null));
  18567. };
  18568. Functions.prototype.replace=function (oldText, startNum, numChars, newText) {
  18569. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Replace", OfficeExtension.OperationType.Default, [oldText, startNum, numChars, newText], false, true, null));
  18570. };
  18571. Functions.prototype.replaceB=function (oldText, startNum, numBytes, newText) {
  18572. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "ReplaceB", OfficeExtension.OperationType.Default, [oldText, startNum, numBytes, newText], false, true, null));
  18573. };
  18574. Functions.prototype.rept=function (text, numberTimes) {
  18575. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rept", OfficeExtension.OperationType.Default, [text, numberTimes], false, true, null));
  18576. };
  18577. Functions.prototype.right=function (text, numChars) {
  18578. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Right", OfficeExtension.OperationType.Default, [text, numChars], false, true, null));
  18579. };
  18580. Functions.prototype.rightb=function (text, numBytes) {
  18581. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rightb", OfficeExtension.OperationType.Default, [text, numBytes], false, true, null));
  18582. };
  18583. Functions.prototype.roman=function (number, form) {
  18584. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Roman", OfficeExtension.OperationType.Default, [number, form], false, true, null));
  18585. };
  18586. Functions.prototype.round=function (number, numDigits) {
  18587. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Round", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18588. };
  18589. Functions.prototype.roundDown=function (number, numDigits) {
  18590. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundDown", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18591. };
  18592. Functions.prototype.roundUp=function (number, numDigits) {
  18593. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "RoundUp", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18594. };
  18595. Functions.prototype.rows=function (array) {
  18596. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rows", OfficeExtension.OperationType.Default, [array], false, true, null));
  18597. };
  18598. Functions.prototype.rri=function (nper, pv, fv) {
  18599. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Rri", OfficeExtension.OperationType.Default, [nper, pv, fv], false, true, null));
  18600. };
  18601. Functions.prototype.sec=function (number) {
  18602. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sec", OfficeExtension.OperationType.Default, [number], false, true, null));
  18603. };
  18604. Functions.prototype.sech=function (number) {
  18605. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sech", OfficeExtension.OperationType.Default, [number], false, true, null));
  18606. };
  18607. Functions.prototype.second=function (serialNumber) {
  18608. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Second", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18609. };
  18610. Functions.prototype.seriesSum=function (x, n, m, coefficients) {
  18611. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SeriesSum", OfficeExtension.OperationType.Default, [x, n, m, coefficients], false, true, null));
  18612. };
  18613. Functions.prototype.sheet=function (value) {
  18614. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheet", OfficeExtension.OperationType.Default, [value], false, true, null));
  18615. };
  18616. Functions.prototype.sheets=function (reference) {
  18617. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sheets", OfficeExtension.OperationType.Default, [reference], false, true, null));
  18618. };
  18619. Functions.prototype.sign=function (number) {
  18620. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sign", OfficeExtension.OperationType.Default, [number], false, true, null));
  18621. };
  18622. Functions.prototype.sin=function (number) {
  18623. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sin", OfficeExtension.OperationType.Default, [number], false, true, null));
  18624. };
  18625. Functions.prototype.sinh=function (number) {
  18626. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sinh", OfficeExtension.OperationType.Default, [number], false, true, null));
  18627. };
  18628. Functions.prototype.skew=function () {
  18629. var values=[];
  18630. for (var _i=0; _i < arguments.length; _i++) {
  18631. values[_i - 0]=arguments[_i];
  18632. }
  18633. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew", OfficeExtension.OperationType.Default, [values], false, true, null));
  18634. };
  18635. Functions.prototype.skew_p=function () {
  18636. var values=[];
  18637. for (var _i=0; _i < arguments.length; _i++) {
  18638. values[_i - 0]=arguments[_i];
  18639. }
  18640. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Skew_p", OfficeExtension.OperationType.Default, [values], false, true, null));
  18641. };
  18642. Functions.prototype.sln=function (cost, salvage, life) {
  18643. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sln", OfficeExtension.OperationType.Default, [cost, salvage, life], false, true, null));
  18644. };
  18645. Functions.prototype.small=function (array, k) {
  18646. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Small", OfficeExtension.OperationType.Default, [array, k], false, true, null));
  18647. };
  18648. Functions.prototype.sqrt=function (number) {
  18649. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sqrt", OfficeExtension.OperationType.Default, [number], false, true, null));
  18650. };
  18651. Functions.prototype.sqrtPi=function (number) {
  18652. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SqrtPi", OfficeExtension.OperationType.Default, [number], false, true, null));
  18653. };
  18654. Functions.prototype.stDevA=function () {
  18655. var values=[];
  18656. for (var _i=0; _i < arguments.length; _i++) {
  18657. values[_i - 0]=arguments[_i];
  18658. }
  18659. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18660. };
  18661. Functions.prototype.stDevPA=function () {
  18662. var values=[];
  18663. for (var _i=0; _i < arguments.length; _i++) {
  18664. values[_i - 0]=arguments[_i];
  18665. }
  18666. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDevPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18667. };
  18668. Functions.prototype.stDev_P=function () {
  18669. var values=[];
  18670. for (var _i=0; _i < arguments.length; _i++) {
  18671. values[_i - 0]=arguments[_i];
  18672. }
  18673. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  18674. };
  18675. Functions.prototype.stDev_S=function () {
  18676. var values=[];
  18677. for (var _i=0; _i < arguments.length; _i++) {
  18678. values[_i - 0]=arguments[_i];
  18679. }
  18680. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "StDev_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  18681. };
  18682. Functions.prototype.standardize=function (x, mean, standardDev) {
  18683. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Standardize", OfficeExtension.OperationType.Default, [x, mean, standardDev], false, true, null));
  18684. };
  18685. Functions.prototype.substitute=function (text, oldText, newText, instanceNum) {
  18686. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Substitute", OfficeExtension.OperationType.Default, [text, oldText, newText, instanceNum], false, true, null));
  18687. };
  18688. Functions.prototype.subtotal=function (functionNum) {
  18689. var values=[];
  18690. for (var _i=1; _i < arguments.length; _i++) {
  18691. values[_i - 1]=arguments[_i];
  18692. }
  18693. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Subtotal", OfficeExtension.OperationType.Default, [functionNum, values], false, true, null));
  18694. };
  18695. Functions.prototype.sum=function () {
  18696. var values=[];
  18697. for (var _i=0; _i < arguments.length; _i++) {
  18698. values[_i - 0]=arguments[_i];
  18699. }
  18700. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Sum", OfficeExtension.OperationType.Default, [values], false, true, null));
  18701. };
  18702. Functions.prototype.sumIf=function (range, criteria, sumRange) {
  18703. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIf", OfficeExtension.OperationType.Default, [range, criteria, sumRange], false, true, null));
  18704. };
  18705. Functions.prototype.sumIfs=function (sumRange) {
  18706. var values=[];
  18707. for (var _i=1; _i < arguments.length; _i++) {
  18708. values[_i - 1]=arguments[_i];
  18709. }
  18710. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumIfs", OfficeExtension.OperationType.Default, [sumRange, values], false, true, null));
  18711. };
  18712. Functions.prototype.sumSq=function () {
  18713. var values=[];
  18714. for (var _i=0; _i < arguments.length; _i++) {
  18715. values[_i - 0]=arguments[_i];
  18716. }
  18717. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "SumSq", OfficeExtension.OperationType.Default, [values], false, true, null));
  18718. };
  18719. Functions.prototype.syd=function (cost, salvage, life, per) {
  18720. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Syd", OfficeExtension.OperationType.Default, [cost, salvage, life, per], false, true, null));
  18721. };
  18722. Functions.prototype.t=function (value) {
  18723. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T", OfficeExtension.OperationType.Default, [value], false, true, null));
  18724. };
  18725. Functions.prototype.tbillEq=function (settlement, maturity, discount) {
  18726. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillEq", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  18727. };
  18728. Functions.prototype.tbillPrice=function (settlement, maturity, discount) {
  18729. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillPrice", OfficeExtension.OperationType.Default, [settlement, maturity, discount], false, true, null));
  18730. };
  18731. Functions.prototype.tbillYield=function (settlement, maturity, pr) {
  18732. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TBillYield", OfficeExtension.OperationType.Default, [settlement, maturity, pr], false, true, null));
  18733. };
  18734. Functions.prototype.t_Dist=function (x, degFreedom, cumulative) {
  18735. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist", OfficeExtension.OperationType.Default, [x, degFreedom, cumulative], false, true, null));
  18736. };
  18737. Functions.prototype.t_Dist_2T=function (x, degFreedom) {
  18738. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_2T", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  18739. };
  18740. Functions.prototype.t_Dist_RT=function (x, degFreedom) {
  18741. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Dist_RT", OfficeExtension.OperationType.Default, [x, degFreedom], false, true, null));
  18742. };
  18743. Functions.prototype.t_Inv=function (probability, degFreedom) {
  18744. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  18745. };
  18746. Functions.prototype.t_Inv_2T=function (probability, degFreedom) {
  18747. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "T_Inv_2T", OfficeExtension.OperationType.Default, [probability, degFreedom], false, true, null));
  18748. };
  18749. Functions.prototype.tan=function (number) {
  18750. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tan", OfficeExtension.OperationType.Default, [number], false, true, null));
  18751. };
  18752. Functions.prototype.tanh=function (number) {
  18753. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Tanh", OfficeExtension.OperationType.Default, [number], false, true, null));
  18754. };
  18755. Functions.prototype.text=function (value, formatText) {
  18756. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Text", OfficeExtension.OperationType.Default, [value, formatText], false, true, null));
  18757. };
  18758. Functions.prototype.time=function (hour, minute, second) {
  18759. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Time", OfficeExtension.OperationType.Default, [hour, minute, second], false, true, null));
  18760. };
  18761. Functions.prototype.timevalue=function (timeText) {
  18762. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Timevalue", OfficeExtension.OperationType.Default, [timeText], false, true, null));
  18763. };
  18764. Functions.prototype.today=function () {
  18765. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Today", OfficeExtension.OperationType.Default, [], false, true, null));
  18766. };
  18767. Functions.prototype.trim=function (text) {
  18768. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trim", OfficeExtension.OperationType.Default, [text], false, true, null));
  18769. };
  18770. Functions.prototype.trimMean=function (array, percent) {
  18771. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "TrimMean", OfficeExtension.OperationType.Default, [array, percent], false, true, null));
  18772. };
  18773. Functions.prototype.true=function () {
  18774. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "True", OfficeExtension.OperationType.Default, [], false, true, null));
  18775. };
  18776. Functions.prototype.trunc=function (number, numDigits) {
  18777. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Trunc", OfficeExtension.OperationType.Default, [number, numDigits], false, true, null));
  18778. };
  18779. Functions.prototype.type=function (value) {
  18780. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Type", OfficeExtension.OperationType.Default, [value], false, true, null));
  18781. };
  18782. Functions.prototype.usdollar=function (number, decimals) {
  18783. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "USDollar", OfficeExtension.OperationType.Default, [number, decimals], false, true, null));
  18784. };
  18785. Functions.prototype.unichar=function (number) {
  18786. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unichar", OfficeExtension.OperationType.Default, [number], false, true, null));
  18787. };
  18788. Functions.prototype.unicode=function (text) {
  18789. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Unicode", OfficeExtension.OperationType.Default, [text], false, true, null));
  18790. };
  18791. Functions.prototype.upper=function (text) {
  18792. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Upper", OfficeExtension.OperationType.Default, [text], false, true, null));
  18793. };
  18794. Functions.prototype.vlookup=function (lookupValue, tableArray, colIndexNum, rangeLookup) {
  18795. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VLookup", OfficeExtension.OperationType.Default, [lookupValue, tableArray, colIndexNum, rangeLookup], false, true, null));
  18796. };
  18797. Functions.prototype.value=function (text) {
  18798. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Value", OfficeExtension.OperationType.Default, [text], false, true, null));
  18799. };
  18800. Functions.prototype.varA=function () {
  18801. var values=[];
  18802. for (var _i=0; _i < arguments.length; _i++) {
  18803. values[_i - 0]=arguments[_i];
  18804. }
  18805. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18806. };
  18807. Functions.prototype.varPA=function () {
  18808. var values=[];
  18809. for (var _i=0; _i < arguments.length; _i++) {
  18810. values[_i - 0]=arguments[_i];
  18811. }
  18812. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "VarPA", OfficeExtension.OperationType.Default, [values], false, true, null));
  18813. };
  18814. Functions.prototype.var_P=function () {
  18815. var values=[];
  18816. for (var _i=0; _i < arguments.length; _i++) {
  18817. values[_i - 0]=arguments[_i];
  18818. }
  18819. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_P", OfficeExtension.OperationType.Default, [values], false, true, null));
  18820. };
  18821. Functions.prototype.var_S=function () {
  18822. var values=[];
  18823. for (var _i=0; _i < arguments.length; _i++) {
  18824. values[_i - 0]=arguments[_i];
  18825. }
  18826. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Var_S", OfficeExtension.OperationType.Default, [values], false, true, null));
  18827. };
  18828. Functions.prototype.vdb=function (cost, salvage, life, startPeriod, endPeriod, factor, noSwitch) {
  18829. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Vdb", OfficeExtension.OperationType.Default, [cost, salvage, life, startPeriod, endPeriod, factor, noSwitch], false, true, null));
  18830. };
  18831. Functions.prototype.weekNum=function (serialNumber, returnType) {
  18832. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WeekNum", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  18833. };
  18834. Functions.prototype.weekday=function (serialNumber, returnType) {
  18835. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weekday", OfficeExtension.OperationType.Default, [serialNumber, returnType], false, true, null));
  18836. };
  18837. Functions.prototype.weibull_Dist=function (x, alpha, beta, cumulative) {
  18838. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Weibull_Dist", OfficeExtension.OperationType.Default, [x, alpha, beta, cumulative], false, true, null));
  18839. };
  18840. Functions.prototype.workDay=function (startDate, days, holidays) {
  18841. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay", OfficeExtension.OperationType.Default, [startDate, days, holidays], false, true, null));
  18842. };
  18843. Functions.prototype.workDay_Intl=function (startDate, days, weekend, holidays) {
  18844. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "WorkDay_Intl", OfficeExtension.OperationType.Default, [startDate, days, weekend, holidays], false, true, null));
  18845. };
  18846. Functions.prototype.xirr=function (values, dates, guess) {
  18847. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xirr", OfficeExtension.OperationType.Default, [values, dates, guess], false, true, null));
  18848. };
  18849. Functions.prototype.xnpv=function (rate, values, dates) {
  18850. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xnpv", OfficeExtension.OperationType.Default, [rate, values, dates], false, true, null));
  18851. };
  18852. Functions.prototype.xor=function () {
  18853. var values=[];
  18854. for (var _i=0; _i < arguments.length; _i++) {
  18855. values[_i - 0]=arguments[_i];
  18856. }
  18857. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Xor", OfficeExtension.OperationType.Default, [values], false, true, null));
  18858. };
  18859. Functions.prototype.year=function (serialNumber) {
  18860. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Year", OfficeExtension.OperationType.Default, [serialNumber], false, true, null));
  18861. };
  18862. Functions.prototype.yearFrac=function (startDate, endDate, basis) {
  18863. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YearFrac", OfficeExtension.OperationType.Default, [startDate, endDate, basis], false, true, null));
  18864. };
  18865. Functions.prototype.yield=function (settlement, maturity, rate, pr, redemption, frequency, basis) {
  18866. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Yield", OfficeExtension.OperationType.Default, [settlement, maturity, rate, pr, redemption, frequency, basis], false, true, null));
  18867. };
  18868. Functions.prototype.yieldDisc=function (settlement, maturity, pr, redemption, basis) {
  18869. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldDisc", OfficeExtension.OperationType.Default, [settlement, maturity, pr, redemption, basis], false, true, null));
  18870. };
  18871. Functions.prototype.yieldMat=function (settlement, maturity, issue, rate, pr, basis) {
  18872. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "YieldMat", OfficeExtension.OperationType.Default, [settlement, maturity, issue, rate, pr, basis], false, true, null));
  18873. };
  18874. Functions.prototype.z_Test=function (array, x, sigma) {
  18875. return new FunctionResult(this.context, _createMethodObjectPath(this.context, this, "Z_Test", OfficeExtension.OperationType.Default, [array, x, sigma], false, true, null));
  18876. };
  18877. Functions.prototype._handleResult=function (value) {
  18878. _super.prototype._handleResult.call(this, value);
  18879. if (_isNullOrUndefined(value))
  18880. return;
  18881. var obj=value;
  18882. _fixObjectPathIfNecessary(this, obj);
  18883. };
  18884. Functions.prototype.toJSON=function () {
  18885. return {};
  18886. };
  18887. return Functions;
  18888. }(OfficeExtension.ClientObject));
  18889. Excel.Functions=Functions;
  18890. var ErrorCodes;
  18891. (function (ErrorCodes) {
  18892. ErrorCodes.accessDenied="AccessDenied";
  18893. ErrorCodes.apiNotFound="ApiNotFound";
  18894. ErrorCodes.generalException="GeneralException";
  18895. ErrorCodes.insertDeleteConflict="InsertDeleteConflict";
  18896. ErrorCodes.invalidArgument="InvalidArgument";
  18897. ErrorCodes.invalidBinding="InvalidBinding";
  18898. ErrorCodes.invalidOperation="InvalidOperation";
  18899. ErrorCodes.invalidReference="InvalidReference";
  18900. ErrorCodes.invalidSelection="InvalidSelection";
  18901. ErrorCodes.itemAlreadyExists="ItemAlreadyExists";
  18902. ErrorCodes.itemNotFound="ItemNotFound";
  18903. ErrorCodes.notImplemented="NotImplemented";
  18904. ErrorCodes.unsupportedOperation="UnsupportedOperation";
  18905. })(ErrorCodes=Excel.ErrorCodes || (Excel.ErrorCodes={}));
  18906. })(Excel || (Excel={}));
  18907. var Excel;
  18908. (function (Excel) {
  18909. var RequestContext=(function (_super) {
  18910. __extends(RequestContext, _super);
  18911. function RequestContext(url) {
  18912. _super.call(this, url);
  18913. this.m_workbook=new Excel.Workbook(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  18914. this._rootObject=this.m_workbook;
  18915. }
  18916. Object.defineProperty(RequestContext.prototype, "workbook", {
  18917. get: function () {
  18918. return this.m_workbook;
  18919. },
  18920. enumerable: true,
  18921. configurable: true
  18922. });
  18923. return RequestContext;
  18924. }(OfficeExtension.ClientRequestContext));
  18925. Excel.RequestContext=RequestContext;
  18926. function run(arg1, arg2, arg3) {
  18927. return OfficeExtension.ClientRequestContext._runBatch("Excel.run", arguments, function (requestInfo) {
  18928. var ret=new Excel.RequestContext(requestInfo ? requestInfo.url : null);
  18929. if (requestInfo && requestInfo.headers) {
  18930. for (var name in requestInfo.headers) {
  18931. ret.requestHeaders[name]=requestInfo.headers[name];
  18932. }
  18933. }
  18934. return ret;
  18935. });
  18936. }
  18937. Excel.run=run;
  18938. })(Excel || (Excel={}));
  18939. var Excel;
  18940. (function (Excel) {
  18941. Excel._RedirectV1APIs=false;
  18942. Excel._V1APIMap={
  18943. "GetDataAsync": {
  18944. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetData(callArgs); },
  18945. postprocess: getDataCommonPostprocess
  18946. },
  18947. "GetSelectedDataAsync": {
  18948. call: function (ctx, callArgs) { return ctx.workbook._V1Api.getSelectedData(callArgs); },
  18949. postprocess: getDataCommonPostprocess
  18950. },
  18951. "GoToByIdAsync": {
  18952. call: function (ctx, callArgs) { return ctx.workbook._V1Api.gotoById(callArgs); }
  18953. },
  18954. "AddColumnsAsync": {
  18955. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddColumns(callArgs); }
  18956. },
  18957. "AddFromSelectionAsync": {
  18958. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromSelection(callArgs); },
  18959. postprocess: postprocessBindingDescriptor
  18960. },
  18961. "AddFromNamedItemAsync": {
  18962. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromNamedItem(callArgs); },
  18963. postprocess: postprocessBindingDescriptor
  18964. },
  18965. "AddFromPromptAsync": {
  18966. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddFromPrompt(callArgs); },
  18967. postprocess: postprocessBindingDescriptor
  18968. },
  18969. "AddRowsAsync": {
  18970. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingAddRows(callArgs); }
  18971. },
  18972. "GetByIdAsync": {
  18973. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingGetById(callArgs); },
  18974. postprocess: postprocessBindingDescriptor
  18975. },
  18976. "ReleaseByIdAsync": {
  18977. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingReleaseById(callArgs); }
  18978. },
  18979. "GetAllAsync": {
  18980. call: function (ctx) { return ctx.workbook._V1Api.bindingGetAll(); },
  18981. postprocess: function (response) {
  18982. return response.bindings.map(function (descriptor) { return postprocessBindingDescriptor(descriptor); });
  18983. }
  18984. },
  18985. "DeleteAllDataValuesAsync": {
  18986. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingDeleteAllDataValues(callArgs); }
  18987. },
  18988. "SetSelectedDataAsync": {
  18989. preprocess: function (callArgs) {
  18990. var preimage=callArgs["cellFormat"];
  18991. if (window.OSF.DDA.SafeArray) {
  18992. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  18993. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  18994. }
  18995. }
  18996. else if (window.OSF.DDA.WAC) {
  18997. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  18998. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  18999. }
  19000. }
  19001. return callArgs;
  19002. },
  19003. call: function (ctx, callArgs) { return ctx.workbook._V1Api.setSelectedData(callArgs); }
  19004. },
  19005. "SetDataAsync": {
  19006. preprocess: function (callArgs) {
  19007. var preimage=callArgs["cellFormat"];
  19008. if (window.OSF.DDA.SafeArray) {
  19009. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19010. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19011. }
  19012. }
  19013. else if (window.OSF.DDA.WAC) {
  19014. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19015. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19016. }
  19017. }
  19018. return callArgs;
  19019. },
  19020. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetData(callArgs); }
  19021. },
  19022. "SetFormatsAsync": {
  19023. preprocess: function (callArgs) {
  19024. var preimage=callArgs["cellFormat"];
  19025. if (window.OSF.DDA.SafeArray) {
  19026. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19027. callArgs["cellFormat"]=window.OSF.DDA.SafeArray.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19028. }
  19029. }
  19030. else if (window.OSF.DDA.WAC) {
  19031. if (window.OSF.OUtil.listContainsKey(window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes, "cellFormat")) {
  19032. callArgs["cellFormat"]=window.OSF.DDA.WAC.Delegate.ParameterMap.dynamicTypes["cellFormat"]["toHost"](preimage);
  19033. }
  19034. }
  19035. return callArgs;
  19036. },
  19037. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetFormats(callArgs); }
  19038. },
  19039. "SetTableOptionsAsync": {
  19040. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingSetTableOptions(callArgs); }
  19041. },
  19042. "ClearFormatsAsync": {
  19043. call: function (ctx, callArgs) { return ctx.workbook._V1Api.bindingClearFormats(callArgs); }
  19044. },
  19045. };
  19046. function postprocessBindingDescriptor(response) {
  19047. var bindingDescriptor={
  19048. BindingColumnCount: response.bindingColumnCount,
  19049. BindingId: response.bindingId,
  19050. BindingRowCount: response.bindingRowCount,
  19051. bindingType: response.bindingType,
  19052. HasHeaders: response.hasHeaders
  19053. };
  19054. return window.OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, window.Microsoft.Office.WebExtension.context.document);
  19055. }
  19056. function getDataCommonPostprocess(response, callArgs) {
  19057. var isPlainData=response.headers==null;
  19058. var data;
  19059. if (isPlainData) {
  19060. data=response.rows;
  19061. }
  19062. else {
  19063. data=response;
  19064. }
  19065. data=window.OSF.DDA.DataCoercion.coerceData(data, callArgs[window.Microsoft.Office.WebExtension.Parameters.CoercionType]);
  19066. return data==undefined ? null : data;
  19067. }
  19068. })(Excel || (Excel={}));