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

word-win32-16.00.debug.js 348KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451
  1. /* Word specific JavaScript API library */
  2. /* Version: 16.0.6216.3006 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. /*
  10. * @overview es6-promise - a tiny implementation of Promises/A+.
  11. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  12. * @license Licensed under MIT license
  13. * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
  14. * @version 2.3.0
  15. */
  16. var __extends=this.__extends || function (d, b) {
  17. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  18. function __() { this.constructor=d; }
  19. __.prototype=b.prototype;
  20. d.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' && Sys.StringBuilder && typeof (Sys.StringBuilder)==="function" && Type.registerNamespace && typeof (Type.registerNamespace)==="function" && Type.registerClass && typeof (Type.registerClass)==="function" && typeof (Function._validateParams)==="function") {
  29. return true;
  30. } else {
  31. return false;
  32. }
  33. };
  34. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function (callback) {
  35. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  36. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  37. };
  38. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  39. get: function () {
  40. if (this._msAjaxError==null && this.isMsAjaxLoaded()) {
  41. this._msAjaxError=Error;
  42. }
  43. return this._msAjaxError;
  44. },
  45. set: function (errorClass) {
  46. this._msAjaxError=errorClass;
  47. },
  48. enumerable: true,
  49. configurable: true
  50. });
  51. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", {
  52. get: function () {
  53. if (this._msAjaxSerializer==null && this.isMsAjaxLoaded()) {
  54. this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;
  55. }
  56. return this._msAjaxSerializer;
  57. },
  58. set: function (serializerClass) {
  59. this._msAjaxSerializer=serializerClass;
  60. },
  61. enumerable: true,
  62. configurable: true
  63. });
  64. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  65. get: function () {
  66. if (this._msAjaxString==null && this.isMsAjaxLoaded()) {
  67. this._msAjaxSerializer=String;
  68. }
  69. return this._msAjaxString;
  70. },
  71. set: function (stringClass) {
  72. this._msAjaxString=stringClass;
  73. },
  74. enumerable: true,
  75. configurable: true
  76. });
  77. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  78. get: function () {
  79. if (this._msAjaxDebug==null && this.isMsAjaxLoaded()) {
  80. this._msAjaxDebug=Sys.Debug;
  81. }
  82. return this._msAjaxDebug;
  83. },
  84. set: function (debugClass) {
  85. this._msAjaxDebug=debugClass;
  86. },
  87. enumerable: true,
  88. configurable: true
  89. });
  90. return MicrosoftAjaxFactory;
  91. })();
  92. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory;
  93. })(OfficeExt || (OfficeExt={}));
  94. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory();
  95. var OSF=OSF || {};
  96. var OfficeExt;
  97. (function (OfficeExt) {
  98. var SafeStorage=(function () {
  99. function SafeStorage(_internalStorage) {
  100. this._internalStorage=_internalStorage;
  101. }
  102. SafeStorage.prototype.getItem=function (key) {
  103. try {
  104. return this._internalStorage && this._internalStorage.getItem(key);
  105. } catch (e) {
  106. return null;
  107. }
  108. };
  109. SafeStorage.prototype.setItem=function (key, data) {
  110. try {
  111. this._internalStorage && this._internalStorage.setItem(key, data);
  112. } catch (e) {
  113. }
  114. };
  115. SafeStorage.prototype.clear=function () {
  116. try {
  117. this._internalStorage && this._internalStorage.clear();
  118. } catch (e) {
  119. }
  120. };
  121. SafeStorage.prototype.removeItem=function (key) {
  122. try {
  123. this._internalStorage && this._internalStorage.removeItem(key);
  124. } catch (e) {
  125. }
  126. };
  127. SafeStorage.prototype.getKeysWithPrefix=function (keyPrefix) {
  128. var keyList=[];
  129. try {
  130. var len=this._internalStorage && this._internalStorage.length || 0;
  131. for (var i=0; i < len; i++) {
  132. var key=this._internalStorage.key(i);
  133. if (key.indexOf(keyPrefix)===0) {
  134. keyList.push(key);
  135. }
  136. }
  137. } catch (e) {
  138. }
  139. return keyList;
  140. };
  141. return SafeStorage;
  142. })();
  143. OfficeExt.SafeStorage=SafeStorage;
  144. })(OfficeExt || (OfficeExt={}));
  145. OSF.OUtil=(function () {
  146. var _uniqueId=-1;
  147. var _xdmInfoKey='&_xdm_Info=';
  148. var _serializerVersionKey='&_serializer_version=';
  149. var _xdmSessionKeyPrefix='_xdm_';
  150. var _serializerVersionKeyPrefix='_serializer_version=';
  151. var _fragmentSeparator='#';
  152. var _loadedScripts={};
  153. var _defaultScriptLoadingTimeout=30000;
  154. var _safeSessionStorage=null;
  155. var _safeLocalStorage=null;
  156. var _rndentropy=new Date().getTime();
  157. function _random() {
  158. var nextrand=0x7fffffff * (Math.random());
  159. nextrand ^=_rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  160. return nextrand.toString(16);
  161. }
  162. ;
  163. function _getSessionStorage() {
  164. if (!_safeSessionStorage) {
  165. try {
  166. var sessionStorage=window.sessionStorage;
  167. } catch (ex) {
  168. sessionStorage=null;
  169. }
  170. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage);
  171. }
  172. return _safeSessionStorage;
  173. }
  174. ;
  175. return {
  176. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  177. if (typeof entropy=="string") {
  178. for (var i=0; i < entropy.length; i+=4) {
  179. var temp=0;
  180. for (var j=0; j < 4 && i+j < entropy.length; j++) {
  181. temp=(temp << 8)+entropy.charCodeAt(i+j);
  182. }
  183. _rndentropy ^=temp;
  184. }
  185. } else if (typeof entropy=="number") {
  186. _rndentropy ^=entropy;
  187. } else {
  188. _rndentropy ^=0x7fffffff * Math.random();
  189. }
  190. _rndentropy &=0x7fffffff;
  191. },
  192. extend: function OSF_OUtil$extend(child, parent) {
  193. var F=function () {
  194. };
  195. F.prototype=parent.prototype;
  196. child.prototype=new F();
  197. child.prototype.constructor=child;
  198. child.uber=parent.prototype;
  199. if (parent.prototype.constructor===Object.prototype.constructor) {
  200. parent.prototype.constructor=parent;
  201. }
  202. },
  203. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  204. if (parent && name && !parent[name]) {
  205. parent[name]={};
  206. }
  207. },
  208. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  209. if (parent && name && parent[name]) {
  210. delete parent[name];
  211. }
  212. },
  213. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  214. if (url && callback) {
  215. var doc=window.document;
  216. var _loadedScriptEntry=_loadedScripts[url];
  217. if (!_loadedScriptEntry) {
  218. var script=doc.createElement("script");
  219. script.type="text/javascript";
  220. _loadedScriptEntry={ loaded: false, pendingCallbacks: [callback], timer: null };
  221. _loadedScripts[url]=_loadedScriptEntry;
  222. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback() {
  223. if (_loadedScriptEntry.timer !=null) {
  224. clearTimeout(_loadedScriptEntry.timer);
  225. delete _loadedScriptEntry.timer;
  226. }
  227. _loadedScriptEntry.loaded=true;
  228. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  229. for (var i=0; i < pendingCallbackCount; i++) {
  230. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  231. currentCallback();
  232. }
  233. };
  234. var onLoadError=function OSF_OUtil_loadScript$onLoadError() {
  235. delete _loadedScripts[url];
  236. if (_loadedScriptEntry.timer !=null) {
  237. clearTimeout(_loadedScriptEntry.timer);
  238. delete _loadedScriptEntry.timer;
  239. }
  240. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  241. for (var i=0; i < pendingCallbackCount; i++) {
  242. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  243. currentCallback();
  244. }
  245. };
  246. if (script.readyState) {
  247. script.onreadystatechange=function () {
  248. if (script.readyState=="loaded" || script.readyState=="complete") {
  249. script.onreadystatechange=null;
  250. onLoadCallback();
  251. }
  252. };
  253. } else {
  254. script.onload=onLoadCallback;
  255. }
  256. script.onerror=onLoadError;
  257. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  258. _loadedScriptEntry.timer=setTimeout(onLoadError, timeoutInMs);
  259. script.src=url;
  260. doc.getElementsByTagName("head")[0].appendChild(script);
  261. } else if (_loadedScriptEntry.loaded) {
  262. callback();
  263. } else {
  264. _loadedScriptEntry.pendingCallbacks.push(callback);
  265. }
  266. }
  267. },
  268. loadCSS: function OSF_OUtil$loadCSS(url) {
  269. if (url) {
  270. var doc=window.document;
  271. var link=doc.createElement("link");
  272. link.type="text/css";
  273. link.rel="stylesheet";
  274. link.href=url;
  275. doc.getElementsByTagName("head")[0].appendChild(link);
  276. }
  277. },
  278. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  279. var parsed=enumObject[str.trim()];
  280. if (typeof (parsed)=='undefined') {
  281. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  282. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  283. }
  284. return parsed;
  285. },
  286. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  287. var obj={ calc: arguments[0] };
  288. return function () {
  289. if (obj.calc) {
  290. obj.val=obj.calc.apply(this, arguments);
  291. delete obj.calc;
  292. }
  293. return obj.val;
  294. };
  295. },
  296. getUniqueId: function OSF_OUtil$getUniqueId() {
  297. _uniqueId=_uniqueId+1;
  298. return _uniqueId.toString();
  299. },
  300. formatString: function OSF_OUtil$formatString() {
  301. var args=arguments;
  302. var source=args[0];
  303. return source.replace(/{(\d+)}/gm, function (match, number) {
  304. var index=parseInt(number, 10)+1;
  305. return args[index]===undefined ? '{'+number+'}' : args[index];
  306. });
  307. },
  308. generateConversationId: function OSF_OUtil$generateConversationId() {
  309. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  310. },
  311. getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame) {
  312. var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  313. frame.setAttribute("name", frameName);
  314. return this.generateConversationId();
  315. },
  316. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  317. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue);
  318. },
  319. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  320. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion);
  321. },
  322. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue) {
  323. url=url.trim() || '';
  324. var urlParts=url.split(_fragmentSeparator);
  325. var urlWithoutFragment=urlParts.shift();
  326. var fragment=urlParts.join(_fragmentSeparator);
  327. return [urlWithoutFragment, _fragmentSeparator, fragment, keyName, infoValue].join('');
  328. },
  329. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  330. return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  331. },
  332. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  333. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, skipSessionStorage, fragment);
  334. },
  335. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  336. return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  337. },
  338. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  339. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, skipSessionStorage, fragment));
  340. },
  341. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment) {
  342. var fragmentParts=fragment.split(infoKey);
  343. var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  344. var osfSessionStorage=_getSessionStorage();
  345. if (!skipSessionStorage && osfSessionStorage) {
  346. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  347. if (sessionKeyStart > -1) {
  348. var sessionKeyEnd=window.name.indexOf(";", sessionKeyStart);
  349. if (sessionKeyEnd==-1) {
  350. sessionKeyEnd=window.name.length;
  351. }
  352. var sessionKey=window.name.substring(sessionKeyStart, sessionKeyEnd);
  353. if (xdmInfoValue) {
  354. osfSessionStorage.setItem(sessionKey, xdmInfoValue);
  355. } else {
  356. xdmInfoValue=osfSessionStorage.getItem(sessionKey);
  357. }
  358. }
  359. }
  360. return xdmInfoValue;
  361. },
  362. getConversationId: function OSF_OUtil$getConversationId() {
  363. var searchString=window.location.search;
  364. var conversationId=null;
  365. if (searchString) {
  366. var index=searchString.indexOf("&");
  367. conversationId=index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  368. if (conversationId && conversationId.charAt(conversationId.length - 1)==='=') {
  369. conversationId=conversationId.substring(0, conversationId.length - 1);
  370. if (conversationId) {
  371. conversationId=decodeURIComponent(conversationId);
  372. }
  373. }
  374. }
  375. return conversationId;
  376. },
  377. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  378. var items=strInfo.split("$");
  379. if (typeof items[1]=="undefined") {
  380. items=strInfo.split("|");
  381. }
  382. return items;
  383. },
  384. getConversationUrl: function OSF_OUtil$getConversationUrl() {
  385. var conversationUrl='';
  386. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  387. if (xdmInfoValue) {
  388. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  389. if (items !=undefined && items.length >=3) {
  390. conversationUrl=items[2];
  391. }
  392. }
  393. return conversationUrl;
  394. },
  395. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  396. var e=Function._validateParams(arguments, [
  397. { name: "params", type: Object, mayBeNull: false },
  398. { name: "expectedProperties", type: Object, mayBeNull: false },
  399. { name: "callback", type: Function, mayBeNull: true }
  400. ]);
  401. if (e)
  402. throw e;
  403. for (var p in expectedProperties) {
  404. e=Function._validateParameter(params[p], expectedProperties[p], p);
  405. if (e)
  406. throw e;
  407. }
  408. },
  409. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  410. if (window.msWriteProfilerMark) {
  411. window.msWriteProfilerMark(text);
  412. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  413. }
  414. },
  415. outputDebug: function OSF_OUtil$outputDebug(text) {
  416. if (typeof (Sys) !=='undefined' && Sys && Sys.Debug) {
  417. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  418. }
  419. },
  420. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  421. descriptor=descriptor || {};
  422. for (var nd in attributes) {
  423. var attribute=attributes[nd];
  424. if (descriptor[attribute]==undefined) {
  425. descriptor[attribute]=true;
  426. }
  427. }
  428. Object.defineProperty(obj, prop, descriptor);
  429. return obj;
  430. },
  431. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  432. descriptors=descriptors || {};
  433. for (var prop in descriptors) {
  434. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  435. }
  436. return obj;
  437. },
  438. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  439. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  440. },
  441. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  442. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  443. },
  444. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  445. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  446. },
  447. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  448. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  449. },
  450. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  451. descriptor=descriptor || {};
  452. var props=Object.getOwnPropertyNames(obj);
  453. var propsLength=props.length;
  454. for (var i=0; i < propsLength; i++) {
  455. var prop=props[i];
  456. var desc=Object.getOwnPropertyDescriptor(obj, prop);
  457. if (!desc.get && !desc.set) {
  458. desc.writable=descriptor.writable || false;
  459. }
  460. desc.configurable=descriptor.configurable || false;
  461. desc.enumerable=descriptor.enumerable || true;
  462. Object.defineProperty(obj, prop, desc);
  463. }
  464. return obj;
  465. },
  466. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  467. var ret=[];
  468. if (list) {
  469. for (var item in list) {
  470. ret.push(mapFunction(list[item]));
  471. }
  472. }
  473. return ret;
  474. },
  475. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  476. for (var item in list) {
  477. if (key==item) {
  478. return true;
  479. }
  480. }
  481. return false;
  482. },
  483. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  484. for (var item in list) {
  485. if (value==list[item]) {
  486. return true;
  487. }
  488. }
  489. return false;
  490. },
  491. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  492. var add=list.push ? function (key, value) {
  493. list.push(value);
  494. } : function (key, value) {
  495. list[key]=value;
  496. };
  497. for (var key in addenda) {
  498. add(key, addenda[key]);
  499. }
  500. },
  501. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  502. for (var key1 in oldList) {
  503. delete oldList[key1];
  504. }
  505. for (var key2 in newList) {
  506. oldList[key2]=newList[key2];
  507. }
  508. },
  509. isArray: function OSF_OUtil$isArray(obj) {
  510. return Object.prototype.toString.apply(obj)==="[object Array]";
  511. },
  512. isFunction: function OSF_OUtil$isFunction(obj) {
  513. return Object.prototype.toString.apply(obj)==="[object Function]";
  514. },
  515. isDate: function OSF_OUtil$isDate(obj) {
  516. return Object.prototype.toString.apply(obj)==="[object Date]";
  517. },
  518. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  519. if (element.addEventListener) {
  520. element.addEventListener(eventName, listener, false);
  521. } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.attachEvent) {
  522. element.attachEvent("on"+eventName, listener);
  523. } else {
  524. element["on"+eventName]=listener;
  525. }
  526. },
  527. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  528. if (element.removeEventListener) {
  529. element.removeEventListener(eventName, listener, false);
  530. } else if ((Sys.Browser.agent===Sys.Browser.InternetExplorer) && element.detachEvent) {
  531. element.detachEvent("on"+eventName, listener);
  532. } else {
  533. element["on"+eventName]=null;
  534. }
  535. },
  536. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  537. var xmlhttp;
  538. try {
  539. xmlhttp=new XMLHttpRequest();
  540. xmlhttp.onreadystatechange=function () {
  541. if (xmlhttp.readyState==4) {
  542. if (xmlhttp.status==200) {
  543. onSuccess(xmlhttp.responseText);
  544. } else {
  545. onError(xmlhttp.status);
  546. }
  547. }
  548. };
  549. xmlhttp.open("GET", url, true);
  550. xmlhttp.send();
  551. } catch (ex) {
  552. onError(ex);
  553. }
  554. },
  555. encodeBase64: function OSF_Outil$encodeBase64(input) {
  556. if (!input)
  557. return input;
  558. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  559. var output=[];
  560. var temp=[];
  561. var index=0;
  562. var c1, c2, c3, a, b, c;
  563. var i;
  564. var length=input.length;
  565. do {
  566. c1=input.charCodeAt(index++);
  567. c2=input.charCodeAt(index++);
  568. c3=input.charCodeAt(index++);
  569. i=0;
  570. a=c1 & 255;
  571. b=c1 >> 8;
  572. c=c2 & 255;
  573. temp[i++]=a >> 2;
  574. temp[i++]=((a & 3) << 4) | (b >> 4);
  575. temp[i++]=((b & 15) << 2) | (c >> 6);
  576. temp[i++]=c & 63;
  577. if (!isNaN(c2)) {
  578. a=c2 >> 8;
  579. b=c3 & 255;
  580. c=c3 >> 8;
  581. temp[i++]=a >> 2;
  582. temp[i++]=((a & 3) << 4) | (b >> 4);
  583. temp[i++]=((b & 15) << 2) | (c >> 6);
  584. temp[i++]=c & 63;
  585. }
  586. if (isNaN(c2)) {
  587. temp[i - 1]=64;
  588. } else if (isNaN(c3)) {
  589. temp[i - 2]=64;
  590. temp[i - 1]=64;
  591. }
  592. for (var t=0; t < i; t++) {
  593. output.push(codex.charAt(temp[t]));
  594. }
  595. } while(index < length);
  596. return output.join("");
  597. },
  598. getSessionStorage: function OSF_Outil$getSessionStorage() {
  599. return _getSessionStorage();
  600. },
  601. getLocalStorage: function OSF_Outil$getLocalStorage() {
  602. if (!_safeLocalStorage) {
  603. try {
  604. var localStorage=window.localStorage;
  605. } catch (ex) {
  606. localStorage=null;
  607. }
  608. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage);
  609. }
  610. return _safeLocalStorage;
  611. },
  612. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  613. var hex="#"+(Number(val)+0x1000000).toString(16).slice(-6);
  614. return hex;
  615. },
  616. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  617. element.onclick=function (e) {
  618. handler();
  619. };
  620. element.ontouchend=function (e) {
  621. handler();
  622. e.preventDefault();
  623. };
  624. },
  625. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  626. var e=Function._validateParams(arguments, [
  627. { name: "queryString", type: String, mayBeNull: false },
  628. { name: "paramName", type: String, mayBeNull: false }
  629. ]);
  630. if (e) {
  631. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  632. return "";
  633. }
  634. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)", "i");
  635. if (!queryExp.test(queryString)) {
  636. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  637. return "";
  638. }
  639. return queryExp.exec(queryString)[1];
  640. },
  641. isiOS: function OSF_Outil$isiOS() {
  642. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  643. },
  644. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  645. var copyObj=sourceObj.constructor();
  646. for (var property in sourceObj) {
  647. if (sourceObj.hasOwnProperty(property)) {
  648. copyObj[property]=sourceObj[property];
  649. }
  650. }
  651. return copyObj;
  652. }
  653. };
  654. })();
  655. OSF.OUtil.Guid=(function () {
  656. var hexCode=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  657. return {
  658. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  659. var result="";
  660. var tick=(new Date()).getTime();
  661. var index=0;
  662. for (; index < 32 && tick > 0; index++) {
  663. if (index==8 || index==12 || index==16 || index==20) {
  664. result+="-";
  665. }
  666. result+=hexCode[tick % 16];
  667. tick=Math.floor(tick / 16);
  668. }
  669. for (; index < 32; index++) {
  670. if (index==8 || index==12 || index==16 || index==20) {
  671. result+="-";
  672. }
  673. result+=hexCode[Math.floor(Math.random() * 16)];
  674. }
  675. return result;
  676. }
  677. };
  678. })();
  679. window.OSF=OSF;
  680. OSF.OUtil.setNamespace("OSF", window);
  681. OSF.AppName={
  682. Unsupported: 0,
  683. Excel: 1,
  684. Word: 2,
  685. PowerPoint: 4,
  686. Outlook: 8,
  687. ExcelWebApp: 16,
  688. WordWebApp: 32,
  689. OutlookWebApp: 64,
  690. Project: 128,
  691. AccessWebApp: 256,
  692. PowerpointWebApp: 512,
  693. ExcelIOS: 1024,
  694. Sway: 2048,
  695. WordIOS: 4096,
  696. PowerPointIOS: 8192,
  697. Access: 16384,
  698. Lync: 32768,
  699. OutlookIOS: 65536,
  700. OneNoteWebApp: 131072
  701. };
  702. OSF.InternalPerfMarker={
  703. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  704. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  705. };
  706. OSF.HostCallPerfMarker={
  707. IssueCall: "Agave.HostCall.IssueCall",
  708. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  709. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  710. };
  711. OSF.AgaveHostAction={
  712. "Select": 0,
  713. "UnSelect": 1,
  714. "CancelDialog": 2,
  715. "InsertAgave": 3,
  716. "CtrlF6In": 4,
  717. "CtrlF6Exit": 5,
  718. "CtrlF6ExitShift": 6,
  719. "SelectWithError": 7,
  720. "NotifyHostError": 8
  721. };
  722. OSF.SharedConstants={
  723. "NotificationConversationIdSuffix": '_ntf'
  724. };
  725. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix) {
  726. this._id=id;
  727. this._appName=appName;
  728. this._appVersion=appVersion;
  729. this._appUILocale=appUILocale;
  730. this._dataLocale=dataLocale;
  731. this._docUrl=docUrl;
  732. this._clientMode=clientMode;
  733. this._settings=settings;
  734. this._reason=reason;
  735. this._osfControlType=osfControlType;
  736. this._eToken=eToken;
  737. this._correlationId=correlationId;
  738. this._appInstanceId=appInstanceId;
  739. this._touchEnabled=touchEnabled;
  740. this._commerceAllowed=commerceAllowed;
  741. this._appMinorVersion=appMinorVersion;
  742. this._requirementMatrix=requirementMatrix;
  743. this.get_id=function get_id() {
  744. return this._id;
  745. };
  746. this.get_appName=function get_appName() {
  747. return this._appName;
  748. };
  749. this.get_appVersion=function get_appVersion() {
  750. return this._appVersion;
  751. };
  752. this.get_appUILocale=function get_appUILocale() {
  753. return this._appUILocale;
  754. };
  755. this.get_dataLocale=function get_dataLocale() {
  756. return this._dataLocale;
  757. };
  758. this.get_docUrl=function get_docUrl() {
  759. return this._docUrl;
  760. };
  761. this.get_clientMode=function get_clientMode() {
  762. return this._clientMode;
  763. };
  764. this.get_bindings=function get_bindings() {
  765. return this._bindings;
  766. };
  767. this.get_settings=function get_settings() {
  768. return this._settings;
  769. };
  770. this.get_reason=function get_reason() {
  771. return this._reason;
  772. };
  773. this.get_osfControlType=function get_osfControlType() {
  774. return this._osfControlType;
  775. };
  776. this.get_eToken=function get_eToken() {
  777. return this._eToken;
  778. };
  779. this.get_correlationId=function get_correlationId() {
  780. return this._correlationId;
  781. };
  782. this.get_appInstanceId=function get_appInstanceId() {
  783. return this._appInstanceId;
  784. };
  785. this.get_touchEnabled=function get_touchEnabled() {
  786. return this._touchEnabled;
  787. };
  788. this.get_commerceAllowed=function get_commerceAllowed() {
  789. return this._commerceAllowed;
  790. };
  791. this.get_appMinorVersion=function get_appMinorVersion() {
  792. return this._appMinorVersion;
  793. };
  794. this.get_requirementMatrix=function get_requirementMatrix() {
  795. return this._requirementMatrix;
  796. };
  797. };
  798. OSF.OsfControlType={
  799. DocumentLevel: 0,
  800. ContainerLevel: 1
  801. };
  802. OSF.ClientMode={
  803. ReadOnly: 0,
  804. ReadWrite: 1
  805. };
  806. OSF.OUtil.setNamespace("Microsoft", window);
  807. OSF.OUtil.setNamespace("Office", Microsoft);
  808. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  809. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  810. Microsoft.Office.WebExtension.InitializationReason={
  811. Inserted: "inserted",
  812. DocumentOpened: "documentOpened"
  813. };
  814. Microsoft.Office.WebExtension.ValueFormat={
  815. Unformatted: "unformatted",
  816. Formatted: "formatted"
  817. };
  818. Microsoft.Office.WebExtension.FilterType={
  819. All: "all"
  820. };
  821. Microsoft.Office.WebExtension.Parameters={
  822. BindingType: "bindingType",
  823. CoercionType: "coercionType",
  824. ValueFormat: "valueFormat",
  825. FilterType: "filterType",
  826. Columns: "columns",
  827. SampleData: "sampleData",
  828. GoToType: "goToType",
  829. SelectionMode: "selectionMode",
  830. Id: "id",
  831. PromptText: "promptText",
  832. ItemName: "itemName",
  833. FailOnCollision: "failOnCollision",
  834. StartRow: "startRow",
  835. StartColumn: "startColumn",
  836. RowCount: "rowCount",
  837. ColumnCount: "columnCount",
  838. Callback: "callback",
  839. AsyncContext: "asyncContext",
  840. Data: "data",
  841. Rows: "rows",
  842. OverwriteIfStale: "overwriteIfStale",
  843. FileType: "fileType",
  844. EventType: "eventType",
  845. Handler: "handler",
  846. SliceSize: "sliceSize",
  847. SliceIndex: "sliceIndex",
  848. ActiveView: "activeView",
  849. Status: "status",
  850. Xml: "xml",
  851. Namespace: "namespace",
  852. Prefix: "prefix",
  853. XPath: "xPath",
  854. ImageLeft: "imageLeft",
  855. ImageTop: "imageTop",
  856. ImageWidth: "imageWidth",
  857. ImageHeight: "imageHeight",
  858. TaskId: "taskId",
  859. FieldId: "fieldId",
  860. FieldValue: "fieldValue",
  861. ServerUrl: "serverUrl",
  862. ListName: "listName",
  863. ResourceId: "resourceId",
  864. ViewType: "viewType",
  865. ViewName: "viewName",
  866. GetRawValue: "getRawValue",
  867. CellFormat: "cellFormat",
  868. TableOptions: "tableOptions",
  869. TaskIndex: "taskIndex",
  870. ResourceIndex: "resourceIndex"
  871. };
  872. OSF.OUtil.setNamespace("DDA", OSF);
  873. OSF.DDA.DocumentMode={
  874. ReadOnly: 1,
  875. ReadWrite: 0
  876. };
  877. OSF.DDA.PropertyDescriptors={
  878. AsyncResultStatus: "AsyncResultStatus"
  879. };
  880. OSF.DDA.EventDescriptors={};
  881. OSF.DDA.ListDescriptors={};
  882. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType) {
  883. if (eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged) {
  884. return bindingId+"_"+eventType;
  885. } else {
  886. return eventType;
  887. }
  888. };
  889. OSF.DDA.MethodDispId={
  890. dispidMethodMin: 64,
  891. dispidGetSelectedDataMethod: 64,
  892. dispidSetSelectedDataMethod: 65,
  893. dispidAddBindingFromSelectionMethod: 66,
  894. dispidAddBindingFromPromptMethod: 67,
  895. dispidGetBindingMethod: 68,
  896. dispidReleaseBindingMethod: 69,
  897. dispidGetBindingDataMethod: 70,
  898. dispidSetBindingDataMethod: 71,
  899. dispidAddRowsMethod: 72,
  900. dispidClearAllRowsMethod: 73,
  901. dispidGetAllBindingsMethod: 74,
  902. dispidLoadSettingsMethod: 75,
  903. dispidSaveSettingsMethod: 76,
  904. dispidGetDocumentCopyMethod: 77,
  905. dispidAddBindingFromNamedItemMethod: 78,
  906. dispidAddColumnsMethod: 79,
  907. dispidGetDocumentCopyChunkMethod: 80,
  908. dispidReleaseDocumentCopyMethod: 81,
  909. dispidNavigateToMethod: 82,
  910. dispidGetActiveViewMethod: 83,
  911. dispidGetDocumentThemeMethod: 84,
  912. dispidGetOfficeThemeMethod: 85,
  913. dispidGetFilePropertiesMethod: 86,
  914. dispidClearFormatsMethod: 87,
  915. dispidSetTableOptionsMethod: 88,
  916. dispidSetFormatsMethod: 89,
  917. dispidExecuteRichApiRequestMethod: 93,
  918. dispidAppCommandInvocationCompletedMethod: 94,
  919. dispidAddDataPartMethod: 128,
  920. dispidGetDataPartByIdMethod: 129,
  921. dispidGetDataPartsByNamespaceMethod: 130,
  922. dispidGetDataPartXmlMethod: 131,
  923. dispidGetDataPartNodesMethod: 132,
  924. dispidDeleteDataPartMethod: 133,
  925. dispidGetDataNodeValueMethod: 134,
  926. dispidGetDataNodeXmlMethod: 135,
  927. dispidGetDataNodesMethod: 136,
  928. dispidSetDataNodeValueMethod: 137,
  929. dispidSetDataNodeXmlMethod: 138,
  930. dispidAddDataNamespaceMethod: 139,
  931. dispidGetDataUriByPrefixMethod: 140,
  932. dispidGetDataPrefixByUriMethod: 141,
  933. dispidMethodMax: 141,
  934. dispidGetSelectedTaskMethod: 110,
  935. dispidGetSelectedResourceMethod: 111,
  936. dispidGetTaskMethod: 112,
  937. dispidGetResourceFieldMethod: 113,
  938. dispidGetWSSUrlMethod: 114,
  939. dispidGetTaskFieldMethod: 115,
  940. dispidGetProjectFieldMethod: 116,
  941. dispidGetSelectedViewMethod: 117,
  942. dispidGetTaskByIndexMethod: 118,
  943. dispidGetResourceByIndexMethod: 119,
  944. dispidSetTaskFieldMethod: 120,
  945. dispidSetResourceFieldMethod: 121,
  946. dispidGetMaxTaskIndexMethod: 122,
  947. dispidGetMaxResourceIndexMethod: 123
  948. };
  949. OSF.DDA.EventDispId={
  950. dispidEventMin: 0,
  951. dispidInitializeEvent: 0,
  952. dispidSettingsChangedEvent: 1,
  953. dispidDocumentSelectionChangedEvent: 2,
  954. dispidBindingSelectionChangedEvent: 3,
  955. dispidBindingDataChangedEvent: 4,
  956. dispidDocumentOpenEvent: 5,
  957. dispidDocumentCloseEvent: 6,
  958. dispidActiveViewChangedEvent: 7,
  959. dispidDocumentThemeChangedEvent: 8,
  960. dispidOfficeThemeChangedEvent: 9,
  961. dispidActivationStatusChangedEvent: 32,
  962. dispidAppCommandInvokedEvent: 39,
  963. dispidTaskSelectionChangedEvent: 56,
  964. dispidResourceSelectionChangedEvent: 57,
  965. dispidViewSelectionChangedEvent: 58,
  966. dispidDataNodeAddedEvent: 60,
  967. dispidDataNodeReplacedEvent: 61,
  968. dispidDataNodeDeletedEvent: 62,
  969. dispidEventMax: 63
  970. };
  971. OSF.DDA.ErrorCodeManager=(function () {
  972. var _errorMappings={};
  973. return {
  974. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  975. return _errorMappings[errorCode] || _errorMappings[this.errorCodes.ooeInternalError];
  976. },
  977. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  978. _errorMappings[errorCode]=errorNameMessage;
  979. },
  980. errorCodes: {
  981. ooeSuccess: 0,
  982. ooeChunkResult: 1,
  983. ooeCoercionTypeNotSupported: 1000,
  984. ooeGetSelectionNotMatchDataType: 1001,
  985. ooeCoercionTypeNotMatchBinding: 1002,
  986. ooeInvalidGetRowColumnCounts: 1003,
  987. ooeSelectionNotSupportCoercionType: 1004,
  988. ooeInvalidGetStartRowColumn: 1005,
  989. ooeNonUniformPartialGetNotSupported: 1006,
  990. ooeGetDataIsTooLarge: 1008,
  991. ooeFileTypeNotSupported: 1009,
  992. ooeGetDataParametersConflict: 1010,
  993. ooeInvalidGetColumns: 1011,
  994. ooeInvalidGetRows: 1012,
  995. ooeInvalidReadForBlankRow: 1013,
  996. ooeUnsupportedDataObject: 2000,
  997. ooeCannotWriteToSelection: 2001,
  998. ooeDataNotMatchSelection: 2002,
  999. ooeOverwriteWorksheetData: 2003,
  1000. ooeDataNotMatchBindingSize: 2004,
  1001. ooeInvalidSetStartRowColumn: 2005,
  1002. ooeInvalidDataFormat: 2006,
  1003. ooeDataNotMatchCoercionType: 2007,
  1004. ooeDataNotMatchBindingType: 2008,
  1005. ooeSetDataIsTooLarge: 2009,
  1006. ooeNonUniformPartialSetNotSupported: 2010,
  1007. ooeInvalidSetColumns: 2011,
  1008. ooeInvalidSetRows: 2012,
  1009. ooeSetDataParametersConflict: 2013,
  1010. ooeCellDataAmountBeyondLimits: 2014,
  1011. ooeSelectionCannotBound: 3000,
  1012. ooeBindingNotExist: 3002,
  1013. ooeBindingToMultipleSelection: 3003,
  1014. ooeInvalidSelectionForBindingType: 3004,
  1015. ooeOperationNotSupportedOnThisBindingType: 3005,
  1016. ooeNamedItemNotFound: 3006,
  1017. ooeMultipleNamedItemFound: 3007,
  1018. ooeInvalidNamedItemForBindingType: 3008,
  1019. ooeUnknownBindingType: 3009,
  1020. ooeOperationNotSupportedOnMatrixData: 3010,
  1021. ooeInvalidColumnsForBinding: 3011,
  1022. ooeSettingNameNotExist: 4000,
  1023. ooeSettingsCannotSave: 4001,
  1024. ooeSettingsAreStale: 4002,
  1025. ooeOperationNotSupported: 5000,
  1026. ooeInternalError: 5001,
  1027. ooeDocumentReadOnly: 5002,
  1028. ooeEventHandlerNotExist: 5003,
  1029. ooeInvalidApiCallInContext: 5004,
  1030. ooeShuttingDown: 5005,
  1031. ooeUnsupportedEnumeration: 5007,
  1032. ooeIndexOutOfRange: 5008,
  1033. ooeBrowserAPINotSupported: 5009,
  1034. ooeInvalidParam: 5010,
  1035. ooeRequestTimeout: 5011,
  1036. ooeTooManyIncompleteRequests: 5100,
  1037. ooeRequestTokenUnavailable: 5101,
  1038. ooeActivityLimitReached: 5102,
  1039. ooeCustomXmlNodeNotFound: 6000,
  1040. ooeCustomXmlError: 6100,
  1041. ooeCustomXmlExceedQuota: 6101,
  1042. ooeCustomXmlOutOfDate: 6102,
  1043. ooeNoCapability: 7000,
  1044. ooeCannotNavTo: 7001,
  1045. ooeSpecifiedIdNotExist: 7002,
  1046. ooeNavOutOfBound: 7004,
  1047. ooeElementMissing: 8000,
  1048. ooeProtectedError: 8001,
  1049. ooeInvalidCellsValue: 8010,
  1050. ooeInvalidTableOptionValue: 8011,
  1051. ooeInvalidFormatValue: 8012,
  1052. ooeRowIndexOutOfRange: 8020,
  1053. ooeColIndexOutOfRange: 8021,
  1054. ooeFormatValueOutOfRange: 8022,
  1055. ooeCellFormatAmountBeyondLimits: 8023,
  1056. ooeMemoryFileLimit: 11000,
  1057. ooeNetworkProblemRetrieveFile: 11001,
  1058. ooeInvalidSliceSize: 11002,
  1059. ooeInvalidCallback: 11101
  1060. },
  1061. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1062. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1063. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={ name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1064. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={ name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1065. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1066. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={ name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1067. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1068. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1069. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1070. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={ name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1071. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={ name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1072. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1073. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1074. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={ name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1075. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={ name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1076. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1077. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1078. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={ name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1079. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={ name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1080. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1081. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={ name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1082. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1083. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={ name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1084. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1085. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={ name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1086. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1087. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={ name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1088. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={ name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1089. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1090. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={ name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1091. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={ name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1092. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1093. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1094. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1095. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={ name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1096. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={ name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1097. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={ name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1098. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={ name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1099. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={ name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1100. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={ name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1101. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={ name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1102. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={ name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1103. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={ name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1104. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={ name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1105. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={ name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1106. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={ name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1107. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={ name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1108. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={ name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1109. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={ name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1110. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={ name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1111. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={ name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1112. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1113. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={ name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1114. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={ name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1115. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={ name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1116. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={ name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1117. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1118. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1119. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={ name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1120. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1121. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={ name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1122. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={ name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1123. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={ name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1124. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={ name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1125. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={ name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1126. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={ name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1127. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1128. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1129. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={ name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1130. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1131. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1132. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={ name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1133. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={ name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1134. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={ name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1135. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={ name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1136. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={ name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1137. }
  1138. };
  1139. })();
  1140. var OfficeExt;
  1141. (function (OfficeExt) {
  1142. (function (Requirement) {
  1143. var RequirementMatrix=(function () {
  1144. function RequirementMatrix(_setMap) {
  1145. this.isSetSupported=function _isSetSupported(name, minVersion) {
  1146. if (name==undefined) {
  1147. return false;
  1148. }
  1149. if (minVersion==undefined) {
  1150. minVersion=0;
  1151. }
  1152. var setSupportArray=this._setMap;
  1153. var sets=setSupportArray._sets;
  1154. if (sets.hasOwnProperty(name.toLowerCase())) {
  1155. var setMaxVersion=sets[name.toLowerCase()];
  1156. return setMaxVersion > 0 && setMaxVersion >=minVersion;
  1157. } else {
  1158. return false;
  1159. }
  1160. };
  1161. this._setMap=_setMap;
  1162. }
  1163. return RequirementMatrix;
  1164. })();
  1165. Requirement.RequirementMatrix=RequirementMatrix;
  1166. var DefaultSetRequirement=(function () {
  1167. function DefaultSetRequirement(setMap) {
  1168. this._sets=setMap;
  1169. }
  1170. return DefaultSetRequirement;
  1171. })();
  1172. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1173. var ExcelClientDefaultSetRequirement=(function (_super) {
  1174. __extends(ExcelClientDefaultSetRequirement, _super);
  1175. function ExcelClientDefaultSetRequirement() {
  1176. _super.call(this, {
  1177. "bindingevents": 1.1,
  1178. "documentevents": 1.1,
  1179. "excelapi": 1.1,
  1180. "matrixbindings": 1.1,
  1181. "matrixcoercion": 1.1,
  1182. "selection": 1.1,
  1183. "settings": 1.1,
  1184. "tablebindings": 1.1,
  1185. "tablecoercion": 1.1,
  1186. "textbindings": 1.1,
  1187. "textcoercion": 1.1
  1188. });
  1189. }
  1190. return ExcelClientDefaultSetRequirement;
  1191. })(DefaultSetRequirement);
  1192. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1193. var OutlookClientDefaultSetRequirement=(function (_super) {
  1194. __extends(OutlookClientDefaultSetRequirement, _super);
  1195. function OutlookClientDefaultSetRequirement() {
  1196. _super.call(this, {
  1197. "mailbox": 1.3
  1198. });
  1199. }
  1200. return OutlookClientDefaultSetRequirement;
  1201. })(DefaultSetRequirement);
  1202. Requirement.OutlookClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1203. var WordClientDefaultSetRequirement=(function (_super) {
  1204. __extends(WordClientDefaultSetRequirement, _super);
  1205. function WordClientDefaultSetRequirement() {
  1206. _super.call(this, {
  1207. "bindingevents": 1.1,
  1208. "compressedfile": 1.1,
  1209. "customxmlparts": 1.1,
  1210. "documentevents": 1.1,
  1211. "file": 1.1,
  1212. "htmlcoercion": 1.1,
  1213. "matrixbindings": 1.1,
  1214. "matrixcoercion": 1.1,
  1215. "ooxmlcoercion": 1.1,
  1216. "pdffile": 1.1,
  1217. "selection": 1.1,
  1218. "settings": 1.1,
  1219. "tablebindings": 1.1,
  1220. "tablecoercion": 1.1,
  1221. "textbindings": 1.1,
  1222. "textcoercion": 1.1,
  1223. "textfile": 1.1,
  1224. "wordapi": 1.1
  1225. });
  1226. }
  1227. return WordClientDefaultSetRequirement;
  1228. })(DefaultSetRequirement);
  1229. Requirement.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1230. var PowerpointClientDefaultSetRequirement=(function (_super) {
  1231. __extends(PowerpointClientDefaultSetRequirement, _super);
  1232. function PowerpointClientDefaultSetRequirement() {
  1233. _super.call(this, {
  1234. "activeview": 1.1,
  1235. "compressedfile": 1.1,
  1236. "documentevents": 1.1,
  1237. "file": 1.1,
  1238. "pdffile": 1.1,
  1239. "selection": 1.1,
  1240. "settings": 1.1,
  1241. "textcoercion": 1.1
  1242. });
  1243. }
  1244. return PowerpointClientDefaultSetRequirement;
  1245. })(DefaultSetRequirement);
  1246. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1247. var ProjectClientDefaultSetRequirement=(function (_super) {
  1248. __extends(ProjectClientDefaultSetRequirement, _super);
  1249. function ProjectClientDefaultSetRequirement() {
  1250. _super.call(this, {
  1251. "selection": 1.1,
  1252. "textcoercion": 1.1
  1253. });
  1254. }
  1255. return ProjectClientDefaultSetRequirement;
  1256. })(DefaultSetRequirement);
  1257. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1258. var ExcelWebDefaultSetRequirement=(function (_super) {
  1259. __extends(ExcelWebDefaultSetRequirement, _super);
  1260. function ExcelWebDefaultSetRequirement() {
  1261. _super.call(this, {
  1262. "bindingevents": 1.1,
  1263. "documentevents": 1.1,
  1264. "matrixbindings": 1.1,
  1265. "matrixcoercion": 1.1,
  1266. "selection": 1.1,
  1267. "settings": 1.1,
  1268. "tablebindings": 1.1,
  1269. "tablecoercion": 1.1,
  1270. "textbindings": 1.1,
  1271. "textcoercion": 1.1,
  1272. "file": 1.1
  1273. });
  1274. }
  1275. return ExcelWebDefaultSetRequirement;
  1276. })(DefaultSetRequirement);
  1277. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1278. var WordWebDefaultSetRequirement=(function (_super) {
  1279. __extends(WordWebDefaultSetRequirement, _super);
  1280. function WordWebDefaultSetRequirement() {
  1281. _super.call(this, {
  1282. "customxmlparts": 1.1,
  1283. "documentevents": 1.1,
  1284. "file": 1.1,
  1285. "ooxmlcoercion": 1.1,
  1286. "selection": 1.1,
  1287. "settings": 1.1,
  1288. "textcoercion": 1.1
  1289. });
  1290. }
  1291. return WordWebDefaultSetRequirement;
  1292. })(DefaultSetRequirement);
  1293. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1294. var PowerpointWebDefaultSetRequirement=(function (_super) {
  1295. __extends(PowerpointWebDefaultSetRequirement, _super);
  1296. function PowerpointWebDefaultSetRequirement() {
  1297. _super.call(this, {
  1298. "activeview": 1.1,
  1299. "settings": 1.1
  1300. });
  1301. }
  1302. return PowerpointWebDefaultSetRequirement;
  1303. })(DefaultSetRequirement);
  1304. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1305. var OutlookWebDefaultSetRequirement=(function (_super) {
  1306. __extends(OutlookWebDefaultSetRequirement, _super);
  1307. function OutlookWebDefaultSetRequirement() {
  1308. _super.call(this, {
  1309. "mailbox": 1.3
  1310. });
  1311. }
  1312. return OutlookWebDefaultSetRequirement;
  1313. })(DefaultSetRequirement);
  1314. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1315. var SwayWebDefaultSetRequirement=(function (_super) {
  1316. __extends(SwayWebDefaultSetRequirement, _super);
  1317. function SwayWebDefaultSetRequirement() {
  1318. _super.call(this, {
  1319. "activeview": 1.1,
  1320. "documentevents": 1.1,
  1321. "selection": 1.1,
  1322. "settings": 1.1,
  1323. "textcoercion": 1.1
  1324. });
  1325. }
  1326. return SwayWebDefaultSetRequirement;
  1327. })(DefaultSetRequirement);
  1328. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1329. var AccessWebDefaultSetRequirement=(function (_super) {
  1330. __extends(AccessWebDefaultSetRequirement, _super);
  1331. function AccessWebDefaultSetRequirement() {
  1332. _super.call(this, {
  1333. "bindingevents": 1.1,
  1334. "partialtablebindings": 1.1,
  1335. "settings": 1.1,
  1336. "tablebindings": 1.1,
  1337. "tablecoercion": 1.1
  1338. });
  1339. }
  1340. return AccessWebDefaultSetRequirement;
  1341. })(DefaultSetRequirement);
  1342. Requirement.AccessWebDefaultSetRequirement=AccessWebDefaultSetRequirement;
  1343. var ExcelIOSDefaultSetRequirement=(function (_super) {
  1344. __extends(ExcelIOSDefaultSetRequirement, _super);
  1345. function ExcelIOSDefaultSetRequirement() {
  1346. _super.call(this, {
  1347. "bindingevents": 1.1,
  1348. "documentevents": 1.1,
  1349. "matrixbindings": 1.1,
  1350. "matrixcoercion": 1.1,
  1351. "selection": 1.1,
  1352. "settings": 1.1,
  1353. "tablebindings": 1.1,
  1354. "tablecoercion": 1.1,
  1355. "textbindings": 1.1,
  1356. "textcoercion": 1.1
  1357. });
  1358. }
  1359. return ExcelIOSDefaultSetRequirement;
  1360. })(DefaultSetRequirement);
  1361. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1362. var WordIOSDefaultSetRequirement=(function (_super) {
  1363. __extends(WordIOSDefaultSetRequirement, _super);
  1364. function WordIOSDefaultSetRequirement() {
  1365. _super.call(this, {
  1366. "bindingevents": 1.1,
  1367. "compressedfile": 1.1,
  1368. "customxmlparts": 1.1,
  1369. "documentevents": 1.1,
  1370. "file": 1.1,
  1371. "htmlcoercion": 1.1,
  1372. "matrixbindings": 1.1,
  1373. "matrixcoercion": 1.1,
  1374. "ooxmlcoercion": 1.1,
  1375. "pdffile": 1.1,
  1376. "selection": 1.1,
  1377. "settings": 1.1,
  1378. "tablebindings": 1.1,
  1379. "tablecoercion": 1.1,
  1380. "textbindings": 1.1,
  1381. "textcoercion": 1.1,
  1382. "textfile": 1.1
  1383. });
  1384. }
  1385. return WordIOSDefaultSetRequirement;
  1386. })(DefaultSetRequirement);
  1387. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1388. var PowerpointIOSDefaultSetRequirement=(function (_super) {
  1389. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1390. function PowerpointIOSDefaultSetRequirement() {
  1391. _super.call(this, {
  1392. "activeview": 1.1,
  1393. "compressedfile": 1.1,
  1394. "documentevents": 1.1,
  1395. "file": 1.1,
  1396. "pdffile": 1.1,
  1397. "selection": 1.1,
  1398. "settings": 1.1,
  1399. "textcoercion": 1.1
  1400. });
  1401. }
  1402. return PowerpointIOSDefaultSetRequirement;
  1403. })(DefaultSetRequirement);
  1404. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1405. var OutlookIOSDefaultSetRequirement=(function (_super) {
  1406. __extends(OutlookIOSDefaultSetRequirement, _super);
  1407. function OutlookIOSDefaultSetRequirement() {
  1408. _super.call(this, {
  1409. "mailbox": 1.1
  1410. });
  1411. }
  1412. return OutlookIOSDefaultSetRequirement;
  1413. })(DefaultSetRequirement);
  1414. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1415. var RequirementsMatrixFactory=(function () {
  1416. function RequirementsMatrixFactory() {
  1417. }
  1418. RequirementsMatrixFactory.initializeOsfDda=function () {
  1419. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1420. };
  1421. RequirementsMatrixFactory.getDefaultRequirementMatrix=function (appContext) {
  1422. this.initializeDefaultSetMatrix();
  1423. var defaultRequirementMatrix=undefined;
  1424. if (appContext.get_requirementMatrix() !=undefined && typeof (JSON) !=="undefined") {
  1425. var matrixItem=JSON.parse(appContext.get_requirementMatrix());
  1426. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1427. } else {
  1428. var appMinorVersion=appContext.get_appMinorVersion();
  1429. var appMinorVersionString="";
  1430. if (appMinorVersion < 10) {
  1431. appMinorVersionString="0"+appMinorVersion;
  1432. } else {
  1433. appMinorVersionString=""+appMinorVersion;
  1434. }
  1435. var appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString;
  1436. var appLocator=appContext.get_appName()+"-"+appFullVersion;
  1437. if (RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined) {
  1438. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1439. } else {
  1440. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}));
  1441. }
  1442. }
  1443. return defaultRequirementMatrix;
  1444. };
  1445. RequirementsMatrixFactory.initializeDefaultSetMatrix=function () {
  1446. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement();
  1447. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement();
  1448. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement();
  1449. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement();
  1450. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement();
  1451. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement();
  1452. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement();
  1453. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement();
  1454. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement();
  1455. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement();
  1456. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement();
  1457. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement();
  1458. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement();
  1459. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement();
  1460. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement();
  1461. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement();
  1462. };
  1463. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  1464. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  1465. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  1466. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  1467. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  1468. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  1469. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  1470. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  1471. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  1472. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  1473. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  1474. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.01";
  1475. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  1476. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  1477. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  1478. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  1479. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  1480. return RequirementsMatrixFactory;
  1481. })();
  1482. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory;
  1483. })(OfficeExt.Requirement || (OfficeExt.Requirement={}));
  1484. var Requirement=OfficeExt.Requirement;
  1485. })(OfficeExt || (OfficeExt={}));
  1486. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1487. Microsoft.Office.WebExtension.ApplicationMode={
  1488. WebEditor: "webEditor",
  1489. WebViewer: "webViewer",
  1490. Client: "client"
  1491. };
  1492. Microsoft.Office.WebExtension.DocumentMode={
  1493. ReadOnly: "readOnly",
  1494. ReadWrite: "readWrite"
  1495. };
  1496. OSF.NamespaceManager=(function OSF_NamespaceManager() {
  1497. var _userOffice;
  1498. var _useShortcut=false;
  1499. return {
  1500. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1501. if (!_useShortcut) {
  1502. if (window.Office) {
  1503. _userOffice=window.Office;
  1504. } else {
  1505. OSF.OUtil.setNamespace("Office", window);
  1506. }
  1507. window.Office=Microsoft.Office.WebExtension;
  1508. _useShortcut=true;
  1509. }
  1510. },
  1511. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1512. if (_useShortcut) {
  1513. if (_userOffice) {
  1514. window.Office=_userOffice;
  1515. } else {
  1516. OSF.OUtil.unsetNamespace("Office", window);
  1517. }
  1518. _useShortcut=false;
  1519. }
  1520. }
  1521. };
  1522. })();
  1523. OSF.NamespaceManager.enableShortcut();
  1524. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1525. if (useShortcut) {
  1526. OSF.NamespaceManager.enableShortcut();
  1527. } else {
  1528. OSF.NamespaceManager.disableShortcut();
  1529. }
  1530. };
  1531. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1532. var promise;
  1533. if (str && typeof str=="string") {
  1534. var index=str.indexOf("#");
  1535. if (index !=-1) {
  1536. var op=str.substring(0, index);
  1537. var target=str.substring(index+1);
  1538. switch (op) {
  1539. case "binding":
  1540. case "bindings":
  1541. if (target) {
  1542. promise=new OSF.DDA.BindingPromise(target);
  1543. }
  1544. break;
  1545. }
  1546. }
  1547. }
  1548. if (!promise) {
  1549. if (errorCallback) {
  1550. var callbackType=typeof errorCallback;
  1551. if (callbackType=="function") {
  1552. var callArgs={};
  1553. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  1554. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  1555. } else {
  1556. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  1557. }
  1558. }
  1559. } else {
  1560. promise.onFail=errorCallback;
  1561. return promise;
  1562. }
  1563. };
  1564. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  1565. OSF.OUtil.defineEnumerableProperties(this, {
  1566. "contentLanguage": {
  1567. value: officeAppContext.get_dataLocale()
  1568. },
  1569. "displayLanguage": {
  1570. value: officeAppContext.get_appUILocale()
  1571. },
  1572. "touchEnabled": {
  1573. value: officeAppContext.get_touchEnabled()
  1574. },
  1575. "commerceAllowed": {
  1576. value: officeAppContext.get_commerceAllowed()
  1577. }
  1578. });
  1579. if (document) {
  1580. OSF.OUtil.defineEnumerableProperty(this, "document", {
  1581. value: document
  1582. });
  1583. }
  1584. if (license) {
  1585. OSF.OUtil.defineEnumerableProperty(this, "license", {
  1586. value: license
  1587. });
  1588. }
  1589. if (appOM) {
  1590. var displayName=appOM.displayName || "appOM";
  1591. delete appOM.displayName;
  1592. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  1593. value: appOM
  1594. });
  1595. }
  1596. if (getOfficeTheme) {
  1597. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  1598. get: function () {
  1599. return getOfficeTheme();
  1600. }
  1601. });
  1602. }
  1603. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  1604. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  1605. value: requirements
  1606. });
  1607. };
  1608. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  1609. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  1610. if (settings) {
  1611. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  1612. value: settings
  1613. });
  1614. }
  1615. };
  1616. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  1617. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady) {
  1618. };
  1619. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings) {
  1620. var mode;
  1621. switch (officeAppContext.get_clientMode()) {
  1622. case OSF.ClientMode.ReadOnly:
  1623. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  1624. break;
  1625. case OSF.ClientMode.ReadWrite:
  1626. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  1627. break;
  1628. }
  1629. ;
  1630. if (settings) {
  1631. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  1632. value: settings
  1633. });
  1634. }
  1635. ;
  1636. OSF.OUtil.defineMutableProperties(this, {
  1637. "mode": {
  1638. value: mode
  1639. },
  1640. "url": {
  1641. value: officeAppContext.get_docUrl()
  1642. }
  1643. });
  1644. };
  1645. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  1646. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  1647. if (bindingFacade) {
  1648. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  1649. get: function OSF_DDA_Document$GetBindings() {
  1650. return bindingFacade;
  1651. }
  1652. });
  1653. }
  1654. var am=OSF.DDA.AsyncMethodNames;
  1655. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  1656. am.GetSelectedDataAsync,
  1657. am.SetSelectedDataAsync
  1658. ]);
  1659. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  1660. };
  1661. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  1662. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  1663. get: function Microsoft_Office_WebExtension$GetContext() {
  1664. var context;
  1665. if (OSF && OSF._OfficeAppFactory) {
  1666. context=OSF._OfficeAppFactory.getContext();
  1667. }
  1668. return context;
  1669. }
  1670. });
  1671. OSF.DDA.License=function OSF_DDA_License(eToken) {
  1672. OSF.OUtil.defineEnumerableProperty(this, "value", {
  1673. value: eToken
  1674. });
  1675. };
  1676. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  1677. OSF.DDA.AsyncResultEnum.Properties={
  1678. Context: "Context",
  1679. Value: "Value",
  1680. Status: "Status",
  1681. Error: "Error"
  1682. };
  1683. Microsoft.Office.WebExtension.AsyncResultStatus={
  1684. Succeeded: "succeeded",
  1685. Failed: "failed"
  1686. };
  1687. OSF.DDA.AsyncResultEnum.ErrorCode={
  1688. Success: 0,
  1689. Failed: 1
  1690. };
  1691. OSF.DDA.AsyncResultEnum.ErrorProperties={
  1692. Name: "Name",
  1693. Message: "Message",
  1694. Code: "Code"
  1695. };
  1696. OSF.DDA.AsyncMethodNames={};
  1697. OSF.DDA.AsyncMethodNames.addNames=function (methodNames) {
  1698. for (var entry in methodNames) {
  1699. var am={};
  1700. OSF.OUtil.defineEnumerableProperties(am, {
  1701. "id": {
  1702. value: entry
  1703. },
  1704. "displayName": {
  1705. value: methodNames[entry]
  1706. }
  1707. });
  1708. OSF.DDA.AsyncMethodNames[entry]=am;
  1709. }
  1710. };
  1711. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  1712. var requiredCount=requiredParameters.length;
  1713. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function () {
  1714. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  1715. });
  1716. function OSF_DAA_AsyncMethodCall$VerifyArguments(params, args) {
  1717. for (var name in params) {
  1718. var param=params[name];
  1719. var arg=args[name];
  1720. if (param["enum"]) {
  1721. switch (typeof arg) {
  1722. case "string":
  1723. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  1724. break;
  1725. }
  1726. case "undefined":
  1727. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  1728. break;
  1729. default:
  1730. throw getInvalidParameterString();
  1731. }
  1732. }
  1733. if (param["types"]) {
  1734. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  1735. throw getInvalidParameterString();
  1736. }
  1737. }
  1738. }
  1739. }
  1740. ;
  1741. function OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  1742. if (userArgs.length < requiredCount) {
  1743. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  1744. }
  1745. var requiredArgs=[];
  1746. var index;
  1747. for (index=0; index < requiredCount; index++) {
  1748. requiredArgs.push(userArgs[index]);
  1749. }
  1750. OSF_DAA_AsyncMethodCall$VerifyArguments(requiredParameters, requiredArgs);
  1751. var ret={};
  1752. for (index=0; index < requiredCount; index++) {
  1753. var param=requiredParameters[index];
  1754. var arg=requiredArgs[index];
  1755. if (param.verify) {
  1756. var isValid=param.verify(arg, caller, stateInfo);
  1757. if (!isValid) {
  1758. throw getInvalidParameterString();
  1759. }
  1760. }
  1761. ret[param.name]=arg;
  1762. }
  1763. return ret;
  1764. }
  1765. ;
  1766. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  1767. if (userArgs.length > requiredCount+2) {
  1768. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  1769. }
  1770. var options, parameterCallback;
  1771. for (var i=userArgs.length - 1; i >=requiredCount; i--) {
  1772. var argument=userArgs[i];
  1773. switch (typeof argument) {
  1774. case "object":
  1775. if (options) {
  1776. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  1777. } else {
  1778. options=argument;
  1779. }
  1780. break;
  1781. case "function":
  1782. if (parameterCallback) {
  1783. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  1784. } else {
  1785. parameterCallback=argument;
  1786. }
  1787. break;
  1788. default:
  1789. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  1790. break;
  1791. }
  1792. }
  1793. options=options || {};
  1794. for (var optionName in supportedOptions) {
  1795. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  1796. var value=undefined;
  1797. var option=supportedOptions[optionName];
  1798. if (option.calculate && requiredArgs) {
  1799. value=option.calculate(requiredArgs, caller, stateInfo);
  1800. }
  1801. if (!value && option.defaultValue !==undefined) {
  1802. value=option.defaultValue;
  1803. }
  1804. options[optionName]=value;
  1805. }
  1806. }
  1807. if (parameterCallback) {
  1808. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  1809. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  1810. } else {
  1811. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  1812. }
  1813. }
  1814. OSF_DAA_AsyncMethodCall$VerifyArguments(supportedOptions, options);
  1815. return options;
  1816. }
  1817. ;
  1818. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  1819. var required=OSF_DAA_AsyncMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo);
  1820. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  1821. var callArgs={};
  1822. for (var r in required) {
  1823. callArgs[r]=required[r];
  1824. }
  1825. for (var o in options) {
  1826. callArgs[o]=options[o];
  1827. }
  1828. for (var s in privateStateCallbacks) {
  1829. callArgs[s]=privateStateCallbacks[s](caller, stateInfo);
  1830. }
  1831. if (checkCallArgs) {
  1832. callArgs=checkCallArgs(callArgs, caller, stateInfo);
  1833. }
  1834. return callArgs;
  1835. };
  1836. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  1837. var payload;
  1838. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  1839. if (onSucceeded) {
  1840. payload=onSucceeded(response, caller, callArgs);
  1841. } else {
  1842. payload=response;
  1843. }
  1844. } else {
  1845. if (onFailed) {
  1846. payload=onFailed(status, response);
  1847. } else {
  1848. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  1849. }
  1850. }
  1851. return payload;
  1852. };
  1853. this.getCallArgs=function (suppliedArgs) {
  1854. var options, parameterCallback;
  1855. for (var i=suppliedArgs.length - 1; i >=requiredCount; i--) {
  1856. var argument=suppliedArgs[i];
  1857. switch (typeof argument) {
  1858. case "object":
  1859. options=argument;
  1860. break;
  1861. case "function":
  1862. parameterCallback=argument;
  1863. break;
  1864. }
  1865. }
  1866. options=options || {};
  1867. if (parameterCallback) {
  1868. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  1869. }
  1870. return options;
  1871. };
  1872. };
  1873. OSF.DDA.AsyncMethodCallFactory=(function () {
  1874. function createObject(properties) {
  1875. var obj=null;
  1876. if (properties) {
  1877. obj={};
  1878. var len=properties.length;
  1879. for (var i=0; i < len; i++) {
  1880. obj[properties[i].name]=properties[i].value;
  1881. }
  1882. }
  1883. return obj;
  1884. }
  1885. return {
  1886. manufacture: function (params) {
  1887. var supportedOptions=params.supportedOptions ? createObject(params.supportedOptions) : [];
  1888. var privateStateCallbacks=params.privateStateCallbacks ? createObject(params.privateStateCallbacks) : [];
  1889. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  1890. }
  1891. };
  1892. })();
  1893. OSF.DDA.AsyncMethodCalls={};
  1894. OSF.DDA.AsyncMethodCalls.define=function (callDefinition) {
  1895. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  1896. };
  1897. OSF.DDA.Error=function OSF_DDA_Error(name, message, code) {
  1898. OSF.OUtil.defineEnumerableProperties(this, {
  1899. "name": {
  1900. value: name
  1901. },
  1902. "message": {
  1903. value: message
  1904. },
  1905. "code": {
  1906. value: code
  1907. }
  1908. });
  1909. };
  1910. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  1911. OSF.OUtil.defineEnumerableProperties(this, {
  1912. "value": {
  1913. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  1914. },
  1915. "status": {
  1916. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  1917. }
  1918. });
  1919. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  1920. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  1921. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  1922. });
  1923. }
  1924. if (errorArgs) {
  1925. OSF.OUtil.defineEnumerableProperty(this, "error", {
  1926. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  1927. });
  1928. }
  1929. };
  1930. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  1931. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  1932. if (callback) {
  1933. var asyncInitArgs={};
  1934. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  1935. var errorArgs;
  1936. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  1937. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  1938. } else {
  1939. errorArgs={};
  1940. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  1941. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  1942. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  1943. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  1944. }
  1945. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  1946. }
  1947. };
  1948. OSF.DDA.ListType=(function () {
  1949. var listTypes={};
  1950. return {
  1951. setListType: function OSF_DDA_ListType$AddListType(t, prop) {
  1952. listTypes[t]=prop;
  1953. },
  1954. isListType: function OSF_DDA_ListType$IsListType(t) {
  1955. return OSF.OUtil.listContainsKey(listTypes, t);
  1956. },
  1957. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) {
  1958. return listTypes[t];
  1959. }
  1960. };
  1961. })();
  1962. OSF.DDA.HostParameterMap=function (specialProcessor, mappings) {
  1963. var toHostMap="toHost";
  1964. var fromHostMap="fromHost";
  1965. var self="self";
  1966. var dynamicTypes={};
  1967. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  1968. toHost: function (data) {
  1969. if (data !=null && data.rows !==undefined) {
  1970. var tableData={};
  1971. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  1972. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  1973. data=tableData;
  1974. }
  1975. return data;
  1976. },
  1977. fromHost: function (args) {
  1978. return args;
  1979. }
  1980. };
  1981. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  1982. function mapValues(preimageSet, mapping) {
  1983. var ret=preimageSet ? {} : undefined;
  1984. for (var entry in preimageSet) {
  1985. var preimage=preimageSet[entry];
  1986. var image;
  1987. if (OSF.DDA.ListType.isListType(entry)) {
  1988. image=[];
  1989. for (var subEntry in preimage) {
  1990. image.push(mapValues(preimage[subEntry], mapping));
  1991. }
  1992. } else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  1993. image=dynamicTypes[entry][mapping](preimage);
  1994. } else if (mapping==fromHostMap && specialProcessor.preserveNesting(entry)) {
  1995. image=mapValues(preimage, mapping);
  1996. } else {
  1997. var maps=mappings[entry];
  1998. if (maps) {
  1999. var map=maps[mapping];
  2000. if (map) {
  2001. image=map[preimage];
  2002. if (image===undefined) {
  2003. image=preimage;
  2004. }
  2005. }
  2006. } else {
  2007. image=preimage;
  2008. }
  2009. }
  2010. ret[entry]=image;
  2011. }
  2012. return ret;
  2013. }
  2014. ;
  2015. function generateArguments(imageSet, parameters) {
  2016. var ret;
  2017. for (var param in parameters) {
  2018. var arg;
  2019. if (specialProcessor.isComplexType(param)) {
  2020. arg=generateArguments(imageSet, mappings[param][toHostMap]);
  2021. } else {
  2022. arg=imageSet[param];
  2023. }
  2024. if (arg !=undefined) {
  2025. if (!ret) {
  2026. ret={};
  2027. }
  2028. var index=parameters[param];
  2029. if (index==self) {
  2030. index=param;
  2031. }
  2032. ret[index]=specialProcessor.pack(param, arg);
  2033. }
  2034. }
  2035. return ret;
  2036. }
  2037. ;
  2038. function extractArguments(source, parameters, extracted) {
  2039. if (!extracted) {
  2040. extracted={};
  2041. }
  2042. for (var param in parameters) {
  2043. var index=parameters[param];
  2044. var value;
  2045. if (index==self) {
  2046. value=source;
  2047. } else {
  2048. value=source[index];
  2049. }
  2050. if (value===null || value===undefined) {
  2051. extracted[param]=undefined;
  2052. } else {
  2053. value=specialProcessor.unpack(param, value);
  2054. var map;
  2055. if (specialProcessor.isComplexType(param)) {
  2056. map=mappings[param][fromHostMap];
  2057. if (specialProcessor.preserveNesting(param)) {
  2058. extracted[param]=extractArguments(value, map);
  2059. } else {
  2060. extractArguments(value, map, extracted);
  2061. }
  2062. } else {
  2063. if (OSF.DDA.ListType.isListType(param)) {
  2064. map={};
  2065. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2066. map[entryDescriptor]=self;
  2067. for (var item in value) {
  2068. value[item]=extractArguments(value[item], map);
  2069. }
  2070. }
  2071. extracted[param]=value;
  2072. }
  2073. }
  2074. }
  2075. return extracted;
  2076. }
  2077. ;
  2078. function applyMap(mapName, preimage, mapping) {
  2079. var parameters=mappings[mapName][mapping];
  2080. var image;
  2081. if (mapping=="toHost") {
  2082. var imageSet=mapValues(preimage, mapping);
  2083. image=generateArguments(imageSet, parameters);
  2084. } else if (mapping=="fromHost") {
  2085. var argumentSet=extractArguments(preimage, parameters);
  2086. image=mapValues(argumentSet, mapping);
  2087. }
  2088. return image;
  2089. }
  2090. ;
  2091. if (!mappings) {
  2092. mappings={};
  2093. }
  2094. this.addMapping=function (mapName, description) {
  2095. var toHost, fromHost;
  2096. if (description.map) {
  2097. toHost=description.map;
  2098. fromHost={};
  2099. for (var preimage in toHost) {
  2100. var image=toHost[preimage];
  2101. if (image==self) {
  2102. image=preimage;
  2103. }
  2104. fromHost[image]=preimage;
  2105. }
  2106. } else {
  2107. toHost=description.toHost;
  2108. fromHost=description.fromHost;
  2109. }
  2110. var pair=mappings[mapName];
  2111. if (pair) {
  2112. var currMap=pair[toHostMap];
  2113. for (var th in currMap)
  2114. toHost[th]=currMap[th];
  2115. currMap=pair[fromHostMap];
  2116. for (var fh in currMap)
  2117. fromHost[fh]=currMap[fh];
  2118. } else {
  2119. pair=mappings[mapName]={};
  2120. }
  2121. pair[toHostMap]=toHost;
  2122. pair[fromHostMap]=fromHost;
  2123. };
  2124. this.toHost=function (mapName, preimage) {
  2125. return applyMap(mapName, preimage, toHostMap);
  2126. };
  2127. this.fromHost=function (mapName, image) {
  2128. return applyMap(mapName, image, fromHostMap);
  2129. };
  2130. this.self=self;
  2131. this.addComplexType=function (ct) {
  2132. specialProcessor.addComplexType(ct);
  2133. };
  2134. this.getDynamicType=function (dt) {
  2135. return specialProcessor.getDynamicType(dt);
  2136. };
  2137. this.setDynamicType=function (dt, handler) {
  2138. specialProcessor.setDynamicType(dt, handler);
  2139. };
  2140. this.dynamicTypes=dynamicTypes;
  2141. this.doMapValues=function (preimageSet, mapping) {
  2142. return mapValues(preimageSet, mapping);
  2143. };
  2144. };
  2145. OSF.DDA.SpecialProcessor=function (complexTypes, dynamicTypes) {
  2146. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2147. complexTypes.push(ct);
  2148. };
  2149. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2150. return dynamicTypes[dt];
  2151. };
  2152. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2153. dynamicTypes[dt]=handler;
  2154. };
  2155. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2156. return OSF.OUtil.listContainsValue(complexTypes, t);
  2157. };
  2158. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2159. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2160. };
  2161. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2162. var pn=[];
  2163. if (OSF.DDA.PropertyDescriptors)
  2164. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2165. if (OSF.DDA.DataNodeEventProperties) {
  2166. pn=pn.concat([
  2167. OSF.DDA.DataNodeEventProperties.OldNode,
  2168. OSF.DDA.DataNodeEventProperties.NewNode,
  2169. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2170. ]);
  2171. }
  2172. return OSF.OUtil.listContainsValue(pn, p);
  2173. };
  2174. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2175. var value;
  2176. if (this.isDynamicType(param)) {
  2177. value=dynamicTypes[param].toHost(arg);
  2178. } else {
  2179. value=arg;
  2180. }
  2181. return value;
  2182. };
  2183. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2184. var value;
  2185. if (this.isDynamicType(param)) {
  2186. value=dynamicTypes[param].fromHost(arg);
  2187. } else {
  2188. value=arg;
  2189. }
  2190. return value;
  2191. };
  2192. };
  2193. OSF.DDA.getDecoratedParameterMap=function (specialProcessor, initialDefs) {
  2194. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2195. var self=parameterMap.self;
  2196. function createObject(properties) {
  2197. var obj=null;
  2198. if (properties) {
  2199. obj={};
  2200. var len=properties.length;
  2201. for (var i=0; i < len; i++) {
  2202. obj[properties[i].name]=properties[i].value;
  2203. }
  2204. }
  2205. return obj;
  2206. }
  2207. parameterMap.define=function define(definition) {
  2208. var args={};
  2209. var toHost=createObject(definition.toHost);
  2210. if (definition.invertible) {
  2211. args.map=toHost;
  2212. } else if (definition.canonical) {
  2213. args.toHost=args.fromHost=toHost;
  2214. } else {
  2215. args.toHost=toHost;
  2216. args.fromHost=createObject(definition.fromHost);
  2217. }
  2218. parameterMap.addMapping(definition.type, args);
  2219. if (definition.isComplexType)
  2220. parameterMap.addComplexType(definition.type);
  2221. };
  2222. for (var id in initialDefs)
  2223. parameterMap.define(initialDefs[id]);
  2224. return parameterMap;
  2225. };
  2226. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2227. OSF.DDA.DispIdHost.Methods={
  2228. InvokeMethod: "invokeMethod",
  2229. AddEventHandler: "addEventHandler",
  2230. RemoveEventHandler: "removeEventHandler"
  2231. };
  2232. OSF.DDA.DispIdHost.Delegates={
  2233. ExecuteAsync: "executeAsync",
  2234. RegisterEventAsync: "registerEventAsync",
  2235. UnregisterEventAsync: "unregisterEventAsync",
  2236. ParameterMap: "parameterMap"
  2237. };
  2238. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2239. var dispIdMap={};
  2240. var jsom=OSF.DDA.AsyncMethodNames;
  2241. var did=OSF.DDA.MethodDispId;
  2242. var methodMap={
  2243. "GoToByIdAsync": did.dispidNavigateToMethod,
  2244. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2245. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2246. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2247. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2248. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2249. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2250. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2251. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2252. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2253. "GetByIdAsync": did.dispidGetBindingMethod,
  2254. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2255. "GetDataAsync": did.dispidGetBindingDataMethod,
  2256. "SetDataAsync": did.dispidSetBindingDataMethod,
  2257. "AddRowsAsync": did.dispidAddRowsMethod,
  2258. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2259. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2260. "RefreshAsync": did.dispidLoadSettingsMethod,
  2261. "SaveAsync": did.dispidSaveSettingsMethod,
  2262. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2263. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2264. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2265. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2266. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2267. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2268. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2269. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2270. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2271. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2272. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2273. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2274. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2275. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2276. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2277. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2278. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2279. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2280. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2281. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2282. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2283. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2284. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2285. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2286. "GetTask": did.dispidGetTaskMethod,
  2287. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2288. "GetTaskField": did.dispidGetTaskFieldMethod,
  2289. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2290. "GetResourceField": did.dispidGetResourceFieldMethod,
  2291. "GetProjectField": did.dispidGetProjectFieldMethod,
  2292. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2293. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2294. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2295. "SetTaskField": did.dispidSetTaskFieldMethod,
  2296. "SetResourceField": did.dispidSetResourceFieldMethod,
  2297. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2298. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod
  2299. };
  2300. for (var method in methodMap) {
  2301. if (jsom[method]) {
  2302. dispIdMap[jsom[method].id]=methodMap[method];
  2303. }
  2304. }
  2305. jsom=Microsoft.Office.WebExtension.EventType;
  2306. did=OSF.DDA.EventDispId;
  2307. var eventMap={
  2308. "SettingsChanged": did.dispidSettingsChangedEvent,
  2309. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2310. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2311. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2312. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2313. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2314. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2315. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2316. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2317. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2318. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2319. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2320. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2321. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2322. };
  2323. for (var event in eventMap) {
  2324. if (jsom[event]) {
  2325. dispIdMap[jsom[event]]=eventMap[event];
  2326. }
  2327. }
  2328. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2329. if (typeof ex=="number") {
  2330. if (!callArgs) {
  2331. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2332. }
  2333. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2334. } else {
  2335. throw ex;
  2336. }
  2337. }
  2338. ;
  2339. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2340. var callArgs;
  2341. try {
  2342. var methodName=method.id;
  2343. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2344. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2345. var dispId=dispIdMap[methodName];
  2346. var delegate=getDelegateMethods(methodName);
  2347. var hostCallArgs;
  2348. if (parameterMap.toHost) {
  2349. hostCallArgs=parameterMap.toHost(dispId, callArgs);
  2350. } else {
  2351. hostCallArgs=callArgs;
  2352. }
  2353. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2354. "dispId": dispId,
  2355. "hostCallArgs": hostCallArgs,
  2356. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2357. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2358. },
  2359. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2360. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2361. },
  2362. "onComplete": function (status, hostResponseArgs) {
  2363. var responseArgs;
  2364. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2365. if (parameterMap.fromHost) {
  2366. responseArgs=parameterMap.fromHost(dispId, hostResponseArgs);
  2367. } else {
  2368. responseArgs=hostResponseArgs;
  2369. }
  2370. } else {
  2371. responseArgs=hostResponseArgs;
  2372. }
  2373. var payload=asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2374. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2375. }
  2376. });
  2377. } catch (ex) {
  2378. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2379. }
  2380. };
  2381. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2382. var callArgs;
  2383. var eventType, handler;
  2384. function onEnsureRegistration(status) {
  2385. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2386. var added=eventDispatch.addEventHandler(eventType, handler);
  2387. if (!added) {
  2388. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2389. }
  2390. }
  2391. var error;
  2392. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2393. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2394. }
  2395. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2396. }
  2397. try {
  2398. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2399. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2400. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2401. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2402. if (eventDispatch.getEventHandlerCount(eventType)==0) {
  2403. var dispId=dispIdMap[eventType];
  2404. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  2405. invoker({
  2406. "eventType": eventType,
  2407. "dispId": dispId,
  2408. "targetId": caller.id || "",
  2409. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2410. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2411. },
  2412. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2413. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2414. },
  2415. "onComplete": onEnsureRegistration,
  2416. "onEvent": function handleEvent(hostArgs) {
  2417. var args=parameterMap.fromHost(dispId, hostArgs);
  2418. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  2419. }
  2420. });
  2421. } else {
  2422. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  2423. }
  2424. } catch (ex) {
  2425. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2426. }
  2427. };
  2428. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  2429. var callArgs;
  2430. var eventType, handler;
  2431. function onEnsureRegistration(status) {
  2432. var error;
  2433. if (status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2434. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2435. }
  2436. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2437. }
  2438. try {
  2439. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  2440. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2441. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2442. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2443. var status, removeSuccess;
  2444. if (handler===null) {
  2445. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  2446. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2447. } else {
  2448. removeSuccess=eventDispatch.removeEventHandler(eventType, handler);
  2449. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  2450. }
  2451. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0) {
  2452. var dispId=dispIdMap[eventType];
  2453. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  2454. invoker({
  2455. "eventType": eventType,
  2456. "dispId": dispId,
  2457. "targetId": caller.id || "",
  2458. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() {
  2459. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall);
  2460. },
  2461. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() {
  2462. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse);
  2463. },
  2464. "onComplete": onEnsureRegistration
  2465. });
  2466. } else {
  2467. onEnsureRegistration(status);
  2468. }
  2469. } catch (ex) {
  2470. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2471. }
  2472. };
  2473. };
  2474. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  2475. for (var entry in asyncMethodNames) {
  2476. var method=asyncMethodNames[entry];
  2477. var name=method.displayName;
  2478. if (!target[name]) {
  2479. OSF.OUtil.defineEnumerableProperty(target, name, {
  2480. value: (function (asyncMethod) {
  2481. return function () {
  2482. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  2483. invokeMethod(asyncMethod, arguments, target, privateState);
  2484. };
  2485. })(method)
  2486. });
  2487. }
  2488. }
  2489. };
  2490. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  2491. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  2492. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  2493. if (!target[add]) {
  2494. OSF.OUtil.defineEnumerableProperty(target, add, {
  2495. value: function () {
  2496. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  2497. addEventHandler(arguments, eventDispatch, target);
  2498. }
  2499. });
  2500. }
  2501. if (!target[remove]) {
  2502. OSF.OUtil.defineEnumerableProperty(target, remove, {
  2503. value: function () {
  2504. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  2505. removeEventHandler(arguments, eventDispatch, target);
  2506. }
  2507. });
  2508. }
  2509. };
  2510. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  2511. if (!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId))) {
  2512. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==='https:' ? 'https:' : 'http:')+'//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  2513. OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback() {
  2514. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  2515. throw 'Not able to load MicrosoftAjax.js.';
  2516. }
  2517. });
  2518. }
  2519. }
  2520. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  2521. OSF.DDA.SafeArray.Response={
  2522. Status: 0,
  2523. Payload: 1
  2524. };
  2525. OSF.DDA.SafeArray.UniqueArguments={
  2526. Offset: "offset",
  2527. Run: "run",
  2528. BindingSpecificData: "bindingSpecificData",
  2529. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  2530. };
  2531. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  2532. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  2533. var status;
  2534. var number=ex.number;
  2535. if (number) {
  2536. switch (number) {
  2537. case -2146828218:
  2538. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  2539. break;
  2540. case -2146827850:
  2541. default:
  2542. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2543. break;
  2544. }
  2545. }
  2546. if (args.onComplete) {
  2547. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2548. }
  2549. };
  2550. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  2551. function _2DVBArrayToJaggedArray(vbArr) {
  2552. var ret;
  2553. try {
  2554. var rows=vbArr.ubound(1);
  2555. var cols=vbArr.ubound(2);
  2556. vbArr=vbArr.toArray();
  2557. if (rows==1 && cols==1) {
  2558. ret=[vbArr];
  2559. } else {
  2560. ret=[];
  2561. for (var row=0; row < rows; row++) {
  2562. var rowArr=[];
  2563. for (var col=0; col < cols; col++) {
  2564. var datum=vbArr[row * cols+col];
  2565. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  2566. rowArr.push(datum);
  2567. }
  2568. }
  2569. if (rowArr.length > 0) {
  2570. ret.push(rowArr);
  2571. }
  2572. }
  2573. }
  2574. } catch (ex) {
  2575. }
  2576. return ret;
  2577. }
  2578. var complexTypes=[];
  2579. var dynamicTypes={};
  2580. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  2581. var tableRows=0;
  2582. var tableHeaders=1;
  2583. return {
  2584. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  2585. if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  2586. var tableData=[];
  2587. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  2588. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  2589. data=tableData;
  2590. }
  2591. return data;
  2592. },
  2593. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  2594. var ret;
  2595. if (hostArgs.toArray) {
  2596. var dimensions=hostArgs.dimensions();
  2597. if (dimensions===2) {
  2598. ret=_2DVBArrayToJaggedArray(hostArgs);
  2599. } else {
  2600. var array=hostArgs.toArray();
  2601. if (array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  2602. ret={};
  2603. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  2604. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  2605. } else {
  2606. ret=array;
  2607. }
  2608. }
  2609. } else {
  2610. ret=hostArgs;
  2611. }
  2612. return ret;
  2613. }
  2614. };
  2615. })();
  2616. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  2617. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  2618. var value;
  2619. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  2620. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  2621. value=toArraySupported ? arg.toArray() : arg || {};
  2622. } else if (this.isDynamicType(param)) {
  2623. value=dynamicTypes[param].fromHost(arg);
  2624. } else {
  2625. value=arg;
  2626. }
  2627. return value;
  2628. };
  2629. };
  2630. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  2631. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  2632. {
  2633. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  2634. toHost: [
  2635. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  2636. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  2637. ]
  2638. },
  2639. {
  2640. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  2641. toHost: [
  2642. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  2643. ]
  2644. }
  2645. ]);
  2646. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  2647. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  2648. fromHost: [
  2649. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  2650. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  2651. ]
  2652. });
  2653. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  2654. function toArray(args) {
  2655. var arrArgs=args;
  2656. if (OSF.OUtil.isArray(args)) {
  2657. var len=arrArgs.length;
  2658. for (var i=0; i < len; i++) {
  2659. arrArgs[i]=toArray(arrArgs[i]);
  2660. }
  2661. } else if (OSF.OUtil.isDate(args)) {
  2662. arrArgs=args.getVarDate();
  2663. } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  2664. arrArgs=[];
  2665. for (var index in args) {
  2666. if (!OSF.OUtil.isFunction(args[index])) {
  2667. arrArgs[index]=toArray(args[index]);
  2668. }
  2669. }
  2670. }
  2671. return arrArgs;
  2672. }
  2673. function fromSafeArray(value) {
  2674. var ret=value;
  2675. if (value !=null && value.toArray) {
  2676. var arrayResult=value.toArray();
  2677. for (var i=0; i < arrayResult.length; i++) {
  2678. arrayResult[i]=fromSafeArray(arrayResult[i]);
  2679. }
  2680. ret=arrayResult;
  2681. }
  2682. return ret;
  2683. }
  2684. try {
  2685. if (args.onCalling) {
  2686. args.onCalling();
  2687. }
  2688. var startTime=(new Date()).getTime();
  2689. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) {
  2690. var result=hostResponseArgs.toArray();
  2691. var status=result[OSF.DDA.SafeArray.Response.Status];
  2692. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  2693. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  2694. payload=fromSafeArray(payload);
  2695. if (payload !=null) {
  2696. if (!args._chunkResultData) {
  2697. args._chunkResultData=new Array();
  2698. }
  2699. args._chunkResultData[payload[0]]=payload[1];
  2700. }
  2701. } else {
  2702. if (args.onReceiving) {
  2703. args.onReceiving();
  2704. }
  2705. if (args.onComplete) {
  2706. var payload;
  2707. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2708. if (result.length > 2) {
  2709. payload=[];
  2710. for (var i=1; i < result.length; i++)
  2711. payload[i - 1]=result[i];
  2712. } else {
  2713. payload=result[OSF.DDA.SafeArray.Response.Payload];
  2714. }
  2715. if (args._chunkResultData) {
  2716. payload=fromSafeArray(payload);
  2717. if (payload !=null) {
  2718. var expectedChunkCount=payload[payload.length - 1];
  2719. if (args._chunkResultData.length==expectedChunkCount) {
  2720. payload[payload.length - 1]=args._chunkResultData;
  2721. } else {
  2722. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2723. }
  2724. }
  2725. }
  2726. } else {
  2727. payload=result[OSF.DDA.SafeArray.Response.Payload];
  2728. }
  2729. args.onComplete(status, payload);
  2730. }
  2731. if (OSF.AppTelemetry) {
  2732. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  2733. }
  2734. }
  2735. });
  2736. } catch (ex) {
  2737. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2738. }
  2739. };
  2740. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  2741. var startTime=(new Date()).getTime();
  2742. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  2743. if (args.onReceiving) {
  2744. args.onReceiving();
  2745. }
  2746. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  2747. if (args.onComplete) {
  2748. args.onComplete(status);
  2749. }
  2750. if (OSF.AppTelemetry) {
  2751. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  2752. }
  2753. };
  2754. };
  2755. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  2756. if (args.onCalling) {
  2757. args.onCalling();
  2758. }
  2759. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  2760. try {
  2761. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  2762. if (args.onEvent) {
  2763. args.onEvent(payload);
  2764. }
  2765. if (OSF.AppTelemetry) {
  2766. OSF.AppTelemetry.onEventDone(args.dispId);
  2767. }
  2768. }, callback);
  2769. } catch (ex) {
  2770. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2771. }
  2772. };
  2773. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  2774. if (args.onCalling) {
  2775. args.onCalling();
  2776. }
  2777. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  2778. try {
  2779. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  2780. } catch (ex) {
  2781. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  2782. }
  2783. };
  2784. OSF.ClientMode={
  2785. ReadWrite: 0,
  2786. ReadOnly: 1
  2787. };
  2788. OSF.DDA.RichInitializationReason={
  2789. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  2790. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  2791. };
  2792. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  2793. this._hostInfo=hostInfo;
  2794. this._webAppState=webAppState;
  2795. this._context=context;
  2796. this._settings=settings;
  2797. this._hostFacade=hostFacade;
  2798. this._initializeSettings=this.initializeSettings;
  2799. };
  2800. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  2801. var settings;
  2802. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  2803. if (osfSessionStorage) {
  2804. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  2805. if (storageSettings) {
  2806. serializedSettings=(typeof (JSON) !=="undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true);
  2807. } else {
  2808. storageSettings=(typeof (JSON) !=="undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings);
  2809. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  2810. }
  2811. }
  2812. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  2813. if (refreshSupported) {
  2814. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  2815. } else {
  2816. settings=new OSF.DDA.Settings(deserializedSettings);
  2817. }
  2818. return settings;
  2819. };
  2820. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication() {
  2821. };
  2822. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  2823. this.prepareApiSurface(appContext);
  2824. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  2825. };
  2826. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  2827. var license=new OSF.DDA.License(appContext.get_eToken());
  2828. var getOfficeThemeHandler=(OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  2829. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  2830. var getDelegateMethods, parameterMap;
  2831. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  2832. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  2833. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  2834. };
  2835. OSF.InitializationHelper.prototype.getInitializationReason=function (appContext) {
  2836. return OSF.DDA.RichInitializationReason[appContext.get_reason()];
  2837. };
  2838. OSF.DDA.DispIdHost.getClientDelegateMethods=function (actionId) {
  2839. var delegateMethods={};
  2840. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  2841. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  2842. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  2843. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  2844. var readSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  2845. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  2846. };
  2847. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  2848. }
  2849. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  2850. var writeSerializedSettings=function (hostCallArgs, onCalling, onReceiving) {
  2851. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  2852. };
  2853. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  2854. }
  2855. return delegateMethods;
  2856. };
  2857. var OSFRichclient;
  2858. (function (OSFRichclient) {
  2859. var RichClientHostController=(function () {
  2860. function RichClientHostController() {
  2861. }
  2862. RichClientHostController.prototype.execute=function (id, params, callback) {
  2863. window.external.Execute(id, params, callback);
  2864. };
  2865. RichClientHostController.prototype.registerEvent=function (id, targetId, handler, callback) {
  2866. window.external.RegisterEvent(id, targetId, handler, callback);
  2867. };
  2868. RichClientHostController.prototype.unregisterEvent=function (id, targetId, callback) {
  2869. window.external.UnregisterEvent(id, targetId, callback);
  2870. };
  2871. return RichClientHostController;
  2872. })();
  2873. OSFRichclient.RichClientHostController=RichClientHostController;
  2874. })(OSFRichclient || (OSFRichclient={}));
  2875. OSF.ClientHostController=new OSFRichclient.RichClientHostController();
  2876. var OfficeExt;
  2877. (function (OfficeExt) {
  2878. (function (OfficeTheme) {
  2879. var OfficeThemeManager=(function () {
  2880. function OfficeThemeManager() {
  2881. this._osfOfficeTheme=null;
  2882. this._osfOfficeThemeTimeStamp=null;
  2883. }
  2884. OfficeThemeManager.prototype.getOfficeTheme=function () {
  2885. if (OSF.DDA._OsfControlContext) {
  2886. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  2887. if (OSF.AppTelemetry) {
  2888. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  2889. }
  2890. } else {
  2891. var startTime=(new Date()).getTime();
  2892. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  2893. var endTime=(new Date()).getTime();
  2894. if (OSF.AppTelemetry) {
  2895. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime));
  2896. }
  2897. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  2898. for (var color in this._osfOfficeTheme) {
  2899. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  2900. }
  2901. this._osfOfficeThemeTimeStamp=endTime;
  2902. }
  2903. return this._osfOfficeTheme;
  2904. }
  2905. };
  2906. OfficeThemeManager.instance=function () {
  2907. if (OfficeThemeManager._instance==null) {
  2908. OfficeThemeManager._instance=new OfficeThemeManager();
  2909. }
  2910. return OfficeThemeManager._instance;
  2911. };
  2912. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5000;
  2913. OfficeThemeManager._instance=null;
  2914. return OfficeThemeManager;
  2915. })();
  2916. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  2917. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  2918. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  2919. })(OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}));
  2920. var OfficeTheme=OfficeExt.OfficeTheme;
  2921. })(OfficeExt || (OfficeExt={}));
  2922. OSF.DDA.ClientSettingsManager={
  2923. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  2924. return function (args) {
  2925. var status, response;
  2926. try {
  2927. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  2928. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2929. } catch (ex) {
  2930. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2931. response={ name: Strings.OfficeOM.L_InternalError, message: ex };
  2932. }
  2933. if (args.onComplete) {
  2934. args.onComplete(status, response);
  2935. }
  2936. };
  2937. },
  2938. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  2939. var keys=[];
  2940. var values=[];
  2941. if (onCalling) {
  2942. onCalling();
  2943. }
  2944. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  2945. if (onReceiving) {
  2946. onReceiving();
  2947. }
  2948. var serializedSettings={};
  2949. for (var index=0; index < keys.length; index++) {
  2950. serializedSettings[keys[index]]=values[index];
  2951. }
  2952. return serializedSettings;
  2953. },
  2954. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  2955. var keys=[];
  2956. var values=[];
  2957. for (var key in serializedSettings) {
  2958. keys.push(key);
  2959. values.push(serializedSettings[key]);
  2960. }
  2961. if (onCalling) {
  2962. onCalling();
  2963. }
  2964. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  2965. if (onReceiving) {
  2966. onReceiving();
  2967. }
  2968. }
  2969. };
  2970. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported) {
  2971. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  2972. var settings=this.deserializeSettings(serializedSettings, refreshSupported);
  2973. return settings;
  2974. };
  2975. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  2976. var returnedContext;
  2977. var context=OSF.DDA._OsfControlContext=window.external.GetContext();
  2978. var appType=context.GetAppType();
  2979. var appTypeSupported=false;
  2980. for (var appEntry in OSF.AppName) {
  2981. if (OSF.AppName[appEntry]==appType) {
  2982. appTypeSupported=true;
  2983. break;
  2984. }
  2985. }
  2986. if (!appTypeSupported) {
  2987. throw "Unsupported client type "+appType;
  2988. }
  2989. var id=context.GetSolutionRef();
  2990. var version=context.GetAppVersionMajor();
  2991. var minorVersion=context.GetAppVersionMinor();
  2992. var UILocale=context.GetAppUILocale();
  2993. var dataLocale=context.GetAppDataLocale();
  2994. var docUrl=context.GetDocUrl();
  2995. var clientMode=context.GetAppCapabilities();
  2996. var reason=context.GetActivationMode();
  2997. var osfControlType=context.GetControlIntegrationLevel();
  2998. var settings=[];
  2999. var eToken;
  3000. try {
  3001. eToken=context.GetSolutionToken();
  3002. } catch (ex) {
  3003. }
  3004. var correlationId;
  3005. if (typeof context.GetCorrelationId !=="undefined") {
  3006. correlationId=context.GetCorrelationId();
  3007. }
  3008. var appInstanceId;
  3009. if (typeof context.GetInstanceId !=="undefined") {
  3010. appInstanceId=context.GetInstanceId();
  3011. }
  3012. var touchEnabled;
  3013. if (typeof context.GetTouchEnabled !=="undefined") {
  3014. touchEnabled=context.GetTouchEnabled();
  3015. }
  3016. var commerceAllowed;
  3017. if (typeof context.GetCommerceAllowed !=="undefined") {
  3018. commerceAllowed=context.GetCommerceAllowed();
  3019. }
  3020. var requirementMatrix;
  3021. if (typeof context.GetSupportedMatrix !=="undefined") {
  3022. requirementMatrix=context.GetSupportedMatrix();
  3023. }
  3024. eToken=eToken ? eToken.toString() : "";
  3025. returnedContext=new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix);
  3026. if (OSF.AppTelemetry) {
  3027. OSF.AppTelemetry.initialize(returnedContext);
  3028. }
  3029. gotAppContext(returnedContext);
  3030. };
  3031. var OSFLog;
  3032. (function (OSFLog) {
  3033. var BaseUsageData=(function () {
  3034. function BaseUsageData(table) {
  3035. this._table=table;
  3036. this._fields={};
  3037. }
  3038. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  3039. get: function () {
  3040. return this._fields;
  3041. },
  3042. enumerable: true,
  3043. configurable: true
  3044. });
  3045. Object.defineProperty(BaseUsageData.prototype, "Table", {
  3046. get: function () {
  3047. return this._table;
  3048. },
  3049. enumerable: true,
  3050. configurable: true
  3051. });
  3052. BaseUsageData.prototype.SerializeFields=function () {
  3053. };
  3054. BaseUsageData.prototype.SetSerializedField=function (key, value) {
  3055. if (typeof (value) !=="undefined" && value !==null) {
  3056. this._serializedFields[key]=value.toString();
  3057. }
  3058. };
  3059. BaseUsageData.prototype.SerializeRow=function () {
  3060. this._serializedFields={};
  3061. this.SetSerializedField("Table", this._table);
  3062. this.SerializeFields();
  3063. return JSON.stringify(this._serializedFields);
  3064. };
  3065. return BaseUsageData;
  3066. })();
  3067. OSFLog.BaseUsageData=BaseUsageData;
  3068. var AppActivatedUsageData=(function (_super) {
  3069. __extends(AppActivatedUsageData, _super);
  3070. function AppActivatedUsageData() {
  3071. _super.call(this, "AppActivated");
  3072. }
  3073. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  3074. get: function () {
  3075. return this.Fields["CorrelationId"];
  3076. },
  3077. set: function (value) {
  3078. this.Fields["CorrelationId"]=value;
  3079. },
  3080. enumerable: true,
  3081. configurable: true
  3082. });
  3083. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  3084. get: function () {
  3085. return this.Fields["SessionId"];
  3086. },
  3087. set: function (value) {
  3088. this.Fields["SessionId"]=value;
  3089. },
  3090. enumerable: true,
  3091. configurable: true
  3092. });
  3093. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  3094. get: function () {
  3095. return this.Fields["AppId"];
  3096. },
  3097. set: function (value) {
  3098. this.Fields["AppId"]=value;
  3099. },
  3100. enumerable: true,
  3101. configurable: true
  3102. });
  3103. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  3104. get: function () {
  3105. return this.Fields["AppURL"];
  3106. },
  3107. set: function (value) {
  3108. this.Fields["AppURL"]=value;
  3109. },
  3110. enumerable: true,
  3111. configurable: true
  3112. });
  3113. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  3114. get: function () {
  3115. return this.Fields["AssetId"];
  3116. },
  3117. set: function (value) {
  3118. this.Fields["AssetId"]=value;
  3119. },
  3120. enumerable: true,
  3121. configurable: true
  3122. });
  3123. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  3124. get: function () {
  3125. return this.Fields["Browser"];
  3126. },
  3127. set: function (value) {
  3128. this.Fields["Browser"]=value;
  3129. },
  3130. enumerable: true,
  3131. configurable: true
  3132. });
  3133. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  3134. get: function () {
  3135. return this.Fields["UserId"];
  3136. },
  3137. set: function (value) {
  3138. this.Fields["UserId"]=value;
  3139. },
  3140. enumerable: true,
  3141. configurable: true
  3142. });
  3143. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  3144. get: function () {
  3145. return this.Fields["Host"];
  3146. },
  3147. set: function (value) {
  3148. this.Fields["Host"]=value;
  3149. },
  3150. enumerable: true,
  3151. configurable: true
  3152. });
  3153. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  3154. get: function () {
  3155. return this.Fields["HostVersion"];
  3156. },
  3157. set: function (value) {
  3158. this.Fields["HostVersion"]=value;
  3159. },
  3160. enumerable: true,
  3161. configurable: true
  3162. });
  3163. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  3164. get: function () {
  3165. return this.Fields["ClientId"];
  3166. },
  3167. set: function (value) {
  3168. this.Fields["ClientId"]=value;
  3169. },
  3170. enumerable: true,
  3171. configurable: true
  3172. });
  3173. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  3174. get: function () {
  3175. return this.Fields["AppSizeWidth"];
  3176. },
  3177. set: function (value) {
  3178. this.Fields["AppSizeWidth"]=value;
  3179. },
  3180. enumerable: true,
  3181. configurable: true
  3182. });
  3183. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  3184. get: function () {
  3185. return this.Fields["AppSizeHeight"];
  3186. },
  3187. set: function (value) {
  3188. this.Fields["AppSizeHeight"]=value;
  3189. },
  3190. enumerable: true,
  3191. configurable: true
  3192. });
  3193. AppActivatedUsageData.prototype.SerializeFields=function () {
  3194. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3195. this.SetSerializedField("SessionId", this.SessionId);
  3196. this.SetSerializedField("AppId", this.AppId);
  3197. this.SetSerializedField("AppURL", this.AppURL);
  3198. this.SetSerializedField("AssetId", this.AssetId);
  3199. this.SetSerializedField("Browser", this.Browser);
  3200. this.SetSerializedField("UserId", this.UserId);
  3201. this.SetSerializedField("Host", this.Host);
  3202. this.SetSerializedField("HostVersion", this.HostVersion);
  3203. this.SetSerializedField("ClientId", this.ClientId);
  3204. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  3205. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  3206. };
  3207. return AppActivatedUsageData;
  3208. })(BaseUsageData);
  3209. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  3210. var ScriptLoadUsageData=(function (_super) {
  3211. __extends(ScriptLoadUsageData, _super);
  3212. function ScriptLoadUsageData() {
  3213. _super.call(this, "ScriptLoad");
  3214. }
  3215. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  3216. get: function () {
  3217. return this.Fields["CorrelationId"];
  3218. },
  3219. set: function (value) {
  3220. this.Fields["CorrelationId"]=value;
  3221. },
  3222. enumerable: true,
  3223. configurable: true
  3224. });
  3225. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  3226. get: function () {
  3227. return this.Fields["SessionId"];
  3228. },
  3229. set: function (value) {
  3230. this.Fields["SessionId"]=value;
  3231. },
  3232. enumerable: true,
  3233. configurable: true
  3234. });
  3235. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  3236. get: function () {
  3237. return this.Fields["ScriptId"];
  3238. },
  3239. set: function (value) {
  3240. this.Fields["ScriptId"]=value;
  3241. },
  3242. enumerable: true,
  3243. configurable: true
  3244. });
  3245. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  3246. get: function () {
  3247. return this.Fields["StartTime"];
  3248. },
  3249. set: function (value) {
  3250. this.Fields["StartTime"]=value;
  3251. },
  3252. enumerable: true,
  3253. configurable: true
  3254. });
  3255. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  3256. get: function () {
  3257. return this.Fields["ResponseTime"];
  3258. },
  3259. set: function (value) {
  3260. this.Fields["ResponseTime"]=value;
  3261. },
  3262. enumerable: true,
  3263. configurable: true
  3264. });
  3265. ScriptLoadUsageData.prototype.SerializeFields=function () {
  3266. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3267. this.SetSerializedField("SessionId", this.SessionId);
  3268. this.SetSerializedField("ScriptId", this.ScriptId);
  3269. this.SetSerializedField("StartTime", this.StartTime);
  3270. this.SetSerializedField("ResponseTime", this.ResponseTime);
  3271. };
  3272. return ScriptLoadUsageData;
  3273. })(BaseUsageData);
  3274. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  3275. var AppClosedUsageData=(function (_super) {
  3276. __extends(AppClosedUsageData, _super);
  3277. function AppClosedUsageData() {
  3278. _super.call(this, "AppClosed");
  3279. }
  3280. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  3281. get: function () {
  3282. return this.Fields["CorrelationId"];
  3283. },
  3284. set: function (value) {
  3285. this.Fields["CorrelationId"]=value;
  3286. },
  3287. enumerable: true,
  3288. configurable: true
  3289. });
  3290. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  3291. get: function () {
  3292. return this.Fields["SessionId"];
  3293. },
  3294. set: function (value) {
  3295. this.Fields["SessionId"]=value;
  3296. },
  3297. enumerable: true,
  3298. configurable: true
  3299. });
  3300. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  3301. get: function () {
  3302. return this.Fields["FocusTime"];
  3303. },
  3304. set: function (value) {
  3305. this.Fields["FocusTime"]=value;
  3306. },
  3307. enumerable: true,
  3308. configurable: true
  3309. });
  3310. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  3311. get: function () {
  3312. return this.Fields["AppSizeFinalWidth"];
  3313. },
  3314. set: function (value) {
  3315. this.Fields["AppSizeFinalWidth"]=value;
  3316. },
  3317. enumerable: true,
  3318. configurable: true
  3319. });
  3320. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  3321. get: function () {
  3322. return this.Fields["AppSizeFinalHeight"];
  3323. },
  3324. set: function (value) {
  3325. this.Fields["AppSizeFinalHeight"]=value;
  3326. },
  3327. enumerable: true,
  3328. configurable: true
  3329. });
  3330. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  3331. get: function () {
  3332. return this.Fields["OpenTime"];
  3333. },
  3334. set: function (value) {
  3335. this.Fields["OpenTime"]=value;
  3336. },
  3337. enumerable: true,
  3338. configurable: true
  3339. });
  3340. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  3341. get: function () {
  3342. return this.Fields["CloseMethod"];
  3343. },
  3344. set: function (value) {
  3345. this.Fields["CloseMethod"]=value;
  3346. },
  3347. enumerable: true,
  3348. configurable: true
  3349. });
  3350. AppClosedUsageData.prototype.SerializeFields=function () {
  3351. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3352. this.SetSerializedField("SessionId", this.SessionId);
  3353. this.SetSerializedField("FocusTime", this.FocusTime);
  3354. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  3355. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  3356. this.SetSerializedField("OpenTime", this.OpenTime);
  3357. this.SetSerializedField("CloseMethod", this.CloseMethod);
  3358. };
  3359. return AppClosedUsageData;
  3360. })(BaseUsageData);
  3361. OSFLog.AppClosedUsageData=AppClosedUsageData;
  3362. var APIUsageUsageData=(function (_super) {
  3363. __extends(APIUsageUsageData, _super);
  3364. function APIUsageUsageData() {
  3365. _super.call(this, "APIUsage");
  3366. }
  3367. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  3368. get: function () {
  3369. return this.Fields["CorrelationId"];
  3370. },
  3371. set: function (value) {
  3372. this.Fields["CorrelationId"]=value;
  3373. },
  3374. enumerable: true,
  3375. configurable: true
  3376. });
  3377. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  3378. get: function () {
  3379. return this.Fields["SessionId"];
  3380. },
  3381. set: function (value) {
  3382. this.Fields["SessionId"]=value;
  3383. },
  3384. enumerable: true,
  3385. configurable: true
  3386. });
  3387. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  3388. get: function () {
  3389. return this.Fields["APIType"];
  3390. },
  3391. set: function (value) {
  3392. this.Fields["APIType"]=value;
  3393. },
  3394. enumerable: true,
  3395. configurable: true
  3396. });
  3397. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  3398. get: function () {
  3399. return this.Fields["APIID"];
  3400. },
  3401. set: function (value) {
  3402. this.Fields["APIID"]=value;
  3403. },
  3404. enumerable: true,
  3405. configurable: true
  3406. });
  3407. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  3408. get: function () {
  3409. return this.Fields["Parameters"];
  3410. },
  3411. set: function (value) {
  3412. this.Fields["Parameters"]=value;
  3413. },
  3414. enumerable: true,
  3415. configurable: true
  3416. });
  3417. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  3418. get: function () {
  3419. return this.Fields["ResponseTime"];
  3420. },
  3421. set: function (value) {
  3422. this.Fields["ResponseTime"]=value;
  3423. },
  3424. enumerable: true,
  3425. configurable: true
  3426. });
  3427. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  3428. get: function () {
  3429. return this.Fields["ErrorType"];
  3430. },
  3431. set: function (value) {
  3432. this.Fields["ErrorType"]=value;
  3433. },
  3434. enumerable: true,
  3435. configurable: true
  3436. });
  3437. APIUsageUsageData.prototype.SerializeFields=function () {
  3438. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3439. this.SetSerializedField("SessionId", this.SessionId);
  3440. this.SetSerializedField("APIType", this.APIType);
  3441. this.SetSerializedField("APIID", this.APIID);
  3442. this.SetSerializedField("Parameters", this.Parameters);
  3443. this.SetSerializedField("ResponseTime", this.ResponseTime);
  3444. this.SetSerializedField("ErrorType", this.ErrorType);
  3445. };
  3446. return APIUsageUsageData;
  3447. })(BaseUsageData);
  3448. OSFLog.APIUsageUsageData=APIUsageUsageData;
  3449. var AppInitializationUsageData=(function (_super) {
  3450. __extends(AppInitializationUsageData, _super);
  3451. function AppInitializationUsageData() {
  3452. _super.call(this, "AppInitialization");
  3453. }
  3454. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  3455. get: function () {
  3456. return this.Fields["CorrelationId"];
  3457. },
  3458. set: function (value) {
  3459. this.Fields["CorrelationId"]=value;
  3460. },
  3461. enumerable: true,
  3462. configurable: true
  3463. });
  3464. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  3465. get: function () {
  3466. return this.Fields["SessionId"];
  3467. },
  3468. set: function (value) {
  3469. this.Fields["SessionId"]=value;
  3470. },
  3471. enumerable: true,
  3472. configurable: true
  3473. });
  3474. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  3475. get: function () {
  3476. return this.Fields["SuccessCode"];
  3477. },
  3478. set: function (value) {
  3479. this.Fields["SuccessCode"]=value;
  3480. },
  3481. enumerable: true,
  3482. configurable: true
  3483. });
  3484. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  3485. get: function () {
  3486. return this.Fields["Message"];
  3487. },
  3488. set: function (value) {
  3489. this.Fields["Message"]=value;
  3490. },
  3491. enumerable: true,
  3492. configurable: true
  3493. });
  3494. AppInitializationUsageData.prototype.SerializeFields=function () {
  3495. this.SetSerializedField("CorrelationId", this.CorrelationId);
  3496. this.SetSerializedField("SessionId", this.SessionId);
  3497. this.SetSerializedField("SuccessCode", this.SuccessCode);
  3498. this.SetSerializedField("Message", this.Message);
  3499. };
  3500. return AppInitializationUsageData;
  3501. })(BaseUsageData);
  3502. OSFLog.AppInitializationUsageData=AppInitializationUsageData;
  3503. })(OSFLog || (OSFLog={}));
  3504. var Logger;
  3505. (function (Logger) {
  3506. "use strict";
  3507. (function (TraceLevel) {
  3508. TraceLevel[TraceLevel["info"]=0]="info";
  3509. TraceLevel[TraceLevel["warning"]=1]="warning";
  3510. TraceLevel[TraceLevel["error"]=2]="error";
  3511. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  3512. var TraceLevel=Logger.TraceLevel;
  3513. (function (SendFlag) {
  3514. SendFlag[SendFlag["none"]=0]="none";
  3515. SendFlag[SendFlag["flush"]=1]="flush";
  3516. })(Logger.SendFlag || (Logger.SendFlag={}));
  3517. var SendFlag=Logger.SendFlag;
  3518. function allowUploadingData() {
  3519. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  3520. OSF.Logger.ulsEndpoint.loadProxyFrame();
  3521. }
  3522. }
  3523. Logger.allowUploadingData=allowUploadingData;
  3524. function sendLog(traceLevel, message, flag) {
  3525. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  3526. var jsonObj={ traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  3527. var logs=JSON.stringify(jsonObj);
  3528. OSF.Logger.ulsEndpoint.writeLog(logs);
  3529. }
  3530. }
  3531. Logger.sendLog=sendLog;
  3532. function creatULSEndpoint() {
  3533. try {
  3534. return new ULSEndpointProxy();
  3535. } catch (e) {
  3536. return null;
  3537. }
  3538. }
  3539. var ULSEndpointProxy=(function () {
  3540. function ULSEndpointProxy() {
  3541. var _this=this;
  3542. this.proxyFrame=null;
  3543. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  3544. this.buffer=[];
  3545. this.proxyFrameReady=false;
  3546. OSF.OUtil.addEventListener(window, "message", function (e) {
  3547. return _this.tellProxyFrameReady(e);
  3548. });
  3549. setTimeout(function () {
  3550. _this.loadProxyFrame();
  3551. }, 3000);
  3552. }
  3553. ULSEndpointProxy.prototype.writeLog=function (log) {
  3554. if (this.proxyFrameReady===true) {
  3555. this.proxyFrame.contentWindow.postMessage(log, "*");
  3556. } else {
  3557. if (this.buffer.length < 128) {
  3558. this.buffer.push(log);
  3559. }
  3560. }
  3561. };
  3562. ULSEndpointProxy.prototype.loadProxyFrame=function () {
  3563. if (this.proxyFrame==null) {
  3564. this.proxyFrame=document.createElement("iframe");
  3565. this.proxyFrame.setAttribute("style", "display:none");
  3566. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  3567. document.head.appendChild(this.proxyFrame);
  3568. }
  3569. };
  3570. ULSEndpointProxy.prototype.tellProxyFrameReady=function (e) {
  3571. var _this=this;
  3572. if (e.data==="ProxyFrameReadyToLog") {
  3573. this.proxyFrameReady=true;
  3574. for (var i=0; i < this.buffer.length; i++) {
  3575. this.writeLog(this.buffer[i]);
  3576. }
  3577. this.buffer.length=0;
  3578. OSF.OUtil.removeEventListener(window, "message", function (e) {
  3579. return _this.tellProxyFrameReady(e);
  3580. });
  3581. } else if (e.data==="ProxyFrameReadyToInit") {
  3582. var initJson={ appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  3583. var initStr=JSON.stringify(initJson);
  3584. this.proxyFrame.contentWindow.postMessage(initStr, "*");
  3585. }
  3586. };
  3587. return ULSEndpointProxy;
  3588. })();
  3589. if (!OSF.Logger) {
  3590. OSF.Logger=Logger;
  3591. }
  3592. Logger.ulsEndpoint=creatULSEndpoint();
  3593. })(Logger || (Logger={}));
  3594. var OSFAppTelemetry;
  3595. (function (OSFAppTelemetry) {
  3596. "use strict";
  3597. var appInfo;
  3598. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  3599. var osfControlAppCorrelationId="";
  3600. ;
  3601. var AppInfo=(function () {
  3602. function AppInfo() {
  3603. }
  3604. return AppInfo;
  3605. })();
  3606. var Event=(function () {
  3607. function Event(name, handler) {
  3608. this.name=name;
  3609. this.handler=handler;
  3610. }
  3611. return Event;
  3612. })();
  3613. var AppStorage=(function () {
  3614. function AppStorage() {
  3615. this.clientIDKey="Office API client";
  3616. this.logIdSetKey="Office App Log Id Set";
  3617. }
  3618. AppStorage.prototype.getClientId=function () {
  3619. var clientId=this.getValue(this.clientIDKey);
  3620. if (!clientId || clientId.length <=0 || clientId.length > 40) {
  3621. clientId=OSF.OUtil.Guid.generateNewGuid();
  3622. this.setValue(this.clientIDKey, clientId);
  3623. }
  3624. return clientId;
  3625. };
  3626. AppStorage.prototype.saveLog=function (logId, log) {
  3627. var logIdSet=this.getValue(this.logIdSetKey);
  3628. logIdSet=((logIdSet && logIdSet.length > 0) ? (logIdSet+";") : "")+logId;
  3629. this.setValue(this.logIdSetKey, logIdSet);
  3630. this.setValue(logId, log);
  3631. };
  3632. AppStorage.prototype.enumerateLog=function (callback, clean) {
  3633. var logIdSet=this.getValue(this.logIdSetKey);
  3634. if (logIdSet) {
  3635. var ids=logIdSet.split(";");
  3636. for (var id in ids) {
  3637. var logId=ids[id];
  3638. var log=this.getValue(logId);
  3639. if (log) {
  3640. if (callback) {
  3641. callback(logId, log);
  3642. }
  3643. if (clean) {
  3644. this.remove(logId);
  3645. }
  3646. }
  3647. }
  3648. if (clean) {
  3649. this.remove(this.logIdSetKey);
  3650. }
  3651. }
  3652. };
  3653. AppStorage.prototype.getValue=function (key) {
  3654. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3655. var value="";
  3656. if (osfLocalStorage) {
  3657. value=osfLocalStorage.getItem(key);
  3658. }
  3659. return value;
  3660. };
  3661. AppStorage.prototype.setValue=function (key, value) {
  3662. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3663. if (osfLocalStorage) {
  3664. osfLocalStorage.setItem(key, value);
  3665. }
  3666. };
  3667. AppStorage.prototype.remove=function (key) {
  3668. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  3669. if (osfLocalStorage) {
  3670. try {
  3671. osfLocalStorage.removeItem(key);
  3672. } catch (ex) {
  3673. }
  3674. }
  3675. };
  3676. return AppStorage;
  3677. })();
  3678. var AppLogger=(function () {
  3679. function AppLogger() {
  3680. }
  3681. AppLogger.prototype.LogData=function (data) {
  3682. if (!OSF.Logger) {
  3683. return;
  3684. }
  3685. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  3686. };
  3687. AppLogger.prototype.LogRawData=function (log) {
  3688. if (!OSF.Logger) {
  3689. return;
  3690. }
  3691. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  3692. };
  3693. return AppLogger;
  3694. })();
  3695. function initialize(context) {
  3696. if (!OSF.Logger) {
  3697. return;
  3698. }
  3699. if (appInfo) {
  3700. return;
  3701. }
  3702. appInfo=new AppInfo();
  3703. appInfo.hostVersion=context.get_appVersion();
  3704. appInfo.appId=context.get_id();
  3705. appInfo.host=context.get_appName();
  3706. appInfo.browser=window.navigator.userAgent;
  3707. appInfo.correlationId=context.get_correlationId();
  3708. appInfo.clientId=(new AppStorage()).getClientId();
  3709. var index=location.href.indexOf("?");
  3710. appInfo.appURL=(index==-1) ? location.href : location.href.substring(0, index);
  3711. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  3712. var xmlContent;
  3713. var parser;
  3714. var xmlDoc;
  3715. appInfo.assetId="";
  3716. appInfo.userId="";
  3717. try {
  3718. xmlContent=decodeURIComponent(token);
  3719. parser=new DOMParser();
  3720. xmlDoc=parser.parseFromString(xmlContent, "text/xml");
  3721. appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;
  3722. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  3723. } catch (e) {
  3724. } finally {
  3725. xmlContent=null;
  3726. xmlDoc=null;
  3727. parser=null;
  3728. }
  3729. })(context.get_eToken(), appInfo);
  3730. (function handleLifecycle() {
  3731. var startTime=new Date();
  3732. var lastFocus=null;
  3733. var focusTime=0;
  3734. var finished=false;
  3735. var adjustFocusTime=function () {
  3736. if (document.hasFocus()) {
  3737. if (lastFocus==null) {
  3738. lastFocus=new Date();
  3739. }
  3740. } else if (lastFocus) {
  3741. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  3742. lastFocus=null;
  3743. }
  3744. };
  3745. var eventList=[];
  3746. eventList.push(new Event("focus", adjustFocusTime));
  3747. eventList.push(new Event("blur", adjustFocusTime));
  3748. eventList.push(new Event("focusout", adjustFocusTime));
  3749. eventList.push(new Event("focusin", adjustFocusTime));
  3750. var exitFunction=function () {
  3751. for (var i=0; i < eventList.length; i++) {
  3752. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  3753. }
  3754. eventList.length=0;
  3755. if (!finished) {
  3756. if (document.hasFocus() && lastFocus) {
  3757. focusTime+=Math.abs((new Date()).getTime() - lastFocus.getTime());
  3758. lastFocus=null;
  3759. }
  3760. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  3761. finished=true;
  3762. }
  3763. };
  3764. eventList.push(new Event("beforeunload", exitFunction));
  3765. eventList.push(new Event("unload", exitFunction));
  3766. for (var i=0; i < eventList.length; i++) {
  3767. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  3768. }
  3769. adjustFocusTime();
  3770. })();
  3771. OSFAppTelemetry.onAppActivated();
  3772. }
  3773. OSFAppTelemetry.initialize=initialize;
  3774. function onAppActivated() {
  3775. if (!appInfo) {
  3776. return;
  3777. }
  3778. (new AppStorage()).enumerateLog(function (id, log) {
  3779. return (new AppLogger()).LogRawData(log);
  3780. }, true);
  3781. var data=new OSFLog.AppActivatedUsageData();
  3782. data.SessionId=sessionId;
  3783. data.AppId=appInfo.appId;
  3784. data.AssetId=appInfo.assetId;
  3785. data.AppURL=appInfo.appURL;
  3786. data.UserId=appInfo.userId;
  3787. data.ClientId=appInfo.clientId;
  3788. data.Browser=appInfo.browser;
  3789. data.Host=appInfo.host;
  3790. data.HostVersion=appInfo.hostVersion;
  3791. data.CorrelationId=appInfo.correlationId;
  3792. data.AppSizeWidth=window.innerWidth;
  3793. data.AppSizeHeight=window.innerHeight;
  3794. (new AppLogger()).LogData(data);
  3795. setTimeout(function () {
  3796. if (!OSF.Logger) {
  3797. return;
  3798. }
  3799. OSF.Logger.allowUploadingData();
  3800. }, 100);
  3801. }
  3802. OSFAppTelemetry.onAppActivated=onAppActivated;
  3803. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  3804. var data=new OSFLog.ScriptLoadUsageData();
  3805. data.CorrelationId=appCorrelationId;
  3806. data.SessionId=sessionId;
  3807. data.ScriptId=scriptId;
  3808. data.StartTime=msStartTime;
  3809. data.ResponseTime=msResponseTime;
  3810. (new AppLogger()).LogData(data);
  3811. }
  3812. OSFAppTelemetry.onScriptDone=onScriptDone;
  3813. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  3814. if (!appInfo) {
  3815. return;
  3816. }
  3817. var data=new OSFLog.APIUsageUsageData();
  3818. data.CorrelationId=osfControlAppCorrelationId;
  3819. data.SessionId=sessionId;
  3820. data.APIType=apiType;
  3821. data.APIID=id;
  3822. data.Parameters=parameters;
  3823. data.ResponseTime=msResponseTime;
  3824. data.ErrorType=errorType;
  3825. (new AppLogger()).LogData(data);
  3826. }
  3827. OSFAppTelemetry.onCallDone=onCallDone;
  3828. ;
  3829. function onMethodDone(id, args, msResponseTime, errorType) {
  3830. var parameters=null;
  3831. if (args) {
  3832. if (typeof args=="number") {
  3833. parameters=String(args);
  3834. } else if (typeof args==="object") {
  3835. for (var index in args) {
  3836. if (parameters !==null) {
  3837. parameters+=",";
  3838. } else {
  3839. parameters="";
  3840. }
  3841. if (typeof args[index]=="number") {
  3842. parameters+=String(args[index]);
  3843. }
  3844. }
  3845. } else {
  3846. parameters="";
  3847. }
  3848. }
  3849. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  3850. }
  3851. OSFAppTelemetry.onMethodDone=onMethodDone;
  3852. function onPropertyDone(propertyName, msResponseTime) {
  3853. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  3854. }
  3855. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  3856. function onEventDone(id, errorType) {
  3857. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  3858. }
  3859. OSFAppTelemetry.onEventDone=onEventDone;
  3860. function onRegisterDone(register, id, msResponseTime, errorType) {
  3861. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  3862. }
  3863. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  3864. function onAppClosed(openTime, focusTime) {
  3865. if (!appInfo) {
  3866. return;
  3867. }
  3868. var data=new OSFLog.AppClosedUsageData();
  3869. data.CorrelationId=osfControlAppCorrelationId;
  3870. data.SessionId=sessionId;
  3871. data.FocusTime=focusTime;
  3872. data.OpenTime=openTime;
  3873. data.AppSizeFinalWidth=window.innerWidth;
  3874. data.AppSizeFinalHeight=window.innerHeight;
  3875. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  3876. }
  3877. OSFAppTelemetry.onAppClosed=onAppClosed;
  3878. function setOsfControlAppCorrelationId(correlationId) {
  3879. osfControlAppCorrelationId=correlationId;
  3880. }
  3881. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  3882. function doAppInitializationLogging(isException, message) {
  3883. var data=new OSFLog.AppInitializationUsageData();
  3884. data.CorrelationId=osfControlAppCorrelationId;
  3885. data.SessionId=sessionId;
  3886. data.SuccessCode=isException ? 1 : 0;
  3887. data.Message=message;
  3888. (new AppLogger()).LogData(data);
  3889. }
  3890. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  3891. function logAppCommonMessage(message) {
  3892. doAppInitializationLogging(false, message);
  3893. }
  3894. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  3895. function logAppException(errorMessage) {
  3896. doAppInitializationLogging(true, errorMessage);
  3897. }
  3898. OSFAppTelemetry.logAppException=logAppException;
  3899. OSF.AppTelemetry=OSFAppTelemetry;
  3900. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  3901. Microsoft.Office.WebExtension.FileType={
  3902. Text: "text",
  3903. Compressed: "compressed",
  3904. Pdf: "pdf"
  3905. };
  3906. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  3907. FileProperties: "FileProperties",
  3908. FileSliceProperties: "FileSliceProperties"
  3909. });
  3910. OSF.DDA.FileProperties={
  3911. Handle: "FileHandle",
  3912. FileSize: "FileSize",
  3913. SliceSize: Microsoft.Office.WebExtension.Parameters.SliceSize
  3914. };
  3915. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) {
  3916. OSF.OUtil.defineEnumerableProperties(this, {
  3917. "size": {
  3918. value: fileSize
  3919. },
  3920. "sliceCount": {
  3921. value: Math.ceil(fileSize / sliceSize)
  3922. }
  3923. });
  3924. var privateState={};
  3925. privateState[OSF.DDA.FileProperties.Handle]=handle;
  3926. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  3927. var am=OSF.DDA.AsyncMethodNames;
  3928. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  3929. am.GetDocumentCopyChunkAsync,
  3930. am.ReleaseDocumentCopyAsync
  3931. ], privateState);
  3932. };
  3933. OSF.DDA.FileSliceOffset="fileSliceoffset";
  3934. OSF.DDA.AsyncMethodNames.addNames({
  3935. GetDocumentCopyAsync: "getFileAsync",
  3936. GetDocumentCopyChunkAsync: "getSliceAsync",
  3937. ReleaseDocumentCopyAsync: "closeAsync"
  3938. });
  3939. OSF.DDA.AsyncMethodCalls.define({
  3940. method: OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,
  3941. requiredArguments: [
  3942. {
  3943. "name": Microsoft.Office.WebExtension.Parameters.FileType,
  3944. "enum": Microsoft.Office.WebExtension.FileType
  3945. }
  3946. ],
  3947. supportedOptions: [
  3948. {
  3949. name: Microsoft.Office.WebExtension.Parameters.SliceSize,
  3950. value: {
  3951. "types": ["number"],
  3952. "defaultValue": 4 * 1024 * 1024
  3953. }
  3954. }
  3955. ],
  3956. checkCallArgs: function (callArgs, caller, stateInfo) {
  3957. var sliceSize=callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize];
  3958. if (sliceSize <=0 || sliceSize > (4 * 1024 * 1024)) {
  3959. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;
  3960. }
  3961. return callArgs;
  3962. },
  3963. onSucceeded: function (fileDescriptor, caller, callArgs) {
  3964. return new OSF.DDA.File(fileDescriptor[OSF.DDA.FileProperties.Handle], fileDescriptor[OSF.DDA.FileProperties.FileSize], callArgs[Microsoft.Office.WebExtension.Parameters.SliceSize]);
  3965. }
  3966. });
  3967. OSF.DDA.AsyncMethodCalls.define({
  3968. method: OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,
  3969. requiredArguments: [
  3970. {
  3971. "name": Microsoft.Office.WebExtension.Parameters.SliceIndex,
  3972. "types": ["number"]
  3973. }
  3974. ],
  3975. privateStateCallbacks: [
  3976. {
  3977. name: OSF.DDA.FileProperties.Handle,
  3978. value: function (caller, stateInfo) {
  3979. return stateInfo[OSF.DDA.FileProperties.Handle];
  3980. }
  3981. },
  3982. {
  3983. name: OSF.DDA.FileProperties.SliceSize,
  3984. value: function (caller, stateInfo) {
  3985. return stateInfo[OSF.DDA.FileProperties.SliceSize];
  3986. }
  3987. }
  3988. ],
  3989. checkCallArgs: function (callArgs, caller, stateInfo) {
  3990. var index=callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex];
  3991. if (index < 0 || index >=caller.sliceCount) {
  3992. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;
  3993. }
  3994. callArgs[OSF.DDA.FileSliceOffset]=parseInt((index * stateInfo[OSF.DDA.FileProperties.SliceSize]).toString());
  3995. return callArgs;
  3996. },
  3997. onSucceeded: function (sliceDescriptor, caller, callArgs) {
  3998. var slice={};
  3999. OSF.OUtil.defineEnumerableProperties(slice, {
  4000. "data": {
  4001. value: sliceDescriptor[Microsoft.Office.WebExtension.Parameters.Data]
  4002. },
  4003. "index": {
  4004. value: callArgs[Microsoft.Office.WebExtension.Parameters.SliceIndex]
  4005. },
  4006. "size": {
  4007. value: sliceDescriptor[OSF.DDA.FileProperties.SliceSize]
  4008. }
  4009. });
  4010. return slice;
  4011. }
  4012. });
  4013. OSF.DDA.AsyncMethodCalls.define({
  4014. method: OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,
  4015. privateStateCallbacks: [
  4016. {
  4017. name: OSF.DDA.FileProperties.Handle,
  4018. value: function (caller, stateInfo) {
  4019. return stateInfo[OSF.DDA.FileProperties.Handle];
  4020. }
  4021. }
  4022. ]
  4023. });
  4024. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FileType, {
  4025. Text: "text",
  4026. Pdf: "pdf"
  4027. });
  4028. OSF.DDA.FilePropertiesDescriptor={
  4029. Url: "Url"
  4030. };
  4031. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  4032. FilePropertiesDescriptor: "FilePropertiesDescriptor"
  4033. });
  4034. Microsoft.Office.WebExtension.FileProperties=function Microsoft_Office_WebExtension_FileProperties(filePropertiesDescriptor) {
  4035. OSF.OUtil.defineEnumerableProperties(this, {
  4036. "url": {
  4037. value: filePropertiesDescriptor[OSF.DDA.FilePropertiesDescriptor.Url]
  4038. }
  4039. });
  4040. };
  4041. OSF.DDA.AsyncMethodNames.addNames({ GetFilePropertiesAsync: "getFilePropertiesAsync" });
  4042. OSF.DDA.AsyncMethodCalls.define({
  4043. method: OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,
  4044. fromHost: [
  4045. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: 0 }
  4046. ],
  4047. requiredArguments: [],
  4048. supportedOptions: [],
  4049. onSucceeded: function (filePropertiesDescriptor, caller, callArgs) {
  4050. return new Microsoft.Office.WebExtension.FileProperties(filePropertiesDescriptor);
  4051. }
  4052. });
  4053. Microsoft.Office.WebExtension.GoToType={
  4054. Binding: "binding",
  4055. NamedItem: "namedItem",
  4056. Slide: "slide",
  4057. Index: "index"
  4058. };
  4059. Microsoft.Office.WebExtension.SelectionMode={
  4060. Default: "default",
  4061. Selected: "selected",
  4062. None: "none"
  4063. };
  4064. Microsoft.Office.WebExtension.Index={
  4065. First: "first",
  4066. Last: "last",
  4067. Next: "next",
  4068. Previous: "previous"
  4069. };
  4070. OSF.DDA.AsyncMethodNames.addNames({ GoToByIdAsync: "goToByIdAsync" });
  4071. OSF.DDA.AsyncMethodCalls.define({
  4072. method: OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  4073. requiredArguments: [
  4074. {
  4075. "name": Microsoft.Office.WebExtension.Parameters.Id,
  4076. "types": ["string", "number"]
  4077. },
  4078. {
  4079. "name": Microsoft.Office.WebExtension.Parameters.GoToType,
  4080. "enum": Microsoft.Office.WebExtension.GoToType
  4081. }
  4082. ],
  4083. supportedOptions: [
  4084. {
  4085. name: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  4086. value: {
  4087. "enum": Microsoft.Office.WebExtension.SelectionMode,
  4088. "defaultValue": Microsoft.Office.WebExtension.SelectionMode.Default
  4089. }
  4090. }
  4091. ]
  4092. });
  4093. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4094. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  4095. toHost: [
  4096. { name: Microsoft.Office.WebExtension.GoToType.Binding, value: 0 },
  4097. { name: Microsoft.Office.WebExtension.GoToType.NamedItem, value: 1 },
  4098. { name: Microsoft.Office.WebExtension.GoToType.Slide, value: 2 },
  4099. { name: Microsoft.Office.WebExtension.GoToType.Index, value: 3 }
  4100. ]
  4101. });
  4102. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4103. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  4104. toHost: [
  4105. { name: Microsoft.Office.WebExtension.SelectionMode.Default, value: 0 },
  4106. { name: Microsoft.Office.WebExtension.SelectionMode.Selected, value: 1 },
  4107. { name: Microsoft.Office.WebExtension.SelectionMode.None, value: 2 }
  4108. ]
  4109. });
  4110. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4111. type: OSF.DDA.MethodDispId.dispidNavigateToMethod,
  4112. toHost: [
  4113. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  4114. { name: Microsoft.Office.WebExtension.Parameters.GoToType, value: 1 },
  4115. { name: Microsoft.Office.WebExtension.Parameters.SelectionMode, value: 2 }
  4116. ]
  4117. });
  4118. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4119. type: OSF.DDA.PropertyDescriptors.FileProperties,
  4120. fromHost: [
  4121. { name: OSF.DDA.FileProperties.Handle, value: 0 },
  4122. { name: OSF.DDA.FileProperties.FileSize, value: 1 }
  4123. ],
  4124. isComplexType: true
  4125. });
  4126. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4127. type: OSF.DDA.PropertyDescriptors.FileSliceProperties,
  4128. fromHost: [
  4129. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 },
  4130. { name: OSF.DDA.FileProperties.SliceSize, value: 1 }
  4131. ],
  4132. isComplexType: true
  4133. });
  4134. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4135. type: Microsoft.Office.WebExtension.Parameters.FileType,
  4136. toHost: [
  4137. { name: Microsoft.Office.WebExtension.FileType.Text, value: 0 },
  4138. { name: Microsoft.Office.WebExtension.FileType.Compressed, value: 5 },
  4139. { name: Microsoft.Office.WebExtension.FileType.Pdf, value: 6 }
  4140. ]
  4141. });
  4142. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4143. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,
  4144. toHost: [{ name: Microsoft.Office.WebExtension.Parameters.FileType, value: 0 }],
  4145. fromHost: [
  4146. { name: OSF.DDA.PropertyDescriptors.FileProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4147. ]
  4148. });
  4149. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4150. type: OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,
  4151. toHost: [
  4152. { name: OSF.DDA.FileProperties.Handle, value: 0 },
  4153. { name: OSF.DDA.FileSliceOffset, value: 1 },
  4154. { name: OSF.DDA.FileProperties.SliceSize, value: 2 }
  4155. ],
  4156. fromHost: [
  4157. { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4158. ]
  4159. });
  4160. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4161. type: OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,
  4162. toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0 }]
  4163. });
  4164. OSF.DDA.AsyncMethodNames.addNames({
  4165. GetSelectedDataAsync: "getSelectedDataAsync",
  4166. SetSelectedDataAsync: "setSelectedDataAsync"
  4167. });
  4168. (function () {
  4169. function processData(dataDescriptor, caller, callArgs) {
  4170. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  4171. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  4172. data=OSF.DDA.OMFactory.manufactureTableData(data);
  4173. }
  4174. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  4175. return data==undefined ? null : data;
  4176. }
  4177. OSF.DDA.AsyncMethodCalls.define({
  4178. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  4179. requiredArguments: [
  4180. {
  4181. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  4182. "enum": Microsoft.Office.WebExtension.CoercionType
  4183. }
  4184. ],
  4185. supportedOptions: [
  4186. {
  4187. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  4188. value: {
  4189. "enum": Microsoft.Office.WebExtension.ValueFormat,
  4190. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  4191. }
  4192. },
  4193. {
  4194. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  4195. value: {
  4196. "enum": Microsoft.Office.WebExtension.FilterType,
  4197. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  4198. }
  4199. }
  4200. ],
  4201. privateStateCallbacks: [],
  4202. onSucceeded: processData
  4203. });
  4204. OSF.DDA.AsyncMethodCalls.define({
  4205. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  4206. requiredArguments: [
  4207. {
  4208. "name": Microsoft.Office.WebExtension.Parameters.Data,
  4209. "types": ["string", "object", "number", "boolean"]
  4210. }
  4211. ],
  4212. supportedOptions: [
  4213. {
  4214. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4215. value: {
  4216. "enum": Microsoft.Office.WebExtension.CoercionType,
  4217. "calculate": function (requiredArgs) {
  4218. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  4219. }
  4220. }
  4221. },
  4222. {
  4223. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  4224. value: {
  4225. "types": ["number", "boolean"],
  4226. "defaultValue": false
  4227. }
  4228. },
  4229. {
  4230. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  4231. value: {
  4232. "types": ["number", "boolean"],
  4233. "defaultValue": false
  4234. }
  4235. },
  4236. {
  4237. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  4238. value: {
  4239. "types": ["number", "boolean"],
  4240. "defaultValue": false
  4241. }
  4242. },
  4243. {
  4244. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  4245. value: {
  4246. "types": ["number", "boolean"],
  4247. "defaultValue": false
  4248. }
  4249. }
  4250. ],
  4251. privateStateCallbacks: []
  4252. });
  4253. })();
  4254. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4255. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  4256. fromHost: [
  4257. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4258. ],
  4259. toHost: [
  4260. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  4261. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  4262. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  4263. ]
  4264. });
  4265. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4266. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  4267. toHost: [
  4268. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  4269. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  4270. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  4271. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  4272. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  4273. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 }
  4274. ]
  4275. });
  4276. OSF.DDA.SettingsManager={
  4277. SerializedSettings: "serializedSettings",
  4278. DateJSONPrefix: "Date(",
  4279. DataJSONSuffix: ")",
  4280. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  4281. var ret={};
  4282. for (var key in settingsCollection) {
  4283. var value=settingsCollection[key];
  4284. try {
  4285. if (JSON) {
  4286. value=JSON.stringify(value, function dateReplacer(k, v) {
  4287. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v;
  4288. });
  4289. } else {
  4290. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  4291. }
  4292. ret[key]=value;
  4293. } catch (ex) {
  4294. }
  4295. }
  4296. return ret;
  4297. },
  4298. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  4299. var ret={};
  4300. serializedSettings=serializedSettings || {};
  4301. for (var key in serializedSettings) {
  4302. var value=serializedSettings[key];
  4303. try {
  4304. if (JSON) {
  4305. value=JSON.parse(value, function dateReviver(k, v) {
  4306. var d;
  4307. if (typeof v==='string' && v && v.length > 6 && v.slice(0, 5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix) {
  4308. d=new Date(parseInt(v.slice(5, -1)));
  4309. if (d) {
  4310. return d;
  4311. }
  4312. }
  4313. return v;
  4314. });
  4315. } else {
  4316. value=Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  4317. }
  4318. ret[key]=value;
  4319. } catch (ex) {
  4320. }
  4321. }
  4322. return ret;
  4323. }
  4324. };
  4325. OSF.DDA.Settings=function OSF_DDA_Settings(settings) {
  4326. settings=settings || {};
  4327. var cacheSessionSettings=function (settings) {
  4328. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  4329. if (osfSessionStorage) {
  4330. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(settings);
  4331. var storageSettings=JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  4332. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  4333. }
  4334. };
  4335. OSF.OUtil.defineEnumerableProperties(this, {
  4336. "get": {
  4337. value: function OSF_DDA_Settings$get(name) {
  4338. var e=Function._validateParams(arguments, [
  4339. { name: "name", type: String, mayBeNull: false }
  4340. ]);
  4341. if (e)
  4342. throw e;
  4343. var setting=settings[name];
  4344. return typeof (setting)==='undefined' ? null : setting;
  4345. }
  4346. },
  4347. "set": {
  4348. value: function OSF_DDA_Settings$set(name, value) {
  4349. var e=Function._validateParams(arguments, [
  4350. { name: "name", type: String, mayBeNull: false },
  4351. { name: "value", mayBeNull: true }
  4352. ]);
  4353. if (e)
  4354. throw e;
  4355. settings[name]=value;
  4356. cacheSessionSettings(settings);
  4357. }
  4358. },
  4359. "remove": {
  4360. value: function OSF_DDA_Settings$remove(name) {
  4361. var e=Function._validateParams(arguments, [
  4362. { name: "name", type: String, mayBeNull: false }
  4363. ]);
  4364. if (e)
  4365. throw e;
  4366. delete settings[name];
  4367. cacheSessionSettings(settings);
  4368. }
  4369. }
  4370. });
  4371. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  4372. };
  4373. OSF.DDA.RefreshableSettings=function OSF_DDA_RefreshableSettings(settings) {
  4374. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  4375. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  4376. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  4377. };
  4378. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  4379. Microsoft.Office.WebExtension.EventType={};
  4380. OSF.EventDispatch=function OSF_EventDispatch(eventTypes) {
  4381. this._eventHandlers={};
  4382. for (var entry in eventTypes) {
  4383. var eventType=eventTypes[entry];
  4384. this._eventHandlers[eventType]=[];
  4385. }
  4386. };
  4387. OSF.EventDispatch.prototype={
  4388. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  4389. var events=[];
  4390. for (var eventName in this._eventHandlers)
  4391. events.push(eventName);
  4392. return events;
  4393. },
  4394. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  4395. var isSupported=false;
  4396. for (var eventName in this._eventHandlers) {
  4397. if (event==eventName) {
  4398. isSupported=true;
  4399. break;
  4400. }
  4401. }
  4402. return isSupported;
  4403. },
  4404. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  4405. var handlers=this._eventHandlers[eventType];
  4406. if (handlers && handlers.length > 0) {
  4407. for (var h in handlers) {
  4408. if (handlers[h]===handler)
  4409. return true;
  4410. }
  4411. }
  4412. return false;
  4413. },
  4414. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  4415. if (typeof handler !="function") {
  4416. return false;
  4417. }
  4418. var handlers=this._eventHandlers[eventType];
  4419. if (handlers && !this.hasEventHandler(eventType, handler)) {
  4420. handlers.push(handler);
  4421. return true;
  4422. } else {
  4423. return false;
  4424. }
  4425. },
  4426. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  4427. var handlers=this._eventHandlers[eventType];
  4428. if (handlers && handlers.length > 0) {
  4429. for (var index=0; index < handlers.length; index++) {
  4430. if (handlers[index]===handler) {
  4431. handlers.splice(index, 1);
  4432. return true;
  4433. }
  4434. }
  4435. }
  4436. return false;
  4437. },
  4438. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  4439. if (typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0) {
  4440. this._eventHandlers[eventType]=[];
  4441. return true;
  4442. }
  4443. return false;
  4444. },
  4445. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  4446. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1;
  4447. },
  4448. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  4449. if (eventArgs.type==undefined)
  4450. return false;
  4451. var eventType=eventArgs.type;
  4452. if (eventType && this._eventHandlers[eventType]) {
  4453. var eventHandlers=this._eventHandlers[eventType];
  4454. for (var handler in eventHandlers)
  4455. eventHandlers[handler](eventArgs);
  4456. return true;
  4457. } else {
  4458. return false;
  4459. }
  4460. }
  4461. };
  4462. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4463. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  4464. var args;
  4465. switch (eventType) {
  4466. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  4467. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  4468. break;
  4469. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  4470. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  4471. break;
  4472. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  4473. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  4474. break;
  4475. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  4476. args=new OSF.DDA.SettingsChangedEventArgs(target);
  4477. break;
  4478. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  4479. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  4480. break;
  4481. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  4482. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  4483. break;
  4484. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  4485. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  4486. break;
  4487. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  4488. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  4489. break;
  4490. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  4491. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4492. break;
  4493. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  4494. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4495. break;
  4496. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  4497. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4498. break;
  4499. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  4500. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  4501. break;
  4502. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  4503. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  4504. break;
  4505. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  4506. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  4507. break;
  4508. default:
  4509. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  4510. }
  4511. return args;
  4512. };
  4513. OSF.DDA.AsyncMethodNames.addNames({
  4514. AddHandlerAsync: "addHandlerAsync",
  4515. RemoveHandlerAsync: "removeHandlerAsync"
  4516. });
  4517. OSF.DDA.AsyncMethodCalls.define({
  4518. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  4519. requiredArguments: [
  4520. {
  4521. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  4522. "enum": Microsoft.Office.WebExtension.EventType,
  4523. "verify": function (eventType, caller, eventDispatch) {
  4524. return eventDispatch.supportsEvent(eventType);
  4525. }
  4526. },
  4527. {
  4528. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  4529. "types": ["function"]
  4530. }
  4531. ],
  4532. supportedOptions: [],
  4533. privateStateCallbacks: []
  4534. });
  4535. OSF.DDA.AsyncMethodCalls.define({
  4536. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  4537. requiredArguments: [
  4538. {
  4539. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  4540. "enum": Microsoft.Office.WebExtension.EventType,
  4541. "verify": function (eventType, caller, eventDispatch) {
  4542. return eventDispatch.supportsEvent(eventType);
  4543. }
  4544. }
  4545. ],
  4546. supportedOptions: [
  4547. {
  4548. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4549. value: {
  4550. "types": ["function", "object"],
  4551. "defaultValue": null
  4552. }
  4553. }
  4554. ],
  4555. privateStateCallbacks: []
  4556. });
  4557. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  4558. SettingsChanged: "settingsChanged"
  4559. });
  4560. OSF.DDA.SettingsChangedEventArgs=function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  4561. OSF.OUtil.defineEnumerableProperties(this, {
  4562. "type": {
  4563. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  4564. },
  4565. "settings": {
  4566. value: settingsInstance
  4567. }
  4568. });
  4569. };
  4570. OSF.DDA.AsyncMethodNames.addNames({
  4571. RefreshAsync: "refreshAsync",
  4572. SaveAsync: "saveAsync"
  4573. });
  4574. OSF.DDA.AsyncMethodCalls.define({
  4575. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  4576. requiredArguments: [],
  4577. supportedOptions: [],
  4578. privateStateCallbacks: [],
  4579. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings) {
  4580. var serializedSettings=serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  4581. var newSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  4582. return newSettings;
  4583. }
  4584. });
  4585. OSF.DDA.AsyncMethodCalls.define({
  4586. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  4587. requiredArguments: [],
  4588. supportedOptions: [
  4589. {
  4590. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  4591. value: {
  4592. "types": ["boolean"],
  4593. "defaultValue": true
  4594. }
  4595. }
  4596. ],
  4597. privateStateCallbacks: [
  4598. {
  4599. name: OSF.DDA.SettingsManager.SerializedSettings,
  4600. value: function serializeSettings(settingsInstance, settingsCollection) {
  4601. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  4602. }
  4603. }
  4604. ]
  4605. });
  4606. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4607. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  4608. fromHost: [
  4609. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  4610. ]
  4611. });
  4612. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4613. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  4614. toHost: [
  4615. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  4616. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  4617. ]
  4618. });
  4619. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  4620. Microsoft.Office.WebExtension.BindingType={
  4621. Table: "table",
  4622. Text: "text",
  4623. Matrix: "matrix"
  4624. };
  4625. OSF.DDA.BindingProperties={
  4626. Id: "BindingId",
  4627. Type: Microsoft.Office.WebExtension.Parameters.BindingType
  4628. };
  4629. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, { BindingList: "BindingList" });
  4630. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  4631. Subset: "subset",
  4632. BindingProperties: "BindingProperties"
  4633. });
  4634. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList, OSF.DDA.PropertyDescriptors.BindingProperties);
  4635. OSF.DDA.BindingPromise=function OSF_DDA_BindingPromise(bindingId, errorCallback) {
  4636. this._id=bindingId;
  4637. OSF.OUtil.defineEnumerableProperty(this, "onFail", {
  4638. get: function () {
  4639. return errorCallback;
  4640. },
  4641. set: function (onError) {
  4642. var t=typeof onError;
  4643. if (t !="undefined" && t !="function") {
  4644. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, t);
  4645. }
  4646. errorCallback=onError;
  4647. }
  4648. });
  4649. };
  4650. OSF.DDA.BindingPromise.prototype={
  4651. _fetch: function OSF_DDA_BindingPromise$_fetch(onComplete) {
  4652. if (this.binding) {
  4653. if (onComplete)
  4654. onComplete(this.binding);
  4655. } else {
  4656. if (!this._binding) {
  4657. var me=this;
  4658. Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id, function (asyncResult) {
  4659. if (asyncResult.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded) {
  4660. OSF.OUtil.defineEnumerableProperty(me, "binding", {
  4661. value: asyncResult.value
  4662. });
  4663. if (onComplete)
  4664. onComplete(me.binding);
  4665. } else {
  4666. if (me.onFail)
  4667. me.onFail(asyncResult);
  4668. }
  4669. });
  4670. }
  4671. }
  4672. return this;
  4673. },
  4674. getDataAsync: function OSF_DDA_BindingPromise$getDataAsync() {
  4675. var args=arguments;
  4676. this._fetch(function onComplete(binding) {
  4677. binding.getDataAsync.apply(binding, args);
  4678. });
  4679. return this;
  4680. },
  4681. setDataAsync: function OSF_DDA_BindingPromise$setDataAsync() {
  4682. var args=arguments;
  4683. this._fetch(function onComplete(binding) {
  4684. binding.setDataAsync.apply(binding, args);
  4685. });
  4686. return this;
  4687. },
  4688. addHandlerAsync: function OSF_DDA_BindingPromise$addHandlerAsync() {
  4689. var args=arguments;
  4690. this._fetch(function onComplete(binding) {
  4691. binding.addHandlerAsync.apply(binding, args);
  4692. });
  4693. return this;
  4694. },
  4695. removeHandlerAsync: function OSF_DDA_BindingPromise$removeHandlerAsync() {
  4696. var args=arguments;
  4697. this._fetch(function onComplete(binding) {
  4698. binding.removeHandlerAsync.apply(binding, args);
  4699. });
  4700. return this;
  4701. }
  4702. };
  4703. OSF.DDA.BindingFacade=function OSF_DDA_BindingFacade(docInstance) {
  4704. this._eventDispatches=[];
  4705. OSF.OUtil.defineEnumerableProperty(this, "document", {
  4706. value: docInstance
  4707. });
  4708. var am=OSF.DDA.AsyncMethodNames;
  4709. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  4710. am.AddFromSelectionAsync,
  4711. am.AddFromNamedItemAsync,
  4712. am.GetAllAsync,
  4713. am.GetByIdAsync,
  4714. am.ReleaseByIdAsync
  4715. ]);
  4716. };
  4717. OSF.DDA.UnknownBinding=function OSF_DDA_UknonwnBinding(id, docInstance) {
  4718. OSF.OUtil.defineEnumerableProperties(this, {
  4719. "document": { value: docInstance },
  4720. "id": { value: id }
  4721. });
  4722. };
  4723. OSF.DDA.Binding=function OSF_DDA_Binding(id, docInstance) {
  4724. OSF.OUtil.defineEnumerableProperties(this, {
  4725. "document": {
  4726. value: docInstance
  4727. },
  4728. "id": {
  4729. value: id
  4730. }
  4731. });
  4732. var am=OSF.DDA.AsyncMethodNames;
  4733. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  4734. am.GetDataAsync,
  4735. am.SetDataAsync
  4736. ]);
  4737. var et=Microsoft.Office.WebExtension.EventType;
  4738. var bindingEventDispatches=docInstance.bindings._eventDispatches;
  4739. if (!bindingEventDispatches[id]) {
  4740. bindingEventDispatches[id]=new OSF.EventDispatch([
  4741. et.BindingSelectionChanged,
  4742. et.BindingDataChanged
  4743. ]);
  4744. }
  4745. var eventDispatch=bindingEventDispatches[id];
  4746. OSF.DDA.DispIdHost.addEventSupport(this, eventDispatch);
  4747. };
  4748. OSF.DDA.generateBindingId=function OSF_DDA$GenerateBindingId() {
  4749. return "UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+new Date().getTime();
  4750. };
  4751. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4752. OSF.DDA.OMFactory.manufactureBinding=function OSF_DDA_OMFactory$manufactureBinding(bindingProperties, containingDocument) {
  4753. var id=bindingProperties[OSF.DDA.BindingProperties.Id];
  4754. var rows=bindingProperties[OSF.DDA.BindingProperties.RowCount];
  4755. var cols=bindingProperties[OSF.DDA.BindingProperties.ColumnCount];
  4756. var hasHeaders=bindingProperties[OSF.DDA.BindingProperties.HasHeaders];
  4757. var binding;
  4758. switch (bindingProperties[OSF.DDA.BindingProperties.Type]) {
  4759. case Microsoft.Office.WebExtension.BindingType.Text:
  4760. binding=new OSF.DDA.TextBinding(id, containingDocument);
  4761. break;
  4762. case Microsoft.Office.WebExtension.BindingType.Matrix:
  4763. binding=new OSF.DDA.MatrixBinding(id, containingDocument, rows, cols);
  4764. break;
  4765. case Microsoft.Office.WebExtension.BindingType.Table:
  4766. var isExcelApp=function () {
  4767. return (OSF.DDA.ExcelDocument) && (Microsoft.Office.WebExtension.context.document) && (Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument);
  4768. };
  4769. var tableBindingObject;
  4770. if (isExcelApp() && OSF.DDA.ExcelTableBinding) {
  4771. tableBindingObject=OSF.DDA.ExcelTableBinding;
  4772. } else {
  4773. tableBindingObject=OSF.DDA.TableBinding;
  4774. }
  4775. binding=new tableBindingObject(id, containingDocument, rows, cols, hasHeaders);
  4776. break;
  4777. default:
  4778. binding=new OSF.DDA.UnknownBinding(id, containingDocument);
  4779. }
  4780. return binding;
  4781. };
  4782. OSF.DDA.AsyncMethodNames.addNames({
  4783. AddFromSelectionAsync: "addFromSelectionAsync",
  4784. AddFromNamedItemAsync: "addFromNamedItemAsync",
  4785. GetAllAsync: "getAllAsync",
  4786. GetByIdAsync: "getByIdAsync",
  4787. ReleaseByIdAsync: "releaseByIdAsync",
  4788. GetDataAsync: "getDataAsync",
  4789. SetDataAsync: "setDataAsync"
  4790. });
  4791. (function () {
  4792. function processBinding(bindingDescriptor) {
  4793. return OSF.DDA.OMFactory.manufactureBinding(bindingDescriptor, Microsoft.Office.WebExtension.context.document);
  4794. }
  4795. function getObjectId(obj) {
  4796. return obj.id;
  4797. }
  4798. function processData(dataDescriptor, caller, callArgs) {
  4799. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  4800. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] !=undefined || data[OSF.DDA.TableDataProperties.TableHeaders] !=undefined)) {
  4801. data=OSF.DDA.OMFactory.manufactureTableData(data);
  4802. }
  4803. data=OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  4804. return data==undefined ? null : data;
  4805. }
  4806. OSF.DDA.AsyncMethodCalls.define({
  4807. method: OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,
  4808. requiredArguments: [
  4809. {
  4810. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  4811. "enum": Microsoft.Office.WebExtension.BindingType
  4812. }
  4813. ],
  4814. supportedOptions: [
  4815. {
  4816. name: Microsoft.Office.WebExtension.Parameters.Id,
  4817. value: {
  4818. "types": ["string"],
  4819. "calculate": OSF.DDA.generateBindingId
  4820. }
  4821. },
  4822. {
  4823. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4824. value: {
  4825. "types": ["object"],
  4826. "defaultValue": null
  4827. }
  4828. }
  4829. ],
  4830. privateStateCallbacks: [],
  4831. onSucceeded: processBinding
  4832. });
  4833. OSF.DDA.AsyncMethodCalls.define({
  4834. method: OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,
  4835. requiredArguments: [
  4836. {
  4837. "name": Microsoft.Office.WebExtension.Parameters.ItemName,
  4838. "types": ["string"]
  4839. },
  4840. {
  4841. "name": Microsoft.Office.WebExtension.Parameters.BindingType,
  4842. "enum": Microsoft.Office.WebExtension.BindingType
  4843. }
  4844. ],
  4845. supportedOptions: [
  4846. {
  4847. name: Microsoft.Office.WebExtension.Parameters.Id,
  4848. value: {
  4849. "types": ["string"],
  4850. "calculate": OSF.DDA.generateBindingId
  4851. }
  4852. },
  4853. {
  4854. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4855. value: {
  4856. "types": ["object"],
  4857. "defaultValue": null
  4858. }
  4859. }
  4860. ],
  4861. privateStateCallbacks: [
  4862. {
  4863. name: Microsoft.Office.WebExtension.Parameters.FailOnCollision,
  4864. value: function () {
  4865. return true;
  4866. }
  4867. }
  4868. ],
  4869. onSucceeded: processBinding
  4870. });
  4871. OSF.DDA.AsyncMethodCalls.define({
  4872. method: OSF.DDA.AsyncMethodNames.GetAllAsync,
  4873. requiredArguments: [],
  4874. supportedOptions: [],
  4875. privateStateCallbacks: [],
  4876. onSucceeded: function (response) {
  4877. return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.BindingList], processBinding);
  4878. }
  4879. });
  4880. OSF.DDA.AsyncMethodCalls.define({
  4881. method: OSF.DDA.AsyncMethodNames.GetByIdAsync,
  4882. requiredArguments: [
  4883. {
  4884. "name": Microsoft.Office.WebExtension.Parameters.Id,
  4885. "types": ["string"]
  4886. }
  4887. ],
  4888. supportedOptions: [],
  4889. privateStateCallbacks: [],
  4890. onSucceeded: processBinding
  4891. });
  4892. OSF.DDA.AsyncMethodCalls.define({
  4893. method: OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,
  4894. requiredArguments: [
  4895. {
  4896. "name": Microsoft.Office.WebExtension.Parameters.Id,
  4897. "types": ["string"]
  4898. }
  4899. ],
  4900. supportedOptions: [],
  4901. privateStateCallbacks: [],
  4902. onSucceeded: function (response, caller, callArgs) {
  4903. var id=callArgs[Microsoft.Office.WebExtension.Parameters.Id];
  4904. delete caller._eventDispatches[id];
  4905. }
  4906. });
  4907. OSF.DDA.AsyncMethodCalls.define({
  4908. method: OSF.DDA.AsyncMethodNames.GetDataAsync,
  4909. requiredArguments: [],
  4910. supportedOptions: [
  4911. {
  4912. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  4913. value: {
  4914. "enum": Microsoft.Office.WebExtension.CoercionType,
  4915. "calculate": function (requiredArgs, binding) {
  4916. return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(binding.type);
  4917. }
  4918. }
  4919. },
  4920. {
  4921. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  4922. value: {
  4923. "enum": Microsoft.Office.WebExtension.ValueFormat,
  4924. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  4925. }
  4926. },
  4927. {
  4928. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  4929. value: {
  4930. "enum": Microsoft.Office.WebExtension.FilterType,
  4931. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  4932. }
  4933. },
  4934. {
  4935. name: Microsoft.Office.WebExtension.Parameters.Rows,
  4936. value: {
  4937. "types": ["object", "string"],
  4938. "defaultValue": null
  4939. }
  4940. },
  4941. {
  4942. name: Microsoft.Office.WebExtension.Parameters.Columns,
  4943. value: {
  4944. "types": ["object"],
  4945. "defaultValue": null
  4946. }
  4947. },
  4948. {
  4949. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  4950. value: {
  4951. "types": ["number"],
  4952. "defaultValue": 0
  4953. }
  4954. },
  4955. {
  4956. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  4957. value: {
  4958. "types": ["number"],
  4959. "defaultValue": 0
  4960. }
  4961. },
  4962. {
  4963. name: Microsoft.Office.WebExtension.Parameters.RowCount,
  4964. value: {
  4965. "types": ["number"],
  4966. "defaultValue": 0
  4967. }
  4968. },
  4969. {
  4970. name: Microsoft.Office.WebExtension.Parameters.ColumnCount,
  4971. value: {
  4972. "types": ["number"],
  4973. "defaultValue": 0
  4974. }
  4975. }
  4976. ],
  4977. checkCallArgs: function (callArgs, caller, stateInfo) {
  4978. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.RowCount]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount]==0) {
  4979. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  4980. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  4981. delete callArgs[Microsoft.Office.WebExtension.Parameters.RowCount];
  4982. delete callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount];
  4983. }
  4984. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn] || callArgs[Microsoft.Office.WebExtension.Parameters.RowCount] || callArgs[Microsoft.Office.WebExtension.Parameters.ColumnCount])) {
  4985. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  4986. }
  4987. return callArgs;
  4988. },
  4989. privateStateCallbacks: [
  4990. {
  4991. name: Microsoft.Office.WebExtension.Parameters.Id,
  4992. value: getObjectId
  4993. }
  4994. ],
  4995. onSucceeded: processData
  4996. });
  4997. OSF.DDA.AsyncMethodCalls.define({
  4998. method: OSF.DDA.AsyncMethodNames.SetDataAsync,
  4999. requiredArguments: [
  5000. {
  5001. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5002. "types": ["string", "object", "number", "boolean"]
  5003. }
  5004. ],
  5005. supportedOptions: [
  5006. {
  5007. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5008. value: {
  5009. "enum": Microsoft.Office.WebExtension.CoercionType,
  5010. "calculate": function (requiredArgs) {
  5011. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5012. }
  5013. }
  5014. },
  5015. {
  5016. name: Microsoft.Office.WebExtension.Parameters.Rows,
  5017. value: {
  5018. "types": ["object", "string"],
  5019. "defaultValue": null
  5020. }
  5021. },
  5022. {
  5023. name: Microsoft.Office.WebExtension.Parameters.Columns,
  5024. value: {
  5025. "types": ["object"],
  5026. "defaultValue": null
  5027. }
  5028. },
  5029. {
  5030. name: Microsoft.Office.WebExtension.Parameters.StartRow,
  5031. value: {
  5032. "types": ["number"],
  5033. "defaultValue": 0
  5034. }
  5035. },
  5036. {
  5037. name: Microsoft.Office.WebExtension.Parameters.StartColumn,
  5038. value: {
  5039. "types": ["number"],
  5040. "defaultValue": 0
  5041. }
  5042. }
  5043. ],
  5044. checkCallArgs: function (callArgs, caller, stateInfo) {
  5045. if (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow]==0 && callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn]==0) {
  5046. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartRow];
  5047. delete callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn];
  5048. }
  5049. if (callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType] !=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(caller.type) && (callArgs[Microsoft.Office.WebExtension.Parameters.StartRow] || callArgs[Microsoft.Office.WebExtension.Parameters.StartColumn])) {
  5050. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;
  5051. }
  5052. return callArgs;
  5053. },
  5054. privateStateCallbacks: [
  5055. {
  5056. name: Microsoft.Office.WebExtension.Parameters.Id,
  5057. value: getObjectId
  5058. }
  5059. ]
  5060. });
  5061. })();
  5062. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  5063. RowCount: "BindingRowCount",
  5064. ColumnCount: "BindingColumnCount",
  5065. HasHeaders: "HasHeaders"
  5066. });
  5067. OSF.DDA.MatrixBinding=function OSF_DDA_MatrixBinding(id, docInstance, rows, cols) {
  5068. OSF.DDA.MatrixBinding.uber.constructor.call(this, id, docInstance);
  5069. OSF.OUtil.defineEnumerableProperties(this, {
  5070. "type": {
  5071. value: Microsoft.Office.WebExtension.BindingType.Matrix
  5072. },
  5073. "rowCount": {
  5074. value: rows ? rows : 0
  5075. },
  5076. "columnCount": {
  5077. value: cols ? cols : 0
  5078. }
  5079. });
  5080. };
  5081. OSF.OUtil.extend(OSF.DDA.MatrixBinding, OSF.DDA.Binding);
  5082. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5083. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  5084. fromHost: [
  5085. { name: OSF.DDA.BindingProperties.Id, value: 0 },
  5086. { name: OSF.DDA.BindingProperties.Type, value: 1 },
  5087. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  5088. ],
  5089. isComplexType: true
  5090. });
  5091. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5092. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  5093. toHost: [
  5094. { name: Microsoft.Office.WebExtension.BindingType.Text, value: 0 },
  5095. { name: Microsoft.Office.WebExtension.BindingType.Matrix, value: 1 },
  5096. { name: Microsoft.Office.WebExtension.BindingType.Table, value: 2 }
  5097. ],
  5098. invertible: true
  5099. });
  5100. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5101. type: OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,
  5102. fromHost: [
  5103. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5104. ],
  5105. toHost: [
  5106. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5107. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 1 }
  5108. ]
  5109. });
  5110. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5111. type: OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,
  5112. fromHost: [
  5113. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5114. ],
  5115. toHost: [
  5116. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 0 },
  5117. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 1 },
  5118. { name: Microsoft.Office.WebExtension.Parameters.BindingType, value: 2 },
  5119. { name: Microsoft.Office.WebExtension.Parameters.FailOnCollision, value: 3 }
  5120. ]
  5121. });
  5122. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5123. type: OSF.DDA.MethodDispId.dispidReleaseBindingMethod,
  5124. toHost: [
  5125. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5126. ]
  5127. });
  5128. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5129. type: OSF.DDA.MethodDispId.dispidGetBindingMethod,
  5130. fromHost: [
  5131. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5132. ],
  5133. toHost: [
  5134. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5135. ]
  5136. });
  5137. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5138. type: OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,
  5139. fromHost: [
  5140. { name: OSF.DDA.ListDescriptors.BindingList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5141. ]
  5142. });
  5143. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5144. type: OSF.DDA.MethodDispId.dispidGetBindingDataMethod,
  5145. fromHost: [
  5146. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5147. ],
  5148. toHost: [
  5149. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5150. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  5151. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 2 },
  5152. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 3 },
  5153. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  5154. ]
  5155. });
  5156. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5157. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  5158. toHost: [
  5159. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5160. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  5161. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  5162. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  5163. ]
  5164. });
  5165. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5166. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  5167. fromHost: [
  5168. { name: OSF.DDA.BindingProperties.RowCount, value: 0 },
  5169. { name: OSF.DDA.BindingProperties.ColumnCount, value: 1 },
  5170. { name: OSF.DDA.BindingProperties.HasHeaders, value: 2 }
  5171. ],
  5172. isComplexType: true
  5173. });
  5174. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5175. type: OSF.DDA.PropertyDescriptors.Subset,
  5176. toHost: [
  5177. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 0 },
  5178. { name: OSF.DDA.SafeArray.UniqueArguments.Run, value: 1 }
  5179. ],
  5180. canonical: true,
  5181. isComplexType: true
  5182. });
  5183. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5184. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  5185. toHost: [
  5186. { name: Microsoft.Office.WebExtension.Parameters.StartRow, value: 0 },
  5187. { name: Microsoft.Office.WebExtension.Parameters.StartColumn, value: 1 }
  5188. ],
  5189. canonical: true,
  5190. isComplexType: true
  5191. });
  5192. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5193. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  5194. toHost: [
  5195. { name: Microsoft.Office.WebExtension.Parameters.RowCount, value: 0 },
  5196. { name: Microsoft.Office.WebExtension.Parameters.ColumnCount, value: 1 }
  5197. ],
  5198. canonical: true,
  5199. isComplexType: true
  5200. });
  5201. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5202. type: OSF.DDA.MethodDispId.dispidAddRowsMethod,
  5203. toHost: [
  5204. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5205. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  5206. ]
  5207. });
  5208. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5209. type: OSF.DDA.MethodDispId.dispidAddColumnsMethod,
  5210. toHost: [
  5211. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  5212. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  5213. ]
  5214. });
  5215. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5216. type: OSF.DDA.MethodDispId.dispidClearAllRowsMethod,
  5217. toHost: [
  5218. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  5219. ]
  5220. });
  5221. Microsoft.Office.WebExtension.TableData=function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5222. function fixData(data) {
  5223. if (data==null || data==undefined) {
  5224. return null;
  5225. }
  5226. try {
  5227. for (var dim=OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5228. data=[data];
  5229. }
  5230. return data;
  5231. } catch (ex) {
  5232. }
  5233. }
  5234. ;
  5235. OSF.OUtil.defineEnumerableProperties(this, {
  5236. "headers": {
  5237. get: function () {
  5238. return headers;
  5239. },
  5240. set: function (value) {
  5241. headers=fixData(value);
  5242. }
  5243. },
  5244. "rows": {
  5245. get: function () {
  5246. return rows;
  5247. },
  5248. set: function (value) {
  5249. rows=(value==null || (OSF.OUtil.isArray(value) && (value.length==0))) ? [] : fixData(value);
  5250. }
  5251. }
  5252. });
  5253. this.headers=headers;
  5254. this.rows=rows;
  5255. };
  5256. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5257. OSF.DDA.OMFactory.manufactureTableData=function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5258. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5259. };
  5260. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, { TableDataProperties: "TableDataProperties" });
  5261. OSF.OUtil.augmentList(OSF.DDA.BindingProperties, {
  5262. RowCount: "BindingRowCount",
  5263. ColumnCount: "BindingColumnCount",
  5264. HasHeaders: "HasHeaders"
  5265. });
  5266. OSF.DDA.TableDataProperties={
  5267. TableRows: "TableRows",
  5268. TableHeaders: "TableHeaders"
  5269. };
  5270. OSF.DDA.TableBinding=function OSF_DDA_TableBinding(id, docInstance, rows, cols, hasHeaders) {
  5271. OSF.DDA.TableBinding.uber.constructor.call(this, id, docInstance);
  5272. OSF.OUtil.defineEnumerableProperties(this, {
  5273. "type": {
  5274. value: Microsoft.Office.WebExtension.BindingType.Table
  5275. },
  5276. "rowCount": {
  5277. value: rows ? rows : 0
  5278. },
  5279. "columnCount": {
  5280. value: cols ? cols : 0
  5281. },
  5282. "hasHeaders": {
  5283. value: hasHeaders ? hasHeaders : false
  5284. }
  5285. });
  5286. var am=OSF.DDA.AsyncMethodNames;
  5287. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5288. am.AddRowsAsync,
  5289. am.AddColumnsAsync,
  5290. am.DeleteAllDataValuesAsync
  5291. ]);
  5292. };
  5293. OSF.OUtil.extend(OSF.DDA.TableBinding, OSF.DDA.Binding);
  5294. OSF.DDA.AsyncMethodNames.addNames({
  5295. AddRowsAsync: "addRowsAsync",
  5296. AddColumnsAsync: "addColumnsAsync",
  5297. DeleteAllDataValuesAsync: "deleteAllDataValuesAsync"
  5298. });
  5299. (function () {
  5300. function getObjectId(obj) {
  5301. return obj.id;
  5302. }
  5303. OSF.DDA.AsyncMethodCalls.define({
  5304. method: OSF.DDA.AsyncMethodNames.AddRowsAsync,
  5305. requiredArguments: [
  5306. {
  5307. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5308. "types": ["object"]
  5309. }
  5310. ],
  5311. supportedOptions: [],
  5312. privateStateCallbacks: [
  5313. {
  5314. name: Microsoft.Office.WebExtension.Parameters.Id,
  5315. value: getObjectId
  5316. }
  5317. ]
  5318. });
  5319. OSF.DDA.AsyncMethodCalls.define({
  5320. method: OSF.DDA.AsyncMethodNames.AddColumnsAsync,
  5321. requiredArguments: [
  5322. {
  5323. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5324. "types": ["object"]
  5325. }
  5326. ],
  5327. supportedOptions: [],
  5328. privateStateCallbacks: [
  5329. {
  5330. name: Microsoft.Office.WebExtension.Parameters.Id,
  5331. value: getObjectId
  5332. }
  5333. ]
  5334. });
  5335. OSF.DDA.AsyncMethodCalls.define({
  5336. method: OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,
  5337. requiredArguments: [],
  5338. supportedOptions: [],
  5339. privateStateCallbacks: [
  5340. {
  5341. name: Microsoft.Office.WebExtension.Parameters.Id,
  5342. value: getObjectId
  5343. }
  5344. ]
  5345. });
  5346. })();
  5347. OSF.DDA.TextBinding=function OSF_DDA_TextBinding(id, docInstance) {
  5348. OSF.DDA.TextBinding.uber.constructor.call(this, id, docInstance);
  5349. OSF.OUtil.defineEnumerableProperty(this, "type", {
  5350. value: Microsoft.Office.WebExtension.BindingType.Text
  5351. });
  5352. };
  5353. OSF.OUtil.extend(OSF.DDA.TextBinding, OSF.DDA.Binding);
  5354. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, { DocumentSelectionChanged: "documentSelectionChanged" });
  5355. OSF.DDA.DocumentSelectionChangedEventArgs=function OSF_DDA_DocumentSelectionChangedEventArgs(docInstance) {
  5356. OSF.OUtil.defineEnumerableProperties(this, {
  5357. "type": {
  5358. value: Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged
  5359. },
  5360. "document": {
  5361. value: docInstance
  5362. }
  5363. });
  5364. };
  5365. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent });
  5366. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5367. BindingSelectionChanged: "bindingSelectionChanged",
  5368. BindingDataChanged: "bindingDataChanged"
  5369. });
  5370. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { BindingSelectionChangedEvent: "BindingSelectionChangedEvent" });
  5371. OSF.DDA.BindingSelectionChangedEventArgs=function OSF_DDA_BindingSelectionChangedEventArgs(bindingInstance, subset) {
  5372. OSF.OUtil.defineEnumerableProperties(this, {
  5373. "type": {
  5374. value: Microsoft.Office.WebExtension.EventType.BindingSelectionChanged
  5375. },
  5376. "binding": {
  5377. value: bindingInstance
  5378. }
  5379. });
  5380. for (var prop in subset) {
  5381. OSF.OUtil.defineEnumerableProperty(this, prop, {
  5382. value: subset[prop]
  5383. });
  5384. }
  5385. };
  5386. OSF.DDA.BindingDataChangedEventArgs=function OSF_DDA_BindingDataChangedEventArgs(bindingInstance) {
  5387. OSF.OUtil.defineEnumerableProperties(this, {
  5388. "type": {
  5389. value: Microsoft.Office.WebExtension.EventType.BindingDataChanged
  5390. },
  5391. "binding": {
  5392. value: bindingInstance
  5393. }
  5394. });
  5395. };
  5396. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5397. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  5398. fromHost: [
  5399. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  5400. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  5401. ],
  5402. isComplexType: true
  5403. });
  5404. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5405. type: OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,
  5406. fromHost: [
  5407. { name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5408. ],
  5409. isComplexType: true
  5410. });
  5411. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5412. type: OSF.DDA.EventDispId.dispidBindingDataChangedEvent,
  5413. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  5414. });
  5415. Microsoft.Office.WebExtension.CoercionType={
  5416. Text: "text",
  5417. Matrix: "matrix",
  5418. Table: "table"
  5419. };
  5420. OSF.DDA.DataCoercion=(function OSF_DDA_DataCoercion() {
  5421. return {
  5422. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5423. if (OSF.OUtil.isArray(obj)) {
  5424. var dim=0;
  5425. for (var index=0; index < obj.length; index++) {
  5426. dim=Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5427. }
  5428. return dim+1;
  5429. } else {
  5430. return 0;
  5431. }
  5432. },
  5433. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5434. switch (bindingType) {
  5435. case Microsoft.Office.WebExtension.BindingType.Matrix:
  5436. return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5437. case Microsoft.Office.WebExtension.BindingType.Table:
  5438. return Microsoft.Office.WebExtension.CoercionType.Table;
  5439. case Microsoft.Office.WebExtension.BindingType.Text:
  5440. default:
  5441. return Microsoft.Office.WebExtension.CoercionType.Text;
  5442. }
  5443. },
  5444. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5445. switch (coercionType) {
  5446. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5447. return Microsoft.Office.WebExtension.BindingType.Matrix;
  5448. case Microsoft.Office.WebExtension.CoercionType.Table:
  5449. return Microsoft.Office.WebExtension.BindingType.Table;
  5450. case Microsoft.Office.WebExtension.CoercionType.Text:
  5451. case Microsoft.Office.WebExtension.CoercionType.Html:
  5452. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5453. default:
  5454. return Microsoft.Office.WebExtension.BindingType.Text;
  5455. }
  5456. },
  5457. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5458. if (data==null || data==undefined)
  5459. return null;
  5460. var sourceType=null;
  5461. var runtimeType=typeof data;
  5462. if (data.rows !==undefined) {
  5463. sourceType=Microsoft.Office.WebExtension.CoercionType.Table;
  5464. } else if (OSF.OUtil.isArray(data)) {
  5465. sourceType=Microsoft.Office.WebExtension.CoercionType.Matrix;
  5466. } else if (runtimeType=="string" || runtimeType=="number" || runtimeType=="boolean" || OSF.OUtil.isDate(data)) {
  5467. sourceType=Microsoft.Office.WebExtension.CoercionType.Text;
  5468. } else {
  5469. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5470. }
  5471. return sourceType;
  5472. },
  5473. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5474. sourceType=sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5475. if (sourceType && sourceType !=destinationType) {
  5476. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5477. data=OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5478. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5479. }
  5480. return data;
  5481. },
  5482. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5483. if (matrix.length==1 && matrix[0].length==1)
  5484. return ""+matrix[0][0];
  5485. var val="";
  5486. for (var i=0; i < matrix.length; i++) {
  5487. val+=matrix[i].join("\t")+"\n";
  5488. }
  5489. return val.substring(0, val.length - 1);
  5490. },
  5491. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5492. var ret=text.split("\n");
  5493. for (var i=0; i < ret.length; i++)
  5494. ret[i]=ret[i].split("\t");
  5495. return ret;
  5496. },
  5497. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5498. var headers="";
  5499. if (table.headers !=null) {
  5500. headers=OSF.DDA.DataCoercion._matrixToText([table.headers])+"\n";
  5501. }
  5502. var rows=OSF.DDA.DataCoercion._matrixToText(table.rows);
  5503. if (rows=="") {
  5504. headers=headers.substring(0, headers.length - 1);
  5505. }
  5506. return headers+rows;
  5507. },
  5508. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5509. var matrix=table.rows;
  5510. if (table.headers !=null) {
  5511. matrix.unshift(table.headers);
  5512. }
  5513. return matrix;
  5514. },
  5515. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5516. var value;
  5517. switch (coercionType) {
  5518. case Microsoft.Office.WebExtension.CoercionType.Table:
  5519. value=table;
  5520. break;
  5521. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5522. value=OSF.DDA.DataCoercion._tableToMatrix(table);
  5523. break;
  5524. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  5525. value=null;
  5526. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  5527. value=OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  5528. }
  5529. if (value==null) {
  5530. value=OSF.DDA.DataCoercion._tableToText(table);
  5531. }
  5532. break;
  5533. case Microsoft.Office.WebExtension.CoercionType.Text:
  5534. case Microsoft.Office.WebExtension.CoercionType.Html:
  5535. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5536. default:
  5537. value=OSF.DDA.DataCoercion._tableToText(table);
  5538. break;
  5539. }
  5540. return value;
  5541. },
  5542. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  5543. if (sourceType==undefined) {
  5544. sourceType=OSF.DDA.DataCoercion.determineCoercionType(data);
  5545. }
  5546. var value;
  5547. switch (sourceType) {
  5548. case Microsoft.Office.WebExtension.CoercionType.Table:
  5549. value=data;
  5550. break;
  5551. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5552. value=new Microsoft.Office.WebExtension.TableData(data);
  5553. break;
  5554. case Microsoft.Office.WebExtension.CoercionType.Text:
  5555. case Microsoft.Office.WebExtension.CoercionType.Html:
  5556. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5557. default:
  5558. value=new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  5559. break;
  5560. }
  5561. return value;
  5562. }
  5563. };
  5564. })();
  5565. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5566. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5567. toHost: [
  5568. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  5569. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  5570. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  5571. ]
  5572. });
  5573. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Html: "html" });
  5574. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5575. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5576. toHost: [
  5577. { name: Microsoft.Office.WebExtension.CoercionType.Html, value: 3 }
  5578. ]
  5579. });
  5580. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { Ooxml: "ooxml" });
  5581. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5582. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5583. toHost: [
  5584. { name: Microsoft.Office.WebExtension.CoercionType.Ooxml, value: 4 }
  5585. ]
  5586. });
  5587. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { OoxmlPackage: "ooxmlPackage" });
  5588. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5589. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5590. toHost: [
  5591. { name: Microsoft.Office.WebExtension.CoercionType.OoxmlPackage, value: 5 }
  5592. ]
  5593. });
  5594. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType, { PdfFile: "pdf" });
  5595. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5596. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5597. toHost: [
  5598. { name: Microsoft.Office.WebExtension.CoercionType.PdfFile, value: 6 }
  5599. ]
  5600. });
  5601. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, { OnlyVisible: "onlyVisible" });
  5602. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5603. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  5604. toHost: [{ name: Microsoft.Office.WebExtension.FilterType.OnlyVisible, value: 1 }]
  5605. });
  5606. OSF.DDA.DataPartProperties={
  5607. Id: Microsoft.Office.WebExtension.Parameters.Id,
  5608. BuiltIn: "DataPartBuiltIn"
  5609. };
  5610. OSF.DDA.DataNodeProperties={
  5611. Handle: "DataNodeHandle",
  5612. BaseName: "DataNodeBaseName",
  5613. NamespaceUri: "DataNodeNamespaceUri",
  5614. NodeType: "DataNodeType"
  5615. };
  5616. OSF.DDA.DataNodeEventProperties={
  5617. OldNode: "OldNode",
  5618. NewNode: "NewNode",
  5619. NextSiblingNode: "NextSiblingNode",
  5620. InUndoRedo: "InUndoRedo"
  5621. };
  5622. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5623. DataPartProperties: "DataPartProperties",
  5624. DataNodeProperties: "DataNodeProperties"
  5625. });
  5626. OSF.OUtil.augmentList(OSF.DDA.ListDescriptors, {
  5627. DataPartList: "DataPartList",
  5628. DataNodeList: "DataNodeList"
  5629. });
  5630. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList, OSF.DDA.PropertyDescriptors.DataPartProperties);
  5631. OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList, OSF.DDA.PropertyDescriptors.DataNodeProperties);
  5632. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, {
  5633. DataNodeInsertedEvent: "DataNodeInsertedEvent",
  5634. DataNodeReplacedEvent: "DataNodeReplacedEvent",
  5635. DataNodeDeletedEvent: "DataNodeDeletedEvent"
  5636. });
  5637. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5638. DataNodeDeleted: "nodeDeleted",
  5639. DataNodeInserted: "nodeInserted",
  5640. DataNodeReplaced: "nodeReplaced"
  5641. });
  5642. OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() {
  5643. this._eventDispatches=[];
  5644. var am=OSF.DDA.AsyncMethodNames;
  5645. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5646. am.AddDataPartAsync,
  5647. am.GetDataPartByIdAsync,
  5648. am.GetDataPartsByNameSpaceAsync
  5649. ]);
  5650. };
  5651. OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) {
  5652. OSF.OUtil.defineEnumerableProperties(this, {
  5653. "builtIn": {
  5654. value: builtIn
  5655. },
  5656. "id": {
  5657. value: id
  5658. },
  5659. "namespaceManager": {
  5660. value: new OSF.DDA.CustomXmlPrefixMappings(id)
  5661. }
  5662. });
  5663. var am=OSF.DDA.AsyncMethodNames;
  5664. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5665. am.DeleteDataPartAsync,
  5666. am.GetPartNodesAsync,
  5667. am.GetPartXmlAsync
  5668. ]);
  5669. var customXmlPartEventDispatches=customXmlParts._eventDispatches;
  5670. var dispatch=customXmlPartEventDispatches[id];
  5671. if (!dispatch) {
  5672. var et=Microsoft.Office.WebExtension.EventType;
  5673. dispatch=new OSF.EventDispatch([
  5674. et.DataNodeDeleted,
  5675. et.DataNodeInserted,
  5676. et.DataNodeReplaced
  5677. ]);
  5678. customXmlPartEventDispatches[id]=dispatch;
  5679. }
  5680. OSF.DDA.DispIdHost.addEventSupport(this, dispatch);
  5681. };
  5682. OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) {
  5683. var am=OSF.DDA.AsyncMethodNames;
  5684. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5685. am.AddDataPartNamespaceAsync,
  5686. am.GetDataPartNamespaceAsync,
  5687. am.GetDataPartPrefixAsync
  5688. ], partId);
  5689. };
  5690. OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) {
  5691. OSF.OUtil.defineEnumerableProperties(this, {
  5692. "baseName": {
  5693. value: baseName
  5694. },
  5695. "namespaceUri": {
  5696. value: ns
  5697. },
  5698. "nodeType": {
  5699. value: nodeType
  5700. }
  5701. });
  5702. var am=OSF.DDA.AsyncMethodNames;
  5703. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  5704. am.GetRelativeNodesAsync,
  5705. am.GetNodeValueAsync,
  5706. am.GetNodeXmlAsync,
  5707. am.SetNodeValueAsync,
  5708. am.SetNodeXmlAsync
  5709. ], handle);
  5710. };
  5711. OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) {
  5712. OSF.OUtil.defineEnumerableProperties(this, {
  5713. "type": {
  5714. value: Microsoft.Office.WebExtension.EventType.DataNodeInserted
  5715. },
  5716. "newNode": {
  5717. value: newNode
  5718. },
  5719. "inUndoRedo": {
  5720. value: inUndoRedo
  5721. }
  5722. });
  5723. };
  5724. OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) {
  5725. OSF.OUtil.defineEnumerableProperties(this, {
  5726. "type": {
  5727. value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced
  5728. },
  5729. "oldNode": {
  5730. value: oldNode
  5731. },
  5732. "newNode": {
  5733. value: newNode
  5734. },
  5735. "inUndoRedo": {
  5736. value: inUndoRedo
  5737. }
  5738. });
  5739. };
  5740. OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) {
  5741. OSF.OUtil.defineEnumerableProperties(this, {
  5742. "type": {
  5743. value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted
  5744. },
  5745. "oldNode": {
  5746. value: oldNode
  5747. },
  5748. "oldNextSibling": {
  5749. value: oldNextSibling
  5750. },
  5751. "inUndoRedo": {
  5752. value: inUndoRedo
  5753. }
  5754. });
  5755. };
  5756. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  5757. OSF.DDA.OMFactory.manufactureDataNode=function OSF_DDA_OMFactory$manufactureDataNode(nodeProperties) {
  5758. if (nodeProperties) {
  5759. return new OSF.DDA.CustomXmlNode(nodeProperties[OSF.DDA.DataNodeProperties.Handle], nodeProperties[OSF.DDA.DataNodeProperties.NodeType], nodeProperties[OSF.DDA.DataNodeProperties.NamespaceUri], nodeProperties[OSF.DDA.DataNodeProperties.BaseName]);
  5760. }
  5761. };
  5762. OSF.DDA.OMFactory.manufactureDataPart=function OSF_DDA_OMFactory$manufactureDataPart(partProperties, containingCustomXmlParts) {
  5763. return new OSF.DDA.CustomXmlPart(containingCustomXmlParts, partProperties[OSF.DDA.DataPartProperties.Id], partProperties[OSF.DDA.DataPartProperties.BuiltIn]);
  5764. };
  5765. OSF.DDA.AsyncMethodNames.addNames({
  5766. AddDataPartAsync: "addAsync",
  5767. GetDataPartByIdAsync: "getByIdAsync",
  5768. GetDataPartsByNameSpaceAsync: "getByNamespaceAsync",
  5769. DeleteDataPartAsync: "deleteAsync",
  5770. GetPartNodesAsync: "getNodesAsync",
  5771. GetPartXmlAsync: "getXmlAsync",
  5772. AddDataPartNamespaceAsync: "addNamespaceAsync",
  5773. GetDataPartNamespaceAsync: "getNamespaceAsync",
  5774. GetDataPartPrefixAsync: "getPrefixAsync",
  5775. GetRelativeNodesAsync: "getNodesAsync",
  5776. GetNodeValueAsync: "getNodeValueAsync",
  5777. GetNodeXmlAsync: "getXmlAsync",
  5778. SetNodeValueAsync: "setNodeValueAsync",
  5779. SetNodeXmlAsync: "setXmlAsync"
  5780. });
  5781. (function () {
  5782. function processDataPart(dataPartDescriptor) {
  5783. return OSF.DDA.OMFactory.manufactureDataPart(dataPartDescriptor, Microsoft.Office.WebExtension.context.document.customXmlParts);
  5784. }
  5785. function processDataNode(dataNodeDescriptor) {
  5786. return OSF.DDA.OMFactory.manufactureDataNode(dataNodeDescriptor);
  5787. }
  5788. function processData(dataDescriptor, caller, callArgs) {
  5789. var data=dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  5790. return data==undefined ? null : data;
  5791. }
  5792. function getObjectId(obj) {
  5793. return obj.id;
  5794. }
  5795. function getPartId(part, partId) {
  5796. return partId;
  5797. }
  5798. ;
  5799. function getNodeHandle(node, nodeHandle) {
  5800. return nodeHandle;
  5801. }
  5802. ;
  5803. OSF.DDA.AsyncMethodCalls.define({
  5804. method: OSF.DDA.AsyncMethodNames.AddDataPartAsync,
  5805. requiredArguments: [
  5806. {
  5807. "name": Microsoft.Office.WebExtension.Parameters.Xml,
  5808. "types": ["string"]
  5809. }
  5810. ],
  5811. supportedOptions: [],
  5812. privateStateCallbacks: [],
  5813. onSucceeded: processDataPart
  5814. });
  5815. OSF.DDA.AsyncMethodCalls.define({
  5816. method: OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync,
  5817. requiredArguments: [
  5818. {
  5819. "name": Microsoft.Office.WebExtension.Parameters.Id,
  5820. "types": ["string"]
  5821. }
  5822. ],
  5823. supportedOptions: [],
  5824. privateStateCallbacks: [],
  5825. onSucceeded: processDataPart
  5826. });
  5827. OSF.DDA.AsyncMethodCalls.define({
  5828. method: OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync,
  5829. requiredArguments: [
  5830. {
  5831. "name": Microsoft.Office.WebExtension.Parameters.Namespace,
  5832. "types": ["string"]
  5833. }
  5834. ],
  5835. supportedOptions: [],
  5836. privateStateCallbacks: [],
  5837. onSucceeded: function (response) {
  5838. return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataPartList], processDataPart);
  5839. }
  5840. });
  5841. OSF.DDA.AsyncMethodCalls.define({
  5842. method: OSF.DDA.AsyncMethodNames.DeleteDataPartAsync,
  5843. requiredArguments: [],
  5844. supportedOptions: [],
  5845. privateStateCallbacks: [
  5846. {
  5847. name: OSF.DDA.DataPartProperties.Id,
  5848. value: getObjectId
  5849. }
  5850. ]
  5851. });
  5852. OSF.DDA.AsyncMethodCalls.define({
  5853. method: OSF.DDA.AsyncMethodNames.GetPartNodesAsync,
  5854. requiredArguments: [
  5855. {
  5856. "name": Microsoft.Office.WebExtension.Parameters.XPath,
  5857. "types": ["string"]
  5858. }
  5859. ],
  5860. supportedOptions: [],
  5861. privateStateCallbacks: [
  5862. {
  5863. name: OSF.DDA.DataPartProperties.Id,
  5864. value: getObjectId
  5865. }
  5866. ],
  5867. onSucceeded: function (response) {
  5868. return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode);
  5869. }
  5870. });
  5871. OSF.DDA.AsyncMethodCalls.define({
  5872. method: OSF.DDA.AsyncMethodNames.GetPartXmlAsync,
  5873. requiredArguments: [],
  5874. supportedOptions: [],
  5875. privateStateCallbacks: [
  5876. {
  5877. name: OSF.DDA.DataPartProperties.Id,
  5878. value: getObjectId
  5879. }
  5880. ],
  5881. onSucceeded: processData
  5882. });
  5883. OSF.DDA.AsyncMethodCalls.define({
  5884. method: OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync,
  5885. requiredArguments: [
  5886. {
  5887. "name": Microsoft.Office.WebExtension.Parameters.Prefix,
  5888. "types": ["string"]
  5889. },
  5890. {
  5891. "name": Microsoft.Office.WebExtension.Parameters.Namespace,
  5892. "types": ["string"]
  5893. }
  5894. ],
  5895. supportedOptions: [],
  5896. privateStateCallbacks: [
  5897. {
  5898. name: OSF.DDA.DataPartProperties.Id,
  5899. value: getPartId
  5900. }
  5901. ]
  5902. });
  5903. OSF.DDA.AsyncMethodCalls.define({
  5904. method: OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync,
  5905. requiredArguments: [
  5906. {
  5907. "name": Microsoft.Office.WebExtension.Parameters.Prefix,
  5908. "types": ["string"]
  5909. }
  5910. ],
  5911. supportedOptions: [],
  5912. privateStateCallbacks: [
  5913. {
  5914. name: OSF.DDA.DataPartProperties.Id,
  5915. value: getPartId
  5916. }
  5917. ],
  5918. onSucceeded: processData
  5919. });
  5920. OSF.DDA.AsyncMethodCalls.define({
  5921. method: OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync,
  5922. requiredArguments: [
  5923. {
  5924. "name": Microsoft.Office.WebExtension.Parameters.Namespace,
  5925. "types": ["string"]
  5926. }
  5927. ],
  5928. supportedOptions: [],
  5929. privateStateCallbacks: [
  5930. {
  5931. name: OSF.DDA.DataPartProperties.Id,
  5932. value: getPartId
  5933. }
  5934. ],
  5935. onSucceeded: processData
  5936. });
  5937. OSF.DDA.AsyncMethodCalls.define({
  5938. method: OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync,
  5939. requiredArguments: [
  5940. {
  5941. "name": Microsoft.Office.WebExtension.Parameters.XPath,
  5942. "types": ["string"]
  5943. }
  5944. ],
  5945. supportedOptions: [],
  5946. privateStateCallbacks: [
  5947. {
  5948. name: OSF.DDA.DataNodeProperties.Handle,
  5949. value: getNodeHandle
  5950. }
  5951. ],
  5952. onSucceeded: function (response) {
  5953. return OSF.OUtil.mapList(response[OSF.DDA.ListDescriptors.DataNodeList], processDataNode);
  5954. }
  5955. });
  5956. OSF.DDA.AsyncMethodCalls.define({
  5957. method: OSF.DDA.AsyncMethodNames.GetNodeValueAsync,
  5958. requiredArguments: [],
  5959. supportedOptions: [],
  5960. privateStateCallbacks: [
  5961. {
  5962. name: OSF.DDA.DataNodeProperties.Handle,
  5963. value: getNodeHandle
  5964. }
  5965. ],
  5966. onSucceeded: processData
  5967. });
  5968. OSF.DDA.AsyncMethodCalls.define({
  5969. method: OSF.DDA.AsyncMethodNames.GetNodeXmlAsync,
  5970. requiredArguments: [],
  5971. supportedOptions: [],
  5972. privateStateCallbacks: [
  5973. {
  5974. name: OSF.DDA.DataNodeProperties.Handle,
  5975. value: getNodeHandle
  5976. }
  5977. ],
  5978. onSucceeded: processData
  5979. });
  5980. OSF.DDA.AsyncMethodCalls.define({
  5981. method: OSF.DDA.AsyncMethodNames.SetNodeValueAsync,
  5982. requiredArguments: [
  5983. {
  5984. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5985. "types": ["string"]
  5986. }
  5987. ],
  5988. supportedOptions: [],
  5989. privateStateCallbacks: [
  5990. {
  5991. name: OSF.DDA.DataNodeProperties.Handle,
  5992. value: getNodeHandle
  5993. }
  5994. ]
  5995. });
  5996. OSF.DDA.AsyncMethodCalls.define({
  5997. method: OSF.DDA.AsyncMethodNames.SetNodeXmlAsync,
  5998. requiredArguments: [
  5999. {
  6000. "name": Microsoft.Office.WebExtension.Parameters.Xml,
  6001. "types": ["string"]
  6002. }
  6003. ],
  6004. supportedOptions: [],
  6005. privateStateCallbacks: [
  6006. {
  6007. name: OSF.DDA.DataNodeProperties.Handle,
  6008. value: getNodeHandle
  6009. }
  6010. ]
  6011. });
  6012. })();
  6013. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6014. type: OSF.DDA.PropertyDescriptors.DataPartProperties,
  6015. fromHost: [
  6016. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  6017. { name: OSF.DDA.DataPartProperties.BuiltIn, value: 1 }
  6018. ],
  6019. isComplexType: true
  6020. });
  6021. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6022. type: OSF.DDA.PropertyDescriptors.DataNodeProperties,
  6023. fromHost: [
  6024. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  6025. { name: OSF.DDA.DataNodeProperties.BaseName, value: 1 },
  6026. { name: OSF.DDA.DataNodeProperties.NamespaceUri, value: 2 },
  6027. { name: OSF.DDA.DataNodeProperties.NodeType, value: 3 }
  6028. ],
  6029. isComplexType: true
  6030. });
  6031. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6032. type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent,
  6033. fromHost: [
  6034. { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 },
  6035. { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 1 }
  6036. ],
  6037. isComplexType: true
  6038. });
  6039. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6040. type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent,
  6041. fromHost: [
  6042. { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 },
  6043. { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 },
  6044. { name: OSF.DDA.DataNodeEventProperties.NewNode, value: 2 }
  6045. ],
  6046. isComplexType: true
  6047. });
  6048. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6049. type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent,
  6050. fromHost: [
  6051. { name: OSF.DDA.DataNodeEventProperties.InUndoRedo, value: 0 },
  6052. { name: OSF.DDA.DataNodeEventProperties.OldNode, value: 1 },
  6053. { name: OSF.DDA.DataNodeEventProperties.NextSiblingNode, value: 2 }
  6054. ],
  6055. isComplexType: true
  6056. });
  6057. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6058. type: OSF.DDA.DataNodeEventProperties.OldNode,
  6059. fromHost: [
  6060. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6061. ],
  6062. isComplexType: true
  6063. });
  6064. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6065. type: OSF.DDA.DataNodeEventProperties.NewNode,
  6066. fromHost: [
  6067. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6068. ],
  6069. isComplexType: true
  6070. });
  6071. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6072. type: OSF.DDA.DataNodeEventProperties.NextSiblingNode,
  6073. fromHost: [
  6074. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6075. ],
  6076. isComplexType: true
  6077. });
  6078. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6079. type: OSF.DDA.MethodDispId.dispidAddDataPartMethod,
  6080. fromHost: [
  6081. { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6082. ],
  6083. toHost: [
  6084. { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 0 }
  6085. ]
  6086. });
  6087. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6088. type: OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod,
  6089. fromHost: [
  6090. { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6091. ],
  6092. toHost: [
  6093. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6094. ]
  6095. });
  6096. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6097. type: OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod,
  6098. fromHost: [
  6099. { name: OSF.DDA.ListDescriptors.DataPartList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6100. ],
  6101. toHost: [
  6102. { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 0 }
  6103. ]
  6104. });
  6105. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6106. type: OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod,
  6107. fromHost: [
  6108. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6109. ],
  6110. toHost: [
  6111. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6112. ]
  6113. });
  6114. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6115. type: OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod,
  6116. fromHost: [
  6117. { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6118. ],
  6119. toHost: [
  6120. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  6121. { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 }
  6122. ]
  6123. });
  6124. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6125. type: OSF.DDA.MethodDispId.dispidDeleteDataPartMethod,
  6126. toHost: [
  6127. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 }
  6128. ]
  6129. });
  6130. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6131. type: OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod,
  6132. fromHost: [
  6133. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6134. ],
  6135. toHost: [
  6136. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }
  6137. ]
  6138. });
  6139. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6140. type: OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod,
  6141. fromHost: [
  6142. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6143. ],
  6144. toHost: [
  6145. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }
  6146. ]
  6147. });
  6148. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6149. type: OSF.DDA.MethodDispId.dispidGetDataNodesMethod,
  6150. fromHost: [
  6151. { name: OSF.DDA.ListDescriptors.DataNodeList, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6152. ],
  6153. toHost: [
  6154. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  6155. { name: Microsoft.Office.WebExtension.Parameters.XPath, value: 1 }
  6156. ]
  6157. });
  6158. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6159. type: OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod,
  6160. toHost: [
  6161. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  6162. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 }
  6163. ]
  6164. });
  6165. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6166. type: OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod,
  6167. toHost: [
  6168. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  6169. { name: Microsoft.Office.WebExtension.Parameters.Xml, value: 1 }
  6170. ]
  6171. });
  6172. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6173. type: OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod,
  6174. toHost: [
  6175. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  6176. { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 },
  6177. { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 2 }
  6178. ]
  6179. });
  6180. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6181. type: OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod,
  6182. fromHost: [
  6183. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6184. ],
  6185. toHost: [
  6186. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  6187. { name: Microsoft.Office.WebExtension.Parameters.Prefix, value: 1 }
  6188. ]
  6189. });
  6190. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6191. type: OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod,
  6192. fromHost: [
  6193. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6194. ],
  6195. toHost: [
  6196. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  6197. { name: Microsoft.Office.WebExtension.Parameters.Namespace, value: 1 }
  6198. ]
  6199. });
  6200. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6201. type: OSF.DDA.EventDispId.dispidDataNodeAddedEvent,
  6202. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6203. });
  6204. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6205. type: OSF.DDA.EventDispId.dispidDataNodeReplacedEvent,
  6206. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6207. });
  6208. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6209. type: OSF.DDA.EventDispId.dispidDataNodeDeletedEvent,
  6210. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }]
  6211. });
  6212. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6213. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  6214. fromHost: [
  6215. { name: OSF.DDA.FilePropertiesDescriptor.Url, value: 0 }
  6216. ],
  6217. isComplexType: true
  6218. });
  6219. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6220. type: OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,
  6221. fromHost: [
  6222. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6223. ]
  6224. });
  6225. OSF.DDA.AsyncMethodNames.addNames({
  6226. ExecuteRichApiRequestAsync: "executeRichApiRequestAsync"
  6227. });
  6228. OSF.DDA.AsyncMethodCalls.define({
  6229. method: OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,
  6230. requiredArguments: [
  6231. {
  6232. name: Microsoft.Office.WebExtension.Parameters.Data,
  6233. types: ["object"]
  6234. }
  6235. ],
  6236. supportedOptions: []
  6237. });
  6238. OSF.OUtil.setNamespace("RichApi", OSF.DDA);
  6239. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6240. type: OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,
  6241. toHost: [
  6242. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 }
  6243. ],
  6244. fromHost: [
  6245. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6246. ]
  6247. });
  6248. OSF.DDA.WordDocument=function OSF_DDA_WordDocument(officeAppContext, settings) {
  6249. OSF.DDA.WordDocument.uber.constructor.call(this, officeAppContext, new OSF.DDA.BindingFacade(this), settings);
  6250. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6251. OSF.DDA.AsyncMethodNames.GoToByIdAsync,
  6252. OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,
  6253. OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync
  6254. ]);
  6255. OSF.OUtil.defineEnumerableProperty(this, "customXmlParts", {
  6256. value: new OSF.DDA.CustomXmlParts()
  6257. });
  6258. OSF.OUtil.finalizeProperties(this);
  6259. };
  6260. OSF.OUtil.extend(OSF.DDA.WordDocument, OSF.DDA.JsomDocument);
  6261. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  6262. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  6263. appContext.doc=new OSF.DDA.WordDocument(appContext, this._initializeSettings(false));
  6264. OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi, [OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]);
  6265. appReady();
  6266. };
  6267. var OfficeExtension;
  6268. (function (OfficeExtension) {
  6269. var Action=(function () {
  6270. function Action(actionInfo, isWriteOperation) {
  6271. this.m_actionInfo=actionInfo;
  6272. this.m_isWriteOperation=isWriteOperation;
  6273. }
  6274. Object.defineProperty(Action.prototype, "actionInfo", {
  6275. get: function () {
  6276. return this.m_actionInfo;
  6277. },
  6278. enumerable: true,
  6279. configurable: true
  6280. });
  6281. Object.defineProperty(Action.prototype, "isWriteOperation", {
  6282. get: function () {
  6283. return this.m_isWriteOperation;
  6284. },
  6285. enumerable: true,
  6286. configurable: true
  6287. });
  6288. return Action;
  6289. })();
  6290. OfficeExtension.Action=Action;
  6291. })(OfficeExtension || (OfficeExtension={}));
  6292. var OfficeExtension;
  6293. (function (OfficeExtension) {
  6294. var ActionFactory=(function () {
  6295. function ActionFactory() {
  6296. }
  6297. ActionFactory.createSetPropertyAction=function (context, parent, propertyName, value) {
  6298. OfficeExtension.Utility.validateObjectPath(parent);
  6299. var actionInfo={
  6300. Id: context._nextId(),
  6301. ActionType: 4 ,
  6302. Name: propertyName,
  6303. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6304. ArgumentInfo: {}
  6305. };
  6306. var args=[value];
  6307. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  6308. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  6309. var ret=new OfficeExtension.Action(actionInfo, true);
  6310. context._pendingRequest.addAction(ret);
  6311. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6312. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  6313. return ret;
  6314. };
  6315. ActionFactory.createMethodAction=function (context, parent, methodName, operationType, args) {
  6316. OfficeExtension.Utility.validateObjectPath(parent);
  6317. var actionInfo={
  6318. Id: context._nextId(),
  6319. ActionType: 3 ,
  6320. Name: methodName,
  6321. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6322. ArgumentInfo: {}
  6323. };
  6324. var referencedArgumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, actionInfo.ArgumentInfo, args);
  6325. OfficeExtension.Utility.validateReferencedObjectPaths(referencedArgumentObjectPaths);
  6326. var isWriteOperation=operationType !=1 ;
  6327. var ret=new OfficeExtension.Action(actionInfo, isWriteOperation);
  6328. context._pendingRequest.addAction(ret);
  6329. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6330. context._pendingRequest.addReferencedObjectPaths(referencedArgumentObjectPaths);
  6331. return ret;
  6332. };
  6333. ActionFactory.createQueryAction=function (context, parent, queryOption) {
  6334. OfficeExtension.Utility.validateObjectPath(parent);
  6335. var actionInfo={
  6336. Id: context._nextId(),
  6337. ActionType: 2 ,
  6338. Name: "",
  6339. ObjectPathId: parent._objectPath.objectPathInfo.Id,
  6340. };
  6341. actionInfo.QueryInfo=queryOption;
  6342. var ret=new OfficeExtension.Action(actionInfo, false);
  6343. context._pendingRequest.addAction(ret);
  6344. context._pendingRequest.addReferencedObjectPath(parent._objectPath);
  6345. return ret;
  6346. };
  6347. ActionFactory.createInstantiateAction=function (context, obj) {
  6348. OfficeExtension.Utility.validateObjectPath(obj);
  6349. var actionInfo={
  6350. Id: context._nextId(),
  6351. ActionType: 1 ,
  6352. Name: "",
  6353. ObjectPathId: obj._objectPath.objectPathInfo.Id
  6354. };
  6355. var ret=new OfficeExtension.Action(actionInfo, false);
  6356. context._pendingRequest.addAction(ret);
  6357. context._pendingRequest.addReferencedObjectPath(obj._objectPath);
  6358. context._pendingRequest.addActionResultHandler(ret, new OfficeExtension.InstantiateActionResultHandler(obj));
  6359. return ret;
  6360. };
  6361. ActionFactory.createTraceAction=function (context, message) {
  6362. var actionInfo={
  6363. Id: context._nextId(),
  6364. ActionType: 5 ,
  6365. Name: "Trace",
  6366. ObjectPathId: 0
  6367. };
  6368. var ret=new OfficeExtension.Action(actionInfo, false);
  6369. context._pendingRequest.addAction(ret);
  6370. context._pendingRequest.addTrace(actionInfo.Id, message);
  6371. return ret;
  6372. };
  6373. return ActionFactory;
  6374. })();
  6375. OfficeExtension.ActionFactory=ActionFactory;
  6376. })(OfficeExtension || (OfficeExtension={}));
  6377. var OfficeExtension;
  6378. (function (OfficeExtension) {
  6379. var ClientObject=(function () {
  6380. function ClientObject(context, objectPath) {
  6381. OfficeExtension.Utility.checkArgumentNull(context, "context");
  6382. this.m_context=context;
  6383. this.m_objectPath=objectPath;
  6384. if (this.m_objectPath) {
  6385. if (!context._processingResult) {
  6386. OfficeExtension.ActionFactory.createInstantiateAction(context, this);
  6387. if ((context._autoCleanup) && (this._KeepReference)) {
  6388. context.trackedObjects._autoAdd(this);
  6389. }
  6390. }
  6391. }
  6392. }
  6393. Object.defineProperty(ClientObject.prototype, "context", {
  6394. get: function () {
  6395. return this.m_context;
  6396. },
  6397. enumerable: true,
  6398. configurable: true
  6399. });
  6400. Object.defineProperty(ClientObject.prototype, "_objectPath", {
  6401. get: function () {
  6402. return this.m_objectPath;
  6403. },
  6404. set: function (value) {
  6405. this.m_objectPath=value;
  6406. },
  6407. enumerable: true,
  6408. configurable: true
  6409. });
  6410. ClientObject.prototype._handleResult=function (value) {
  6411. };
  6412. return ClientObject;
  6413. })();
  6414. OfficeExtension.ClientObject=ClientObject;
  6415. })(OfficeExtension || (OfficeExtension={}));
  6416. var OfficeExtension;
  6417. (function (OfficeExtension) {
  6418. var ClientRequest=(function () {
  6419. function ClientRequest(context) {
  6420. this.m_context=context;
  6421. this.m_actions=[];
  6422. this.m_actionResultHandler={};
  6423. this.m_referencedObjectPaths={};
  6424. this.m_flags=0 ;
  6425. this.m_traceInfos={};
  6426. }
  6427. Object.defineProperty(ClientRequest.prototype, "flags", {
  6428. get: function () {
  6429. return this.m_flags;
  6430. },
  6431. enumerable: true,
  6432. configurable: true
  6433. });
  6434. Object.defineProperty(ClientRequest.prototype, "traceInfos", {
  6435. get: function () {
  6436. return this.m_traceInfos;
  6437. },
  6438. enumerable: true,
  6439. configurable: true
  6440. });
  6441. ClientRequest.prototype.addAction=function (action) {
  6442. if (action.isWriteOperation) {
  6443. this.m_flags=this.m_flags | 1 ;
  6444. }
  6445. this.m_actions.push(action);
  6446. };
  6447. Object.defineProperty(ClientRequest.prototype, "hasActions", {
  6448. get: function () {
  6449. return this.m_actions.length > 0;
  6450. },
  6451. enumerable: true,
  6452. configurable: true
  6453. });
  6454. ClientRequest.prototype.addTrace=function (actionId, message) {
  6455. this.m_traceInfos[actionId]=message;
  6456. };
  6457. ClientRequest.prototype.addReferencedObjectPath=function (objectPath) {
  6458. if (this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]) {
  6459. return;
  6460. }
  6461. if (!objectPath.isValid) {
  6462. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, OfficeExtension.Utility.getObjectPathExpression(objectPath));
  6463. }
  6464. while (objectPath) {
  6465. if (objectPath.isWriteOperation) {
  6466. this.m_flags=this.m_flags | 1 ;
  6467. }
  6468. this.m_referencedObjectPaths[objectPath.objectPathInfo.Id]=objectPath;
  6469. if (objectPath.objectPathInfo.ObjectPathType==3 ) {
  6470. this.addReferencedObjectPaths(objectPath.argumentObjectPaths);
  6471. }
  6472. objectPath=objectPath.parentObjectPath;
  6473. }
  6474. };
  6475. ClientRequest.prototype.addReferencedObjectPaths=function (objectPaths) {
  6476. if (objectPaths) {
  6477. for (var i=0; i < objectPaths.length; i++) {
  6478. this.addReferencedObjectPath(objectPaths[i]);
  6479. }
  6480. }
  6481. };
  6482. ClientRequest.prototype.addActionResultHandler=function (action, resultHandler) {
  6483. this.m_actionResultHandler[action.actionInfo.Id]=resultHandler;
  6484. };
  6485. ClientRequest.prototype.buildRequestMessageBody=function () {
  6486. var objectPaths={};
  6487. for (var i in this.m_referencedObjectPaths) {
  6488. objectPaths[i]=this.m_referencedObjectPaths[i].objectPathInfo;
  6489. }
  6490. var actions=[];
  6491. for (var index=0; index < this.m_actions.length; index++) {
  6492. actions.push(this.m_actions[index].actionInfo);
  6493. }
  6494. var ret={
  6495. Actions: actions,
  6496. ObjectPaths: objectPaths
  6497. };
  6498. return ret;
  6499. };
  6500. ClientRequest.prototype.processResponse=function (msg) {
  6501. if (msg && msg.Results) {
  6502. for (var i=0; i < msg.Results.length; i++) {
  6503. var actionResult=msg.Results[i];
  6504. var handler=this.m_actionResultHandler[actionResult.ActionId];
  6505. if (handler) {
  6506. handler._handleResult(actionResult.Value);
  6507. }
  6508. }
  6509. }
  6510. };
  6511. ClientRequest.prototype.invalidatePendingInvalidObjectPaths=function () {
  6512. for (var i in this.m_referencedObjectPaths) {
  6513. if (this.m_referencedObjectPaths[i].isInvalidAfterRequest) {
  6514. this.m_referencedObjectPaths[i].isValid=false;
  6515. }
  6516. }
  6517. };
  6518. return ClientRequest;
  6519. })();
  6520. OfficeExtension.ClientRequest=ClientRequest;
  6521. })(OfficeExtension || (OfficeExtension={}));
  6522. var OfficeExtension;
  6523. (function (OfficeExtension) {
  6524. var ClientRequestContext=(function () {
  6525. function ClientRequestContext(url) {
  6526. this.m_nextId=0;
  6527. this.m_url=url;
  6528. if (OfficeExtension.Utility.isNullOrEmptyString(this.m_url)) {
  6529. this.m_url=OfficeExtension.Constants.localDocument;
  6530. }
  6531. this._processingResult=false;
  6532. this._customData=OfficeExtension.Constants.iterativeExecutor;
  6533. this._requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  6534. this.sync=this.sync.bind(this);
  6535. }
  6536. Object.defineProperty(ClientRequestContext.prototype, "_pendingRequest", {
  6537. get: function () {
  6538. if (this.m_pendingRequest==null) {
  6539. this.m_pendingRequest=new OfficeExtension.ClientRequest(this);
  6540. }
  6541. return this.m_pendingRequest;
  6542. },
  6543. enumerable: true,
  6544. configurable: true
  6545. });
  6546. Object.defineProperty(ClientRequestContext.prototype, "trackedObjects", {
  6547. get: function () {
  6548. if (!this.m_trackedObjects) {
  6549. this.m_trackedObjects=new OfficeExtension.TrackedObjects(this);
  6550. }
  6551. return this.m_trackedObjects;
  6552. },
  6553. enumerable: true,
  6554. configurable: true
  6555. });
  6556. ClientRequestContext.prototype.load=function (clientObj, option) {
  6557. OfficeExtension.Utility.validateContext(this, clientObj);
  6558. var queryOption={};
  6559. if (typeof (option)=="string") {
  6560. var select=option;
  6561. queryOption.Select=this.parseSelectExpand(select);
  6562. }
  6563. else if (Array.isArray(option)) {
  6564. queryOption.Select=option;
  6565. }
  6566. else if (typeof (option)=="object") {
  6567. var loadOption=option;
  6568. if (typeof (loadOption.select)=="string") {
  6569. queryOption.Select=this.parseSelectExpand(loadOption.select);
  6570. }
  6571. else if (Array.isArray(loadOption.select)) {
  6572. queryOption.Select=loadOption.select;
  6573. }
  6574. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.select)) {
  6575. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.select");
  6576. }
  6577. if (typeof (loadOption.expand)=="string") {
  6578. queryOption.Expand=this.parseSelectExpand(loadOption.expand);
  6579. }
  6580. else if (Array.isArray(loadOption.expand)) {
  6581. queryOption.Expand=loadOption.expand;
  6582. }
  6583. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.expand)) {
  6584. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.expand");
  6585. }
  6586. if (typeof (loadOption.top)=="number") {
  6587. queryOption.Top=loadOption.top;
  6588. }
  6589. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.top)) {
  6590. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.top");
  6591. }
  6592. if (typeof (loadOption.skip)=="number") {
  6593. queryOption.Skip=loadOption.skip;
  6594. }
  6595. else if (!OfficeExtension.Utility.isNullOrUndefined(loadOption.skip)) {
  6596. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option.skip");
  6597. }
  6598. }
  6599. else if (!OfficeExtension.Utility.isNullOrUndefined(option)) {
  6600. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "option");
  6601. }
  6602. var action=OfficeExtension.ActionFactory.createQueryAction(this, clientObj, queryOption);
  6603. this._pendingRequest.addActionResultHandler(action, clientObj);
  6604. };
  6605. ClientRequestContext.prototype.trace=function (message) {
  6606. OfficeExtension.ActionFactory.createTraceAction(this, message);
  6607. };
  6608. ClientRequestContext.prototype.parseSelectExpand=function (select) {
  6609. var args=[];
  6610. if (!OfficeExtension.Utility.isNullOrEmptyString(select)) {
  6611. var propertyNames=select.split(",");
  6612. for (var i=0; i < propertyNames.length; i++) {
  6613. var propertyName=propertyNames[i];
  6614. propertyName=propertyName.trim();
  6615. args.push(propertyName);
  6616. }
  6617. }
  6618. return args;
  6619. };
  6620. ClientRequestContext.prototype.syncPrivate=function (doneCallback, failCallback) {
  6621. var req=this._pendingRequest;
  6622. if (!req.hasActions) {
  6623. doneCallback();
  6624. return;
  6625. }
  6626. this.m_pendingRequest=null;
  6627. var msgBody=req.buildRequestMessageBody();
  6628. var requestFlags=req.flags;
  6629. var requestExecutor=this._requestExecutor;
  6630. if (!requestExecutor) {
  6631. requestExecutor=new OfficeExtension.OfficeJsRequestExecutor();
  6632. }
  6633. var requestExecutorRequestMessage={
  6634. Url: this.m_url,
  6635. Headers: null,
  6636. Body: msgBody
  6637. };
  6638. req.invalidatePendingInvalidObjectPaths();
  6639. var thisObj=this;
  6640. requestExecutor.executeAsync(this._customData, requestFlags, requestExecutorRequestMessage, function (response) {
  6641. var error;
  6642. var traceMessages=new Array();
  6643. if (!OfficeExtension.Utility.isNullOrEmptyString(response.ErrorCode)) {
  6644. error=new OfficeExtension._Internal.RuntimeError(response.ErrorCode, response.ErrorMessage, traceMessages, {});
  6645. }
  6646. else if (response.Body && response.Body.Error) {
  6647. error=new OfficeExtension._Internal.RuntimeError(response.Body.Error.Code, response.Body.Error.Message, traceMessages, {
  6648. errorLocation: response.Body.Error.Location
  6649. });
  6650. }
  6651. if (response.Body && response.Body.TraceIds) {
  6652. var traceMessageMap=req.traceInfos;
  6653. for (var i=0; i < response.Body.TraceIds.length; i++) {
  6654. var traceId=response.Body.TraceIds[i];
  6655. var message=traceMessageMap[traceId];
  6656. traceMessages.push(message);
  6657. }
  6658. }
  6659. if (error) {
  6660. failCallback(error);
  6661. return;
  6662. }
  6663. else {
  6664. thisObj._processingResult=true;
  6665. try {
  6666. req.processResponse(response.Body);
  6667. }
  6668. finally {
  6669. thisObj._processingResult=false;
  6670. }
  6671. doneCallback();
  6672. return;
  6673. }
  6674. });
  6675. };
  6676. ClientRequestContext.prototype.sync=function (passThroughValue) {
  6677. var _this=this;
  6678. OfficeExtension._EnsurePromise();
  6679. return new OfficeExtension['Promise'](function (resolve, reject) {
  6680. _this.syncPrivate(function () {
  6681. resolve(passThroughValue);
  6682. }, function (error) {
  6683. reject(error);
  6684. });
  6685. });
  6686. };
  6687. ClientRequestContext._run=function (ctxInitializer, batch, numCleanupAttempts, retryDelay, onCleanupSuccess, onCleanupFailure) {
  6688. if (numCleanupAttempts===void 0) { numCleanupAttempts=3; }
  6689. if (retryDelay===void 0) { retryDelay=5000; }
  6690. OfficeExtension._EnsurePromise();
  6691. var starterPromise=new OfficeExtension['Promise'](function (resolve, reject) {
  6692. resolve();
  6693. });
  6694. var ctx;
  6695. var succeeded=false;
  6696. var resultOrError;
  6697. return starterPromise.then(function () {
  6698. ctx=ctxInitializer();
  6699. ctx._autoCleanup=true;
  6700. var batchResult=batch(ctx);
  6701. if (OfficeExtension.Utility.isNullOrUndefined(batchResult) || (typeof batchResult.then !=='function')) {
  6702. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.runMustReturnPromise);
  6703. }
  6704. return batchResult;
  6705. }).then(function (batchResult) {
  6706. return ctx.sync(batchResult);
  6707. }).then(function (result) {
  6708. succeeded=true;
  6709. resultOrError=result;
  6710. }).catch(function (error) {
  6711. resultOrError=error;
  6712. }).then(function () {
  6713. var itemsToRemove=ctx.trackedObjects._retrieveAndClearAutoCleanupList();
  6714. ctx._autoCleanup=false;
  6715. for (var key in itemsToRemove) {
  6716. itemsToRemove[key]._objectPath.isValid=false;
  6717. }
  6718. var cleanupCounter=0;
  6719. attemptCleanup();
  6720. function attemptCleanup() {
  6721. cleanupCounter++;
  6722. for (var key in itemsToRemove) {
  6723. ctx.trackedObjects.remove(itemsToRemove[key]);
  6724. }
  6725. ctx.sync().then(function () {
  6726. if (onCleanupSuccess) {
  6727. onCleanupSuccess(cleanupCounter);
  6728. }
  6729. }).catch(function () {
  6730. if (onCleanupFailure) {
  6731. onCleanupFailure(cleanupCounter);
  6732. }
  6733. if (cleanupCounter < numCleanupAttempts) {
  6734. setTimeout(function () {
  6735. attemptCleanup();
  6736. }, retryDelay);
  6737. }
  6738. });
  6739. }
  6740. }).then(function () {
  6741. if (succeeded) {
  6742. return resultOrError;
  6743. }
  6744. else {
  6745. throw resultOrError;
  6746. }
  6747. });
  6748. };
  6749. ClientRequestContext.prototype._nextId=function () {
  6750. return++this.m_nextId;
  6751. };
  6752. return ClientRequestContext;
  6753. })();
  6754. OfficeExtension.ClientRequestContext=ClientRequestContext;
  6755. })(OfficeExtension || (OfficeExtension={}));
  6756. var OfficeExtension;
  6757. (function (OfficeExtension) {
  6758. (function (ClientRequestFlags) {
  6759. ClientRequestFlags[ClientRequestFlags["None"]=0]="None";
  6760. ClientRequestFlags[ClientRequestFlags["WriteOperation"]=1]="WriteOperation";
  6761. })(OfficeExtension.ClientRequestFlags || (OfficeExtension.ClientRequestFlags={}));
  6762. var ClientRequestFlags=OfficeExtension.ClientRequestFlags;
  6763. })(OfficeExtension || (OfficeExtension={}));
  6764. var OfficeExtension;
  6765. (function (OfficeExtension) {
  6766. var ClientResult=(function () {
  6767. function ClientResult() {
  6768. }
  6769. Object.defineProperty(ClientResult.prototype, "value", {
  6770. get: function () {
  6771. return this.m_value;
  6772. },
  6773. enumerable: true,
  6774. configurable: true
  6775. });
  6776. ClientResult.prototype._handleResult=function (value) {
  6777. this.m_value=value;
  6778. };
  6779. return ClientResult;
  6780. })();
  6781. OfficeExtension.ClientResult=ClientResult;
  6782. })(OfficeExtension || (OfficeExtension={}));
  6783. var OfficeExtension;
  6784. (function (OfficeExtension) {
  6785. var Constants=(function () {
  6786. function Constants() {
  6787. }
  6788. Constants.getItemAt="GetItemAt";
  6789. Constants.id="Id";
  6790. Constants.idPrivate="_Id";
  6791. Constants.index="_Index";
  6792. Constants.items="_Items";
  6793. Constants.iterativeExecutor="IterativeExecutor";
  6794. Constants.localDocument="http://document.localhost/";
  6795. Constants.localDocumentApiPrefix="http://document.localhost/_api/";
  6796. Constants.referenceId="_ReferenceId";
  6797. return Constants;
  6798. })();
  6799. OfficeExtension.Constants=Constants;
  6800. })(OfficeExtension || (OfficeExtension={}));
  6801. var __extends=this.__extends || function (d, b) {
  6802. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  6803. function __() { this.constructor=d; }
  6804. __.prototype=b.prototype;
  6805. d.prototype=new __();
  6806. };
  6807. var OfficeExtension;
  6808. (function (OfficeExtension) {
  6809. var _Internal;
  6810. (function (_Internal) {
  6811. var RuntimeError=(function (_super) {
  6812. __extends(RuntimeError, _super);
  6813. function RuntimeError(code, message, traceMessages, debugInfo) {
  6814. _super.call(this, message);
  6815. this.name="OfficeExtension.Error";
  6816. this.code=code;
  6817. this.message=message;
  6818. this.traceMessages=traceMessages;
  6819. this.debugInfo=debugInfo;
  6820. }
  6821. RuntimeError.prototype.toString=function () {
  6822. return this.code+': '+this.message;
  6823. };
  6824. return RuntimeError;
  6825. })(Error);
  6826. _Internal.RuntimeError=RuntimeError;
  6827. })(_Internal=OfficeExtension._Internal || (OfficeExtension._Internal={}));
  6828. OfficeExtension.Error=OfficeExtension._Internal.RuntimeError;
  6829. })(OfficeExtension || (OfficeExtension={}));
  6830. var OfficeExtension;
  6831. (function (OfficeExtension) {
  6832. var ErrorCodes=(function () {
  6833. function ErrorCodes() {
  6834. }
  6835. ErrorCodes.accessDenied="AccessDenied";
  6836. ErrorCodes.generalException="GeneralException";
  6837. ErrorCodes.activityLimitReached="ActivityLimitReached";
  6838. return ErrorCodes;
  6839. })();
  6840. OfficeExtension.ErrorCodes=ErrorCodes;
  6841. })(OfficeExtension || (OfficeExtension={}));
  6842. var OfficeExtension;
  6843. (function (OfficeExtension) {
  6844. var InstantiateActionResultHandler=(function () {
  6845. function InstantiateActionResultHandler(clientObject) {
  6846. this.m_clientObject=clientObject;
  6847. }
  6848. InstantiateActionResultHandler.prototype._handleResult=function (value) {
  6849. OfficeExtension.Utility.fixObjectPathIfNecessary(this.m_clientObject, value);
  6850. if (value && !OfficeExtension.Utility.isNullOrUndefined(value[OfficeExtension.Constants.referenceId]) && this.m_clientObject._initReferenceId) {
  6851. this.m_clientObject._initReferenceId(value[OfficeExtension.Constants.referenceId]);
  6852. }
  6853. };
  6854. return InstantiateActionResultHandler;
  6855. })();
  6856. OfficeExtension.InstantiateActionResultHandler=InstantiateActionResultHandler;
  6857. })(OfficeExtension || (OfficeExtension={}));
  6858. var OfficeExtension;
  6859. (function (OfficeExtension) {
  6860. (function (RichApiRequestMessageIndex) {
  6861. RichApiRequestMessageIndex[RichApiRequestMessageIndex["CustomData"]=0]="CustomData";
  6862. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Method"]=1]="Method";
  6863. RichApiRequestMessageIndex[RichApiRequestMessageIndex["PathAndQuery"]=2]="PathAndQuery";
  6864. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Headers"]=3]="Headers";
  6865. RichApiRequestMessageIndex[RichApiRequestMessageIndex["Body"]=4]="Body";
  6866. RichApiRequestMessageIndex[RichApiRequestMessageIndex["AppPermission"]=5]="AppPermission";
  6867. RichApiRequestMessageIndex[RichApiRequestMessageIndex["RequestFlags"]=6]="RequestFlags";
  6868. })(OfficeExtension.RichApiRequestMessageIndex || (OfficeExtension.RichApiRequestMessageIndex={}));
  6869. var RichApiRequestMessageIndex=OfficeExtension.RichApiRequestMessageIndex;
  6870. (function (RichApiResponseMessageIndex) {
  6871. RichApiResponseMessageIndex[RichApiResponseMessageIndex["StatusCode"]=0]="StatusCode";
  6872. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Headers"]=1]="Headers";
  6873. RichApiResponseMessageIndex[RichApiResponseMessageIndex["Body"]=2]="Body";
  6874. })(OfficeExtension.RichApiResponseMessageIndex || (OfficeExtension.RichApiResponseMessageIndex={}));
  6875. var RichApiResponseMessageIndex=OfficeExtension.RichApiResponseMessageIndex;
  6876. ;
  6877. (function (ActionType) {
  6878. ActionType[ActionType["Instantiate"]=1]="Instantiate";
  6879. ActionType[ActionType["Query"]=2]="Query";
  6880. ActionType[ActionType["Method"]=3]="Method";
  6881. ActionType[ActionType["SetProperty"]=4]="SetProperty";
  6882. ActionType[ActionType["Trace"]=5]="Trace";
  6883. })(OfficeExtension.ActionType || (OfficeExtension.ActionType={}));
  6884. var ActionType=OfficeExtension.ActionType;
  6885. (function (ObjectPathType) {
  6886. ObjectPathType[ObjectPathType["GlobalObject"]=1]="GlobalObject";
  6887. ObjectPathType[ObjectPathType["NewObject"]=2]="NewObject";
  6888. ObjectPathType[ObjectPathType["Method"]=3]="Method";
  6889. ObjectPathType[ObjectPathType["Property"]=4]="Property";
  6890. ObjectPathType[ObjectPathType["Indexer"]=5]="Indexer";
  6891. ObjectPathType[ObjectPathType["ReferenceId"]=6]="ReferenceId";
  6892. })(OfficeExtension.ObjectPathType || (OfficeExtension.ObjectPathType={}));
  6893. var ObjectPathType=OfficeExtension.ObjectPathType;
  6894. })(OfficeExtension || (OfficeExtension={}));
  6895. var OfficeExtension;
  6896. (function (OfficeExtension) {
  6897. var ObjectPath=(function () {
  6898. function ObjectPath(objectPathInfo, parentObjectPath, isCollection, isInvalidAfterRequest) {
  6899. this.m_objectPathInfo=objectPathInfo;
  6900. this.m_parentObjectPath=parentObjectPath;
  6901. this.m_isWriteOperation=false;
  6902. this.m_isCollection=isCollection;
  6903. this.m_isInvalidAfterRequest=isInvalidAfterRequest;
  6904. this.m_isValid=true;
  6905. }
  6906. Object.defineProperty(ObjectPath.prototype, "objectPathInfo", {
  6907. get: function () {
  6908. return this.m_objectPathInfo;
  6909. },
  6910. enumerable: true,
  6911. configurable: true
  6912. });
  6913. Object.defineProperty(ObjectPath.prototype, "isWriteOperation", {
  6914. get: function () {
  6915. return this.m_isWriteOperation;
  6916. },
  6917. set: function (value) {
  6918. this.m_isWriteOperation=value;
  6919. },
  6920. enumerable: true,
  6921. configurable: true
  6922. });
  6923. Object.defineProperty(ObjectPath.prototype, "isCollection", {
  6924. get: function () {
  6925. return this.m_isCollection;
  6926. },
  6927. enumerable: true,
  6928. configurable: true
  6929. });
  6930. Object.defineProperty(ObjectPath.prototype, "isInvalidAfterRequest", {
  6931. get: function () {
  6932. return this.m_isInvalidAfterRequest;
  6933. },
  6934. enumerable: true,
  6935. configurable: true
  6936. });
  6937. Object.defineProperty(ObjectPath.prototype, "parentObjectPath", {
  6938. get: function () {
  6939. return this.m_parentObjectPath;
  6940. },
  6941. enumerable: true,
  6942. configurable: true
  6943. });
  6944. Object.defineProperty(ObjectPath.prototype, "argumentObjectPaths", {
  6945. get: function () {
  6946. return this.m_argumentObjectPaths;
  6947. },
  6948. set: function (value) {
  6949. this.m_argumentObjectPaths=value;
  6950. },
  6951. enumerable: true,
  6952. configurable: true
  6953. });
  6954. Object.defineProperty(ObjectPath.prototype, "isValid", {
  6955. get: function () {
  6956. return this.m_isValid;
  6957. },
  6958. set: function (value) {
  6959. this.m_isValid=value;
  6960. },
  6961. enumerable: true,
  6962. configurable: true
  6963. });
  6964. ObjectPath.prototype.updateUsingObjectData=function (value) {
  6965. var referenceId=value[OfficeExtension.Constants.referenceId];
  6966. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  6967. this.m_isInvalidAfterRequest=false;
  6968. this.m_isValid=true;
  6969. this.m_objectPathInfo.ObjectPathType=6 ;
  6970. this.m_objectPathInfo.Name=referenceId;
  6971. this.m_objectPathInfo.ArgumentInfo={};
  6972. this.m_parentObjectPath=null;
  6973. this.m_argumentObjectPaths=null;
  6974. return;
  6975. }
  6976. if (this.parentObjectPath && this.parentObjectPath.isCollection) {
  6977. var id=value[OfficeExtension.Constants.id];
  6978. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  6979. id=value[OfficeExtension.Constants.idPrivate];
  6980. }
  6981. if (!OfficeExtension.Utility.isNullOrUndefined(id)) {
  6982. this.m_isInvalidAfterRequest=false;
  6983. this.m_isValid=true;
  6984. this.m_objectPathInfo.ObjectPathType=5 ;
  6985. this.m_objectPathInfo.Name="";
  6986. this.m_objectPathInfo.ArgumentInfo={};
  6987. this.m_objectPathInfo.ArgumentInfo.Arguments=[id];
  6988. this.m_argumentObjectPaths=null;
  6989. return;
  6990. }
  6991. }
  6992. };
  6993. return ObjectPath;
  6994. })();
  6995. OfficeExtension.ObjectPath=ObjectPath;
  6996. })(OfficeExtension || (OfficeExtension={}));
  6997. var OfficeExtension;
  6998. (function (OfficeExtension) {
  6999. var ObjectPathFactory=(function () {
  7000. function ObjectPathFactory() {
  7001. }
  7002. ObjectPathFactory.createGlobalObjectObjectPath=function (context) {
  7003. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 1 , Name: "" };
  7004. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  7005. };
  7006. ObjectPathFactory.createNewObjectObjectPath=function (context, typeName, isCollection) {
  7007. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 2 , Name: typeName };
  7008. return new OfficeExtension.ObjectPath(objectPathInfo, null, isCollection, false);
  7009. };
  7010. ObjectPathFactory.createPropertyObjectPath=function (context, parent, propertyName, isCollection, isInvalidAfterRequest) {
  7011. var objectPathInfo={
  7012. Id: context._nextId(),
  7013. ObjectPathType: 4 ,
  7014. Name: propertyName,
  7015. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  7016. };
  7017. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  7018. };
  7019. ObjectPathFactory.createIndexerObjectPath=function (context, parent, args) {
  7020. var objectPathInfo={
  7021. Id: context._nextId(),
  7022. ObjectPathType: 5 ,
  7023. Name: "",
  7024. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  7025. ArgumentInfo: {}
  7026. };
  7027. objectPathInfo.ArgumentInfo.Arguments=args;
  7028. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  7029. };
  7030. ObjectPathFactory.createIndexerObjectPathUsingParentPath=function (context, parentObjectPath, args) {
  7031. var objectPathInfo={
  7032. Id: context._nextId(),
  7033. ObjectPathType: 5 ,
  7034. Name: "",
  7035. ParentObjectPathId: parentObjectPath.objectPathInfo.Id,
  7036. ArgumentInfo: {}
  7037. };
  7038. objectPathInfo.ArgumentInfo.Arguments=args;
  7039. return new OfficeExtension.ObjectPath(objectPathInfo, parentObjectPath, false, false);
  7040. };
  7041. ObjectPathFactory.createMethodObjectPath=function (context, parent, methodName, operationType, args, isCollection, isInvalidAfterRequest) {
  7042. var objectPathInfo={
  7043. Id: context._nextId(),
  7044. ObjectPathType: 3 ,
  7045. Name: methodName,
  7046. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  7047. ArgumentInfo: {}
  7048. };
  7049. var argumentObjectPaths=OfficeExtension.Utility.setMethodArguments(context, objectPathInfo.ArgumentInfo, args);
  7050. var ret=new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, isCollection, isInvalidAfterRequest);
  7051. ret.argumentObjectPaths=argumentObjectPaths;
  7052. ret.isWriteOperation=(operationType !=1 );
  7053. return ret;
  7054. };
  7055. ObjectPathFactory.createChildItemObjectPathUsingIndexer=function (context, parent, childItem) {
  7056. var id=childItem[OfficeExtension.Constants.id];
  7057. if (OfficeExtension.Utility.isNullOrUndefined(id)) {
  7058. id=childItem[OfficeExtension.Constants.idPrivate];
  7059. }
  7060. var objectPathInfo=objectPathInfo={
  7061. Id: context._nextId(),
  7062. ObjectPathType: 5 ,
  7063. Name: "",
  7064. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  7065. ArgumentInfo: {}
  7066. };
  7067. objectPathInfo.ArgumentInfo.Arguments=[id];
  7068. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  7069. };
  7070. ObjectPathFactory.createChildItemObjectPathUsingGetItemAt=function (context, parent, childItem, index) {
  7071. var indexFromServer=childItem[OfficeExtension.Constants.index];
  7072. if (indexFromServer) {
  7073. index=indexFromServer;
  7074. }
  7075. var objectPathInfo={
  7076. Id: context._nextId(),
  7077. ObjectPathType: 3 ,
  7078. Name: OfficeExtension.Constants.getItemAt,
  7079. ParentObjectPathId: parent._objectPath.objectPathInfo.Id,
  7080. ArgumentInfo: {}
  7081. };
  7082. objectPathInfo.ArgumentInfo.Arguments=[index];
  7083. return new OfficeExtension.ObjectPath(objectPathInfo, parent._objectPath, false, false);
  7084. };
  7085. ObjectPathFactory.createReferenceIdObjectPath=function (context, referenceId) {
  7086. var objectPathInfo={ Id: context._nextId(), ObjectPathType: 6 , Name: referenceId };
  7087. return new OfficeExtension.ObjectPath(objectPathInfo, null, false, false);
  7088. };
  7089. return ObjectPathFactory;
  7090. })();
  7091. OfficeExtension.ObjectPathFactory=ObjectPathFactory;
  7092. })(OfficeExtension || (OfficeExtension={}));
  7093. var OfficeExtension;
  7094. (function (OfficeExtension) {
  7095. var OfficeJsRequestExecutor=(function () {
  7096. function OfficeJsRequestExecutor() {
  7097. }
  7098. OfficeJsRequestExecutor.prototype.executeAsync=function (customData, requestFlags, requestMessage, callback) {
  7099. var requestMessageText=JSON.stringify(requestMessage.Body);
  7100. OfficeExtension.Utility.log("Request:");
  7101. OfficeExtension.Utility.log(requestMessageText);
  7102. var messageSafearray=OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray(customData, requestFlags, "POST", "ProcessQuery", null, requestMessageText);
  7103. OSF.DDA.RichApi.executeRichApiRequestAsync(messageSafearray, function (result) {
  7104. OfficeExtension.Utility.log("Response:");
  7105. OfficeExtension.Utility.log(JSON.stringify(result));
  7106. var response={ ErrorCode: '', ErrorMessage: '', Headers: null, Body: null };
  7107. if (result.status=="succeeded") {
  7108. var bodyText=OfficeExtension.RichApiMessageUtility.getResponseBody(result);
  7109. response.Body=JSON.parse(bodyText);
  7110. response.Headers=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result);
  7111. callback(response);
  7112. }
  7113. else {
  7114. response.ErrorCode=OfficeExtension.ErrorCodes.generalException;
  7115. if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability) {
  7116. response.ErrorCode=OfficeExtension.ErrorCodes.accessDenied;
  7117. }
  7118. else if (result.error.code==OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached) {
  7119. response.ErrorCode=OfficeExtension.ErrorCodes.activityLimitReached;
  7120. }
  7121. response.ErrorMessage=result.error.message;
  7122. callback(response);
  7123. }
  7124. });
  7125. };
  7126. OfficeJsRequestExecutor.OfficeJsErrorCode_ooeNoCapability=7000;
  7127. OfficeJsRequestExecutor.OfficeJsErrorCode_ooeActivityLimitReached=5102;
  7128. return OfficeJsRequestExecutor;
  7129. })();
  7130. OfficeExtension.OfficeJsRequestExecutor=OfficeJsRequestExecutor;
  7131. })(OfficeExtension || (OfficeExtension={}));
  7132. var OfficeExtension;
  7133. (function (OfficeExtension) {
  7134. var OfficeXHRSettings=(function () {
  7135. function OfficeXHRSettings() {
  7136. }
  7137. return OfficeXHRSettings;
  7138. })();
  7139. OfficeExtension.OfficeXHRSettings=OfficeXHRSettings;
  7140. function resetXHRFactory(oldFactory) {
  7141. OfficeXHR.settings.oldxhr=oldFactory;
  7142. return officeXHRFactory;
  7143. }
  7144. OfficeExtension.resetXHRFactory=resetXHRFactory;
  7145. function officeXHRFactory() {
  7146. return new OfficeXHR;
  7147. }
  7148. OfficeExtension.officeXHRFactory=officeXHRFactory;
  7149. var OfficeXHR=(function () {
  7150. function OfficeXHR() {
  7151. }
  7152. OfficeXHR.prototype.open=function (method, url) {
  7153. this.m_method=method;
  7154. this.m_url=url;
  7155. if (this.m_url.toLowerCase().indexOf(OfficeExtension.Constants.localDocumentApiPrefix)==0) {
  7156. this.m_url=this.m_url.substr(OfficeExtension.Constants.localDocumentApiPrefix.length);
  7157. }
  7158. else {
  7159. this.m_innerXhr=OfficeXHR.settings.oldxhr();
  7160. var thisObj=this;
  7161. this.m_innerXhr.onreadystatechange=function () {
  7162. thisObj.innerXhrOnreadystatechage();
  7163. };
  7164. this.m_innerXhr.open(method, this.m_url);
  7165. }
  7166. };
  7167. OfficeXHR.prototype.abort=function () {
  7168. if (this.m_innerXhr) {
  7169. this.m_innerXhr.abort();
  7170. }
  7171. };
  7172. OfficeXHR.prototype.send=function (body) {
  7173. if (this.m_innerXhr) {
  7174. this.m_innerXhr.send(body);
  7175. }
  7176. else {
  7177. var thisObj=this;
  7178. var requestFlags=0 ;
  7179. if (!OfficeExtension.Utility.isReadonlyRestRequest(this.m_method)) {
  7180. requestFlags=1 ;
  7181. }
  7182. var execFunction=OfficeXHR.settings.executeRichApiRequestAsync;
  7183. if (!execFunction) {
  7184. execFunction=OSF.DDA.RichApi.executeRichApiRequestAsync;
  7185. }
  7186. execFunction(OfficeExtension.RichApiMessageUtility.buildRequestMessageSafeArray('', requestFlags, this.m_method, this.m_url, this.m_requestHeaders, body), function (asyncResult) {
  7187. thisObj.officeContextRequestCallback(asyncResult);
  7188. });
  7189. }
  7190. };
  7191. OfficeXHR.prototype.setRequestHeader=function (header, value) {
  7192. if (this.m_innerXhr) {
  7193. this.m_innerXhr.setRequestHeader(header, value);
  7194. }
  7195. else {
  7196. if (!this.m_requestHeaders) {
  7197. this.m_requestHeaders={};
  7198. }
  7199. this.m_requestHeaders[header]=value;
  7200. }
  7201. };
  7202. OfficeXHR.prototype.getResponseHeader=function (header) {
  7203. if (this.m_responseHeaders) {
  7204. return this.m_responseHeaders[header.toUpperCase()];
  7205. }
  7206. return null;
  7207. };
  7208. OfficeXHR.prototype.getAllResponseHeaders=function () {
  7209. return this.m_allResponseHeaders;
  7210. };
  7211. OfficeXHR.prototype.overrideMimeType=function (mimeType) {
  7212. if (this.m_innerXhr) {
  7213. this.m_innerXhr.overrideMimeType(mimeType);
  7214. }
  7215. };
  7216. OfficeXHR.prototype.innerXhrOnreadystatechage=function () {
  7217. this.readyState=this.m_innerXhr.readyState;
  7218. if (this.readyState==OfficeXHR.DONE) {
  7219. this.status=this.m_innerXhr.status;
  7220. this.statusText=this.m_innerXhr.statusText;
  7221. this.responseText=this.m_innerXhr.responseText;
  7222. this.response=this.m_innerXhr.response;
  7223. this.responseType=this.m_innerXhr.responseType;
  7224. this.setAllResponseHeaders(this.m_innerXhr.getAllResponseHeaders());
  7225. }
  7226. if (this.onreadystatechange) {
  7227. this.onreadystatechange();
  7228. }
  7229. };
  7230. OfficeXHR.prototype.officeContextRequestCallback=function (result) {
  7231. this.readyState=OfficeXHR.DONE;
  7232. if (result.status=="succeeded") {
  7233. this.status=OfficeExtension.RichApiMessageUtility.getResponseStatusCode(result);
  7234. this.m_responseHeaders=OfficeExtension.RichApiMessageUtility.getResponseHeaders(result);
  7235. console.debug("ResponseHeaders="+JSON.stringify(this.m_responseHeaders));
  7236. this.responseText=OfficeExtension.RichApiMessageUtility.getResponseBody(result);
  7237. console.debug("ResponseText="+this.responseText);
  7238. this.response=this.responseText;
  7239. }
  7240. else {
  7241. this.status=500;
  7242. this.statusText="Internal Error";
  7243. }
  7244. if (this.onreadystatechange) {
  7245. this.onreadystatechange();
  7246. }
  7247. };
  7248. OfficeXHR.prototype.setAllResponseHeaders=function (allResponseHeaders) {
  7249. this.m_allResponseHeaders=allResponseHeaders;
  7250. this.m_responseHeaders={};
  7251. if (this.m_allResponseHeaders !=null) {
  7252. var regex=new RegExp("\r?\n");
  7253. var entries=this.m_allResponseHeaders.split(regex);
  7254. for (var i=0; i < entries.length; i++) {
  7255. var entry=entries[i];
  7256. if (entry !=null) {
  7257. var index=entry.indexOf(':');
  7258. if (index > 0) {
  7259. var key=entry.substr(0, index);
  7260. var value=entry.substr(index+1);
  7261. key=OfficeExtension.Utility.trim(key);
  7262. value=OfficeExtension.Utility.trim(value);
  7263. this.m_responseHeaders[key.toUpperCase()]=value;
  7264. }
  7265. }
  7266. }
  7267. }
  7268. };
  7269. OfficeXHR.UNSENT=0;
  7270. OfficeXHR.OPENED=1;
  7271. OfficeXHR.DONE=4;
  7272. OfficeXHR.settings=new OfficeXHRSettings();
  7273. return OfficeXHR;
  7274. })();
  7275. OfficeExtension.OfficeXHR=OfficeXHR;
  7276. })(OfficeExtension || (OfficeExtension={}));
  7277. var OfficeExtension;
  7278. (function (OfficeExtension) {
  7279. function _EnsurePromise() {
  7280. if (!OfficeExtension["Promise"]) {
  7281. PromiseImpl.Init();
  7282. }
  7283. }
  7284. OfficeExtension._EnsurePromise=_EnsurePromise;
  7285. var PromiseImpl;
  7286. (function (PromiseImpl) {
  7287. function Init() {
  7288. (function () {
  7289. "use strict";
  7290. function lib$es6$promise$utils$$objectOrFunction(x) {
  7291. return typeof x==='function' || (typeof x==='object' && x !==null);
  7292. }
  7293. function lib$es6$promise$utils$$isFunction(x) {
  7294. return typeof x==='function';
  7295. }
  7296. function lib$es6$promise$utils$$isMaybeThenable(x) {
  7297. return typeof x==='object' && x !==null;
  7298. }
  7299. var lib$es6$promise$utils$$_isArray;
  7300. if (!Array.isArray) {
  7301. lib$es6$promise$utils$$_isArray=function (x) {
  7302. return Object.prototype.toString.call(x)==='[object Array]';
  7303. };
  7304. }
  7305. else {
  7306. lib$es6$promise$utils$$_isArray=Array.isArray;
  7307. }
  7308. var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;
  7309. var lib$es6$promise$asap$$len=0;
  7310. var lib$es6$promise$asap$$toString={}.toString;
  7311. var lib$es6$promise$asap$$vertxNext;
  7312. var lib$es6$promise$asap$$customSchedulerFn;
  7313. var lib$es6$promise$asap$$asap=function asap(callback, arg) {
  7314. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;
  7315. lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;
  7316. lib$es6$promise$asap$$len+=2;
  7317. if (lib$es6$promise$asap$$len===2) {
  7318. if (lib$es6$promise$asap$$customSchedulerFn) {
  7319. lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
  7320. }
  7321. else {
  7322. lib$es6$promise$asap$$scheduleFlush();
  7323. }
  7324. }
  7325. };
  7326. function lib$es6$promise$asap$$setScheduler(scheduleFn) {
  7327. lib$es6$promise$asap$$customSchedulerFn=scheduleFn;
  7328. }
  7329. function lib$es6$promise$asap$$setAsap(asapFn) {
  7330. lib$es6$promise$asap$$asap=asapFn;
  7331. }
  7332. var lib$es6$promise$asap$$browserWindow=(typeof window !=='undefined') ? window : undefined;
  7333. var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow || {};
  7334. var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
  7335. var lib$es6$promise$asap$$isNode=typeof process !=='undefined' && {}.toString.call(process)==='[object process]';
  7336. var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray !=='undefined' && typeof importScripts !=='undefined' && typeof MessageChannel !=='undefined';
  7337. function lib$es6$promise$asap$$useNextTick() {
  7338. var nextTick=process.nextTick;
  7339. var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
  7340. if (Array.isArray(version) && version[1]==='0' && version[2]==='10') {
  7341. nextTick=setImmediate;
  7342. }
  7343. return function () {
  7344. nextTick(lib$es6$promise$asap$$flush);
  7345. };
  7346. }
  7347. function lib$es6$promise$asap$$useVertxTimer() {
  7348. return function () {
  7349. lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
  7350. };
  7351. }
  7352. function lib$es6$promise$asap$$useMutationObserver() {
  7353. var iterations=0;
  7354. var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
  7355. var node=document.createTextNode('');
  7356. observer.observe(node, { characterData: true });
  7357. return function () {
  7358. node.data=(iterations=++iterations % 2);
  7359. };
  7360. }
  7361. function lib$es6$promise$asap$$useMessageChannel() {
  7362. var channel=new MessageChannel();
  7363. channel.port1.onmessage=lib$es6$promise$asap$$flush;
  7364. return function () {
  7365. channel.port2.postMessage(0);
  7366. };
  7367. }
  7368. function lib$es6$promise$asap$$useSetTimeout() {
  7369. return function () {
  7370. setTimeout(lib$es6$promise$asap$$flush, 1);
  7371. };
  7372. }
  7373. var lib$es6$promise$asap$$queue=new Array(1000);
  7374. function lib$es6$promise$asap$$flush() {
  7375. for (var i=0; i < lib$es6$promise$asap$$len; i+=2) {
  7376. var callback=lib$es6$promise$asap$$queue[i];
  7377. var arg=lib$es6$promise$asap$$queue[i+1];
  7378. callback(arg);
  7379. lib$es6$promise$asap$$queue[i]=undefined;
  7380. lib$es6$promise$asap$$queue[i+1]=undefined;
  7381. }
  7382. lib$es6$promise$asap$$len=0;
  7383. }
  7384. function lib$es6$promise$asap$$attemptVertex() {
  7385. try {
  7386. var r=require;
  7387. var vertx=r('vertx');
  7388. lib$es6$promise$asap$$vertxNext=vertx.runOnLoop || vertx.runOnContext;
  7389. return lib$es6$promise$asap$$useVertxTimer();
  7390. }
  7391. catch (e) {
  7392. return lib$es6$promise$asap$$useSetTimeout();
  7393. }
  7394. }
  7395. var lib$es6$promise$asap$$scheduleFlush;
  7396. if (lib$es6$promise$asap$$isNode) {
  7397. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick();
  7398. }
  7399. else if (lib$es6$promise$asap$$BrowserMutationObserver) {
  7400. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver();
  7401. }
  7402. else if (lib$es6$promise$asap$$isWorker) {
  7403. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel();
  7404. }
  7405. else if (lib$es6$promise$asap$$browserWindow===undefined && typeof require==='function') {
  7406. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertex();
  7407. }
  7408. else {
  7409. lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout();
  7410. }
  7411. function lib$es6$promise$$internal$$noop() {
  7412. }
  7413. var lib$es6$promise$$internal$$PENDING=void 0;
  7414. var lib$es6$promise$$internal$$FULFILLED=1;
  7415. var lib$es6$promise$$internal$$REJECTED=2;
  7416. var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  7417. function lib$es6$promise$$internal$$selfFullfillment() {
  7418. return new TypeError("You cannot resolve a promise with itself");
  7419. }
  7420. function lib$es6$promise$$internal$$cannotReturnOwn() {
  7421. return new TypeError('A promises callback cannot return that same promise.');
  7422. }
  7423. function lib$es6$promise$$internal$$getThen(promise) {
  7424. try {
  7425. return promise.then;
  7426. }
  7427. catch (error) {
  7428. lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;
  7429. return lib$es6$promise$$internal$$GET_THEN_ERROR;
  7430. }
  7431. }
  7432. function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
  7433. try {
  7434. then.call(value, fulfillmentHandler, rejectionHandler);
  7435. }
  7436. catch (e) {
  7437. return e;
  7438. }
  7439. }
  7440. function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
  7441. lib$es6$promise$asap$$asap(function (promise) {
  7442. var sealed=false;
  7443. var error=lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {
  7444. if (sealed) {
  7445. return;
  7446. }
  7447. sealed=true;
  7448. if (thenable !==value) {
  7449. lib$es6$promise$$internal$$resolve(promise, value);
  7450. }
  7451. else {
  7452. lib$es6$promise$$internal$$fulfill(promise, value);
  7453. }
  7454. }, function (reason) {
  7455. if (sealed) {
  7456. return;
  7457. }
  7458. sealed=true;
  7459. lib$es6$promise$$internal$$reject(promise, reason);
  7460. }, 'Settle: '+(promise._label || ' unknown promise'));
  7461. if (!sealed && error) {
  7462. sealed=true;
  7463. lib$es6$promise$$internal$$reject(promise, error);
  7464. }
  7465. }, promise);
  7466. }
  7467. function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
  7468. if (thenable._state===lib$es6$promise$$internal$$FULFILLED) {
  7469. lib$es6$promise$$internal$$fulfill(promise, thenable._result);
  7470. }
  7471. else if (thenable._state===lib$es6$promise$$internal$$REJECTED) {
  7472. lib$es6$promise$$internal$$reject(promise, thenable._result);
  7473. }
  7474. else {
  7475. lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {
  7476. lib$es6$promise$$internal$$resolve(promise, value);
  7477. }, function (reason) {
  7478. lib$es6$promise$$internal$$reject(promise, reason);
  7479. });
  7480. }
  7481. }
  7482. function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
  7483. if (maybeThenable.constructor===promise.constructor) {
  7484. lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
  7485. }
  7486. else {
  7487. var then=lib$es6$promise$$internal$$getThen(maybeThenable);
  7488. if (then===lib$es6$promise$$internal$$GET_THEN_ERROR) {
  7489. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
  7490. }
  7491. else if (then===undefined) {
  7492. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  7493. }
  7494. else if (lib$es6$promise$utils$$isFunction(then)) {
  7495. lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
  7496. }
  7497. else {
  7498. lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
  7499. }
  7500. }
  7501. }
  7502. function lib$es6$promise$$internal$$resolve(promise, value) {
  7503. if (promise===value) {
  7504. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
  7505. }
  7506. else if (lib$es6$promise$utils$$objectOrFunction(value)) {
  7507. lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
  7508. }
  7509. else {
  7510. lib$es6$promise$$internal$$fulfill(promise, value);
  7511. }
  7512. }
  7513. function lib$es6$promise$$internal$$publishRejection(promise) {
  7514. if (promise._onerror) {
  7515. promise._onerror(promise._result);
  7516. }
  7517. lib$es6$promise$$internal$$publish(promise);
  7518. }
  7519. function lib$es6$promise$$internal$$fulfill(promise, value) {
  7520. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7521. return;
  7522. }
  7523. promise._result=value;
  7524. promise._state=lib$es6$promise$$internal$$FULFILLED;
  7525. if (promise._subscribers.length !==0) {
  7526. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
  7527. }
  7528. }
  7529. function lib$es6$promise$$internal$$reject(promise, reason) {
  7530. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7531. return;
  7532. }
  7533. promise._state=lib$es6$promise$$internal$$REJECTED;
  7534. promise._result=reason;
  7535. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
  7536. }
  7537. function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
  7538. var subscribers=parent._subscribers;
  7539. var length=subscribers.length;
  7540. parent._onerror=null;
  7541. subscribers[length]=child;
  7542. subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment;
  7543. subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection;
  7544. if (length===0 && parent._state) {
  7545. lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
  7546. }
  7547. }
  7548. function lib$es6$promise$$internal$$publish(promise) {
  7549. var subscribers=promise._subscribers;
  7550. var settled=promise._state;
  7551. if (subscribers.length===0) {
  7552. return;
  7553. }
  7554. var child, callback, detail=promise._result;
  7555. for (var i=0; i < subscribers.length; i+=3) {
  7556. child=subscribers[i];
  7557. callback=subscribers[i+settled];
  7558. if (child) {
  7559. lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
  7560. }
  7561. else {
  7562. callback(detail);
  7563. }
  7564. }
  7565. promise._subscribers.length=0;
  7566. }
  7567. function lib$es6$promise$$internal$$ErrorObject() {
  7568. this.error=null;
  7569. }
  7570. var lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject();
  7571. function lib$es6$promise$$internal$$tryCatch(callback, detail) {
  7572. try {
  7573. return callback(detail);
  7574. }
  7575. catch (e) {
  7576. lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e;
  7577. return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
  7578. }
  7579. }
  7580. function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
  7581. var hasCallback=lib$es6$promise$utils$$isFunction(callback), value, error, succeeded, failed;
  7582. if (hasCallback) {
  7583. value=lib$es6$promise$$internal$$tryCatch(callback, detail);
  7584. if (value===lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
  7585. failed=true;
  7586. error=value.error;
  7587. value=null;
  7588. }
  7589. else {
  7590. succeeded=true;
  7591. }
  7592. if (promise===value) {
  7593. lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
  7594. return;
  7595. }
  7596. }
  7597. else {
  7598. value=detail;
  7599. succeeded=true;
  7600. }
  7601. if (promise._state !==lib$es6$promise$$internal$$PENDING) {
  7602. }
  7603. else if (hasCallback && succeeded) {
  7604. lib$es6$promise$$internal$$resolve(promise, value);
  7605. }
  7606. else if (failed) {
  7607. lib$es6$promise$$internal$$reject(promise, error);
  7608. }
  7609. else if (settled===lib$es6$promise$$internal$$FULFILLED) {
  7610. lib$es6$promise$$internal$$fulfill(promise, value);
  7611. }
  7612. else if (settled===lib$es6$promise$$internal$$REJECTED) {
  7613. lib$es6$promise$$internal$$reject(promise, value);
  7614. }
  7615. }
  7616. function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
  7617. try {
  7618. resolver(function resolvePromise(value) {
  7619. lib$es6$promise$$internal$$resolve(promise, value);
  7620. }, function rejectPromise(reason) {
  7621. lib$es6$promise$$internal$$reject(promise, reason);
  7622. });
  7623. }
  7624. catch (e) {
  7625. lib$es6$promise$$internal$$reject(promise, e);
  7626. }
  7627. }
  7628. function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
  7629. var enumerator=this;
  7630. enumerator._instanceConstructor=Constructor;
  7631. enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop);
  7632. if (enumerator._validateInput(input)) {
  7633. enumerator._input=input;
  7634. enumerator.length=input.length;
  7635. enumerator._remaining=input.length;
  7636. enumerator._init();
  7637. if (enumerator.length===0) {
  7638. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  7639. }
  7640. else {
  7641. enumerator.length=enumerator.length || 0;
  7642. enumerator._enumerate();
  7643. if (enumerator._remaining===0) {
  7644. lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
  7645. }
  7646. }
  7647. }
  7648. else {
  7649. lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
  7650. }
  7651. }
  7652. lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function (input) {
  7653. return lib$es6$promise$utils$$isArray(input);
  7654. };
  7655. lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function () {
  7656. return new OfficeExtension.Error('Array Methods must be provided an Array');
  7657. };
  7658. lib$es6$promise$enumerator$$Enumerator.prototype._init=function () {
  7659. this._result=new Array(this.length);
  7660. };
  7661. var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;
  7662. lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function () {
  7663. var enumerator=this;
  7664. var length=enumerator.length;
  7665. var promise=enumerator.promise;
  7666. var input=enumerator._input;
  7667. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  7668. enumerator._eachEntry(input[i], i);
  7669. }
  7670. };
  7671. lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function (entry, i) {
  7672. var enumerator=this;
  7673. var c=enumerator._instanceConstructor;
  7674. if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
  7675. if (entry.constructor===c && entry._state !==lib$es6$promise$$internal$$PENDING) {
  7676. entry._onerror=null;
  7677. enumerator._settledAt(entry._state, i, entry._result);
  7678. }
  7679. else {
  7680. enumerator._willSettleAt(c.resolve(entry), i);
  7681. }
  7682. }
  7683. else {
  7684. enumerator._remaining--;
  7685. enumerator._result[i]=entry;
  7686. }
  7687. };
  7688. lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function (state, i, value) {
  7689. var enumerator=this;
  7690. var promise=enumerator.promise;
  7691. if (promise._state===lib$es6$promise$$internal$$PENDING) {
  7692. enumerator._remaining--;
  7693. if (state===lib$es6$promise$$internal$$REJECTED) {
  7694. lib$es6$promise$$internal$$reject(promise, value);
  7695. }
  7696. else {
  7697. enumerator._result[i]=value;
  7698. }
  7699. }
  7700. if (enumerator._remaining===0) {
  7701. lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
  7702. }
  7703. };
  7704. lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function (promise, i) {
  7705. var enumerator=this;
  7706. lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {
  7707. enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
  7708. }, function (reason) {
  7709. enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
  7710. });
  7711. };
  7712. function lib$es6$promise$promise$all$$all(entries) {
  7713. return new lib$es6$promise$enumerator$$default(this, entries).promise;
  7714. }
  7715. var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all;
  7716. function lib$es6$promise$promise$race$$race(entries) {
  7717. var Constructor=this;
  7718. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7719. if (!lib$es6$promise$utils$$isArray(entries)) {
  7720. lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
  7721. return promise;
  7722. }
  7723. var length=entries.length;
  7724. function onFulfillment(value) {
  7725. lib$es6$promise$$internal$$resolve(promise, value);
  7726. }
  7727. function onRejection(reason) {
  7728. lib$es6$promise$$internal$$reject(promise, reason);
  7729. }
  7730. for (var i=0; promise._state===lib$es6$promise$$internal$$PENDING && i < length; i++) {
  7731. lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
  7732. }
  7733. return promise;
  7734. }
  7735. var lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race;
  7736. function lib$es6$promise$promise$resolve$$resolve(object) {
  7737. var Constructor=this;
  7738. if (object && typeof object==='object' && object.constructor===Constructor) {
  7739. return object;
  7740. }
  7741. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7742. lib$es6$promise$$internal$$resolve(promise, object);
  7743. return promise;
  7744. }
  7745. var lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve;
  7746. function lib$es6$promise$promise$reject$$reject(reason) {
  7747. var Constructor=this;
  7748. var promise=new Constructor(lib$es6$promise$$internal$$noop);
  7749. lib$es6$promise$$internal$$reject(promise, reason);
  7750. return promise;
  7751. }
  7752. var lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject;
  7753. var lib$es6$promise$promise$$counter=0;
  7754. function lib$es6$promise$promise$$needsResolver() {
  7755. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  7756. }
  7757. function lib$es6$promise$promise$$needsNew() {
  7758. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  7759. }
  7760. var lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;
  7761. function lib$es6$promise$promise$$Promise(resolver) {
  7762. this._id=lib$es6$promise$promise$$counter++;
  7763. this._state=undefined;
  7764. this._result=undefined;
  7765. this._subscribers=[];
  7766. if (lib$es6$promise$$internal$$noop !==resolver) {
  7767. if (!lib$es6$promise$utils$$isFunction(resolver)) {
  7768. lib$es6$promise$promise$$needsResolver();
  7769. }
  7770. if (!(this instanceof lib$es6$promise$promise$$Promise)) {
  7771. lib$es6$promise$promise$$needsNew();
  7772. }
  7773. lib$es6$promise$$internal$$initializePromise(this, resolver);
  7774. }
  7775. }
  7776. lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default;
  7777. lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default;
  7778. lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default;
  7779. lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default;
  7780. lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler;
  7781. lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap;
  7782. lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap;
  7783. lib$es6$promise$promise$$Promise.prototype={
  7784. constructor: lib$es6$promise$promise$$Promise,
  7785. then: function (onFulfillment, onRejection) {
  7786. var parent=this;
  7787. var state=parent._state;
  7788. if (state===lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state===lib$es6$promise$$internal$$REJECTED && !onRejection) {
  7789. return this;
  7790. }
  7791. var child=new this.constructor(lib$es6$promise$$internal$$noop);
  7792. var result=parent._result;
  7793. if (state) {
  7794. var callback=arguments[state - 1];
  7795. lib$es6$promise$asap$$asap(function () {
  7796. lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
  7797. });
  7798. }
  7799. else {
  7800. lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
  7801. }
  7802. return child;
  7803. },
  7804. 'catch': function (onRejection) {
  7805. return this.then(null, onRejection);
  7806. }
  7807. };
  7808. OfficeExtension["Promise"]=lib$es6$promise$promise$$default;
  7809. }).call(this);
  7810. }
  7811. PromiseImpl.Init=Init;
  7812. })(PromiseImpl || (PromiseImpl={}));
  7813. })(OfficeExtension || (OfficeExtension={}));
  7814. var OfficeExtension;
  7815. (function (OfficeExtension) {
  7816. (function (OperationType) {
  7817. OperationType[OperationType["Default"]=0]="Default";
  7818. OperationType[OperationType["Read"]=1]="Read";
  7819. })(OfficeExtension.OperationType || (OfficeExtension.OperationType={}));
  7820. var OperationType=OfficeExtension.OperationType;
  7821. })(OfficeExtension || (OfficeExtension={}));
  7822. var OfficeExtension;
  7823. (function (OfficeExtension) {
  7824. var TrackedObjects=(function () {
  7825. function TrackedObjects(context) {
  7826. this._autoCleanupList={};
  7827. this.m_context=context;
  7828. }
  7829. TrackedObjects.prototype.add=function (param) {
  7830. var _this=this;
  7831. if (Array.isArray(param)) {
  7832. param.forEach(function (item) { return _this._addCommon(item, true); });
  7833. }
  7834. else {
  7835. this._addCommon(param, true);
  7836. }
  7837. };
  7838. TrackedObjects.prototype._autoAdd=function (object) {
  7839. this._addCommon(object, false);
  7840. this._autoCleanupList[object._objectPath.objectPathInfo.Id]=object;
  7841. };
  7842. TrackedObjects.prototype._addCommon=function (object, isExplicitlyAdded) {
  7843. var referenceId=object[OfficeExtension.Constants.referenceId];
  7844. if (OfficeExtension.Utility.isNullOrEmptyString(referenceId) && object._KeepReference) {
  7845. object._KeepReference();
  7846. OfficeExtension.ActionFactory.createInstantiateAction(this.m_context, object);
  7847. if (isExplicitlyAdded && this.m_context._autoCleanup) {
  7848. delete this._autoCleanupList[object._objectPath.objectPathInfo.Id];
  7849. }
  7850. }
  7851. };
  7852. TrackedObjects.prototype.remove=function (param) {
  7853. var _this=this;
  7854. if (Array.isArray(param)) {
  7855. param.forEach(function (item) { return _this._removeCommon(item); });
  7856. }
  7857. else {
  7858. this._removeCommon(param);
  7859. }
  7860. };
  7861. TrackedObjects.prototype._removeCommon=function (object) {
  7862. var referenceId=object[OfficeExtension.Constants.referenceId];
  7863. if (!OfficeExtension.Utility.isNullOrEmptyString(referenceId)) {
  7864. var rootObject=this.m_context._rootObject;
  7865. if (rootObject._RemoveReference) {
  7866. rootObject._RemoveReference(referenceId);
  7867. }
  7868. }
  7869. };
  7870. TrackedObjects.prototype._retrieveAndClearAutoCleanupList=function () {
  7871. var list=this._autoCleanupList;
  7872. this._autoCleanupList={};
  7873. return list;
  7874. };
  7875. return TrackedObjects;
  7876. })();
  7877. OfficeExtension.TrackedObjects=TrackedObjects;
  7878. })(OfficeExtension || (OfficeExtension={}));
  7879. var OfficeExtension;
  7880. (function (OfficeExtension) {
  7881. var ResourceStrings=(function () {
  7882. function ResourceStrings() {
  7883. }
  7884. ResourceStrings.invalidObjectPath="InvalidObjectPath";
  7885. ResourceStrings.propertyNotLoaded="PropertyNotLoaded";
  7886. ResourceStrings.invalidRequestContext="InvalidRequestContext";
  7887. ResourceStrings.invalidArgument="InvalidArgument";
  7888. ResourceStrings.runMustReturnPromise="RunMustReturnPromise";
  7889. return ResourceStrings;
  7890. })();
  7891. OfficeExtension.ResourceStrings=ResourceStrings;
  7892. })(OfficeExtension || (OfficeExtension={}));
  7893. var OfficeExtension;
  7894. (function (OfficeExtension) {
  7895. var RichApiMessageUtility=(function () {
  7896. function RichApiMessageUtility() {
  7897. }
  7898. RichApiMessageUtility.buildRequestMessageSafeArray=function (customData, requestFlags, method, path, headers, body) {
  7899. var headerArray=[];
  7900. if (headers) {
  7901. for (var headerName in headers) {
  7902. headerArray.push(headerName);
  7903. headerArray.push(headers[headerName]);
  7904. }
  7905. }
  7906. var appPermission=0;
  7907. var solutionId="";
  7908. var instanceId="";
  7909. var marketplaceType="";
  7910. return [
  7911. customData,
  7912. method,
  7913. path,
  7914. headerArray,
  7915. body,
  7916. appPermission,
  7917. requestFlags,
  7918. solutionId,
  7919. instanceId,
  7920. marketplaceType
  7921. ];
  7922. };
  7923. RichApiMessageUtility.getResponseBody=function (result) {
  7924. return RichApiMessageUtility.getResponseBodyFromSafeArray(result.value.data);
  7925. };
  7926. RichApiMessageUtility.getResponseHeaders=function (result) {
  7927. return RichApiMessageUtility.getResponseHeadersFromSafeArray(result.value.data);
  7928. };
  7929. RichApiMessageUtility.getResponseBodyFromSafeArray=function (data) {
  7930. var ret=data[2 ];
  7931. if (typeof (ret)==="string") {
  7932. return ret;
  7933. }
  7934. var arr=ret;
  7935. return arr.join("");
  7936. };
  7937. RichApiMessageUtility.getResponseHeadersFromSafeArray=function (data) {
  7938. var arrayHeader=data[1 ];
  7939. if (!arrayHeader) {
  7940. return null;
  7941. }
  7942. var headers={};
  7943. for (var i=0; i < arrayHeader.length - 1; i+=2) {
  7944. headers[arrayHeader[i]]=arrayHeader[i+1];
  7945. }
  7946. return headers;
  7947. };
  7948. RichApiMessageUtility.getResponseStatusCode=function (result) {
  7949. return RichApiMessageUtility.getResponseStatusCodeFromSafeArray(result.value.data);
  7950. };
  7951. RichApiMessageUtility.getResponseStatusCodeFromSafeArray=function (data) {
  7952. return data[0 ];
  7953. };
  7954. return RichApiMessageUtility;
  7955. })();
  7956. OfficeExtension.RichApiMessageUtility=RichApiMessageUtility;
  7957. })(OfficeExtension || (OfficeExtension={}));
  7958. var OfficeExtension;
  7959. (function (OfficeExtension) {
  7960. var Utility=(function () {
  7961. function Utility() {
  7962. }
  7963. Utility.checkArgumentNull=function (value, name) {
  7964. };
  7965. Utility.isNullOrUndefined=function (value) {
  7966. if (value===null) {
  7967. return true;
  7968. }
  7969. if (typeof (value)==="undefined") {
  7970. return true;
  7971. }
  7972. return false;
  7973. };
  7974. Utility.isUndefined=function (value) {
  7975. if (typeof (value)==="undefined") {
  7976. return true;
  7977. }
  7978. return false;
  7979. };
  7980. Utility.isNullOrEmptyString=function (value) {
  7981. if (value===null) {
  7982. return true;
  7983. }
  7984. if (typeof (value)==="undefined") {
  7985. return true;
  7986. }
  7987. if (value.length==0) {
  7988. return true;
  7989. }
  7990. return false;
  7991. };
  7992. Utility.trim=function (str) {
  7993. return str.replace(new RegExp("^\\s+|\\s+$", "g"), "");
  7994. };
  7995. Utility.caseInsensitiveCompareString=function (str1, str2) {
  7996. if (Utility.isNullOrUndefined(str1)) {
  7997. return Utility.isNullOrUndefined(str2);
  7998. }
  7999. else {
  8000. if (Utility.isNullOrUndefined(str2)) {
  8001. return false;
  8002. }
  8003. else {
  8004. return str1.toUpperCase()==str2.toUpperCase();
  8005. }
  8006. }
  8007. };
  8008. Utility.isReadonlyRestRequest=function (method) {
  8009. return Utility.caseInsensitiveCompareString(method, "GET");
  8010. };
  8011. Utility.setMethodArguments=function (context, argumentInfo, args) {
  8012. if (Utility.isNullOrUndefined(args)) {
  8013. return null;
  8014. }
  8015. var referencedObjectPaths=new Array();
  8016. var referencedObjectPathIds=new Array();
  8017. var hasOne=false;
  8018. for (var i=0; i < args.length; i++) {
  8019. if (args[i] instanceof OfficeExtension.ClientObject) {
  8020. var clientObject=args[i];
  8021. Utility.validateContext(context, clientObject);
  8022. args[i]=clientObject._objectPath.objectPathInfo.Id;
  8023. referencedObjectPathIds.push(clientObject._objectPath.objectPathInfo.Id);
  8024. referencedObjectPaths.push(clientObject._objectPath);
  8025. hasOne=true;
  8026. }
  8027. else {
  8028. referencedObjectPathIds.push(0);
  8029. }
  8030. }
  8031. argumentInfo.Arguments=args;
  8032. if (hasOne) {
  8033. argumentInfo.ReferencedObjectPathIds=referencedObjectPathIds;
  8034. return referencedObjectPaths;
  8035. }
  8036. return null;
  8037. };
  8038. Utility.fixObjectPathIfNecessary=function (clientObject, value) {
  8039. if (clientObject && clientObject._objectPath && value) {
  8040. clientObject._objectPath.updateUsingObjectData(value);
  8041. }
  8042. };
  8043. Utility.validateObjectPath=function (clientObject) {
  8044. var objectPath=clientObject._objectPath;
  8045. while (objectPath) {
  8046. if (!objectPath.isValid) {
  8047. var pathExpression=Utility.getObjectPathExpression(objectPath);
  8048. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  8049. }
  8050. objectPath=objectPath.parentObjectPath;
  8051. }
  8052. };
  8053. Utility.validateReferencedObjectPaths=function (objectPaths) {
  8054. if (objectPaths) {
  8055. for (var i=0; i < objectPaths.length; i++) {
  8056. var objectPath=objectPaths[i];
  8057. while (objectPath) {
  8058. if (!objectPath.isValid) {
  8059. var pathExpression=Utility.getObjectPathExpression(objectPath);
  8060. Utility.throwError(OfficeExtension.ResourceStrings.invalidObjectPath, pathExpression);
  8061. }
  8062. objectPath=objectPath.parentObjectPath;
  8063. }
  8064. }
  8065. }
  8066. };
  8067. Utility.validateContext=function (context, obj) {
  8068. if (obj && obj.context !==context) {
  8069. Utility.throwError(OfficeExtension.ResourceStrings.invalidRequestContext);
  8070. }
  8071. };
  8072. Utility.log=function (message) {
  8073. if (Utility._logEnabled && window.console && window.console.log) {
  8074. window.console.log(message);
  8075. }
  8076. };
  8077. Utility.load=function (clientObj, option) {
  8078. clientObj.context.load(clientObj, option);
  8079. };
  8080. Utility.throwError=function (resourceId, arg) {
  8081. throw new OfficeExtension._Internal.RuntimeError(resourceId, Utility._getResourceString(resourceId, arg), new Array(), {});
  8082. };
  8083. Utility.createRuntimeError=function (code, message, location) {
  8084. return new OfficeExtension._Internal.RuntimeError(code, message, [], { errorLocation: location });
  8085. };
  8086. Utility._getResourceString=function (resourceId, arg) {
  8087. var ret=resourceId;
  8088. if (window.Strings && window.Strings.OfficeOM) {
  8089. var stringName="L_"+resourceId;
  8090. var stringValue=window.Strings.OfficeOM[stringName];
  8091. if (stringValue) {
  8092. ret=stringValue;
  8093. }
  8094. }
  8095. if (!Utility.isNullOrUndefined(arg)) {
  8096. ret=ret.replace("{0}", arg);
  8097. }
  8098. return ret;
  8099. };
  8100. Utility.throwIfNotLoaded=function (propertyName, fieldValue) {
  8101. if (Utility.isUndefined(fieldValue) && propertyName.charCodeAt(0) !=Utility.s_underscoreCharCode) {
  8102. Utility.throwError(OfficeExtension.ResourceStrings.propertyNotLoaded, propertyName);
  8103. }
  8104. };
  8105. Utility.getObjectPathExpression=function (objectPath) {
  8106. var ret="";
  8107. while (objectPath) {
  8108. switch (objectPath.objectPathInfo.ObjectPathType) {
  8109. case 1 :
  8110. ret=ret;
  8111. break;
  8112. case 2 :
  8113. ret="new()"+(ret.length > 0 ? "." : "")+ret;
  8114. break;
  8115. case 3 :
  8116. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+"()"+(ret.length > 0 ? "." : "")+ret;
  8117. break;
  8118. case 4 :
  8119. ret=Utility.normalizeName(objectPath.objectPathInfo.Name)+(ret.length > 0 ? "." : "")+ret;
  8120. break;
  8121. case 5 :
  8122. ret="getItem()"+(ret.length > 0 ? "." : "")+ret;
  8123. break;
  8124. case 6 :
  8125. ret="_reference()"+(ret.length > 0 ? "." : "")+ret;
  8126. break;
  8127. }
  8128. objectPath=objectPath.parentObjectPath;
  8129. }
  8130. return ret;
  8131. };
  8132. Utility._createPromiseFromResult=function (value) {
  8133. OfficeExtension._EnsurePromise();
  8134. return new OfficeExtension['Promise'](function (resolve, reject) {
  8135. resolve(value);
  8136. });
  8137. };
  8138. Utility._addActionResultHandler=function (clientObj, action, resultHandler) {
  8139. clientObj.context._pendingRequest.addActionResultHandler(action, resultHandler);
  8140. };
  8141. Utility._handleNavigationPropertyResults=function (clientObj, objectValue, propertyNames) {
  8142. for (var i=0; i < propertyNames.length - 1; i+=2) {
  8143. if (!Utility.isUndefined(objectValue[propertyNames[i+1]])) {
  8144. clientObj[propertyNames[i]]._handleResult(objectValue[propertyNames[i+1]]);
  8145. }
  8146. }
  8147. };
  8148. Utility.normalizeName=function (name) {
  8149. return name.substr(0, 1).toLowerCase()+name.substr(1);
  8150. };
  8151. Utility._logEnabled=false;
  8152. Utility.s_underscoreCharCode="_".charCodeAt(0);
  8153. return Utility;
  8154. })();
  8155. OfficeExtension.Utility=Utility;
  8156. })(OfficeExtension || (OfficeExtension={}));
  8157. var __extends=this.__extends || function (d, b) {
  8158. for (var p in b) if (b.hasOwnProperty(p)) d[p]=b[p];
  8159. function __() { this.constructor=d; }
  8160. __.prototype=b.prototype;
  8161. d.prototype=new __();
  8162. };
  8163. var Word;
  8164. (function (Word) {
  8165. function _normalizeSearchOptions(context, searchOptions) {
  8166. if (OfficeExtension.Utility.isNullOrUndefined(searchOptions)) {
  8167. return null;
  8168. }
  8169. if (typeof (searchOptions) !="object") {
  8170. OfficeExtension.Utility.throwError(OfficeExtension.ResourceStrings.invalidArgument, "searchOptions");
  8171. }
  8172. if (searchOptions instanceof Word.SearchOptions) {
  8173. return searchOptions;
  8174. }
  8175. var newSearchOptions=Word.SearchOptions.newObject(context);
  8176. for (var property in searchOptions) {
  8177. if (searchOptions.hasOwnProperty(property)) {
  8178. newSearchOptions[property]=searchOptions[property];
  8179. }
  8180. }
  8181. return newSearchOptions;
  8182. }
  8183. var _createPropertyObjectPath=OfficeExtension.ObjectPathFactory.createPropertyObjectPath;
  8184. var _createMethodObjectPath=OfficeExtension.ObjectPathFactory.createMethodObjectPath;
  8185. var _createIndexerObjectPath=OfficeExtension.ObjectPathFactory.createIndexerObjectPath;
  8186. var _createNewObjectObjectPath=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath;
  8187. var _createChildItemObjectPathUsingIndexer=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer;
  8188. var _createChildItemObjectPathUsingGetItemAt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt;
  8189. var _createMethodAction=OfficeExtension.ActionFactory.createMethodAction;
  8190. var _createSetPropertyAction=OfficeExtension.ActionFactory.createSetPropertyAction;
  8191. var _isNullOrUndefined=OfficeExtension.Utility.isNullOrUndefined;
  8192. var _isUndefined=OfficeExtension.Utility.isUndefined;
  8193. var _throwIfNotLoaded=OfficeExtension.Utility.throwIfNotLoaded;
  8194. var _load=OfficeExtension.Utility.load;
  8195. var _fixObjectPathIfNecessary=OfficeExtension.Utility.fixObjectPathIfNecessary;
  8196. var _addActionResultHandler=OfficeExtension.Utility._addActionResultHandler;
  8197. var _handleNavigationPropertyResults=OfficeExtension.Utility._handleNavigationPropertyResults;
  8198. var Body=(function (_super) {
  8199. __extends(Body, _super);
  8200. function Body() {
  8201. _super.apply(this, arguments);
  8202. }
  8203. Object.defineProperty(Body.prototype, "contentControls", {
  8204. get: function () {
  8205. if (!this.m_contentControls) {
  8206. this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false));
  8207. }
  8208. return this.m_contentControls;
  8209. },
  8210. enumerable: true,
  8211. configurable: true
  8212. });
  8213. Object.defineProperty(Body.prototype, "font", {
  8214. get: function () {
  8215. if (!this.m_font) {
  8216. this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  8217. }
  8218. return this.m_font;
  8219. },
  8220. enumerable: true,
  8221. configurable: true
  8222. });
  8223. Object.defineProperty(Body.prototype, "inlinePictures", {
  8224. get: function () {
  8225. if (!this.m_inlinePictures) {
  8226. this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false));
  8227. }
  8228. return this.m_inlinePictures;
  8229. },
  8230. enumerable: true,
  8231. configurable: true
  8232. });
  8233. Object.defineProperty(Body.prototype, "paragraphs", {
  8234. get: function () {
  8235. if (!this.m_paragraphs) {
  8236. this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false));
  8237. }
  8238. return this.m_paragraphs;
  8239. },
  8240. enumerable: true,
  8241. configurable: true
  8242. });
  8243. Object.defineProperty(Body.prototype, "parentContentControl", {
  8244. get: function () {
  8245. if (!this.m_parentContentControl) {
  8246. this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false));
  8247. }
  8248. return this.m_parentContentControl;
  8249. },
  8250. enumerable: true,
  8251. configurable: true
  8252. });
  8253. Object.defineProperty(Body.prototype, "style", {
  8254. get: function () {
  8255. _throwIfNotLoaded("style", this.m_style);
  8256. return this.m_style;
  8257. },
  8258. set: function (value) {
  8259. this.m_style=value;
  8260. _createSetPropertyAction(this.context, this, "Style", value);
  8261. },
  8262. enumerable: true,
  8263. configurable: true
  8264. });
  8265. Object.defineProperty(Body.prototype, "text", {
  8266. get: function () {
  8267. _throwIfNotLoaded("text", this.m_text);
  8268. return this.m_text;
  8269. },
  8270. enumerable: true,
  8271. configurable: true
  8272. });
  8273. Object.defineProperty(Body.prototype, "_ReferenceId", {
  8274. get: function () {
  8275. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  8276. return this.m__ReferenceId;
  8277. },
  8278. enumerable: true,
  8279. configurable: true
  8280. });
  8281. Body.prototype.clear=function () {
  8282. _createMethodAction(this.context, this, "Clear", 0 , []);
  8283. };
  8284. Body.prototype.getHtml=function () {
  8285. var action=_createMethodAction(this.context, this, "GetHtml", 1 , []);
  8286. var ret=new OfficeExtension.ClientResult();
  8287. _addActionResultHandler(this, action, ret);
  8288. return ret;
  8289. };
  8290. Body.prototype.getOoxml=function () {
  8291. var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []);
  8292. var ret=new OfficeExtension.ClientResult();
  8293. _addActionResultHandler(this, action, ret);
  8294. return ret;
  8295. };
  8296. Body.prototype.insertBreak=function (breakType, insertLocation) {
  8297. _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]);
  8298. };
  8299. Body.prototype.insertContentControl=function () {
  8300. return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true));
  8301. };
  8302. Body.prototype.insertFileFromBase64=function (base64File, insertLocation) {
  8303. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true));
  8304. };
  8305. Body.prototype.insertHtml=function (html, insertLocation) {
  8306. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true));
  8307. };
  8308. Body.prototype.insertOoxml=function (ooxml, insertLocation) {
  8309. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true));
  8310. };
  8311. Body.prototype.insertParagraph=function (paragraphText, insertLocation) {
  8312. return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true));
  8313. };
  8314. Body.prototype.insertText=function (text, insertLocation) {
  8315. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true));
  8316. };
  8317. Body.prototype.search=function (searchText, searchOptions) {
  8318. searchOptions=_normalizeSearchOptions(this.context, searchOptions);
  8319. return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true));
  8320. };
  8321. Body.prototype.select=function () {
  8322. _createMethodAction(this.context, this, "Select", 1 , []);
  8323. };
  8324. Body.prototype._KeepReference=function () {
  8325. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  8326. };
  8327. Body.prototype._handleResult=function (value) {
  8328. if (_isNullOrUndefined(value))
  8329. return;
  8330. var obj=value;
  8331. _fixObjectPathIfNecessary(this, obj);
  8332. if (!_isUndefined(obj["Style"])) {
  8333. this.m_style=obj["Style"];
  8334. }
  8335. if (!_isUndefined(obj["Text"])) {
  8336. this.m_text=obj["Text"];
  8337. }
  8338. if (!_isUndefined(obj["_ReferenceId"])) {
  8339. this.m__ReferenceId=obj["_ReferenceId"];
  8340. }
  8341. _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]);
  8342. };
  8343. Body.prototype.load=function (option) {
  8344. _load(this, option);
  8345. return this;
  8346. };
  8347. Body.prototype._initReferenceId=function (value) {
  8348. this.m__ReferenceId=value;
  8349. };
  8350. return Body;
  8351. })(OfficeExtension.ClientObject);
  8352. Word.Body=Body;
  8353. var ContentControl=(function (_super) {
  8354. __extends(ContentControl, _super);
  8355. function ContentControl() {
  8356. _super.apply(this, arguments);
  8357. }
  8358. Object.defineProperty(ContentControl.prototype, "contentControls", {
  8359. get: function () {
  8360. if (!this.m_contentControls) {
  8361. this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false));
  8362. }
  8363. return this.m_contentControls;
  8364. },
  8365. enumerable: true,
  8366. configurable: true
  8367. });
  8368. Object.defineProperty(ContentControl.prototype, "font", {
  8369. get: function () {
  8370. if (!this.m_font) {
  8371. this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  8372. }
  8373. return this.m_font;
  8374. },
  8375. enumerable: true,
  8376. configurable: true
  8377. });
  8378. Object.defineProperty(ContentControl.prototype, "inlinePictures", {
  8379. get: function () {
  8380. if (!this.m_inlinePictures) {
  8381. this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false));
  8382. }
  8383. return this.m_inlinePictures;
  8384. },
  8385. enumerable: true,
  8386. configurable: true
  8387. });
  8388. Object.defineProperty(ContentControl.prototype, "paragraphs", {
  8389. get: function () {
  8390. if (!this.m_paragraphs) {
  8391. this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false));
  8392. }
  8393. return this.m_paragraphs;
  8394. },
  8395. enumerable: true,
  8396. configurable: true
  8397. });
  8398. Object.defineProperty(ContentControl.prototype, "parentContentControl", {
  8399. get: function () {
  8400. if (!this.m_parentContentControl) {
  8401. this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false));
  8402. }
  8403. return this.m_parentContentControl;
  8404. },
  8405. enumerable: true,
  8406. configurable: true
  8407. });
  8408. Object.defineProperty(ContentControl.prototype, "appearance", {
  8409. get: function () {
  8410. _throwIfNotLoaded("appearance", this.m_appearance);
  8411. return this.m_appearance;
  8412. },
  8413. set: function (value) {
  8414. this.m_appearance=value;
  8415. _createSetPropertyAction(this.context, this, "Appearance", value);
  8416. },
  8417. enumerable: true,
  8418. configurable: true
  8419. });
  8420. Object.defineProperty(ContentControl.prototype, "cannotDelete", {
  8421. get: function () {
  8422. _throwIfNotLoaded("cannotDelete", this.m_cannotDelete);
  8423. return this.m_cannotDelete;
  8424. },
  8425. set: function (value) {
  8426. this.m_cannotDelete=value;
  8427. _createSetPropertyAction(this.context, this, "CannotDelete", value);
  8428. },
  8429. enumerable: true,
  8430. configurable: true
  8431. });
  8432. Object.defineProperty(ContentControl.prototype, "cannotEdit", {
  8433. get: function () {
  8434. _throwIfNotLoaded("cannotEdit", this.m_cannotEdit);
  8435. return this.m_cannotEdit;
  8436. },
  8437. set: function (value) {
  8438. this.m_cannotEdit=value;
  8439. _createSetPropertyAction(this.context, this, "CannotEdit", value);
  8440. },
  8441. enumerable: true,
  8442. configurable: true
  8443. });
  8444. Object.defineProperty(ContentControl.prototype, "color", {
  8445. get: function () {
  8446. _throwIfNotLoaded("color", this.m_color);
  8447. return this.m_color;
  8448. },
  8449. set: function (value) {
  8450. this.m_color=value;
  8451. _createSetPropertyAction(this.context, this, "Color", value);
  8452. },
  8453. enumerable: true,
  8454. configurable: true
  8455. });
  8456. Object.defineProperty(ContentControl.prototype, "id", {
  8457. get: function () {
  8458. _throwIfNotLoaded("id", this.m_id);
  8459. return this.m_id;
  8460. },
  8461. enumerable: true,
  8462. configurable: true
  8463. });
  8464. Object.defineProperty(ContentControl.prototype, "placeholderText", {
  8465. get: function () {
  8466. _throwIfNotLoaded("placeholderText", this.m_placeholderText);
  8467. return this.m_placeholderText;
  8468. },
  8469. set: function (value) {
  8470. this.m_placeholderText=value;
  8471. _createSetPropertyAction(this.context, this, "PlaceholderText", value);
  8472. },
  8473. enumerable: true,
  8474. configurable: true
  8475. });
  8476. Object.defineProperty(ContentControl.prototype, "removeWhenEdited", {
  8477. get: function () {
  8478. _throwIfNotLoaded("removeWhenEdited", this.m_removeWhenEdited);
  8479. return this.m_removeWhenEdited;
  8480. },
  8481. set: function (value) {
  8482. this.m_removeWhenEdited=value;
  8483. _createSetPropertyAction(this.context, this, "RemoveWhenEdited", value);
  8484. },
  8485. enumerable: true,
  8486. configurable: true
  8487. });
  8488. Object.defineProperty(ContentControl.prototype, "style", {
  8489. get: function () {
  8490. _throwIfNotLoaded("style", this.m_style);
  8491. return this.m_style;
  8492. },
  8493. set: function (value) {
  8494. this.m_style=value;
  8495. _createSetPropertyAction(this.context, this, "Style", value);
  8496. },
  8497. enumerable: true,
  8498. configurable: true
  8499. });
  8500. Object.defineProperty(ContentControl.prototype, "tag", {
  8501. get: function () {
  8502. _throwIfNotLoaded("tag", this.m_tag);
  8503. return this.m_tag;
  8504. },
  8505. set: function (value) {
  8506. this.m_tag=value;
  8507. _createSetPropertyAction(this.context, this, "Tag", value);
  8508. },
  8509. enumerable: true,
  8510. configurable: true
  8511. });
  8512. Object.defineProperty(ContentControl.prototype, "text", {
  8513. get: function () {
  8514. _throwIfNotLoaded("text", this.m_text);
  8515. return this.m_text;
  8516. },
  8517. enumerable: true,
  8518. configurable: true
  8519. });
  8520. Object.defineProperty(ContentControl.prototype, "title", {
  8521. get: function () {
  8522. _throwIfNotLoaded("title", this.m_title);
  8523. return this.m_title;
  8524. },
  8525. set: function (value) {
  8526. this.m_title=value;
  8527. _createSetPropertyAction(this.context, this, "Title", value);
  8528. },
  8529. enumerable: true,
  8530. configurable: true
  8531. });
  8532. Object.defineProperty(ContentControl.prototype, "type", {
  8533. get: function () {
  8534. _throwIfNotLoaded("type", this.m_type);
  8535. return this.m_type;
  8536. },
  8537. enumerable: true,
  8538. configurable: true
  8539. });
  8540. Object.defineProperty(ContentControl.prototype, "_ReferenceId", {
  8541. get: function () {
  8542. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  8543. return this.m__ReferenceId;
  8544. },
  8545. enumerable: true,
  8546. configurable: true
  8547. });
  8548. ContentControl.prototype.clear=function () {
  8549. _createMethodAction(this.context, this, "Clear", 0 , []);
  8550. };
  8551. ContentControl.prototype.delete=function (keepContent) {
  8552. _createMethodAction(this.context, this, "Delete", 0 , [keepContent]);
  8553. };
  8554. ContentControl.prototype.getHtml=function () {
  8555. var action=_createMethodAction(this.context, this, "GetHtml", 1 , []);
  8556. var ret=new OfficeExtension.ClientResult();
  8557. _addActionResultHandler(this, action, ret);
  8558. return ret;
  8559. };
  8560. ContentControl.prototype.getOoxml=function () {
  8561. var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []);
  8562. var ret=new OfficeExtension.ClientResult();
  8563. _addActionResultHandler(this, action, ret);
  8564. return ret;
  8565. };
  8566. ContentControl.prototype.insertBreak=function (breakType, insertLocation) {
  8567. _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]);
  8568. };
  8569. ContentControl.prototype.insertFileFromBase64=function (base64File, insertLocation) {
  8570. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true));
  8571. };
  8572. ContentControl.prototype.insertHtml=function (html, insertLocation) {
  8573. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true));
  8574. };
  8575. ContentControl.prototype.insertOoxml=function (ooxml, insertLocation) {
  8576. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true));
  8577. };
  8578. ContentControl.prototype.insertParagraph=function (paragraphText, insertLocation) {
  8579. return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true));
  8580. };
  8581. ContentControl.prototype.insertText=function (text, insertLocation) {
  8582. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true));
  8583. };
  8584. ContentControl.prototype.search=function (searchText, searchOptions) {
  8585. searchOptions=_normalizeSearchOptions(this.context, searchOptions);
  8586. return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true));
  8587. };
  8588. ContentControl.prototype.select=function () {
  8589. _createMethodAction(this.context, this, "Select", 1 , []);
  8590. };
  8591. ContentControl.prototype._KeepReference=function () {
  8592. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  8593. };
  8594. ContentControl.prototype._handleResult=function (value) {
  8595. if (_isNullOrUndefined(value))
  8596. return;
  8597. var obj=value;
  8598. _fixObjectPathIfNecessary(this, obj);
  8599. if (!_isUndefined(obj["Appearance"])) {
  8600. this.m_appearance=obj["Appearance"];
  8601. }
  8602. if (!_isUndefined(obj["CannotDelete"])) {
  8603. this.m_cannotDelete=obj["CannotDelete"];
  8604. }
  8605. if (!_isUndefined(obj["CannotEdit"])) {
  8606. this.m_cannotEdit=obj["CannotEdit"];
  8607. }
  8608. if (!_isUndefined(obj["Color"])) {
  8609. this.m_color=obj["Color"];
  8610. }
  8611. if (!_isUndefined(obj["Id"])) {
  8612. this.m_id=obj["Id"];
  8613. }
  8614. if (!_isUndefined(obj["PlaceholderText"])) {
  8615. this.m_placeholderText=obj["PlaceholderText"];
  8616. }
  8617. if (!_isUndefined(obj["RemoveWhenEdited"])) {
  8618. this.m_removeWhenEdited=obj["RemoveWhenEdited"];
  8619. }
  8620. if (!_isUndefined(obj["Style"])) {
  8621. this.m_style=obj["Style"];
  8622. }
  8623. if (!_isUndefined(obj["Tag"])) {
  8624. this.m_tag=obj["Tag"];
  8625. }
  8626. if (!_isUndefined(obj["Text"])) {
  8627. this.m_text=obj["Text"];
  8628. }
  8629. if (!_isUndefined(obj["Title"])) {
  8630. this.m_title=obj["Title"];
  8631. }
  8632. if (!_isUndefined(obj["Type"])) {
  8633. this.m_type=obj["Type"];
  8634. }
  8635. if (!_isUndefined(obj["_ReferenceId"])) {
  8636. this.m__ReferenceId=obj["_ReferenceId"];
  8637. }
  8638. _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]);
  8639. };
  8640. ContentControl.prototype.load=function (option) {
  8641. _load(this, option);
  8642. return this;
  8643. };
  8644. ContentControl.prototype._initReferenceId=function (value) {
  8645. this.m__ReferenceId=value;
  8646. };
  8647. return ContentControl;
  8648. })(OfficeExtension.ClientObject);
  8649. Word.ContentControl=ContentControl;
  8650. var ContentControlCollection=(function (_super) {
  8651. __extends(ContentControlCollection, _super);
  8652. function ContentControlCollection() {
  8653. _super.apply(this, arguments);
  8654. }
  8655. Object.defineProperty(ContentControlCollection.prototype, "items", {
  8656. get: function () {
  8657. _throwIfNotLoaded("items", this.m__items);
  8658. return this.m__items;
  8659. },
  8660. enumerable: true,
  8661. configurable: true
  8662. });
  8663. Object.defineProperty(ContentControlCollection.prototype, "_ReferenceId", {
  8664. get: function () {
  8665. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  8666. return this.m__ReferenceId;
  8667. },
  8668. enumerable: true,
  8669. configurable: true
  8670. });
  8671. ContentControlCollection.prototype.getById=function (id) {
  8672. return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "GetById", 1 , [id], false, false));
  8673. };
  8674. ContentControlCollection.prototype.getByTag=function (tag) {
  8675. return new Word.ContentControlCollection(this.context, _createMethodObjectPath(this.context, this, "GetByTag", 1 , [tag], true, false));
  8676. };
  8677. ContentControlCollection.prototype.getByTitle=function (title) {
  8678. return new Word.ContentControlCollection(this.context, _createMethodObjectPath(this.context, this, "GetByTitle", 1 , [title], true, false));
  8679. };
  8680. ContentControlCollection.prototype.getItem=function (index) {
  8681. return new Word.ContentControl(this.context, _createIndexerObjectPath(this.context, this, [index]));
  8682. };
  8683. ContentControlCollection.prototype._KeepReference=function () {
  8684. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  8685. };
  8686. ContentControlCollection.prototype._handleResult=function (value) {
  8687. if (_isNullOrUndefined(value))
  8688. return;
  8689. var obj=value;
  8690. _fixObjectPathIfNecessary(this, obj);
  8691. if (!_isUndefined(obj["_ReferenceId"])) {
  8692. this.m__ReferenceId=obj["_ReferenceId"];
  8693. }
  8694. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  8695. this.m__items=[];
  8696. var _data=obj[OfficeExtension.Constants.items];
  8697. for (var i=0; i < _data.length; i++) {
  8698. var _item=new Word.ContentControl(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  8699. _item._handleResult(_data[i]);
  8700. this.m__items.push(_item);
  8701. }
  8702. }
  8703. };
  8704. ContentControlCollection.prototype.load=function (option) {
  8705. _load(this, option);
  8706. return this;
  8707. };
  8708. ContentControlCollection.prototype._initReferenceId=function (value) {
  8709. this.m__ReferenceId=value;
  8710. };
  8711. return ContentControlCollection;
  8712. })(OfficeExtension.ClientObject);
  8713. Word.ContentControlCollection=ContentControlCollection;
  8714. var Document=(function (_super) {
  8715. __extends(Document, _super);
  8716. function Document() {
  8717. _super.apply(this, arguments);
  8718. }
  8719. Object.defineProperty(Document.prototype, "body", {
  8720. get: function () {
  8721. if (!this.m_body) {
  8722. this.m_body=new Word.Body(this.context, _createPropertyObjectPath(this.context, this, "Body", false, false));
  8723. }
  8724. return this.m_body;
  8725. },
  8726. enumerable: true,
  8727. configurable: true
  8728. });
  8729. Object.defineProperty(Document.prototype, "contentControls", {
  8730. get: function () {
  8731. if (!this.m_contentControls) {
  8732. this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false));
  8733. }
  8734. return this.m_contentControls;
  8735. },
  8736. enumerable: true,
  8737. configurable: true
  8738. });
  8739. Object.defineProperty(Document.prototype, "sections", {
  8740. get: function () {
  8741. if (!this.m_sections) {
  8742. this.m_sections=new Word.SectionCollection(this.context, _createPropertyObjectPath(this.context, this, "Sections", true, false));
  8743. }
  8744. return this.m_sections;
  8745. },
  8746. enumerable: true,
  8747. configurable: true
  8748. });
  8749. Object.defineProperty(Document.prototype, "saved", {
  8750. get: function () {
  8751. _throwIfNotLoaded("saved", this.m_saved);
  8752. return this.m_saved;
  8753. },
  8754. enumerable: true,
  8755. configurable: true
  8756. });
  8757. Document.prototype.getSelection=function () {
  8758. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "GetSelection", 1 , [], false, true));
  8759. };
  8760. Document.prototype.save=function () {
  8761. _createMethodAction(this.context, this, "Save", 0 , []);
  8762. };
  8763. Document.prototype._GetObjectByReferenceId=function (referenceId) {
  8764. var action=_createMethodAction(this.context, this, "_GetObjectByReferenceId", 1 , [referenceId]);
  8765. var ret=new OfficeExtension.ClientResult();
  8766. _addActionResultHandler(this, action, ret);
  8767. return ret;
  8768. };
  8769. Document.prototype._GetObjectTypeNameByReferenceId=function (referenceId) {
  8770. var action=_createMethodAction(this.context, this, "_GetObjectTypeNameByReferenceId", 1 , [referenceId]);
  8771. var ret=new OfficeExtension.ClientResult();
  8772. _addActionResultHandler(this, action, ret);
  8773. return ret;
  8774. };
  8775. Document.prototype._RemoveAllReferences=function () {
  8776. _createMethodAction(this.context, this, "_RemoveAllReferences", 1 , []);
  8777. };
  8778. Document.prototype._RemoveReference=function (referenceId) {
  8779. _createMethodAction(this.context, this, "_RemoveReference", 1 , [referenceId]);
  8780. };
  8781. Document.prototype._handleResult=function (value) {
  8782. if (_isNullOrUndefined(value))
  8783. return;
  8784. var obj=value;
  8785. _fixObjectPathIfNecessary(this, obj);
  8786. if (!_isUndefined(obj["Saved"])) {
  8787. this.m_saved=obj["Saved"];
  8788. }
  8789. _handleNavigationPropertyResults(this, obj, ["body", "Body", "contentControls", "ContentControls", "sections", "Sections"]);
  8790. };
  8791. Document.prototype.load=function (option) {
  8792. _load(this, option);
  8793. return this;
  8794. };
  8795. return Document;
  8796. })(OfficeExtension.ClientObject);
  8797. Word.Document=Document;
  8798. var Font=(function (_super) {
  8799. __extends(Font, _super);
  8800. function Font() {
  8801. _super.apply(this, arguments);
  8802. }
  8803. Object.defineProperty(Font.prototype, "bold", {
  8804. get: function () {
  8805. _throwIfNotLoaded("bold", this.m_bold);
  8806. return this.m_bold;
  8807. },
  8808. set: function (value) {
  8809. this.m_bold=value;
  8810. _createSetPropertyAction(this.context, this, "Bold", value);
  8811. },
  8812. enumerable: true,
  8813. configurable: true
  8814. });
  8815. Object.defineProperty(Font.prototype, "color", {
  8816. get: function () {
  8817. _throwIfNotLoaded("color", this.m_color);
  8818. return this.m_color;
  8819. },
  8820. set: function (value) {
  8821. this.m_color=value;
  8822. _createSetPropertyAction(this.context, this, "Color", value);
  8823. },
  8824. enumerable: true,
  8825. configurable: true
  8826. });
  8827. Object.defineProperty(Font.prototype, "doubleStrikeThrough", {
  8828. get: function () {
  8829. _throwIfNotLoaded("doubleStrikeThrough", this.m_doubleStrikeThrough);
  8830. return this.m_doubleStrikeThrough;
  8831. },
  8832. set: function (value) {
  8833. this.m_doubleStrikeThrough=value;
  8834. _createSetPropertyAction(this.context, this, "DoubleStrikeThrough", value);
  8835. },
  8836. enumerable: true,
  8837. configurable: true
  8838. });
  8839. Object.defineProperty(Font.prototype, "highlightColor", {
  8840. get: function () {
  8841. _throwIfNotLoaded("highlightColor", this.m_highlightColor);
  8842. return this.m_highlightColor;
  8843. },
  8844. set: function (value) {
  8845. this.m_highlightColor=value;
  8846. _createSetPropertyAction(this.context, this, "HighlightColor", value);
  8847. },
  8848. enumerable: true,
  8849. configurable: true
  8850. });
  8851. Object.defineProperty(Font.prototype, "italic", {
  8852. get: function () {
  8853. _throwIfNotLoaded("italic", this.m_italic);
  8854. return this.m_italic;
  8855. },
  8856. set: function (value) {
  8857. this.m_italic=value;
  8858. _createSetPropertyAction(this.context, this, "Italic", value);
  8859. },
  8860. enumerable: true,
  8861. configurable: true
  8862. });
  8863. Object.defineProperty(Font.prototype, "name", {
  8864. get: function () {
  8865. _throwIfNotLoaded("name", this.m_name);
  8866. return this.m_name;
  8867. },
  8868. set: function (value) {
  8869. this.m_name=value;
  8870. _createSetPropertyAction(this.context, this, "Name", value);
  8871. },
  8872. enumerable: true,
  8873. configurable: true
  8874. });
  8875. Object.defineProperty(Font.prototype, "size", {
  8876. get: function () {
  8877. _throwIfNotLoaded("size", this.m_size);
  8878. return this.m_size;
  8879. },
  8880. set: function (value) {
  8881. this.m_size=value;
  8882. _createSetPropertyAction(this.context, this, "Size", value);
  8883. },
  8884. enumerable: true,
  8885. configurable: true
  8886. });
  8887. Object.defineProperty(Font.prototype, "strikeThrough", {
  8888. get: function () {
  8889. _throwIfNotLoaded("strikeThrough", this.m_strikeThrough);
  8890. return this.m_strikeThrough;
  8891. },
  8892. set: function (value) {
  8893. this.m_strikeThrough=value;
  8894. _createSetPropertyAction(this.context, this, "StrikeThrough", value);
  8895. },
  8896. enumerable: true,
  8897. configurable: true
  8898. });
  8899. Object.defineProperty(Font.prototype, "subscript", {
  8900. get: function () {
  8901. _throwIfNotLoaded("subscript", this.m_subscript);
  8902. return this.m_subscript;
  8903. },
  8904. set: function (value) {
  8905. this.m_subscript=value;
  8906. _createSetPropertyAction(this.context, this, "Subscript", value);
  8907. },
  8908. enumerable: true,
  8909. configurable: true
  8910. });
  8911. Object.defineProperty(Font.prototype, "superscript", {
  8912. get: function () {
  8913. _throwIfNotLoaded("superscript", this.m_superscript);
  8914. return this.m_superscript;
  8915. },
  8916. set: function (value) {
  8917. this.m_superscript=value;
  8918. _createSetPropertyAction(this.context, this, "Superscript", value);
  8919. },
  8920. enumerable: true,
  8921. configurable: true
  8922. });
  8923. Object.defineProperty(Font.prototype, "underline", {
  8924. get: function () {
  8925. _throwIfNotLoaded("underline", this.m_underline);
  8926. return this.m_underline;
  8927. },
  8928. set: function (value) {
  8929. this.m_underline=value;
  8930. _createSetPropertyAction(this.context, this, "Underline", value);
  8931. },
  8932. enumerable: true,
  8933. configurable: true
  8934. });
  8935. Object.defineProperty(Font.prototype, "_ReferenceId", {
  8936. get: function () {
  8937. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  8938. return this.m__ReferenceId;
  8939. },
  8940. enumerable: true,
  8941. configurable: true
  8942. });
  8943. Font.prototype._KeepReference=function () {
  8944. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  8945. };
  8946. Font.prototype._handleResult=function (value) {
  8947. if (_isNullOrUndefined(value))
  8948. return;
  8949. var obj=value;
  8950. _fixObjectPathIfNecessary(this, obj);
  8951. if (!_isUndefined(obj["Bold"])) {
  8952. this.m_bold=obj["Bold"];
  8953. }
  8954. if (!_isUndefined(obj["Color"])) {
  8955. this.m_color=obj["Color"];
  8956. }
  8957. if (!_isUndefined(obj["DoubleStrikeThrough"])) {
  8958. this.m_doubleStrikeThrough=obj["DoubleStrikeThrough"];
  8959. }
  8960. if (!_isUndefined(obj["HighlightColor"])) {
  8961. this.m_highlightColor=obj["HighlightColor"];
  8962. }
  8963. if (!_isUndefined(obj["Italic"])) {
  8964. this.m_italic=obj["Italic"];
  8965. }
  8966. if (!_isUndefined(obj["Name"])) {
  8967. this.m_name=obj["Name"];
  8968. }
  8969. if (!_isUndefined(obj["Size"])) {
  8970. this.m_size=obj["Size"];
  8971. }
  8972. if (!_isUndefined(obj["StrikeThrough"])) {
  8973. this.m_strikeThrough=obj["StrikeThrough"];
  8974. }
  8975. if (!_isUndefined(obj["Subscript"])) {
  8976. this.m_subscript=obj["Subscript"];
  8977. }
  8978. if (!_isUndefined(obj["Superscript"])) {
  8979. this.m_superscript=obj["Superscript"];
  8980. }
  8981. if (!_isUndefined(obj["Underline"])) {
  8982. this.m_underline=obj["Underline"];
  8983. }
  8984. if (!_isUndefined(obj["_ReferenceId"])) {
  8985. this.m__ReferenceId=obj["_ReferenceId"];
  8986. }
  8987. };
  8988. Font.prototype.load=function (option) {
  8989. _load(this, option);
  8990. return this;
  8991. };
  8992. Font.prototype._initReferenceId=function (value) {
  8993. this.m__ReferenceId=value;
  8994. };
  8995. return Font;
  8996. })(OfficeExtension.ClientObject);
  8997. Word.Font=Font;
  8998. var InlinePicture=(function (_super) {
  8999. __extends(InlinePicture, _super);
  9000. function InlinePicture() {
  9001. _super.apply(this, arguments);
  9002. }
  9003. Object.defineProperty(InlinePicture.prototype, "parentContentControl", {
  9004. get: function () {
  9005. if (!this.m_parentContentControl) {
  9006. this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false));
  9007. }
  9008. return this.m_parentContentControl;
  9009. },
  9010. enumerable: true,
  9011. configurable: true
  9012. });
  9013. Object.defineProperty(InlinePicture.prototype, "altTextDescription", {
  9014. get: function () {
  9015. _throwIfNotLoaded("altTextDescription", this.m_altTextDescription);
  9016. return this.m_altTextDescription;
  9017. },
  9018. set: function (value) {
  9019. this.m_altTextDescription=value;
  9020. _createSetPropertyAction(this.context, this, "AltTextDescription", value);
  9021. },
  9022. enumerable: true,
  9023. configurable: true
  9024. });
  9025. Object.defineProperty(InlinePicture.prototype, "altTextTitle", {
  9026. get: function () {
  9027. _throwIfNotLoaded("altTextTitle", this.m_altTextTitle);
  9028. return this.m_altTextTitle;
  9029. },
  9030. set: function (value) {
  9031. this.m_altTextTitle=value;
  9032. _createSetPropertyAction(this.context, this, "AltTextTitle", value);
  9033. },
  9034. enumerable: true,
  9035. configurable: true
  9036. });
  9037. Object.defineProperty(InlinePicture.prototype, "height", {
  9038. get: function () {
  9039. _throwIfNotLoaded("height", this.m_height);
  9040. return this.m_height;
  9041. },
  9042. set: function (value) {
  9043. this.m_height=value;
  9044. _createSetPropertyAction(this.context, this, "Height", value);
  9045. },
  9046. enumerable: true,
  9047. configurable: true
  9048. });
  9049. Object.defineProperty(InlinePicture.prototype, "hyperlink", {
  9050. get: function () {
  9051. _throwIfNotLoaded("hyperlink", this.m_hyperlink);
  9052. return this.m_hyperlink;
  9053. },
  9054. set: function (value) {
  9055. this.m_hyperlink=value;
  9056. _createSetPropertyAction(this.context, this, "Hyperlink", value);
  9057. },
  9058. enumerable: true,
  9059. configurable: true
  9060. });
  9061. Object.defineProperty(InlinePicture.prototype, "lockAspectRatio", {
  9062. get: function () {
  9063. _throwIfNotLoaded("lockAspectRatio", this.m_lockAspectRatio);
  9064. return this.m_lockAspectRatio;
  9065. },
  9066. set: function (value) {
  9067. this.m_lockAspectRatio=value;
  9068. _createSetPropertyAction(this.context, this, "LockAspectRatio", value);
  9069. },
  9070. enumerable: true,
  9071. configurable: true
  9072. });
  9073. Object.defineProperty(InlinePicture.prototype, "width", {
  9074. get: function () {
  9075. _throwIfNotLoaded("width", this.m_width);
  9076. return this.m_width;
  9077. },
  9078. set: function (value) {
  9079. this.m_width=value;
  9080. _createSetPropertyAction(this.context, this, "Width", value);
  9081. },
  9082. enumerable: true,
  9083. configurable: true
  9084. });
  9085. Object.defineProperty(InlinePicture.prototype, "_Id", {
  9086. get: function () {
  9087. _throwIfNotLoaded("_Id", this.m__Id);
  9088. return this.m__Id;
  9089. },
  9090. enumerable: true,
  9091. configurable: true
  9092. });
  9093. Object.defineProperty(InlinePicture.prototype, "_ReferenceId", {
  9094. get: function () {
  9095. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9096. return this.m__ReferenceId;
  9097. },
  9098. enumerable: true,
  9099. configurable: true
  9100. });
  9101. InlinePicture.prototype.getBase64ImageSrc=function () {
  9102. var action=_createMethodAction(this.context, this, "GetBase64ImageSrc", 1 , []);
  9103. var ret=new OfficeExtension.ClientResult();
  9104. _addActionResultHandler(this, action, ret);
  9105. return ret;
  9106. };
  9107. InlinePicture.prototype.insertContentControl=function () {
  9108. return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true));
  9109. };
  9110. InlinePicture.prototype._KeepReference=function () {
  9111. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9112. };
  9113. InlinePicture.prototype._handleResult=function (value) {
  9114. if (_isNullOrUndefined(value))
  9115. return;
  9116. var obj=value;
  9117. _fixObjectPathIfNecessary(this, obj);
  9118. if (!_isUndefined(obj["AltTextDescription"])) {
  9119. this.m_altTextDescription=obj["AltTextDescription"];
  9120. }
  9121. if (!_isUndefined(obj["AltTextTitle"])) {
  9122. this.m_altTextTitle=obj["AltTextTitle"];
  9123. }
  9124. if (!_isUndefined(obj["Height"])) {
  9125. this.m_height=obj["Height"];
  9126. }
  9127. if (!_isUndefined(obj["Hyperlink"])) {
  9128. this.m_hyperlink=obj["Hyperlink"];
  9129. }
  9130. if (!_isUndefined(obj["LockAspectRatio"])) {
  9131. this.m_lockAspectRatio=obj["LockAspectRatio"];
  9132. }
  9133. if (!_isUndefined(obj["Width"])) {
  9134. this.m_width=obj["Width"];
  9135. }
  9136. if (!_isUndefined(obj["_Id"])) {
  9137. this.m__Id=obj["_Id"];
  9138. }
  9139. if (!_isUndefined(obj["_ReferenceId"])) {
  9140. this.m__ReferenceId=obj["_ReferenceId"];
  9141. }
  9142. _handleNavigationPropertyResults(this, obj, ["parentContentControl", "ParentContentControl"]);
  9143. };
  9144. InlinePicture.prototype.load=function (option) {
  9145. _load(this, option);
  9146. return this;
  9147. };
  9148. InlinePicture.prototype._initReferenceId=function (value) {
  9149. this.m__ReferenceId=value;
  9150. };
  9151. return InlinePicture;
  9152. })(OfficeExtension.ClientObject);
  9153. Word.InlinePicture=InlinePicture;
  9154. var InlinePictureCollection=(function (_super) {
  9155. __extends(InlinePictureCollection, _super);
  9156. function InlinePictureCollection() {
  9157. _super.apply(this, arguments);
  9158. }
  9159. Object.defineProperty(InlinePictureCollection.prototype, "items", {
  9160. get: function () {
  9161. _throwIfNotLoaded("items", this.m__items);
  9162. return this.m__items;
  9163. },
  9164. enumerable: true,
  9165. configurable: true
  9166. });
  9167. Object.defineProperty(InlinePictureCollection.prototype, "_ReferenceId", {
  9168. get: function () {
  9169. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9170. return this.m__ReferenceId;
  9171. },
  9172. enumerable: true,
  9173. configurable: true
  9174. });
  9175. InlinePictureCollection.prototype._GetItem=function (index) {
  9176. return new Word.InlinePicture(this.context, _createIndexerObjectPath(this.context, this, [index]));
  9177. };
  9178. InlinePictureCollection.prototype._KeepReference=function () {
  9179. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9180. };
  9181. InlinePictureCollection.prototype._handleResult=function (value) {
  9182. if (_isNullOrUndefined(value))
  9183. return;
  9184. var obj=value;
  9185. _fixObjectPathIfNecessary(this, obj);
  9186. if (!_isUndefined(obj["_ReferenceId"])) {
  9187. this.m__ReferenceId=obj["_ReferenceId"];
  9188. }
  9189. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9190. this.m__items=[];
  9191. var _data=obj[OfficeExtension.Constants.items];
  9192. for (var i=0; i < _data.length; i++) {
  9193. var _item=new Word.InlinePicture(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  9194. _item._handleResult(_data[i]);
  9195. this.m__items.push(_item);
  9196. }
  9197. }
  9198. };
  9199. InlinePictureCollection.prototype.load=function (option) {
  9200. _load(this, option);
  9201. return this;
  9202. };
  9203. InlinePictureCollection.prototype._initReferenceId=function (value) {
  9204. this.m__ReferenceId=value;
  9205. };
  9206. return InlinePictureCollection;
  9207. })(OfficeExtension.ClientObject);
  9208. Word.InlinePictureCollection=InlinePictureCollection;
  9209. var Paragraph=(function (_super) {
  9210. __extends(Paragraph, _super);
  9211. function Paragraph() {
  9212. _super.apply(this, arguments);
  9213. }
  9214. Object.defineProperty(Paragraph.prototype, "contentControls", {
  9215. get: function () {
  9216. if (!this.m_contentControls) {
  9217. this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false));
  9218. }
  9219. return this.m_contentControls;
  9220. },
  9221. enumerable: true,
  9222. configurable: true
  9223. });
  9224. Object.defineProperty(Paragraph.prototype, "font", {
  9225. get: function () {
  9226. if (!this.m_font) {
  9227. this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  9228. }
  9229. return this.m_font;
  9230. },
  9231. enumerable: true,
  9232. configurable: true
  9233. });
  9234. Object.defineProperty(Paragraph.prototype, "inlinePictures", {
  9235. get: function () {
  9236. if (!this.m_inlinePictures) {
  9237. this.m_inlinePictures=new Word.InlinePictureCollection(this.context, _createPropertyObjectPath(this.context, this, "InlinePictures", true, false));
  9238. }
  9239. return this.m_inlinePictures;
  9240. },
  9241. enumerable: true,
  9242. configurable: true
  9243. });
  9244. Object.defineProperty(Paragraph.prototype, "parentContentControl", {
  9245. get: function () {
  9246. if (!this.m_parentContentControl) {
  9247. this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false));
  9248. }
  9249. return this.m_parentContentControl;
  9250. },
  9251. enumerable: true,
  9252. configurable: true
  9253. });
  9254. Object.defineProperty(Paragraph.prototype, "alignment", {
  9255. get: function () {
  9256. _throwIfNotLoaded("alignment", this.m_alignment);
  9257. return this.m_alignment;
  9258. },
  9259. set: function (value) {
  9260. this.m_alignment=value;
  9261. _createSetPropertyAction(this.context, this, "Alignment", value);
  9262. },
  9263. enumerable: true,
  9264. configurable: true
  9265. });
  9266. Object.defineProperty(Paragraph.prototype, "firstLineIndent", {
  9267. get: function () {
  9268. _throwIfNotLoaded("firstLineIndent", this.m_firstLineIndent);
  9269. return this.m_firstLineIndent;
  9270. },
  9271. set: function (value) {
  9272. this.m_firstLineIndent=value;
  9273. _createSetPropertyAction(this.context, this, "FirstLineIndent", value);
  9274. },
  9275. enumerable: true,
  9276. configurable: true
  9277. });
  9278. Object.defineProperty(Paragraph.prototype, "leftIndent", {
  9279. get: function () {
  9280. _throwIfNotLoaded("leftIndent", this.m_leftIndent);
  9281. return this.m_leftIndent;
  9282. },
  9283. set: function (value) {
  9284. this.m_leftIndent=value;
  9285. _createSetPropertyAction(this.context, this, "LeftIndent", value);
  9286. },
  9287. enumerable: true,
  9288. configurable: true
  9289. });
  9290. Object.defineProperty(Paragraph.prototype, "lineSpacing", {
  9291. get: function () {
  9292. _throwIfNotLoaded("lineSpacing", this.m_lineSpacing);
  9293. return this.m_lineSpacing;
  9294. },
  9295. set: function (value) {
  9296. this.m_lineSpacing=value;
  9297. _createSetPropertyAction(this.context, this, "LineSpacing", value);
  9298. },
  9299. enumerable: true,
  9300. configurable: true
  9301. });
  9302. Object.defineProperty(Paragraph.prototype, "lineUnitAfter", {
  9303. get: function () {
  9304. _throwIfNotLoaded("lineUnitAfter", this.m_lineUnitAfter);
  9305. return this.m_lineUnitAfter;
  9306. },
  9307. set: function (value) {
  9308. this.m_lineUnitAfter=value;
  9309. _createSetPropertyAction(this.context, this, "LineUnitAfter", value);
  9310. },
  9311. enumerable: true,
  9312. configurable: true
  9313. });
  9314. Object.defineProperty(Paragraph.prototype, "lineUnitBefore", {
  9315. get: function () {
  9316. _throwIfNotLoaded("lineUnitBefore", this.m_lineUnitBefore);
  9317. return this.m_lineUnitBefore;
  9318. },
  9319. set: function (value) {
  9320. this.m_lineUnitBefore=value;
  9321. _createSetPropertyAction(this.context, this, "LineUnitBefore", value);
  9322. },
  9323. enumerable: true,
  9324. configurable: true
  9325. });
  9326. Object.defineProperty(Paragraph.prototype, "outlineLevel", {
  9327. get: function () {
  9328. _throwIfNotLoaded("outlineLevel", this.m_outlineLevel);
  9329. return this.m_outlineLevel;
  9330. },
  9331. set: function (value) {
  9332. this.m_outlineLevel=value;
  9333. _createSetPropertyAction(this.context, this, "OutlineLevel", value);
  9334. },
  9335. enumerable: true,
  9336. configurable: true
  9337. });
  9338. Object.defineProperty(Paragraph.prototype, "rightIndent", {
  9339. get: function () {
  9340. _throwIfNotLoaded("rightIndent", this.m_rightIndent);
  9341. return this.m_rightIndent;
  9342. },
  9343. set: function (value) {
  9344. this.m_rightIndent=value;
  9345. _createSetPropertyAction(this.context, this, "RightIndent", value);
  9346. },
  9347. enumerable: true,
  9348. configurable: true
  9349. });
  9350. Object.defineProperty(Paragraph.prototype, "spaceAfter", {
  9351. get: function () {
  9352. _throwIfNotLoaded("spaceAfter", this.m_spaceAfter);
  9353. return this.m_spaceAfter;
  9354. },
  9355. set: function (value) {
  9356. this.m_spaceAfter=value;
  9357. _createSetPropertyAction(this.context, this, "SpaceAfter", value);
  9358. },
  9359. enumerable: true,
  9360. configurable: true
  9361. });
  9362. Object.defineProperty(Paragraph.prototype, "spaceBefore", {
  9363. get: function () {
  9364. _throwIfNotLoaded("spaceBefore", this.m_spaceBefore);
  9365. return this.m_spaceBefore;
  9366. },
  9367. set: function (value) {
  9368. this.m_spaceBefore=value;
  9369. _createSetPropertyAction(this.context, this, "SpaceBefore", value);
  9370. },
  9371. enumerable: true,
  9372. configurable: true
  9373. });
  9374. Object.defineProperty(Paragraph.prototype, "style", {
  9375. get: function () {
  9376. _throwIfNotLoaded("style", this.m_style);
  9377. return this.m_style;
  9378. },
  9379. set: function (value) {
  9380. this.m_style=value;
  9381. _createSetPropertyAction(this.context, this, "Style", value);
  9382. },
  9383. enumerable: true,
  9384. configurable: true
  9385. });
  9386. Object.defineProperty(Paragraph.prototype, "text", {
  9387. get: function () {
  9388. _throwIfNotLoaded("text", this.m_text);
  9389. return this.m_text;
  9390. },
  9391. enumerable: true,
  9392. configurable: true
  9393. });
  9394. Object.defineProperty(Paragraph.prototype, "_Id", {
  9395. get: function () {
  9396. _throwIfNotLoaded("_Id", this.m__Id);
  9397. return this.m__Id;
  9398. },
  9399. enumerable: true,
  9400. configurable: true
  9401. });
  9402. Object.defineProperty(Paragraph.prototype, "_ReferenceId", {
  9403. get: function () {
  9404. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9405. return this.m__ReferenceId;
  9406. },
  9407. enumerable: true,
  9408. configurable: true
  9409. });
  9410. Paragraph.prototype.clear=function () {
  9411. _createMethodAction(this.context, this, "Clear", 0 , []);
  9412. };
  9413. Paragraph.prototype.delete=function () {
  9414. _createMethodAction(this.context, this, "Delete", 0 , []);
  9415. };
  9416. Paragraph.prototype.getHtml=function () {
  9417. var action=_createMethodAction(this.context, this, "GetHtml", 1 , []);
  9418. var ret=new OfficeExtension.ClientResult();
  9419. _addActionResultHandler(this, action, ret);
  9420. return ret;
  9421. };
  9422. Paragraph.prototype.getOoxml=function () {
  9423. var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []);
  9424. var ret=new OfficeExtension.ClientResult();
  9425. _addActionResultHandler(this, action, ret);
  9426. return ret;
  9427. };
  9428. Paragraph.prototype.insertBreak=function (breakType, insertLocation) {
  9429. _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]);
  9430. };
  9431. Paragraph.prototype.insertContentControl=function () {
  9432. return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true));
  9433. };
  9434. Paragraph.prototype.insertFileFromBase64=function (base64File, insertLocation) {
  9435. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true));
  9436. };
  9437. Paragraph.prototype.insertHtml=function (html, insertLocation) {
  9438. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true));
  9439. };
  9440. Paragraph.prototype.insertInlinePictureFromBase64=function (base64EncodedImage, insertLocation) {
  9441. return new Word.InlinePicture(this.context, _createMethodObjectPath(this.context, this, "InsertInlinePictureFromBase64", 0 , [base64EncodedImage, insertLocation], false, true));
  9442. };
  9443. Paragraph.prototype.insertOoxml=function (ooxml, insertLocation) {
  9444. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true));
  9445. };
  9446. Paragraph.prototype.insertParagraph=function (paragraphText, insertLocation) {
  9447. return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true));
  9448. };
  9449. Paragraph.prototype.insertText=function (text, insertLocation) {
  9450. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true));
  9451. };
  9452. Paragraph.prototype.search=function (searchText, searchOptions) {
  9453. searchOptions=_normalizeSearchOptions(this.context, searchOptions);
  9454. return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true));
  9455. };
  9456. Paragraph.prototype.select=function () {
  9457. _createMethodAction(this.context, this, "Select", 1 , []);
  9458. };
  9459. Paragraph.prototype._KeepReference=function () {
  9460. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9461. };
  9462. Paragraph.prototype._handleResult=function (value) {
  9463. if (_isNullOrUndefined(value))
  9464. return;
  9465. var obj=value;
  9466. _fixObjectPathIfNecessary(this, obj);
  9467. if (!_isUndefined(obj["Alignment"])) {
  9468. this.m_alignment=obj["Alignment"];
  9469. }
  9470. if (!_isUndefined(obj["FirstLineIndent"])) {
  9471. this.m_firstLineIndent=obj["FirstLineIndent"];
  9472. }
  9473. if (!_isUndefined(obj["LeftIndent"])) {
  9474. this.m_leftIndent=obj["LeftIndent"];
  9475. }
  9476. if (!_isUndefined(obj["LineSpacing"])) {
  9477. this.m_lineSpacing=obj["LineSpacing"];
  9478. }
  9479. if (!_isUndefined(obj["LineUnitAfter"])) {
  9480. this.m_lineUnitAfter=obj["LineUnitAfter"];
  9481. }
  9482. if (!_isUndefined(obj["LineUnitBefore"])) {
  9483. this.m_lineUnitBefore=obj["LineUnitBefore"];
  9484. }
  9485. if (!_isUndefined(obj["OutlineLevel"])) {
  9486. this.m_outlineLevel=obj["OutlineLevel"];
  9487. }
  9488. if (!_isUndefined(obj["RightIndent"])) {
  9489. this.m_rightIndent=obj["RightIndent"];
  9490. }
  9491. if (!_isUndefined(obj["SpaceAfter"])) {
  9492. this.m_spaceAfter=obj["SpaceAfter"];
  9493. }
  9494. if (!_isUndefined(obj["SpaceBefore"])) {
  9495. this.m_spaceBefore=obj["SpaceBefore"];
  9496. }
  9497. if (!_isUndefined(obj["Style"])) {
  9498. this.m_style=obj["Style"];
  9499. }
  9500. if (!_isUndefined(obj["Text"])) {
  9501. this.m_text=obj["Text"];
  9502. }
  9503. if (!_isUndefined(obj["_Id"])) {
  9504. this.m__Id=obj["_Id"];
  9505. }
  9506. if (!_isUndefined(obj["_ReferenceId"])) {
  9507. this.m__ReferenceId=obj["_ReferenceId"];
  9508. }
  9509. _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "inlinePictures", "InlinePictures", "parentContentControl", "ParentContentControl"]);
  9510. };
  9511. Paragraph.prototype.load=function (option) {
  9512. _load(this, option);
  9513. return this;
  9514. };
  9515. Paragraph.prototype._initReferenceId=function (value) {
  9516. this.m__ReferenceId=value;
  9517. };
  9518. return Paragraph;
  9519. })(OfficeExtension.ClientObject);
  9520. Word.Paragraph=Paragraph;
  9521. var ParagraphCollection=(function (_super) {
  9522. __extends(ParagraphCollection, _super);
  9523. function ParagraphCollection() {
  9524. _super.apply(this, arguments);
  9525. }
  9526. Object.defineProperty(ParagraphCollection.prototype, "items", {
  9527. get: function () {
  9528. _throwIfNotLoaded("items", this.m__items);
  9529. return this.m__items;
  9530. },
  9531. enumerable: true,
  9532. configurable: true
  9533. });
  9534. Object.defineProperty(ParagraphCollection.prototype, "_ReferenceId", {
  9535. get: function () {
  9536. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9537. return this.m__ReferenceId;
  9538. },
  9539. enumerable: true,
  9540. configurable: true
  9541. });
  9542. ParagraphCollection.prototype._GetItem=function (index) {
  9543. return new Word.Paragraph(this.context, _createIndexerObjectPath(this.context, this, [index]));
  9544. };
  9545. ParagraphCollection.prototype._KeepReference=function () {
  9546. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9547. };
  9548. ParagraphCollection.prototype._handleResult=function (value) {
  9549. if (_isNullOrUndefined(value))
  9550. return;
  9551. var obj=value;
  9552. _fixObjectPathIfNecessary(this, obj);
  9553. if (!_isUndefined(obj["_ReferenceId"])) {
  9554. this.m__ReferenceId=obj["_ReferenceId"];
  9555. }
  9556. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9557. this.m__items=[];
  9558. var _data=obj[OfficeExtension.Constants.items];
  9559. for (var i=0; i < _data.length; i++) {
  9560. var _item=new Word.Paragraph(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  9561. _item._handleResult(_data[i]);
  9562. this.m__items.push(_item);
  9563. }
  9564. }
  9565. };
  9566. ParagraphCollection.prototype.load=function (option) {
  9567. _load(this, option);
  9568. return this;
  9569. };
  9570. ParagraphCollection.prototype._initReferenceId=function (value) {
  9571. this.m__ReferenceId=value;
  9572. };
  9573. return ParagraphCollection;
  9574. })(OfficeExtension.ClientObject);
  9575. Word.ParagraphCollection=ParagraphCollection;
  9576. var Range=(function (_super) {
  9577. __extends(Range, _super);
  9578. function Range() {
  9579. _super.apply(this, arguments);
  9580. }
  9581. Object.defineProperty(Range.prototype, "contentControls", {
  9582. get: function () {
  9583. if (!this.m_contentControls) {
  9584. this.m_contentControls=new Word.ContentControlCollection(this.context, _createPropertyObjectPath(this.context, this, "ContentControls", true, false));
  9585. }
  9586. return this.m_contentControls;
  9587. },
  9588. enumerable: true,
  9589. configurable: true
  9590. });
  9591. Object.defineProperty(Range.prototype, "font", {
  9592. get: function () {
  9593. if (!this.m_font) {
  9594. this.m_font=new Word.Font(this.context, _createPropertyObjectPath(this.context, this, "Font", false, false));
  9595. }
  9596. return this.m_font;
  9597. },
  9598. enumerable: true,
  9599. configurable: true
  9600. });
  9601. Object.defineProperty(Range.prototype, "paragraphs", {
  9602. get: function () {
  9603. if (!this.m_paragraphs) {
  9604. this.m_paragraphs=new Word.ParagraphCollection(this.context, _createPropertyObjectPath(this.context, this, "Paragraphs", true, false));
  9605. }
  9606. return this.m_paragraphs;
  9607. },
  9608. enumerable: true,
  9609. configurable: true
  9610. });
  9611. Object.defineProperty(Range.prototype, "parentContentControl", {
  9612. get: function () {
  9613. if (!this.m_parentContentControl) {
  9614. this.m_parentContentControl=new Word.ContentControl(this.context, _createPropertyObjectPath(this.context, this, "ParentContentControl", false, false));
  9615. }
  9616. return this.m_parentContentControl;
  9617. },
  9618. enumerable: true,
  9619. configurable: true
  9620. });
  9621. Object.defineProperty(Range.prototype, "style", {
  9622. get: function () {
  9623. _throwIfNotLoaded("style", this.m_style);
  9624. return this.m_style;
  9625. },
  9626. set: function (value) {
  9627. this.m_style=value;
  9628. _createSetPropertyAction(this.context, this, "Style", value);
  9629. },
  9630. enumerable: true,
  9631. configurable: true
  9632. });
  9633. Object.defineProperty(Range.prototype, "text", {
  9634. get: function () {
  9635. _throwIfNotLoaded("text", this.m_text);
  9636. return this.m_text;
  9637. },
  9638. enumerable: true,
  9639. configurable: true
  9640. });
  9641. Object.defineProperty(Range.prototype, "_Id", {
  9642. get: function () {
  9643. _throwIfNotLoaded("_Id", this.m__Id);
  9644. return this.m__Id;
  9645. },
  9646. enumerable: true,
  9647. configurable: true
  9648. });
  9649. Object.defineProperty(Range.prototype, "_ReferenceId", {
  9650. get: function () {
  9651. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9652. return this.m__ReferenceId;
  9653. },
  9654. enumerable: true,
  9655. configurable: true
  9656. });
  9657. Range.prototype.clear=function () {
  9658. _createMethodAction(this.context, this, "Clear", 0 , []);
  9659. };
  9660. Range.prototype.delete=function () {
  9661. _createMethodAction(this.context, this, "Delete", 0 , []);
  9662. };
  9663. Range.prototype.getHtml=function () {
  9664. var action=_createMethodAction(this.context, this, "GetHtml", 1 , []);
  9665. var ret=new OfficeExtension.ClientResult();
  9666. _addActionResultHandler(this, action, ret);
  9667. return ret;
  9668. };
  9669. Range.prototype.getOoxml=function () {
  9670. var action=_createMethodAction(this.context, this, "GetOoxml", 1 , []);
  9671. var ret=new OfficeExtension.ClientResult();
  9672. _addActionResultHandler(this, action, ret);
  9673. return ret;
  9674. };
  9675. Range.prototype.insertBreak=function (breakType, insertLocation) {
  9676. _createMethodAction(this.context, this, "InsertBreak", 0 , [breakType, insertLocation]);
  9677. };
  9678. Range.prototype.insertContentControl=function () {
  9679. return new Word.ContentControl(this.context, _createMethodObjectPath(this.context, this, "InsertContentControl", 0 , [], false, true));
  9680. };
  9681. Range.prototype.insertFileFromBase64=function (base64File, insertLocation) {
  9682. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertFileFromBase64", 0 , [base64File, insertLocation], false, true));
  9683. };
  9684. Range.prototype.insertHtml=function (html, insertLocation) {
  9685. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertHtml", 0 , [html, insertLocation], false, true));
  9686. };
  9687. Range.prototype.insertOoxml=function (ooxml, insertLocation) {
  9688. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertOoxml", 0 , [ooxml, insertLocation], false, true));
  9689. };
  9690. Range.prototype.insertParagraph=function (paragraphText, insertLocation) {
  9691. return new Word.Paragraph(this.context, _createMethodObjectPath(this.context, this, "InsertParagraph", 0 , [paragraphText, insertLocation], false, true));
  9692. };
  9693. Range.prototype.insertText=function (text, insertLocation) {
  9694. return new Word.Range(this.context, _createMethodObjectPath(this.context, this, "InsertText", 0 , [text, insertLocation], false, true));
  9695. };
  9696. Range.prototype.search=function (searchText, searchOptions) {
  9697. searchOptions=_normalizeSearchOptions(this.context, searchOptions);
  9698. return new Word.SearchResultCollection(this.context, _createMethodObjectPath(this.context, this, "Search", 1 , [searchText, searchOptions], true, true));
  9699. };
  9700. Range.prototype.select=function () {
  9701. _createMethodAction(this.context, this, "Select", 1 , []);
  9702. };
  9703. Range.prototype._KeepReference=function () {
  9704. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9705. };
  9706. Range.prototype._handleResult=function (value) {
  9707. if (_isNullOrUndefined(value))
  9708. return;
  9709. var obj=value;
  9710. _fixObjectPathIfNecessary(this, obj);
  9711. if (!_isUndefined(obj["Style"])) {
  9712. this.m_style=obj["Style"];
  9713. }
  9714. if (!_isUndefined(obj["Text"])) {
  9715. this.m_text=obj["Text"];
  9716. }
  9717. if (!_isUndefined(obj["_Id"])) {
  9718. this.m__Id=obj["_Id"];
  9719. }
  9720. if (!_isUndefined(obj["_ReferenceId"])) {
  9721. this.m__ReferenceId=obj["_ReferenceId"];
  9722. }
  9723. _handleNavigationPropertyResults(this, obj, ["contentControls", "ContentControls", "font", "Font", "paragraphs", "Paragraphs", "parentContentControl", "ParentContentControl"]);
  9724. };
  9725. Range.prototype.load=function (option) {
  9726. _load(this, option);
  9727. return this;
  9728. };
  9729. Range.prototype._initReferenceId=function (value) {
  9730. this.m__ReferenceId=value;
  9731. };
  9732. return Range;
  9733. })(OfficeExtension.ClientObject);
  9734. Word.Range=Range;
  9735. var SearchOptions=(function (_super) {
  9736. __extends(SearchOptions, _super);
  9737. function SearchOptions() {
  9738. _super.apply(this, arguments);
  9739. }
  9740. Object.defineProperty(SearchOptions.prototype, "ignorePunct", {
  9741. get: function () {
  9742. _throwIfNotLoaded("ignorePunct", this.m_ignorePunct);
  9743. return this.m_ignorePunct;
  9744. },
  9745. set: function (value) {
  9746. this.m_ignorePunct=value;
  9747. _createSetPropertyAction(this.context, this, "IgnorePunct", value);
  9748. },
  9749. enumerable: true,
  9750. configurable: true
  9751. });
  9752. Object.defineProperty(SearchOptions.prototype, "ignoreSpace", {
  9753. get: function () {
  9754. _throwIfNotLoaded("ignoreSpace", this.m_ignoreSpace);
  9755. return this.m_ignoreSpace;
  9756. },
  9757. set: function (value) {
  9758. this.m_ignoreSpace=value;
  9759. _createSetPropertyAction(this.context, this, "IgnoreSpace", value);
  9760. },
  9761. enumerable: true,
  9762. configurable: true
  9763. });
  9764. Object.defineProperty(SearchOptions.prototype, "matchCase", {
  9765. get: function () {
  9766. _throwIfNotLoaded("matchCase", this.m_matchCase);
  9767. return this.m_matchCase;
  9768. },
  9769. set: function (value) {
  9770. this.m_matchCase=value;
  9771. _createSetPropertyAction(this.context, this, "MatchCase", value);
  9772. },
  9773. enumerable: true,
  9774. configurable: true
  9775. });
  9776. Object.defineProperty(SearchOptions.prototype, "matchPrefix", {
  9777. get: function () {
  9778. _throwIfNotLoaded("matchPrefix", this.m_matchPrefix);
  9779. return this.m_matchPrefix;
  9780. },
  9781. set: function (value) {
  9782. this.m_matchPrefix=value;
  9783. _createSetPropertyAction(this.context, this, "MatchPrefix", value);
  9784. },
  9785. enumerable: true,
  9786. configurable: true
  9787. });
  9788. Object.defineProperty(SearchOptions.prototype, "matchSoundsLike", {
  9789. get: function () {
  9790. _throwIfNotLoaded("matchSoundsLike", this.m_matchSoundsLike);
  9791. return this.m_matchSoundsLike;
  9792. },
  9793. set: function (value) {
  9794. this.m_matchSoundsLike=value;
  9795. _createSetPropertyAction(this.context, this, "MatchSoundsLike", value);
  9796. },
  9797. enumerable: true,
  9798. configurable: true
  9799. });
  9800. Object.defineProperty(SearchOptions.prototype, "matchSuffix", {
  9801. get: function () {
  9802. _throwIfNotLoaded("matchSuffix", this.m_matchSuffix);
  9803. return this.m_matchSuffix;
  9804. },
  9805. set: function (value) {
  9806. this.m_matchSuffix=value;
  9807. _createSetPropertyAction(this.context, this, "MatchSuffix", value);
  9808. },
  9809. enumerable: true,
  9810. configurable: true
  9811. });
  9812. Object.defineProperty(SearchOptions.prototype, "matchWholeWord", {
  9813. get: function () {
  9814. _throwIfNotLoaded("matchWholeWord", this.m_matchWholeWord);
  9815. return this.m_matchWholeWord;
  9816. },
  9817. set: function (value) {
  9818. this.m_matchWholeWord=value;
  9819. _createSetPropertyAction(this.context, this, "MatchWholeWord", value);
  9820. },
  9821. enumerable: true,
  9822. configurable: true
  9823. });
  9824. Object.defineProperty(SearchOptions.prototype, "matchWildCards", {
  9825. get: function () {
  9826. _throwIfNotLoaded("matchWildCards", this.m_matchWildCards);
  9827. return this.m_matchWildCards;
  9828. },
  9829. set: function (value) {
  9830. this.m_matchWildCards=value;
  9831. _createSetPropertyAction(this.context, this, "MatchWildCards", value);
  9832. },
  9833. enumerable: true,
  9834. configurable: true
  9835. });
  9836. SearchOptions.prototype._handleResult=function (value) {
  9837. if (_isNullOrUndefined(value))
  9838. return;
  9839. var obj=value;
  9840. _fixObjectPathIfNecessary(this, obj);
  9841. if (!_isUndefined(obj["IgnorePunct"])) {
  9842. this.m_ignorePunct=obj["IgnorePunct"];
  9843. }
  9844. if (!_isUndefined(obj["IgnoreSpace"])) {
  9845. this.m_ignoreSpace=obj["IgnoreSpace"];
  9846. }
  9847. if (!_isUndefined(obj["MatchCase"])) {
  9848. this.m_matchCase=obj["MatchCase"];
  9849. }
  9850. if (!_isUndefined(obj["MatchPrefix"])) {
  9851. this.m_matchPrefix=obj["MatchPrefix"];
  9852. }
  9853. if (!_isUndefined(obj["MatchSoundsLike"])) {
  9854. this.m_matchSoundsLike=obj["MatchSoundsLike"];
  9855. }
  9856. if (!_isUndefined(obj["MatchSuffix"])) {
  9857. this.m_matchSuffix=obj["MatchSuffix"];
  9858. }
  9859. if (!_isUndefined(obj["MatchWholeWord"])) {
  9860. this.m_matchWholeWord=obj["MatchWholeWord"];
  9861. }
  9862. if (!_isUndefined(obj["MatchWildCards"])) {
  9863. this.m_matchWildCards=obj["MatchWildCards"];
  9864. }
  9865. };
  9866. SearchOptions.prototype.load=function (option) {
  9867. _load(this, option);
  9868. return this;
  9869. };
  9870. SearchOptions.newObject=function (context) {
  9871. var ret=new Word.SearchOptions(context, _createNewObjectObjectPath(context, "Microsoft.WordServices.SearchOptions", false));
  9872. return ret;
  9873. };
  9874. return SearchOptions;
  9875. })(OfficeExtension.ClientObject);
  9876. Word.SearchOptions=SearchOptions;
  9877. var SearchResultCollection=(function (_super) {
  9878. __extends(SearchResultCollection, _super);
  9879. function SearchResultCollection() {
  9880. _super.apply(this, arguments);
  9881. }
  9882. Object.defineProperty(SearchResultCollection.prototype, "items", {
  9883. get: function () {
  9884. _throwIfNotLoaded("items", this.m__items);
  9885. return this.m__items;
  9886. },
  9887. enumerable: true,
  9888. configurable: true
  9889. });
  9890. Object.defineProperty(SearchResultCollection.prototype, "_ReferenceId", {
  9891. get: function () {
  9892. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9893. return this.m__ReferenceId;
  9894. },
  9895. enumerable: true,
  9896. configurable: true
  9897. });
  9898. SearchResultCollection.prototype._GetItem=function (index) {
  9899. return new Word.Range(this.context, _createIndexerObjectPath(this.context, this, [index]));
  9900. };
  9901. SearchResultCollection.prototype._KeepReference=function () {
  9902. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9903. };
  9904. SearchResultCollection.prototype._handleResult=function (value) {
  9905. if (_isNullOrUndefined(value))
  9906. return;
  9907. var obj=value;
  9908. _fixObjectPathIfNecessary(this, obj);
  9909. if (!_isUndefined(obj["_ReferenceId"])) {
  9910. this.m__ReferenceId=obj["_ReferenceId"];
  9911. }
  9912. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  9913. this.m__items=[];
  9914. var _data=obj[OfficeExtension.Constants.items];
  9915. for (var i=0; i < _data.length; i++) {
  9916. var _item=new Word.Range(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  9917. _item._handleResult(_data[i]);
  9918. this.m__items.push(_item);
  9919. }
  9920. }
  9921. };
  9922. SearchResultCollection.prototype.load=function (option) {
  9923. _load(this, option);
  9924. return this;
  9925. };
  9926. SearchResultCollection.prototype._initReferenceId=function (value) {
  9927. this.m__ReferenceId=value;
  9928. };
  9929. return SearchResultCollection;
  9930. })(OfficeExtension.ClientObject);
  9931. Word.SearchResultCollection=SearchResultCollection;
  9932. var Section=(function (_super) {
  9933. __extends(Section, _super);
  9934. function Section() {
  9935. _super.apply(this, arguments);
  9936. }
  9937. Object.defineProperty(Section.prototype, "body", {
  9938. get: function () {
  9939. if (!this.m_body) {
  9940. this.m_body=new Word.Body(this.context, _createPropertyObjectPath(this.context, this, "Body", false, false));
  9941. }
  9942. return this.m_body;
  9943. },
  9944. enumerable: true,
  9945. configurable: true
  9946. });
  9947. Object.defineProperty(Section.prototype, "_Id", {
  9948. get: function () {
  9949. _throwIfNotLoaded("_Id", this.m__Id);
  9950. return this.m__Id;
  9951. },
  9952. enumerable: true,
  9953. configurable: true
  9954. });
  9955. Object.defineProperty(Section.prototype, "_ReferenceId", {
  9956. get: function () {
  9957. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  9958. return this.m__ReferenceId;
  9959. },
  9960. enumerable: true,
  9961. configurable: true
  9962. });
  9963. Section.prototype.getFooter=function (type) {
  9964. return new Word.Body(this.context, _createMethodObjectPath(this.context, this, "GetFooter", 1 , [type], false, true));
  9965. };
  9966. Section.prototype.getHeader=function (type) {
  9967. return new Word.Body(this.context, _createMethodObjectPath(this.context, this, "GetHeader", 1 , [type], false, true));
  9968. };
  9969. Section.prototype._KeepReference=function () {
  9970. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  9971. };
  9972. Section.prototype._handleResult=function (value) {
  9973. if (_isNullOrUndefined(value))
  9974. return;
  9975. var obj=value;
  9976. _fixObjectPathIfNecessary(this, obj);
  9977. if (!_isUndefined(obj["_Id"])) {
  9978. this.m__Id=obj["_Id"];
  9979. }
  9980. if (!_isUndefined(obj["_ReferenceId"])) {
  9981. this.m__ReferenceId=obj["_ReferenceId"];
  9982. }
  9983. _handleNavigationPropertyResults(this, obj, ["body", "Body"]);
  9984. };
  9985. Section.prototype.load=function (option) {
  9986. _load(this, option);
  9987. return this;
  9988. };
  9989. Section.prototype._initReferenceId=function (value) {
  9990. this.m__ReferenceId=value;
  9991. };
  9992. return Section;
  9993. })(OfficeExtension.ClientObject);
  9994. Word.Section=Section;
  9995. var SectionCollection=(function (_super) {
  9996. __extends(SectionCollection, _super);
  9997. function SectionCollection() {
  9998. _super.apply(this, arguments);
  9999. }
  10000. Object.defineProperty(SectionCollection.prototype, "items", {
  10001. get: function () {
  10002. _throwIfNotLoaded("items", this.m__items);
  10003. return this.m__items;
  10004. },
  10005. enumerable: true,
  10006. configurable: true
  10007. });
  10008. Object.defineProperty(SectionCollection.prototype, "_ReferenceId", {
  10009. get: function () {
  10010. _throwIfNotLoaded("_ReferenceId", this.m__ReferenceId);
  10011. return this.m__ReferenceId;
  10012. },
  10013. enumerable: true,
  10014. configurable: true
  10015. });
  10016. SectionCollection.prototype._GetItem=function (index) {
  10017. return new Word.Section(this.context, _createIndexerObjectPath(this.context, this, [index]));
  10018. };
  10019. SectionCollection.prototype._KeepReference=function () {
  10020. _createMethodAction(this.context, this, "_KeepReference", 1 , []);
  10021. };
  10022. SectionCollection.prototype._handleResult=function (value) {
  10023. if (_isNullOrUndefined(value))
  10024. return;
  10025. var obj=value;
  10026. _fixObjectPathIfNecessary(this, obj);
  10027. if (!_isUndefined(obj["_ReferenceId"])) {
  10028. this.m__ReferenceId=obj["_ReferenceId"];
  10029. }
  10030. if (!_isNullOrUndefined(obj[OfficeExtension.Constants.items])) {
  10031. this.m__items=[];
  10032. var _data=obj[OfficeExtension.Constants.items];
  10033. for (var i=0; i < _data.length; i++) {
  10034. var _item=new Word.Section(this.context, _createChildItemObjectPathUsingIndexer(this.context, this, _data[i]));
  10035. _item._handleResult(_data[i]);
  10036. this.m__items.push(_item);
  10037. }
  10038. }
  10039. };
  10040. SectionCollection.prototype.load=function (option) {
  10041. _load(this, option);
  10042. return this;
  10043. };
  10044. SectionCollection.prototype._initReferenceId=function (value) {
  10045. this.m__ReferenceId=value;
  10046. };
  10047. return SectionCollection;
  10048. })(OfficeExtension.ClientObject);
  10049. Word.SectionCollection=SectionCollection;
  10050. var ContentControlType;
  10051. (function (ContentControlType) {
  10052. ContentControlType.richText="RichText";
  10053. })(ContentControlType=Word.ContentControlType || (Word.ContentControlType={}));
  10054. var ContentControlAppearance;
  10055. (function (ContentControlAppearance) {
  10056. ContentControlAppearance.boundingBox="BoundingBox";
  10057. ContentControlAppearance.tags="Tags";
  10058. ContentControlAppearance.hidden="Hidden";
  10059. })(ContentControlAppearance=Word.ContentControlAppearance || (Word.ContentControlAppearance={}));
  10060. var UnderlineType;
  10061. (function (UnderlineType) {
  10062. UnderlineType.none="None";
  10063. UnderlineType.single="Single";
  10064. UnderlineType.word="Word";
  10065. UnderlineType.double="Double";
  10066. UnderlineType.dotted="Dotted";
  10067. UnderlineType.hidden="Hidden";
  10068. UnderlineType.thick="Thick";
  10069. UnderlineType.dashLine="DashLine";
  10070. UnderlineType.dotLine="DotLine";
  10071. UnderlineType.dotDashLine="DotDashLine";
  10072. UnderlineType.twoDotDashLine="TwoDotDashLine";
  10073. UnderlineType.wave="Wave";
  10074. })(UnderlineType=Word.UnderlineType || (Word.UnderlineType={}));
  10075. var BreakType;
  10076. (function (BreakType) {
  10077. BreakType.page="Page";
  10078. BreakType.column="Column";
  10079. BreakType.next="Next";
  10080. BreakType.sectionContinuous="SectionContinuous";
  10081. BreakType.sectionEven="SectionEven";
  10082. BreakType.sectionOdd="SectionOdd";
  10083. BreakType.line="Line";
  10084. BreakType.lineClearLeft="LineClearLeft";
  10085. BreakType.lineClearRight="LineClearRight";
  10086. BreakType.textWrapping="TextWrapping";
  10087. })(BreakType=Word.BreakType || (Word.BreakType={}));
  10088. var InsertLocation;
  10089. (function (InsertLocation) {
  10090. InsertLocation.before="Before";
  10091. InsertLocation.after="After";
  10092. InsertLocation.start="Start";
  10093. InsertLocation.end="End";
  10094. InsertLocation.replace="Replace";
  10095. })(InsertLocation=Word.InsertLocation || (Word.InsertLocation={}));
  10096. var Alignment;
  10097. (function (Alignment) {
  10098. Alignment.unknown="Unknown";
  10099. Alignment.left="Left";
  10100. Alignment.centered="Centered";
  10101. Alignment.right="Right";
  10102. Alignment.justified="Justified";
  10103. })(Alignment=Word.Alignment || (Word.Alignment={}));
  10104. var HeaderFooterType;
  10105. (function (HeaderFooterType) {
  10106. HeaderFooterType.primary="Primary";
  10107. HeaderFooterType.firstPage="FirstPage";
  10108. HeaderFooterType.evenPages="EvenPages";
  10109. })(HeaderFooterType=Word.HeaderFooterType || (Word.HeaderFooterType={}));
  10110. var ErrorCodes;
  10111. (function (ErrorCodes) {
  10112. ErrorCodes.accessDenied="AccessDenied";
  10113. ErrorCodes.generalException="GeneralException";
  10114. ErrorCodes.invalidArgument="InvalidArgument";
  10115. ErrorCodes.itemNotFound="ItemNotFound";
  10116. ErrorCodes.notImplemented="NotImplemented";
  10117. })(ErrorCodes=Word.ErrorCodes || (Word.ErrorCodes={}));
  10118. })(Word || (Word={}));
  10119. var Word;
  10120. (function (Word) {
  10121. var RequestContext=(function (_super) {
  10122. __extends(RequestContext, _super);
  10123. function RequestContext(url) {
  10124. _super.call(this, url);
  10125. this.m_document=new Word.Document(this, OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(this));
  10126. this._rootObject=this.m_document;
  10127. }
  10128. Object.defineProperty(RequestContext.prototype, "document", {
  10129. get: function () {
  10130. return this.m_document;
  10131. },
  10132. enumerable: true,
  10133. configurable: true
  10134. });
  10135. return RequestContext;
  10136. })(OfficeExtension.ClientRequestContext);
  10137. Word.RequestContext=RequestContext;
  10138. function run(batch) {
  10139. return OfficeExtension.ClientRequestContext._run(function () { return new Word.RequestContext(); }, batch);
  10140. }
  10141. Word.run=run;
  10142. })(Word || (Word={}));