{"4":"tiddlyclass-class-fun101","$:/.tb/modules/startup/hide-sidebar.js":"tiddlyclass","$:/1":"tiddlyclass-class-fun101","$:/10":"tiddlyclass-class-fun101","$:/2":"tiddlyclass-class-fun101","$:/3":"tiddlyclass-class-fun101","$:/4":"tiddlyclass-class-fun101","$:/5":"tiddlyclass-class-fun101","$:/6":"tiddlyclass-class-fun101","$:/DefaultTiddlers":"tiddlyclass","$:/Enhanced communication skills-explained":"tiddlyclass-class-fun101","$:/SiteSubtitle":"tiddlyclass-class-fun101","$:/SiteTitle":"tiddlyclass-class-fun101","$:/Zotero Resource Macros":"tiddlyclass-classes","$:/_ExcelImporter/ImportSpecifiers/Workbook":"tiddlyclass-classes","$:/config/HideSidebarOnStartup":"tiddlyclass","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home":"tiddlyclass","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import":"tiddlyclass-classes","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh":"tiddlyclass","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview":"tiddlyclass-class-fun101","$:/config/PageControlButtons/Visibility/$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette":"tiddlyclass","$:/config/RelinkOnRename":"tiddlyclass-classes","$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here":"tiddlyclass","$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/pagecontrols":"tiddlyclass","$:/config/plugins/menubar/TableOfContents/Tag":"tiddlyclass","$:/favicon.ico":"tiddlyclass-class-fun101","$:/palette":"tiddlyclass-class-fun101","$:/palettes/VanillaFUN101":"tiddlyclass-class-fun101","$:/palettes/VanillaTiddlyCampus":"tiddlyclass","$:/palettes/VanillaTiddlyClass":"tiddlyclass","$:/plugins/eucaly/popuptagger":"tiddlyclass","$:/plugins/flibbles/relink":"tiddlyclass","$:/plugins/kookma/shiraz":"tiddlyclass","$:/plugins/kookma/tamasha":"tiddlyclass-classes","$:/plugins/kookma/tamasha-themes":"tiddlyclass-classes","$:/plugins/telmiger/details":"tiddlyclass","$:/plugins/tiddlywiki/bibtex":"tiddlyclass-classes","$:/plugins/tiddlywiki/jszip":"tiddlyclass","$:/plugins/tiddlywiki/menubar":"tiddlyclass","$:/plugins/tiddlywiki/xlsx-utils":"tiddlyclass","$:/plugins/tobibeer/appear":"tiddlyclass","$:/selected-objective":"tiddlyclass-class-fun101","$:/selected-objectives":"tiddlyclass-class-fun101","$:/selected-outcomes":"tiddlyclass-class-fun101","$:/tiddlyclass/Assignments":"tiddlyclass","$:/tiddlyclass/Calendar":"tiddlyclass","$:/tiddlyclass/Catalog Description":"tiddlyclass","$:/tiddlyclass/Contents":"tiddlyclass","$:/tiddlyclass/Learning Objectives":"tiddlyclass","$:/tiddlyclass/Professor Contact Information":"tiddlyclass","$:/tiddlyclass/Student Learning Outcomes":"tiddlyclass","$:/tiddlyclass/Welcome":"tiddlyclass","$:/tiddlyclass/class":"tiddlyclass","$:/view":"tiddlyclass-class-fun101","-explained":"tiddlyclass-class-fun101","003542b7-2cf9-4606-8e06-30ff7115f69a":"tiddlyclass-class-fun101","006181e9-c29c-4a53-a1bb-761dfb7ea79d":"tiddlyclass-class-fun101","0073ba83-2409-4e3f-b41b-bd66e89e4f1f":"tiddlyclass-class-fun101","0076757e-e680-4c5f-94a3-af4d4f21e15d":"tiddlyclass-class-fun101","00799199-95b5-4dd6-8e8d-56c98919c1f7":"tiddlyclass-class-fun101","00c84cd8-7411-41f0-92bb-bb5d3d503c68":"tiddlyclass-class-fun101","0129a7ba-39a3-4aed-be13-2277d1e7cc8a":"tiddlyclass-class-fun101","01e604a1-6601-4bc1-88b4-cfc0ac30b6cb":"tiddlyclass-class-fun101","01f30994-5e76-43e6-a5af-ce7a7c7fc58a":"tiddlyclass-class-fun101","02524b9d-34d9-4355-b7d7-fca54eb339eb":"tiddlyclass-class-fun101","02a739ef-f43d-47dd-aade-887e4a556aa3":"tiddlyclass-class-fun101","02f46318-425f-4371-a5f1-35e61f4d4aed":"tiddlyclass-class-fun101","0312d6fd-79c0-4b81-a464-71ea51b18d8b":"tiddlyclass-class-fun101","507 GOO Choice Assignment Writer":"tiddlyclass-class-fun101","507 GOO Choice Results":"tiddlyclass-class-fun101","507-Broader Theoretical Questions":"tiddlyclass-class-fun101","507-Teaching approach fall2022 and prior":"tiddlyclass-class-fun101","507GOO":"tiddlyclass-class-fun101","AbortionDocumentGale":"tiddlyclass-class-fun101","AbortionDocumentGalea":"tiddlyclass-class-fun101","Accessing Articles from SUNY Poly via LibKey using DOI via Zotero":"tiddlyclass-classes","Accommodations for Students with Accessibility Needs":"tiddlyclass-classes","Actor-Network Theory":"tiddlyclass-class-fun101","Adapt":"tiddlyclass-class-fun101","Advanced Information Architecture":"tiddlyclass-class-fun101","Advanced Mathematical Understanding":"tiddlyclass-class-fun101","Affordance Theory":"tiddlyclass-class-fun101","Analyze":"tiddlyclass-class-fun101","Analyze Apply Technologies":"tiddlyclass-class-fun101","Application":"tiddlyclass-class-fun101","Apply":"tiddlyclass-class-fun101","AssistedSuicideDeserves":"tiddlyclass-class-fun101","AssistedSuicideDocument":"tiddlyclass-class-fun101","AssistedSuicideMoral":"tiddlyclass-class-fun101","BioethicsDocumentGale":"tiddlyclass-class-fun101","Browse":"tiddlyclass-class-fun101","COM 375 Learning Objectives":"tiddlyclass-class-fun101","COM 375 Learning Outcomes":"tiddlyclass-class-fun101","COM375 Summer 2023 Build":"tiddlyclass-class-fun101","CanadaKillingRegime":"tiddlyclass-class-fun101","Catalog Description":"tiddlyclass-classes","Choosing 507GOO":"tiddlyclass-class-fun101","Cognitive Load Theory":"tiddlyclass-class-fun101","Collaborate":"tiddlyclass-class-fun101","Completion/Demonstration/Presentation":"tiddlyclass-class-fun101","ConceptionHowIt":"tiddlyclass-class-fun101","ConsequentialismDocumentGale":"tiddlyclass-class-fun101","Contents":"tiddlyclass-class-fun101","Create":"tiddlyclass-class-fun101","Critical Theory":"tiddlyclass-class-fun101","Critique":"tiddlyclass-class-fun101","Cultural Materialism Theory":"tiddlyclass-class-fun101","Cultural Studies Theory":"tiddlyclass-class-fun101","D2L Brightspace Build":"tiddlyclass-class-fun101","DWS Style Sheet":"tiddlyclass-classes","Define your own outcomes based on your goals and objectives":"tiddlyclass-class-fun101","Delete current conversations":"tiddlyclass-class-fun101","Designing Inclusive Experiences":"tiddlyclass-class-fun101","DesperatePleasSmuggled2022":"tiddlyclass-class-fun101","Diffusion of Innovation Theory":"tiddlyclass-class-fun101","Discover":"tiddlyclass-class-fun101","Draft of 'Simple case 1' by steve":"tiddlyclass-class-fun101","Draft of Project Proposal":"tiddlyclass-class-fun101","Enhanced Communication Skills":"tiddlyclass-class-fun101","Enhanced Leadership Capabilities":"tiddlyclass-class-fun101","Enhanced ability to engage with digital information":"tiddlyclass-class-fun101","Enhanced communication skills-explained":"tiddlyclass-class-fun101","Ep343When":"tiddlyclass-class-fun101","Episode14Euthanasia":"tiddlyclass-class-fun101","Ethical Considerations in IT":"tiddlyclass-class-fun101","Evaluate":"tiddlyclass-class-fun101","Evaluate Usability Systems":"tiddlyclass-class-fun101","Evaluation":"tiddlyclass-class-fun101","Examine past course iterations":"tiddlyclass-class-fun101","Expanded Historical Knowledge":"tiddlyclass-class-fun101","Expanded knowledge of historical events-explained":"tiddlyclass-class-fun101","FamilyTree/Stylesheet":"tiddlyclass-class-fun101","Feminist Theory":"tiddlyclass-class-fun101","Form Preparation":"tiddlyclass-classes","From the Memex to Xememex":"tiddlyclass-classes","GeneticsReproductiveTechnologies":"tiddlyclass-class-fun101","Goals, Objectives, Outcomes":"tiddlyclass-class-fun101","Goals, Objectives, Outcomes hypertextualized":"tiddlyclass-class-fun101","Goals, Objectives, Outcomes hypertextualized .01":"tiddlyclass-class-fun101","Goals, Objectives, Outcomes hypertextualized 1":"tiddlyclass-class-fun101","Goals, Objectives, Outcomes hypertextualized 1 1":"tiddlyclass-class-fun101","Google Form Submission":"tiddlyclass-classes","GuideSynthesisEssays":"tiddlyclass-class-fun101","HelloThere":"tiddlyclass-class-fun101","How did gender dynamics manifest in oral cultures and communication practices?":"tiddlyclass-class-fun101","How did material conditions shape the evolution and spread of oral traditions?":"tiddlyclass-class-fun101","How did new oral communication technologies spread and get adopted across different groups?":"tiddlyclass-class-fun101","How did oral communication impact cognitive load and information processing?":"tiddlyclass-class-fun101","How did orality shape the overall ecological relationships within human societies?":"tiddlyclass-class-fun101","How do cultural and social factors shape the development and use of oral communication technologies?":"tiddlyclass-class-fun101","How do language and meaning systems shape oral communication and knowledge construction?":"tiddlyclass-class-fun101","How do oral traditions and storytelling shape cultural identities and practices?":"tiddlyclass-class-fun101","How do power dynamics influence the distribution and control of oral information?":"tiddlyclass-class-fun101","How do social interactions and knowledge formation occur in oral cultures?":"tiddlyclass-class-fun101","How do social networks and relationships function within oral cultures?":"tiddlyclass-class-fun101","How does oral knowledge production and dissemination intersect with colonial power structures?":"tiddlyclass-class-fun101","How does the exchange of information and resources occur within oral communities?":"tiddlyclass-class-fun101","IDT 507 Objectives":"tiddlyclass-class-fun101","IDT 507 Outcomes":"tiddlyclass-class-fun101","IDT507-Redesign":"tiddlyclass-class-fun101","IDT553":"tiddlyclass-class-fun101","ImplicationsDefiningWhen2015":"tiddlyclass-class-fun101","Import OpenAI ChatGPT Archive":"tiddlyclass-class-fun101","Improved Time Management":"tiddlyclass-class-fun101","Increased Cultural Competency":"tiddlyclass-class-fun101","Information Project Management":"tiddlyclass-class-fun101","Information Retrieval Strategies":"tiddlyclass-class-fun101","Information Security Practices":"tiddlyclass-class-fun101","Innovate":"tiddlyclass-class-fun101","Learning Path":"tiddlyclass-class-fun101","Learning Resources":"tiddlyclass-class-fun101","Learning Resources by Type":"tiddlyclass-classes","Learning goals":"tiddlyclass-class-fun101","Learning objectives":"tiddlyclass-class-fun101","Learning outcomes":"tiddlyclass-class-fun101","Legal Policy Issues":"tiddlyclass-class-fun101","Media Ecology Theory":"tiddlyclass-class-fun101","Modules":"tiddlyclass-class-fun101","Multimedia Production Storytelling":"tiddlyclass-class-fun101","Network Society Theory":"tiddlyclass-class-fun101","New Tiddler":"tiddlyclass-class-fun101","New Tiddler 1":"tiddlyclass-class-fun101","New Tiddler 2":"tiddlyclass-class-fun101","No definition of hypertext is offered by Bernstein":"tiddlyclass-classes","Order of things":"tiddlyclass-class-fun101","Organize":"tiddlyclass-class-fun101","Outcome":"tiddlyclass-class-fun101","Participatory Culture Theory":"tiddlyclass-class-fun101","Perspective":"tiddlyclass-class-fun101","Phase 1":"tiddlyclass-class-fun101","Phase 2":"tiddlyclass-class-fun101","Phase 3":"tiddlyclass-class-fun101","PhilosophyBites":"tiddlyclass-class-fun101","PhilosophyBitesRaymond":"tiddlyclass-class-fun101","PhysicianPerspective2023":"tiddlyclass-class-fun101","Postcolonial Theory":"tiddlyclass-class-fun101","Poststructuralist Theory":"tiddlyclass-class-fun101","ProQuestEbookCentral":"tiddlyclass-class-fun101","ProQuestEbookCentrala":"tiddlyclass-class-fun101","ProQuestEbookCentralb":"tiddlyclass-class-fun101","Professor Contact Information":"tiddlyclass-classes","Proficiency Content Strategy":"tiddlyclass-class-fun101","Proficiency Project Management":"tiddlyclass-class-fun101","Proposal":"tiddlyclass-class-fun101","Read":"tiddlyclass-class-fun101","Reflect":"tiddlyclass-class-fun101","RenameTags":"tiddlyclass-classes","ReproductiveTechnologies1012007":"tiddlyclass-class-fun101","Review":"tiddlyclass-class-fun101","ScottSignsBill2022":"tiddlyclass-class-fun101","SearchFor":"tiddlyclass-class-fun101","Semester Calendar":"tiddlyclass","Share":"tiddlyclass-class-fun101","Simple case":"tiddlyclass-class-fun101","Social Capital Theory":"tiddlyclass-class-fun101","Social Construction of Technology Theory":"tiddlyclass-class-fun101","Student Learning Outcomes":"tiddlyclass-classes","SuicideDocumentGale":"tiddlyclass-class-fun101","Synthesize":"tiddlyclass-class-fun101","Telmiger Details Styles":"tiddlyclass-classes","This is an example of a tiddler in Classes":"tiddlyclass-classes","TiddlyCampus":"tiddlyclass","TiddlyClass":"tiddlyclass-classes","Uses & Gratifications Theory":"tiddlyclass-class-fun101","VideoAudioMoral":"tiddlyclass-class-fun101","Watch":"tiddlyclass-class-fun101","Welcome":"tiddlyclass-class-fun101","What affordances did oral communication provide for information exchange and social interaction?":"tiddlyclass-class-fun101","What are the participatory practices and modes of engagement in oral cultures?":"tiddlyclass-class-fun101","What were the social and psychological needs fulfilled by oral communication?":"tiddlyclass-class-fun101","WhoseRightsAre":"tiddlyclass-class-fun101","ZoteroGroupsForClasses":"tiddlyclass-classes","anderssenCanadaWillSoon2022":"tiddlyclass-class-fun101","article":"tiddlyclass-classes","audio":"tiddlyclass-classes","batemanExploringReproductionIt2020":"tiddlyclass-class-fun101","bernsteinDisasterDoubtOrigins2022":"tiddlyclass-classes","bibtex-entry-template":"tiddlyclass-classes","bibtex-field-template":"tiddlyclass-classes","book":"tiddlyclass-classes","brakeParenthoodProcreation2012":"tiddlyclass-class-fun101","bushWeMayThink1999":"tiddlyclass-classes","bushWeMayThink1999-Exercise3Annotation":"tiddlyclass-classes","chatgpt conversations":"tiddlyclass-class-fun101","chatgptconversation_template":"tiddlyclass-class-fun101","chatgptmessage_template":"tiddlyclass-class-fun101","christmanAutonomyMoralPolitical2020":"tiddlyclass-class-fun101","clarkeSanctityLifeSacred2023":"tiddlyclass-class-fun101","dameResolvedLegalAccess":"tiddlyclass-class-fun101","degraziaDefinitionDeath2007":"tiddlyclass-class-fun101","euchnerMoralityPolicy2019":"tiddlyclass-class-fun101","ex3-annotation template":"tiddlyclass-classes","gertDefinitionMorality2002":"tiddlyclass-class-fun101","hacking2008SuicideWeapon":"tiddlyclass-class-fun101","hackingSuicideWeapon2008":"tiddlyclass-class-fun101","incollection":"tiddlyclass-classes","inproceedings":"tiddlyclass-classes","inreference":"tiddlyclass-classes","jacksonRegulatingReproductionLaw2001":"tiddlyclass-class-fun101","kaczorDisputesBioethicsAbortion2020":"tiddlyclass-class-fun101","mariscalLife2021":"tiddlyclass-class-fun101","mccarthyWhySexSelection2001":"tiddlyclass-class-fun101","new today":"tiddlyclass","online":"tiddlyclass-classes","philosophyNewBooksPhilosophy":"tiddlyclass-class-fun101","pubPoliticsPubState":"tiddlyclass-class-fun101","python script written by chatgpt":"tiddlyclass-class-fun101","shapiroLawGoverningLGBTQparent2020":"tiddlyclass-class-fun101","shawProvidingMedicalAssistance2018":"tiddlyclass-class-fun101","software":"tiddlyclass-classes","tabs demo":"tiddlyclass-class-fun101","takeTakeExpansionAssisted":"tiddlyclass-class-fun101","technologiesMoralPsychology21":"tiddlyclass-class-fun101","theoretical-framework":"tiddlyclass-class-fun101","theoretical-framework-selected":"tiddlyclass-class-fun101","universityAssistedSuicide":"tiddlyclass-class-fun101","unpublished":"tiddlyclass-classes","video":"tiddlyclass-classes","walkerMostAbortionBans2023":"tiddlyclass-class-fun101","wikipedia macro":"tiddlyclass-class-fun101","youngVoluntaryEuthanasia1996":"tiddlyclass-class-fun101","zotero-bbt-annotation-macros":"tiddlyclass-classes","zotero-bbt-macros (depreciated)":"tiddlyclass-classes","zotero-resource template":"tiddlyclass-classes"}
{"4":"\"9d5b1660f1d3be79c4d1ae994de94e71\"","$:/.tb/modules/startup/hide-sidebar.js":"\"2c1ad62fc4d9d9ccea6802b872313aa2\"","$:/1":"\"d14b5e0d8d095076522346caac00f892\"","$:/10":"\"8517a534a14b59fd984702ec21e7f79f\"","$:/2":"\"6759c08a0e12e561cb8df2eff3cdd968\"","$:/3":"\"122bdc1726457d3da94554c6afdb0a0a\"","$:/4":"\"8925e6255ac72f3d4400a24ab94615bc\"","$:/5":"\"693e6ff9e6a7fcfa983a1a91abfdfc17\"","$:/6":"\"3206f821d28ae0309cff44603bc86c76\"","$:/DefaultTiddlers":"\"6ac3206133fb00b2c0fb6c0c23f62508\"","$:/Enhanced communication skills-explained":"\"fb0b3b7906a93834ef754402337a4658\"","$:/SiteSubtitle":"\"e8a29d995c8d3e5c40ad300ff67de34d\"","$:/SiteTitle":"\"93961a3cf184891e3840b49c37bbcf4a\"","$:/Zotero Resource Macros":"\"8e95f4a3895460b4045898802de38187\"","$:/_ExcelImporter/ImportSpecifiers/Workbook":"\"e4790db91be1db6ef0bf4d4ea876a796\"","$:/config/HideSidebarOnStartup":"\"5a91e5c05fe80709fb8f1401a2be5ce3\"","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home":"\"80544ebf45a38db5e153db249f333df3\"","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import":"\"c6d8742a474ec3a3a5fbc9307b3ba36e\"","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh":"\"56b3ae2bde67243c26598e1f21de417c\"","$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview":"\"21e9b6eb10bf96ac2ca80f49d3f18e13\"","$:/config/PageControlButtons/Visibility/$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette":"\"75dc7d84995e06d6430fe094d2e6f91c\"","$:/config/RelinkOnRename":"\"13fa1a99cf2b532e2bc3d779d7ad3ecb\"","$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here":"\"3f8e0c395f41b823c181b7e2e519641b\"","$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/pagecontrols":"\"3eb5a7aa6ac50d3fc670f8b2f185530d\"","$:/config/plugins/menubar/TableOfContents/Tag":"\"33bd9be7595d5408cfc83871d3464291\"","$:/favicon.ico":"\"7b894a8bf2d572ee2d9ce7fe96511f1b\"","$:/palette":"\"6e3587e42091efbcf46cceaa6319547c\"","$:/palettes/VanillaFUN101":"\"52a5813460dd2b5bb461213d853056f0\"","$:/palettes/VanillaTiddlyCampus":"\"31c72c9d4d1d1267c731b1501533d304\"","$:/palettes/VanillaTiddlyClass":"\"750b46cb27747ac4954db560ebbe4f0c\"","$:/plugins/eucaly/popuptagger":"\"17e25f064661ef81d4b72404204d0a34\"","$:/plugins/flibbles/relink":"\"93a23b9c45473c8b8b54ea51d9cc0d94\"","$:/plugins/kookma/shiraz":"\"c252064c874df92e8cf94ab423f1cb80\"","$:/plugins/kookma/tamasha":"\"b4736dec4d2a1df4435a138b46b86772\"","$:/plugins/kookma/tamasha-themes":"\"b9088e9fef0e583170f055b21cf55232\"","$:/plugins/telmiger/details":"\"d785a0d0448ea496becfc09e0ceb6923\"","$:/plugins/tiddlywiki/bibtex":"\"4df0ef7ca14816c89a2c4893dd229273\"","$:/plugins/tiddlywiki/jszip":"\"7c08a8f3aadb017ca8329bbb1542e462\"","$:/plugins/tiddlywiki/menubar":"\"01b1564276154b700d9f9a8bb973c18f\"","$:/plugins/tiddlywiki/xlsx-utils":"\"f72b94faed4606821c3dab7e2ac9ef47\"","$:/plugins/tobibeer/appear":"\"47cec762d13f78080d79ee0222f4f656\"","$:/selected-objective":"\"671cdd5a7a549f97f7225a1406770790\"","$:/selected-objectives":"\"58938acf3f1f8befc548290562fd6cb8\"","$:/selected-outcomes":"\"89aa34f771193febc213538f5fb449db\"","$:/tiddlyclass/Assignments":"\"73e5e582e85ae3afd88c1ce7a310ec7b\"","$:/tiddlyclass/Calendar":"\"6446a4cac4bfdea3fd8734542e727019\"","$:/tiddlyclass/Catalog Description":"\"20ff56930933bf55183fe7d723f6cb16\"","$:/tiddlyclass/Contents":"\"438ef08d5e71cf27020ce892161dc443\"","$:/tiddlyclass/Learning Objectives":"\"8bb6a36365ca383c5cf7f8b427b328c6\"","$:/tiddlyclass/Professor Contact Information":"\"8eee5e88cd13e990c167e9c779b1ef31\"","$:/tiddlyclass/Student Learning Outcomes":"\"ddd2f5687e971512d2eff325231f68e7\"","$:/tiddlyclass/Welcome":"\"6583d46d296748ee4ac07a0f894ef7b4\"","$:/tiddlyclass/class":"\"4f9a03169af33f914caf5c8136fa36b3\"","$:/view":"\"eaff2aeca5faf2c73fd5da319a2d207a\"","-explained":"\"9e1a9d1693ba3cd939e4bdbc17c56eca\"","003542b7-2cf9-4606-8e06-30ff7115f69a":"\"80959f4dcb5237df7b483701e1f87503\"","006181e9-c29c-4a53-a1bb-761dfb7ea79d":"\"72b8be4e3d01e00a212ca01c99b30226\"","0073ba83-2409-4e3f-b41b-bd66e89e4f1f":"\"5bcf5f62fff96f67eb49d186d6a765fc\"","0076757e-e680-4c5f-94a3-af4d4f21e15d":"\"4ee4a8358a8ce2008e64a57daa76bbca\"","00799199-95b5-4dd6-8e8d-56c98919c1f7":"\"075b4fd60aa8efaac20b105e74e7fdb9\"","00c84cd8-7411-41f0-92bb-bb5d3d503c68":"\"a28f9f4544b97ffffd19c44ada43fa87\"","0129a7ba-39a3-4aed-be13-2277d1e7cc8a":"\"4ea3f013b1a4abbb69f45badceac32e3\"","01e604a1-6601-4bc1-88b4-cfc0ac30b6cb":"\"004e10845ff252b842fe27522fac3e23\"","01f30994-5e76-43e6-a5af-ce7a7c7fc58a":"\"97245732636495cb340e06c10db836eb\"","02524b9d-34d9-4355-b7d7-fca54eb339eb":"\"86d662a1d345fadc86ad4568b922b9d6\"","02a739ef-f43d-47dd-aade-887e4a556aa3":"\"09fdc25b0f11c25cad9a9b5f91c710a3\"","02f46318-425f-4371-a5f1-35e61f4d4aed":"\"7930fb5df56e5ebeaa960664c6791eb2\"","0312d6fd-79c0-4b81-a464-71ea51b18d8b":"\"1a6d1aaf155038d02ac15c1cbe07537d\"","507 GOO Choice Assignment Writer":"\"c92c8989e4984f534c7f8abd10ae0489\"","507 GOO Choice Results":"\"cd5cee222e89800d5ec9c21f6da867fd\"","507-Broader Theoretical Questions":"\"e7b24c7bc8c2a8b02aaa15309f8ba83b\"","507-Teaching approach fall2022 and prior":"\"6949b0ae67167f30172ab27cb8cf88d5\"","507GOO":"\"6d5ef766ec135518059e5ceb3164411f\"","AbortionDocumentGale":"\"4a76afe04f00ffe08327f18224e42f00\"","AbortionDocumentGalea":"\"8505c42aee74392a7596eddcdbdc72ec\"","Accessing Articles from SUNY Poly via LibKey using DOI via Zotero":"\"7d24de7761d4e96e0496898ccd6895ad\"","Accommodations for Students with Accessibility Needs":"\"23a042e152045ee29d9c077b4eb474b5\"","Actor-Network Theory":"\"3ed2b58909830b7fde5189c38b1a5d6b\"","Adapt":"\"ffc056030db8b21efd3dab1328491a38\"","Advanced Information Architecture":"\"b76052304326c971e39bd1df584b0662\"","Advanced Mathematical Understanding":"\"3ae428e9cd340eefe64c50db63d0e73a\"","Affordance Theory":"\"d5266d42eb3562cb27e63bc5cef1a9bb\"","Analyze":"\"ad5c474501421485bd2e93275eb21d7b\"","Analyze Apply Technologies":"\"9973f9be88a60bb7cbf77b11ca8d5c42\"","Application":"\"8ec3bb86d02fd34877d759e1a1d8d960\"","Apply":"\"ff3f8faf3ab5d5d7e0012b1febd78191\"","AssistedSuicideDeserves":"\"aa52cd82a5610ea2303148ebe069402a\"","AssistedSuicideDocument":"\"e1276eae4c8ccd979619ea41f4502d44\"","AssistedSuicideMoral":"\"2559d270b751bab32cc8ffa3853eaba0\"","BioethicsDocumentGale":"\"d39c9a14200994046363512c00e12f1d\"","Browse":"\"828c13f103c08fab87e051f44f0f89ee\"","COM 375 Learning Objectives":"\"0b7a6d7a42df31328b4b8d0997183cb3\"","COM 375 Learning Outcomes":"\"b7a7eb5516d64b3834787a12e5f46117\"","COM375 Summer 2023 Build":"\"6dfa2b6f859510ae3694196545681afe\"","CanadaKillingRegime":"\"6616c7f9796fe90ef55cb67b80459b8a\"","Catalog Description":"\"3f1c4438c246571578f121e2cfa5b71a\"","Choosing 507GOO":"\"4febff4b514210cc1f13acff62d2d5f4\"","Cognitive Load Theory":"\"6d798128920bb9d06ac33ceb0301612c\"","Collaborate":"\"1dba066d195fd9a642ad9f4d8d5b9d56\"","Completion/Demonstration/Presentation":"\"1590a1ab31732df9bf20f15b4edc8444\"","ConceptionHowIt":"\"22b13e606b2c3b8e747b1c79516ce2e9\"","ConsequentialismDocumentGale":"\"ab6e3d8885e93d610f974fb8dd317d64\"","Contents":"\"232ea96d1af80fdb16a26b9227cc098b\"","Create":"\"bcfb0c3945df9bb9d2eb2ed6f18dd22b\"","Critical Theory":"\"4b898d370cd9961138638f6e35b56feb\"","Critique":"\"32377156156e9e9fbfe4c91f079525f4\"","Cultural Materialism Theory":"\"bc8bd219a8f610b498f216e8937594a6\"","Cultural Studies Theory":"\"cb435737d4fcb8ad6acc1c68e6b4a579\"","D2L Brightspace Build":"\"53071ecee4d94e52f8baf9fbe6b5229c\"","DWS Style Sheet":"\"2251f87f907097f0d83eb18179031930\"","Define your own outcomes based on your goals and objectives":"\"aeff1ee4dbf319a8a203c2f01b61a988\"","Delete current conversations":"\"fc730b17fabaf4604863240deacec1f4\"","Designing Inclusive Experiences":"\"5c17287de72b05517053530b5445f73a\"","DesperatePleasSmuggled2022":"\"c7670f619afa1eaebd21853ccaca635f\"","Diffusion of Innovation Theory":"\"af1608838e4ef9bd3524f9779ddb3049\"","Discover":"\"1445feaf848a358c1f59124616213a10\"","Draft of 'Simple case 1' by steve":"\"69b78577ad6e0890bf326e4f19289bc0\"","Draft of Project Proposal":"\"0f4756f738c6cc0cf88884fd4951476c\"","Enhanced Communication Skills":"\"482b3ce94604b9309bdd0073edd89604\"","Enhanced Leadership Capabilities":"\"91bad44625597dfd1ed752a327b694dc\"","Enhanced ability to engage with digital information":"\"0582c39beb0d961915cc7b2ff01a7b8a\"","Enhanced communication skills-explained":"\"25f010edd8986da77193259f0553c61b\"","Ep343When":"\"ab2d7174995605b9ec4c3d97b44d85d6\"","Episode14Euthanasia":"\"e054d1ba7d51195302f0eccb72b67ac2\"","Ethical Considerations in IT":"\"1c69e639c19b69297f7f27aa9990c586\"","Evaluate":"\"b5747605c1b3f259126426913727853d\"","Evaluate Usability Systems":"\"ee2a87cb781cde53f9b6689d93a8f592\"","Evaluation":"\"dabfb38b4a2f903b1594cd790eb0aa7a\"","Examine past course iterations":"\"49e287672a28af8100791d0960ec40ca\"","Expanded Historical Knowledge":"\"d07abf2dec5be2e7492ed4a3217351d3\"","Expanded knowledge of historical events-explained":"\"576e7924c1c1a776ef7988ae5805559b\"","FamilyTree/Stylesheet":"\"1c6f260783b4c0e77168eccac6b7f2c3\"","Feminist Theory":"\"287d6fa69055497d3e05f57a6aec6f5e\"","Form Preparation":"\"c699e5d612820ea7190131489c3cb26d\"","From the Memex to Xememex":"\"b82feec7f55de5eb0fe4241f96d2e9c2\"","GeneticsReproductiveTechnologies":"\"b288ef5aee4b740d827c3f23323adb78\"","Goals, Objectives, Outcomes":"\"8a410477b2f1535ea2eb31e73eb5d319\"","Goals, Objectives, Outcomes hypertextualized":"\"838568c9ad65c4e38332f60be4a9ebae\"","Goals, Objectives, Outcomes hypertextualized .01":"\"80e406c7ebfcfdd57b99cc7cebcad6b0\"","Goals, Objectives, Outcomes hypertextualized 1":"\"bad506bd9f31487a03b6b1e9cd01db8a\"","Goals, Objectives, Outcomes hypertextualized 1 1":"\"fe76631a83042d772a66efdc2ac31b17\"","Google Form Submission":"\"a2fcd287f553af4ad5b1123a644729dc\"","GuideSynthesisEssays":"\"a5c7774140b803ebf2a3f6f147f2cba0\"","HelloThere":"\"2716f4338864dfbe01d8ce232f688060\"","How did gender dynamics manifest in oral cultures and communication practices?":"\"8138c9d21006e7e16e8ee4e52ed60976\"","How did material conditions shape the evolution and spread of oral traditions?":"\"aff3bed05b92b60bfec13559de28bfd2\"","How did new oral communication technologies spread and get adopted across different groups?":"\"85d90817089c28c40a02d956b3d11232\"","How did oral communication impact cognitive load and information processing?":"\"11dcdea7318943c042aa33d791b6bc22\"","How did orality shape the overall ecological relationships within human societies?":"\"d7eed7a7d4b1504d8530b82acfe51510\"","How do cultural and social factors shape the development and use of oral communication technologies?":"\"89ef2128911cb01b4ab8acea3ce9c381\"","How do language and meaning systems shape oral communication and knowledge construction?":"\"3085ea7e225f35091cd724a4b74d543e\"","How do oral traditions and storytelling shape cultural identities and practices?":"\"08a1c5f9f9b90bba4985dc17a585f449\"","How do power dynamics influence the distribution and control of oral information?":"\"f9c6332e6c4a199419bd997273354efa\"","How do social interactions and knowledge formation occur in oral cultures?":"\"9958864d331dd12098b50beb78d3a965\"","How do social networks and relationships function within oral cultures?":"\"a69fc5fd52a54fb77e69a0f83ccca5b2\"","How does oral knowledge production and dissemination intersect with colonial power structures?":"\"88c035800de6b6d30b6842c667f270a4\"","How does the exchange of information and resources occur within oral communities?":"\"ee8a1df843beb4b0190861884658ea5e\"","IDT 507 Objectives":"\"737a0b0466bec34df8168232b7306df4\"","IDT 507 Outcomes":"\"681d64ba32128227758e118a77020665\"","IDT507-Redesign":"\"4afce648c1a08c2d73bf04972343e72e\"","IDT553":"\"d8e034bb8aa22f8166265eed96258534\"","ImplicationsDefiningWhen2015":"\"8e22b1e7b1d2be4deb9a1338780f8f81\"","Import OpenAI ChatGPT Archive":"\"292205b12648e194b465ef7fc8204ae2\"","Improved Time Management":"\"8a38a1458d2e623efb0661fa0fa8706c\"","Increased Cultural Competency":"\"9dc14c35c8ddadeb86ea2cc5a0759eac\"","Information Project Management":"\"ce380f1e94a659e12f254b170491242f\"","Information Retrieval Strategies":"\"ebaa3675fadb527b2502dd2a22f6cb85\"","Information Security Practices":"\"77183f19546828c0c85b1ffd093ebc21\"","Innovate":"\"1000af4fd5b14182dd782acbfab70f4f\"","Learning Path":"\"f6ce6ef323c6c3db39011909b2b21469\"","Learning Resources":"\"80731c6ae4f9a9219f7daf2ea87f4a29\"","Learning Resources by Type":"\"9d75353cbdbe6fc3b67176423f50724b\"","Learning goals":"\"ad214bb3010d7f2312ee4b66b31a2e2c\"","Learning objectives":"\"f63c3041c390cb41e14df98faa679bab\"","Learning outcomes":"\"5ce04f335611c64df772a3cbbd92ba25\"","Legal Policy Issues":"\"05c974852aeaba4067eecaa2fbab8c5e\"","Media Ecology Theory":"\"f6872604f169e8bac7fc4a99b683a541\"","Modules":"\"0480b45170d0faaf15007edf665b7eba\"","Multimedia Production Storytelling":"\"ef37965e66e456087e0196a4165d15ff\"","Network Society Theory":"\"8c49bf53a4f3eabb5b2f624c0ab2278a\"","New Tiddler":"\"50a476e0fdca2b8696047385687dc48a\"","New Tiddler 1":"\"494085b229b5cec425e6b3adebc2d850\"","New Tiddler 2":"\"62d68921a94da27c59831015411c2436\"","No definition of hypertext is offered by Bernstein":"\"087e9c8df06e07a5e332c6135b30544c\"","Order of things":"\"3cf664a8dc40dc01bb0890c9765758e0\"","Organize":"\"65c5716db80e0b3a52d49010c4ae40f6\"","Outcome":"\"9f04508558c06b56c7ddc6853af41d7a\"","Participatory Culture Theory":"\"cbdd512e6a1fd69b2fdda14b91d02daa\"","Perspective":"\"3db6532b42e3457718385d304c64f7f9\"","Phase 1":"\"f0cfa2175f3cc273e12ef47b7afc6001\"","Phase 2":"\"1fb6bb102e963335fcaa1b1239812ef1\"","Phase 3":"\"7fe3e26ccf3e9a02ef4da2ea53985931\"","PhilosophyBites":"\"540dbfed1355b162f74295884c6cb5ca\"","PhilosophyBitesRaymond":"\"decc032696b78a867b879403c7f5e7db\"","PhysicianPerspective2023":"\"15c28af9ffb30775412dd42ed068a064\"","Postcolonial Theory":"\"10b571ca4483e12501e6ab1bea14c4d6\"","Poststructuralist Theory":"\"54c8beff21e9ac35e4001bf71b6ce725\"","ProQuestEbookCentral":"\"95d930c239652fccc18d25e4ffa16676\"","ProQuestEbookCentrala":"\"22369bae44464bb18fb6a43fb09793b6\"","ProQuestEbookCentralb":"\"062c1eb5a924f683e99b1fada560613b\"","Professor Contact Information":"\"e6704ab5a87b9cb4f639c33a814675f0\"","Proficiency Content Strategy":"\"4101e7e88ecd2ce67ee0e87729b863d2\"","Proficiency Project Management":"\"dfaff1361877a5591004bf8beeb0feec\"","Proposal":"\"0d12b456cd9bbd4414a1e7d0123c57cf\"","Read":"\"bd84b6e6ebdbe0f30c8b2bb7794585bd\"","Reflect":"\"0a9dec9aed9e0d6db2b4c051d5b9fc3b\"","RenameTags":"\"f2aa40a1c9bea4bfc48c9dfaf2459a4a\"","ReproductiveTechnologies1012007":"\"e995ebbc1874fddc0d01bc593612cca4\"","Review":"\"81766793ac37a6c2a29100a230e95f54\"","ScottSignsBill2022":"\"f34ee30c67cb23a940cb1e419a519130\"","SearchFor":"\"45faa6ba50fa183052f53a01412d64f4\"","Semester Calendar":"\"7f85714db36662c11ed8783d34a485a5\"","Share":"\"94df880c757260cf3fd9c783b4689619\"","Simple case":"\"13d7f74fa630f60e3f30d81e0c99e158\"","Social Capital Theory":"\"2c94d24399f70e22861eb572cedbff3e\"","Social Construction of Technology Theory":"\"c9ee9c75b7608d1d608409bc9e12964c\"","Student Learning Outcomes":"\"f00aeb07c0e6103c7defc5032b050617\"","SuicideDocumentGale":"\"1e56d5dc12d0c80ad529b06e074c3206\"","Synthesize":"\"9c52201408cc603f3d2a74774fb6150b\"","Telmiger Details Styles":"\"d72ffcee476392389e664774dbfbd6a5\"","This is an example of a tiddler in Classes":"\"19b1f1b331cb5fc0d93fc93ca763ce68\"","TiddlyCampus":"\"dc3689dca8541332d04a8eafa5010874\"","TiddlyClass":"\"ca631247d7c9eb04e797db2e58ee1134\"","Uses & Gratifications Theory":"\"06b5e72ca512ac8556656668ed2000e0\"","VideoAudioMoral":"\"c65a729f1a48bbde765eba66affb27e3\"","Watch":"\"a6a2dcba6e90711fed9a52812d9f7ceb\"","Welcome":"\"64e6b8d6dbae505e3c454b8f2f1f34b7\"","What affordances did oral communication provide for information exchange and social interaction?":"\"d82fc0b297a1ac3bdc08a3f7e0f60853\"","What are the participatory practices and modes of engagement in oral cultures?":"\"9d6f4d6067154cec3713624fd4dc56c9\"","What were the social and psychological needs fulfilled by oral communication?":"\"13c5ec77d3d651f834f636078aad3681\"","WhoseRightsAre":"\"af853cdc9e2593505dfcb37414a2f8ff\"","ZoteroGroupsForClasses":"\"44a3711ade09aa58ed910e634bc734e9\"","anderssenCanadaWillSoon2022":"\"679d6e6739536911c177a59564013be9\"","article":"\"5bbea57c4d2b50752a7a4b2d56d2e623\"","audio":"\"d82687c540dc84d05aca7781afaf8459\"","batemanExploringReproductionIt2020":"\"7d41d73e599d1c95d1ee873ce41c2285\"","bernsteinDisasterDoubtOrigins2022":"\"789b45b02e4cf1b6e011d1c754a518ce\"","bibtex-entry-template":"\"577d80465dabbbd960fb681b0cb07c34\"","bibtex-field-template":"\"1d0c4ee9bdd89556344fe0bced729288\"","book":"\"3d2e7e3931c3022e77dbd318c26c656d\"","brakeParenthoodProcreation2012":"\"d863b28f56d1035bc0524dce9acb41f8\"","bushWeMayThink1999":"\"5f530d9abc6694d7cb27dfd578020623\"","bushWeMayThink1999-Exercise3Annotation":"\"c94118d8c7a47be4bf8da4ed3f045052\"","chatgpt conversations":"\"438ae4e8f69704e2b9947ed2b5135cc8\"","chatgptconversation_template":"\"1b5bcb599ca81a4e5a41b47ff820ec42\"","chatgptmessage_template":"\"f2a790120599742f5556305fcd85dc37\"","christmanAutonomyMoralPolitical2020":"\"96bb9d7e2f2a90120b9bcc0e2746ba53\"","clarkeSanctityLifeSacred2023":"\"1607dcb2ea6eb05f03fb25ee47da837d\"","dameResolvedLegalAccess":"\"aabb1fb6bcea813875d101f03a647418\"","degraziaDefinitionDeath2007":"\"1b3fa95926ec4e31a457d04756a750ce\"","euchnerMoralityPolicy2019":"\"2798fbe34c58559028d5207c78f136ec\"","ex3-annotation template":"\"37720cd6dd99fcc3a50796bd7d7a772d\"","gertDefinitionMorality2002":"\"64b15c5f91e607ed62ad07e000fa6573\"","hacking2008SuicideWeapon":"\"ab266ce352b22ac753e05c43b178129c\"","hackingSuicideWeapon2008":"\"87fa8a53f7e7754aeae33bf4b76ed124\"","incollection":"\"c70f61768ce50e50382b902ce136abb6\"","inproceedings":"\"1c3d9041368c37a1f8546fed964ab6fc\"","inreference":"\"5c4589e151697aa48f00ff65755623f9\"","jacksonRegulatingReproductionLaw2001":"\"888885ee1a54851c9c7d0615dc9e218a\"","kaczorDisputesBioethicsAbortion2020":"\"bd2913a5c2c1805f2a08f5868420b072\"","mariscalLife2021":"\"c16cb06a3c66b0d020c2bafb6d843365\"","mccarthyWhySexSelection2001":"\"fdbe055d3228e1c8f83df05749908930\"","new today":"\"e5da69c0a05b0ed1ae0a3e0d78d57bfb\"","online":"\"bf30c0dfc8811b19e03b79a430def2f4\"","philosophyNewBooksPhilosophy":"\"394e9557adba504d19b9242413012346\"","pubPoliticsPubState":"\"e6064ea671b1e9049993b7bdf3970f61\"","python script written by chatgpt":"\"41a82630d25cbb24deb1967d1de4aac8\"","shapiroLawGoverningLGBTQparent2020":"\"e32cc53ce241b6b4971e5e1de1027230\"","shawProvidingMedicalAssistance2018":"\"a41e4fea5ba0cc7cf200dd6178089170\"","software":"\"eeef9ab8b07acaec335fbf85499c2c51\"","tabs demo":"\"b32345364768032a8f9edeae2129bf6d\"","takeTakeExpansionAssisted":"\"9d70e0172e9407eca1138da148e35531\"","technologiesMoralPsychology21":"\"39c420b46da83fb56277b89bd794f4c6\"","theoretical-framework":"\"3879d30de05aa5e78104d6d5d8204c1c\"","theoretical-framework-selected":"\"65b9cfa0e5803e1d1110f2f9bede2c73\"","universityAssistedSuicide":"\"dac58a939b38947d9142f52b7b8de238\"","unpublished":"\"9a4526e0bc28776cfb3f7671b159c1a1\"","video":"\"490135caf838c6de5c549f58b36b018b\"","walkerMostAbortionBans2023":"\"a26605372b927af83930e49bfb653534\"","wikipedia macro":"\"ce24c518384cd2721ae26c6ee5591503\"","youngVoluntaryEuthanasia1996":"\"6fd8fbee9d63b647498b2a956ce94b92\"","zotero-bbt-annotation-macros":"\"8b68a5a2ae81918f84eeaa87edc18b93\"","zotero-bbt-macros (depreciated)":"\"070ccb9e9032a9d949cce0597b41aa2e\"","zotero-resource template":"\"ee2fdea013c8ac07d91a1c6f8628a59e\""}
https://3ra8f69t8l.execute-api.eu-west-2.amazonaws.com/prod/
7dt020qa8e7mu1oqeqqc0sdss4
eu-west-2:a8912c43-2425-4dc8-b508-26f00b4c2342
tiddlyclass-class-fun101-pricec
/*\
title: $:/.tb/modules/startup/hide-sidebar.js
type: application/javascript
module-type: startup
created: 20151010151732122
creator: Tobias Beer
modified: 20151010151750739
Hides the sidebar on startup when the config tiddler [[$:/config/hide-sidebar-on-startup]] contains "yes"
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
// Export name and synchronous status
exports.name = "hide-sidebar-on-startup";
exports.platforms = ["browser"];
exports.after = ["startup"];
exports.synchronous = true;
exports.startup = function() {
var conf = $tw.wiki.getTiddler("$:/config/HideSidebarOnStartup"),
value = (conf ? conf.getFieldString("text") : "").toLowerCase(),
state = value == "yes" ? "no" : "yes";
$tw.wiki.setText("$:/state/sidebar", "text", undefined, state);
};
})();
Draft of 'New Tiddler 2' by steve
Draft of '507Choice' by steve
A Place for <$transclude tiddler="$:/status/UserName"/> to play
\define thePresentationResource() $(thisPresentation)$===$(thisResource)$
\define theResourceNote() $(thisResource)$===$(thisNoteTitle)$
\define authenticated-doi-lookup-link() https://libkey.io/libraries/$(libraryID)$/$(doi)$
\define generic-doi-lookup-link() https://doi.org/$(doi)$
\define show-resource-notes(thisResource)
<$vars thisResource=$thisResource$ >
<$list filter="[resource<thisResource>resource-object[resource-note]]">
<$link/><br>
</$list>
</$vars>
\end
\define resource-note(thisResource)
<$vars thisResource=$thisResource$ thisNoteTitle="Note: ">
<$button>
<$action-sendmessage $message="tm-new-tiddler" title=<<theResourceNote>> resource-note-date=<<now "YYYYMMDDHHMMSS">> resource-object="resource-note" resource=<<thisResource>> text="<$link to={{!!resource}}/><br>"/>
New Note
</$button>
</$vars>
\end
\define link-resource(thisResource)
<$vars thisResource=$thisResource$>
<$list filter="[course-designer[course-presentation]nsort[week-num]]">
<$vars thisPresentation={{!!title}}>
<$link/>
<$button>
Link
<$action-setfield $tiddler=<<thePresentationResource>> presentation=<<thisPresentation>> resource=<<thisResource>>/>
</$button>
<$button>
<$action-deletetiddler $tiddler=<<thePresentationResource>>/>
Unlink
</$button>
<br>
<<thePresentationResource>>
<$list filter="[title<thePresentationResource>]" emptyMessage="No links">
<$link/>^^linked to {{!!presentation}}^^<br>
</$list>
</$vars>
</$list></$vars>
\end
\define presentation-resource0(thisResource)
<$list filter="[course-designer[course-presentation]]">
\end
\define presentation-resource(thisPresentation,thisResource)
<$vars thisPresentation=$thisPresentation$ thisResource=$thisResource$>
<$button>
<$action-createtiddler $basetitle=<<thePresentationResource>> $overwrite="yes" presentation=$thisPresentation$ resource=$thisResource$ />
Link<br>$thisResource$ <br> with<br>$thisPresentation$
</$button>
<br>
<$link to=<<presentationResource>>>Link</$link>
\end
\define show-resource(thisResource)
<$vars libraryID="2121">
<$list filter="[title[$thisResource$]]">
<$link/><br>
<$vars doi={{!!bibtex-doi}} isbn={{!!bibtex-isbn}}>
Title: ''{{!!bibtex-title}}''<br>
Abstract <$appear>{{!!bibtex-abstract}}</$appear><br>
Author-Date: {{!!bibtex-author}}, {{!!bibtex-date}}<br>
{{!!bibtex-url}}: <a href={{!!bibtex-url}} target="_blank">Link</a><br>
{{!!bibtex-doi}} :
<a href=<<authenticated-doi-lookup-link>> target="_blank">SUNY Poly via ~LibKey</a> || <a href=<<generic-doi-lookup-link>> target="_blank">doi.org</a><br>
ISBN: {{!!bibtex-isbn}}<br>
^^Tiddler: <$link/>^^
</$vars>
</$list>
</$vars>
\end
```
<$macrocall $name="show-resource-notes" thisResource="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="show-resource-notes" thisResource="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="resource-note" thisResource="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="resource-note" thisResource="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="show-resource" title="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="show-resource" thisResource="haas2022DougEngelbartEdge" thisPresentation=<<thisPresentation>>/>
<hr>
```
<$macrocall $name="link-resource" thisResource="haas2022DougEngelbartEdge"/>
```
<$macrocall $name="link-resource" thisResource="haas2022DougEngelbartEdge"/>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABI5JREFUWEftl3tM1WUYxz8H8AaHLoiUsBUt48wIoQypjZqrpZLzQhglGbqymuBoLbyC3BVhXjbRkdNKcM5QBArDUiijGasJAyQoyJUBxW1eQA25nfbw/s5+Bzhbh/6pP3i2s533+15+n9/7vM/zvD+D+V3M/IdmmACY2IH/xw7chDGxILExCXAEerUwkf9G4C+gT9NkzFRA1hCTedIW3aKJLvPuWM1zAlzAYH7PyczcCJjqCoMDekA6TYbOJrjeAo88p1bu6YDv8+DR+eAVoLS2erhcDvPWgIMjyLwfS+DaFXjqTTA4wNAg/HAEvJ8GTz8wm+Ha71BdhMG8wcVMpjWqVVL49TtoKIEX05R4+yqsmw6xheC3XGlNX0HuSkht1yeW74OzqZDWqWvb7ocV+8F/hdL+qIHkAAFwNpPUDM5uY9PRL+ehrhiW71Z9XZdhwyyIzoUnX1fapSLIexvSOvT5TV/DsUiG17VYvAcsSoLgKKXUFsK+lzSAhCtgdFcdA30wcEe5pDoffqvQAcQlG30gKgcCI7WFCuDEOyPf9kYrHFoKsZU6QJw7PBsDCxOUdvEoZEfaAPgiGQrTwWiAnkEI3QwhKWqSvQBDA3B0FbyWA05T1Nyt0xV06F7VvvABfLTOBkD+esg5AK5AP7A2CRYmjg9ARpdlQHA0TJHjrwE8Hg4vZ6v22TT4ZJsNAPFffTkYneHSOXhoDizbNX6AxjJ4YJ5ypZi4wOd5WJ2n2qe3QMHOUQDmIRU2Fqs4CM1VEH5w/AC93TBpGjhKQgDiZ4CnP0SVqnZBDJzO+geACwegtfbfAeivoQF4gIcJYr5V7dwI+Oa4DRf0tEN3JxjvhbLdYO6HsKzx78BoAMkDRg/YVKt6Di+FimIbAMWbIS9Dpc7bQESiil8xe6JgsB8kDN28RyIkeIKDAyS1KD37BagstQHweRyc2KEAbgGvJEBIsgbQCBtNEHUEAlcrTRLKcB7QEtFgH9ScgidWjgRI9IKhfkjVxu0JhIaLNgBKEuBUqgLoAcKtdqCjEd43wfoPIegN9QBbmfDTWFi8Xc8BMi7FG663waZqdTiznoE/m+0ACIuDxVotuNUFMTMg5qSe06uOQ3407Liqv/GhJRC2H9we1LUMP6ir06vuNFUhVS2wTsXWOyAuCA6DNfn6Qq1VcJ+v/nal6XAuHTK69TF7gpTbZi/StWRvMIWAaT5IuEsVLUmzUYzOJMLJFD0TurhC5jUwyGXAhqX7ws122N6ld2b6Q0A4LIjTNYmCVblgWqA0KWzxs7RynNEDBoPqKN0Jx7bAXYBIUqmDlsFbRWOfLm/+8Vbw9YG4n/X+XXPhHi9Y+5muySF89TDMDlGanKdEk1xIHM3D4mQXcHCClkpo/QnkxmIxgZg5E/xD4W4v6L0B9V9CUw1IrTG6qu2WLCq/hjMg4fjYErXdcgGRsu45B9wfVheZ7jZoPI/6LhBfD2lPkwXlN/pzxXKdsugCKAdJMvegFrIWYBdtvuQRi1muZFLgxMSjw1ey8X4ZWQA0j9k+GPar4wewf227Rk4ATOzA335n+CkqWnjdAAAAAElFTkSuQmCC
$:/palettes/VanillaFUN101
menubar-foreground: white
menubar-background: #FF6F00
alert-background: #ffe476
alert-border: #b99e2f
alert-highlight: #881122
alert-muted-foreground: #b99e2f
background: #ffffff
blockquote-bar: <<colour muted-foreground>>
button-background:
button-foreground:
button-border:
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
diff-delete-background: #ffc9c9
diff-delete-foreground: <<colour foreground>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #aaefad
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-invisible-foreground: <<colour muted-foreground>>
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
dragger-foreground: <<colour background>>
dropdown-background: <<colour background>>
dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
highlight-background: #ffff00
highlight-foreground: #000000
message-background: #ecf2ff
message-border: #cfd6e6
message-foreground: #547599
modal-backdrop: <<colour foreground>>
modal-background: <<colour background>>
modal-border: #999999
modal-footer-background: #f5f5f5
modal-footer-border: #dddddd
modal-header-border: #eeeeee
muted-foreground: #bbb
notification-background: #ffffdd
notification-border: #999999
page-background: #f4f4f4
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
selection-background:
selection-foreground:
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #aaaaaa
sidebar-foreground-shadow: rgba(255,255,255, 0.8)
sidebar-foreground: #acacac
sidebar-muted-foreground-hover: #444444
sidebar-muted-foreground: #c0c0c0
sidebar-tab-background-selected: #f4f4f4
sidebar-tab-background: #e0e0e0
sidebar-tab-border-selected: <<colour tab-border-selected>>
sidebar-tab-border: <<colour tab-border>>
sidebar-tab-divider: #e4e4e4
sidebar-tab-foreground-selected:
sidebar-tab-foreground: <<colour tab-foreground>>
sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #999999
site-title-foreground: <<colour tiddler-title-foreground>>
static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff
tab-background: #d8d8d8
tab-border-selected: #d8d8d8
tab-border: #cccccc
tab-divider: #d8d8d8
tab-foreground-selected: <<colour tab-foreground>>
tab-foreground: #666666
table-border: #dddddd
table-footer-background: #a8a8a8
table-header-background: #f0f0f0
tag-background: #ec6
tag-foreground: #ffffff
tiddler-background: <<colour background>>
tiddler-border: <<colour background>>
tiddler-controls-foreground-hover: #888888
tiddler-controls-foreground-selected: #444444
tiddler-controls-foreground: #cccccc
tiddler-editor-background: #f8f8f8
tiddler-editor-border-image: #ffffff
tiddler-editor-border: #cccccc
tiddler-editor-fields-even: #e0e8e0
tiddler-editor-fields-odd: #f0f4f0
tiddler-info-background: #f8f8f8
tiddler-info-border: #dddddd
tiddler-info-tab-background: #f8f8f8
tiddler-link-background: <<colour background>>
tiddler-link-foreground: <<colour primary>>
tiddler-subtitle-foreground: #c0c0c0
tiddler-title-foreground: #182955
toolbar-new-button:
toolbar-options-button:
toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
toolbar-delete-button:
toolbar-cancel-button:
toolbar-done-button:
untagged-background: #999999
very-muted-foreground: #888888
wikilist-background: #e5e5e5
wikilist-item: #fff
wikilist-info: #000
wikilist-title: #666
wikilist-title-svg: <<colour wikilist-title>>
wikilist-url: #aaa
wikilist-button-open: #4fb82b
wikilist-button-open-hover: green
wikilist-button-reveal: #5778d8
wikilist-button-reveal-hover: blue
wikilist-button-remove: #d85778
wikilist-button-remove-hover: red
wikilist-toolbar-background: #d3d3d3
wikilist-toolbar-foreground: #888
wikilist-droplink-dragover: rgba(255,192,192,0.5)
wikilist-button-background: #acacac
wikilist-button-foreground: #000
menubar-foreground: white
menubar-background: #000000
alert-background: #ffe476
alert-border: #b99e2f
alert-highlight: #881122
alert-muted-foreground: #b99e2f
background: #ffffff
blockquote-bar: <<colour muted-foreground>>
button-background:
button-foreground:
button-border:
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
diff-delete-background: #ffc9c9
diff-delete-foreground: <<colour foreground>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #aaefad
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-invisible-foreground: <<colour muted-foreground>>
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
dragger-foreground: <<colour background>>
dropdown-background: <<colour background>>
dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
highlight-background: #ffff00
highlight-foreground: #000000
message-background: #ecf2ff
message-border: #cfd6e6
message-foreground: #547599
modal-backdrop: <<colour foreground>>
modal-background: <<colour background>>
modal-border: #999999
modal-footer-background: #f5f5f5
modal-footer-border: #dddddd
modal-header-border: #eeeeee
muted-foreground: #bbb
notification-background: #ffffdd
notification-border: #999999
page-background: #f4f4f4
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
selection-background:
selection-foreground:
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #aaaaaa
sidebar-foreground-shadow: rgba(255,255,255, 0.8)
sidebar-foreground: #acacac
sidebar-muted-foreground-hover: #444444
sidebar-muted-foreground: #c0c0c0
sidebar-tab-background-selected: #f4f4f4
sidebar-tab-background: #e0e0e0
sidebar-tab-border-selected: <<colour tab-border-selected>>
sidebar-tab-border: <<colour tab-border>>
sidebar-tab-divider: #e4e4e4
sidebar-tab-foreground-selected:
sidebar-tab-foreground: <<colour tab-foreground>>
sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #999999
site-title-foreground: <<colour tiddler-title-foreground>>
static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff
tab-background: #d8d8d8
tab-border-selected: #d8d8d8
tab-border: #cccccc
tab-divider: #d8d8d8
tab-foreground-selected: <<colour tab-foreground>>
tab-foreground: #666666
table-border: #dddddd
table-footer-background: #a8a8a8
table-header-background: #f0f0f0
tag-background: #ec6
tag-foreground: #ffffff
tiddler-background: <<colour background>>
tiddler-border: <<colour background>>
tiddler-controls-foreground-hover: #888888
tiddler-controls-foreground-selected: #444444
tiddler-controls-foreground: #cccccc
tiddler-editor-background: #f8f8f8
tiddler-editor-border-image: #ffffff
tiddler-editor-border: #cccccc
tiddler-editor-fields-even: #e0e8e0
tiddler-editor-fields-odd: #f0f4f0
tiddler-info-background: #f8f8f8
tiddler-info-border: #dddddd
tiddler-info-tab-background: #f8f8f8
tiddler-link-background: <<colour background>>
tiddler-link-foreground: <<colour primary>>
tiddler-subtitle-foreground: #c0c0c0
tiddler-title-foreground: #182955
toolbar-new-button:
toolbar-options-button:
toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
toolbar-delete-button:
toolbar-cancel-button:
toolbar-done-button:
untagged-background: #999999
very-muted-foreground: #888888
wikilist-background: #e5e5e5
wikilist-item: #fff
wikilist-info: #000
wikilist-title: #666
wikilist-title-svg: <<colour wikilist-title>>
wikilist-url: #aaa
wikilist-button-open: #4fb82b
wikilist-button-open-hover: green
wikilist-button-reveal: #5778d8
wikilist-button-reveal-hover: blue
wikilist-button-remove: #d85778
wikilist-button-remove-hover: red
wikilist-toolbar-background: #d3d3d3
wikilist-toolbar-foreground: #888
wikilist-droplink-dragover: rgba(255,192,192,0.5)
wikilist-button-background: #acacac
wikilist-button-foreground: #000
menubar-foreground: white
menubar-background: #a50d0d
alert-background: #ffe476
alert-border: #b99e2f
alert-highlight: #881122
alert-muted-foreground: #b99e2f
background: #ffffff
blockquote-bar: <<colour muted-foreground>>
button-background:
button-foreground:
button-border:
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
diff-delete-background: #ffc9c9
diff-delete-foreground: <<colour foreground>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #aaefad
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-invisible-foreground: <<colour muted-foreground>>
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
dragger-foreground: <<colour background>>
dropdown-background: <<colour background>>
dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
highlight-background: #ffff00
highlight-foreground: #000000
message-background: #ecf2ff
message-border: #cfd6e6
message-foreground: #547599
modal-backdrop: <<colour foreground>>
modal-background: <<colour background>>
modal-border: #999999
modal-footer-background: #f5f5f5
modal-footer-border: #dddddd
modal-header-border: #eeeeee
muted-foreground: #bbb
notification-background: #ffffdd
notification-border: #999999
page-background: #f4f4f4
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
selection-background:
selection-foreground:
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #aaaaaa
sidebar-foreground-shadow: rgba(255,255,255, 0.8)
sidebar-foreground: #acacac
sidebar-muted-foreground-hover: #444444
sidebar-muted-foreground: #c0c0c0
sidebar-tab-background-selected: #f4f4f4
sidebar-tab-background: #e0e0e0
sidebar-tab-border-selected: <<colour tab-border-selected>>
sidebar-tab-border: <<colour tab-border>>
sidebar-tab-divider: #e4e4e4
sidebar-tab-foreground-selected:
sidebar-tab-foreground: <<colour tab-foreground>>
sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #999999
site-title-foreground: <<colour tiddler-title-foreground>>
static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff
tab-background: #d8d8d8
tab-border-selected: #d8d8d8
tab-border: #cccccc
tab-divider: #d8d8d8
tab-foreground-selected: <<colour tab-foreground>>
tab-foreground: #666666
table-border: #dddddd
table-footer-background: #a8a8a8
table-header-background: #f0f0f0
tag-background: #ec6
tag-foreground: #ffffff
tiddler-background: <<colour background>>
tiddler-border: <<colour background>>
tiddler-controls-foreground-hover: #888888
tiddler-controls-foreground-selected: #444444
tiddler-controls-foreground: #cccccc
tiddler-editor-background: #f8f8f8
tiddler-editor-border-image: #ffffff
tiddler-editor-border: #cccccc
tiddler-editor-fields-even: #e0e8e0
tiddler-editor-fields-odd: #f0f4f0
tiddler-info-background: #f8f8f8
tiddler-info-border: #dddddd
tiddler-info-tab-background: #f8f8f8
tiddler-link-background: <<colour background>>
tiddler-link-foreground: <<colour primary>>
tiddler-subtitle-foreground: #c0c0c0
tiddler-title-foreground: #182955
toolbar-new-button:
toolbar-options-button:
toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
toolbar-delete-button:
toolbar-cancel-button:
toolbar-done-button:
untagged-background: #999999
very-muted-foreground: #888888
wikilist-background: #e5e5e5
wikilist-item: #fff
wikilist-info: #000
wikilist-title: #666
wikilist-title-svg: <<colour wikilist-title>>
wikilist-url: #aaa
wikilist-button-open: #4fb82b
wikilist-button-open-hover: green
wikilist-button-reveal: #5778d8
wikilist-button-reveal-hover: blue
wikilist-button-remove: #d85778
wikilist-button-remove-hover: red
wikilist-toolbar-background: #d3d3d3
wikilist-toolbar-foreground: #888
wikilist-droplink-dragover: rgba(255,192,192,0.5)
wikilist-button-background: #acacac
wikilist-button-foreground: #000
{"tiddlers":{"$:/plugins/eucaly/popuptagger/config":{"_active":"on","created":"20140913215723814","creator":"EucalyJ","modified":"20140923134103805","modifier":"EucalyJ","tags":"$:/_popuptagger $:/_macros","title":"$:/plugins/eucaly/popuptagger/config","type":"text/vnd.tiddlywiki","text":"$:/plugins/eucaly/popuptagger/TagBar"},"$:/plugins/eucaly/popuptagger/ControlPage":{"created":"20140913163723059","creator":"EucalyJ","modified":"20140922055743981","modifier":"EucalyJ","tags":"$:/_macros $:/_popuptagger $:/_UI","title":"$:/plugins/eucaly/popuptagger/ControlPage","type":"text/vnd.tiddlywiki","text":"\\define if-match-else(A,B,C=\"\",D,E)\n<$reveal type=\"match\" state=\"$A$\" text=$B$ default=$C$>\n\t$D$\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$A$\" text=$B$ default=$C$>\n\t$E$\n</$reveal>\n\\end\n\n\\define if-matchB-blank-default(A,B,C=\"\",D)\n<$reveal type=\"match\" state=\"$A$\" text=\"$B$\" default=\"\">\n\t$D$\n</$reveal>\n\\end\n\n* `**` In this tiddler, all PopupTagger(s) are displayed (view filters are ignored).\n\n<$reveal state=\"$:/plugins/eucaly/popuptagger/config!!_active\" type=\"nomatch\" text=\"off\" default=\"\">\n~PopupTagger ''Enabled''\n</$reveal>\n<$reveal state=\"$:/plugins/eucaly/popuptagger/config!!_active\" type=\"match\" text=\"off\" default=\"\">\n~PopupTagger `Disabled`\n</$reveal> <<PopupTaggerSwitch>>\n\n<h3> Available ~PopupTagger(s)</h3>\n<table>\n<tr align=\"center\">\n<th>Debug</th>\n<th>Active</th>\n<th>Tag<br/>Edit</th>\n<th>Tag<br/>Table</th>\n<th>Tag<br/>Bar</th>\n<th>\n\t<p>~PopupTagger(s) <$button message=\"tm-new-tiddler\" param=\"$:/plugins/eucaly/popuptagger/TagBar\">Add</$button></p>\n</th></tr>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]tag[$:/_popuptagger]]\" >\n<tr>\n\t<$list filter=\"_debug _active _edittag _tagtable _tagpopup\"] variable=\"field\">\n<td align=\"center\">\n\t\t<$checkbox field=<<field>> checked=\"on\" unchecked=\"off\" default=\"on\"/>\n</td>\n\t</$list>\n<td>\n\t<p><$radio tiddler=\"$:/plugins/eucaly/popuptagger/config\" value={{!!title}}/> <$link to={{!!title}}><$text text={{!!title}}/></$link>\n\t<$macrocall $name=\"if-matchB-blank-default\" \nA=\"$:/plugins/eucaly/popuptagger/config\" \nB={{!!title}}\nD=\"<br/>@@color:red;=>@@ Configure as below\" \n/>\n<$reveal type=\"nomatch\" state=\"$:/plugins/eucaly/popuptagger/config\" text={{!!title}} default=\"\">\n<br/>Parent Tags : ''<$view field=\"taggroup\"/>''\n<br/>View Filter : ''<$view field=\"view-filter\"/>''\n<br/>List After : ''<$view field=\"list-after\"/>''\n</$reveal>\n</p>\n</td></tr>\n</$list>\n</table><br/>\n\n<$list filter=\"[title{$:/plugins/eucaly/popuptagger/config}]\" >\n<h3> Configure ~PopupTagger -- [ <$text text={{!!title}}/> ]</h3>\n\n<ul>\n<li> Parent Tags : ''<$view field=\"taggroup\"/>''\n<$linkcatcher message=\"tm-navigate\" set=<<qualify $:/state/tab>> setTo=\"$:/plugins/eucaly/popuptagger/tab-taggroup\">\n\t<$button set=\"$:/temp/pptg-taggroup!!tags\" setTo={{!!taggroup}} to=<<InPlace>> >Verify</$button>\n</$linkcatcher>\n</li>\n<ul><li>\n\t<$reveal type=\"nomatch\" state=<<qualify $:/state/tab>> text=\"$:/plugins/eucaly/popuptagger/tab-taggroup\" default=\"\">\n\t\tconfig with <$button set=<<qualify $:/state/tab>> setTo=\"$:/plugins/eucaly/popuptagger/tab-taggroup\"> \n Parent Tags </$button> tab below\n\t</$reveal>\n\t<$reveal type=\"match\" state=<<qualify $:/state/tab>> text=\"$:/plugins/eucaly/popuptagger/tab-taggroup\" default=\"\">\n\t\tnew value -- \n\t\t<<if-match-else \"!!taggroup\" {{$:/temp/pptg-taggroup!!tags}} {{!!taggroup}}\n\t\t\"@@color:blue;no changed@@ --\"\n\t\t\"\"\"@@color:blue;<$text text={{$:/temp/pptg-taggroup!!tags}}/>@@ --\n\t\t<$list filter=\"[{$:/temp/pptg-taggroup!!tags}regexp[\\S]first[]]\" variable=\"text1\">\t<!-- not empty -->\n\t\t\t<$button set=\"!!taggroup\" setTo={{$:/temp/pptg-taggroup!!tags}}>Proceed</$button>\n\t\t</$list>\n\t\t\"\"\">>\n\t</$reveal>\n</li></ul><br/>\n\n<li> View Filter : ''<$text text={{!!view-filter}}/>''\n<$linkcatcher message=\"tm-navigate\" set=<<qualify $:/state/tab>> setTo=\"$:/core/ui/AdvancedSearch/Filter\">\n\t<$button set=\"$:/temp/advancedsearch\" setTo={{!!view-filter}} to=<<InPlace>> >Verify</$button>\n</$linkcatcher>\n</li>\n<ul><li>\n\t<$reveal type=\"nomatch\" state=<<qualify $:/state/tab>> text=\"$:/core/ui/AdvancedSearch/Filter\" default=\"\">\n\t\tconfig and verify with <$button set=<<qualify $:/state/tab>> setTo=\"$:/core/ui/AdvancedSearch/Filter\"> \n Filter </$button> tab below\n\t</$reveal>\n\t<$reveal type=\"match\" state=<<qualify $:/state/tab>> text=\"$:/core/ui/AdvancedSearch/Filter\" default=\"\">\n\t\tnew value -- \n\t\t<<if-match-else \"!!view-filter\" {{$:/temp/advancedsearch}} {{$(pptg-tool-base)$!!view-filter}} \n\t\t\"@@color:blue;no changed@@ --\"\n\t\t\"\"\"@@color:blue;{{$:/temp/advancedsearch}}@@ --\n\t\t<$list filter=\"[{$:/temp/advancedsearch}regexp[\\S]first[]]\" variable=\"text1\">\t<!-- not empty -->\n\t\t\t<$button set=\"!!view-filter\" setTo={{$:/temp/advancedsearch}}>Proceed</$button>\n\t\t</$list> \n\t\t\"\"\">>\n\t</$reveal>\n</li></ul><br/>\n\n<li> Location -- list after :\n<$select field=\"list-after\" default=\"\">\n\t<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]] -[[$(pptg-tool-base)$]]\">\n\t\t<option value=<<currentTiddler>>><$view field=\"title\"/></option>\n\t</$list>\n\t<option value=\"\">== none ==</option>\n</$select></li>\n</ul>\n</$list>\n<<tabs \"$:/plugins/eucaly/popuptagger/readme $:/plugins/eucaly/popuptagger/tab-taggroup $:/core/ui/AdvancedSearch/Filter\" \"$:/plugins/eucaly/popuptagger/readme\" \"$:/state/tab\">>"},"$:/plugins/eucaly/popuptagger/history":{"caption":"History","created":"20140905163101231","creator":"EucalyJ","lastupdate":"20141004","modified":"20141004021938843","modifier":"EucalyJ","tags":"$:/_readme $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/history","type":"text/vnd.tiddlywiki","text":"!!!History\n* 20141004 / ''0.1.4'' \n** add `Verify` button for Parent Tags in [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]]\n** fix `New Tag` button when parent tag contains `!`\n* 20140921 / update icons\n* 20140914 / ''0.1.3'' ( 32K / 17.8K )\n** Global switch `<<PopupTaggerSwitch>>`\n** Reshape with central [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]]\n** No need user-provided \"pptg-tool-base\"\n** ==== coding details ====\n** only necessary macros are global\n** `InPlace.js` -- extended from TitleMe\n* 20140913 / ''0.1.2'' ( 24K / 11.4K ) -- for 5.0.17-beta ~\n** stylesheet tagged with {{$:/tags/Stylesheet||$:/core/ui/TagTemplate}}\n** sync ''~TagBar'' / ''~TagTable'' with the same column layout\n** add \"edit button\" for child tag\n** change to <$button to=\"\" class=<<tv-config-toolbar-class>>> {{$:/core/images/options-button}} </$button> [[$:/core/images/options-button]]\n** show PopupTagger config in one place\n** ==== coding details ====\n** Change ButtonWidget `title` attribute to `tooltip`\n** reduce `<$list>` use\n** use `listItem` to detect body / tagbar\n** use `storyTiddler`, `transclusion`, `listItem` variable for debug\n* 20140908 / ''0.1.1'' ( 14.8K / 10.2K )\n** Add ''~TagTable''\n** `<<PopupTaggerAuto>>` provides handy setup process\n** Each element can be enabled / disabled\n* 20140906 / ''0.0.1'' ( 4.5K / 2.2K ) -- not released\n** `<<PopupTaggerBar>>` -- global for all tiddlers\n** `<<PopupTaggerBarIf>>` -- selective, but might need some tweak for filter setup\n* 20140905 -- working draft\n"},"$:/plugins/eucaly/popuptagger/icon":{"created":"20140921105653585","creator":"EucalyJ","modified":"20140921105712528","modifier":"EucalyJ","ref":"tagx3-ON.svg","tags":"$:/tags/Image $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/icon","type":"text/vnd.tiddlywiki","text":"<svg class=\"tc-close-all-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g transform=\"translate(0,-924.36)\">\n\t\t<path d=\"m115.92 980.32a4.0004 4.0004 0 0 0 -2.75 1.21l-60 60.07a4.0004 4.0004 0 0 0 -0.01 0c-1.774 1.8-5.403 3.1-9.16 3.1s-7.385-1.3-9.16-3.1a4.0004 4.0004 0 0 0 -0.01 0l-24-24a4.0004 4.0004 0 1 0 -5.6561 5.6l23.988 24c3.882 3.9 9.425 5.5 14.84 5.5s10.959-1.6 14.84-5.5l59.99-60.01a4.0004 4.0004 0 0 0 -2.91 -6.87z\"/>\n\t\t<path d=\"m115.92 998.36a4.0004 4.0004 0 0 0 -2.75 1.21l-43.998 44.03a4.0004 4.0004 0 1 0 5.656 5.6l44.002-44a4.0004 4.0004 0 0 0 -2.91 -6.84z\"/>\n\t\t<path d=\"m83.105 0.5c-3.975 0-7.795 1.5904-10.605 4.4004l-60.504 60.539c-5.7851 5.79-5.7851 15.402 0 21.202l21.393 21.399c5.795 5.8 15.423 5.8 21.218 0l60.503-60.55c2.81-2.81 4.4-6.629 4.4-10.599v-21.391c0-8.2-6.81-15-15-15h-10.51-10.883zm10.895 15c5.847 0 10.43 4.548 10.49 10.379v0.242c-0.06 5.831-4.643 10.379-10.49 10.379-5.888 0-10.5-4.61-10.5-10.5s4.612-10.5 10.5-10.5z\" transform=\"translate(0,924.36)\"/>\n\t</g>\n</svg>\n\n"},"$:/plugins/eucaly/popuptagger/img/tag-tree.png":{"created":"20140909162119303","creator":"EucalyJ","modified":"20140909162542278","modifier":"EucalyJ","title":"$:/plugins/eucaly/popuptagger/img/tag-tree.png","type":"image/png","text":"iVBORw0KGgoAAAANSUhEUgAAAJMAAADjCAIAAAAOpbGDAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAT20lEQVR4nO2da1dTRxfH+y37QXzTTyGfglcUxQoUBR+KLk25a1DRpaJFQpFQL2FxCy15Jue6Z2bPJTM7hzNh/svVlSZzJof5ZS5n9mV+6kWFqZ+u+waiHBXJhSoacp/nd27Nn5NUFWUpf3KdsV/e/Jz+u93+rCjUGNd9CuppNXzvxKeGkORJDmBL/413sGLnE7ffmDrlzWp3f/mRa7bSrtboj5Zt0PQ8hoP2rV/ejDV7KcL+++mFHCp4SV4MflR22fTTtAD8CKsB+aLsfpD3g5IfubQJMnKwS/Hk+s0HG5T/p2l3WFtWjK/h9s4tXQ3oeCCNE4ZhvKbynef6E1jeBKrxEExyWYPmJbNGTLqjHbmsu2QfsZWRln3+RfnYUNYQJi2ojNzZ2dnu7u7V1ZWq3MXFBStweXmJfQh+4EiLJJ9mv3cBSdb0SfvakUsZlLOpfrTcmThQFRuV0fLVq1e//vpro9FA4TGuDx48YAU+ffqE1pI+FaQYkg4E1W+p/M2KySlmSm6eg4BDUkbu+Ph4enoahVdgW1xcFPtc3o46cv0yRdMMNFpmVXFD4mCjpWqNUyod7aVfWwAq57nDw8OlpSVGaHV19eTkJH3z27dvz549Y2+y/7LX0uWq2b5sxH7jIstC/QqFmz75YgOtUDQzZfADJrdC6XQ6sOfpehu4CHsSLxoRTnI9ZLGOXCJWO9YUekzxkcVTAbwEHy2DHCp78tqygMc6mQW2TNa7X+I85yu4aLxhQp4KimFTPUg6y5+cND6rn0ZGW/jzHOt5c3NzjJ+xtw0oij5Xboto9ttGX9HKE6oiuVAVyYWqSC5URXKhKpILVe7k3r9//+HDB9vSYCmv3CQ8aN/S+0OQb1b1N1Pk2tgjo7Sxgpe8TrmTS7danj9/bi7a/7NZW5xPjLc/q5tAuxGTt2YVLYh91yiRYx0uhddsNg0P7KzD9TtTQk5ZiD2kq7cQi4aL5HJ5zXM7OzszMzNmeNmfLZJjAyDoZJ0x1VAJNojH5mELwq3nvhKjT44/uerWfGfidj4+l+4w+Y8J8ijG8/FWQq6oHFDMy9TBKuS7QingvXjxotvtqoplhjTN38waRbOPhfS58wIJNCT1p8OknuJn0f80rbnZunV7p3iz/6KsrTT/lvjFPvemqKcOhiGCteXHjx9nZ2eN8HpJn5sYx5cYrKF1P2SZ3IHQ+Tjj7dh4i7PpJK8b4zsTzfatfuvn1ItKmi3eioSSg715JMgx7e3tTU5OMnjv3r1Tl0pHy7KvALHG0rYFTk7hkZCMaeArUhLse1N7XvHfsjbe/Gua50aSHHtUkD/Nxys1Of1Q2TP2Oaik3Zvcp/0OPQ963nz+dYP1uZEjV4yWW1tb//33H1ICPhVwbimZGFrDnK+d54Q3y+mtgCHMcPlri3kOGyFHg1yxQnn58iWOLRX2JJ4vIrTPA6mU0xs3VPLRC8mnZd8Cq0olj9RO285nTeDINGLkbLFl0j/PRQ0md3LF3Ga1jRJFLXdyaW8jxoa41AXsnjVUuZP7lIjwVqIGUrTyhKpILlRFcqEqkgtVkVyocif3v0RnZ2dWpb29GYYixW6I6DlRj00TQV7k2PPcgwcPzPAIvBmcZGxxSz+USi3ytnInV4TWPX78+OjoSFfU35vBTW7k5DdHjFyPh9dut5XlPL0Z+kosA/P5Dst4p9xtKcxDMFKk/6a4H815RUAjA/RRQD0nsvuXKpTcKZIBvzVGG2mmkO8KxRKerzdDum0PIxzLANS0HUE0emENkAwLolUI9VHQ2AK5CjF3CmiUGLII1pZFaKtpzvPwZuDssarXhTDTKGc7zYVa4CzJoe4UsMIhi+ap4PT09O7du6YNaA9vBhtycgwxaFzeXyEXSmIActK2eIUTIQG5q6urRqPBsE1NTX39+lUuQODNYCTH/dgH6nM+5CxWN0OTL7mLi4vNzU2G7eHDh58/K1YY/t4MRnLAky55GpPHLmGeU3uaGF7wTmbIxBkCufPzczO2VJ7eDObRssy2AbxjubwqyrVlj3+t62p8hfjytfbkGLaNjQ2GbX5+fm9vz+aK6M1AKHdyq6ur6dxmeAyPGo7cyc3Ozt67d48YW/RmsFa0FYSqSC5URXKhKpILVZFcqHIn9/XrV9JkblGDyZ3cb7/9Njk5afcMXldvhpDlTu7du3fsSdwK3nV5MzioTlZvvbzmudevXzNy9+/fRwMeS12XN4ODbgg5pu3tbQaPjZw6eDTeDEmsqeDBUO65wC18qSRunZFLSjvIoocE/6XjbcQ6CN8cprsDwdqSwbtz5w6DpwkSp/FmAPGlRaJ84MEAt/P5kkpy2pKoh4QY3VomfpfeHK67A81TQTHn7e/vq0tReTPkplrUn8BYEo1XxuuEyusXI8pz66D85pDdHWjIdTqde/fupaHi6lJU3gx5S3HtxRnqxJIW5JCSPcRDQk7iz2pA3xy2uwMBuYODg9Rrdnl5mSGUC1B7M1TV51APCcc+VzRWbchBbMfHx4pCNN4M0GtPmF3EeU5dMpmH1CUhLdRDwmmeG4a7gxe5AtvKyooSWyoSb4bxlpjmHl9bIiWLJVKSegH0ObEk9FdAPSTgMrI1xvkxSG8O093BndwA2DL5eDOgs2NlJVXCMmHib9LLnZz9CSIUqg05dDhVjLFDlTu5jY2N1dVVYmxKb4bakAMDL5yw0TeHqmjlCVWRXKiK5EJVJBeqIrlQ5U5ua2ur2WxqjkPm5GMTVy04m27bS3DzV6xWuWtVP3n5OGuOQ+ZEZRNHtoMdmth09MHIk2u1WgsLCwze+vr66empriiVTTySA/Ka5/b39x89esTgra2t6eAR2MRhPfz/CmcIwL1daH0WjyOwIyfui4ohstzpB/qbp5bvCgXCK86yluVtE0+EGs908fmcVwGWppmf50TXB8QWoTv9oFoRrC3//vvvdOtZD8/PJp4IIaePzwd7ifrU6Oi3qIzaqtMPqhWxTfzly5fqUj428USaeU4b020+jgD9Ftzmrj79oFpR+qEw7e7uyp9S2MQTuZKj7HOa0w+qFZnv1927d9++fYuXILCJF/U4kTMeu4N/C2pzV59+UK1o/C2npqaU2FL52sQTuZMr1yPlcQQua8vyTeT0g2pF4ONsxpYpRvhTyjeuwHSKUtSw5BXLQ48tRvhbK9oKQlUkF6oiuVAVyYWqSC5URXKhyusUs+npaTR4B1FlEf4Guyi63309m/2ecie3srLCnues4NUowj9ISKjcyZ2cnKytrTF4CwsLrVZLV7RGEf6RXCJbeDTeDHlEUxFCr99x7mFJZCG5ZADPt7w1x+Aaj0pQZB8YsnxXKKenp+vr60Z4JBH+GebioHcDOeyAAi7vs5SRWZMIQHdUApp9YOiizJ1umvM8vBm42VHb0LhFG9xD1oHgyGzR50wppMWo5eGL5qmg2+2m3gybm5vqUh7eDIOTww8oyDtQg2tfSnKV+YERkLu8vFxcXNScEULgzUDb50p3EosKR7XP/fjxIx0ql5aWDg8P8UJEEf7iPIfG7SvnOclhskQLceKJAMwJ98WcAkOXF7nv37+bsaUi8GbI15aJ/ytMhMDF7duvLdMW593ulIkAjH1Ozj4wZLmTY9jSU7DM2DJReTOQP5N5Vhiav+Xjx49tz3wkFnlLeWZTCI3cw0TE2Ky8GShbKhsevVaDoZGLul5FcqEqkgtVkVyoiuRCFQ25WqQ9v2HyJ1ckAtStrfv5IQdYeQNjCpGsIiuDkic5gE1nVwS7jvbV0pFL8opGclDpbmRiNEk2+jgD48/8/qFV1thsj1EkBzLZCb+A8ipFbkJYILOnw0g4aBb/GeQLEGqDN1CTX4AfuXTLIyMHG5QnZ075yLcvP/amPQbr2fJV8rcI5DogWy/M8TvYDdRhUved5+Bfpfp7zJNctukFwro5pwG4AZb+JmByBZhqGe8Q3EdlRgfohZCRy/+EbBYoU6DzAePV5B7VKyPX7Xa/fPmiySb077//HhwcsP9iH4IfrMoMrTc2pmNUWQaMluJHIMV1OdbxgpufWTS3aOhJ3k++heu+JY/0W/qVw2NC6hQYlpHb2trSpIIqrN4fPnxAa0mfCuBABGRhbPQgh/wmDOTyUPF+2jAh8XaA5I6Pj6enp1F40Fnh4uKCuzpvOx05m0hqitGybGtJ4kCKRH/bj5Z1UTnPFbnQNzY2CttNp9NZXl5mbz558uSff/6RLpeeCqB3m86TR9DwVih8DcKF4uxlfQM1AMmtUBgn2POMrkHpRdiTeEHOYpLLBA8HaFs/FcBmVffsopMJMHj3L+6pgGfDwasBtp68toTwLLBlCm73SxrY67JitBfyVFAMm+pBMnTJnEaCXC/peTMzM8TOCrinQtXrNIWf/KiQ6yUPcLaZfqOuQ9E+F6oiuVAVyYWqSC5URXKhyp3c7u7u3t6ebenKcjPUQlV4PVeSa69GuRnqehzB4HflTo51uMnJSSt4NcrNEMklYszSnvfq1SuL2yLKzSAErw6WNYE7sra/jyxY/sTNcSzvgnCGhcJmBI9KEO0YYmCfdJCuhXxXKO/fv79//74RHkluhjI4EcSaDpw1AQ8p7ikmJ1UNyBkWwsnYQiAyuG0saUTFfS6VJTy63Azooe/WEdwqWnjbqWpAT5mWbgz9FA1gvxZyPTDnffr0SV3KMzeDvEntlDWBb6NihCzWR6UtUD7/Q64BP40CkhNvGzc1Xxe5o6OjqakpRg5Nok6dm6GQf5/r5T8a1frIVMMAfQ78sTUhxx7s5ubmGLbnz593u12kBFFuBmVCIeVrLGsCHOsSwTM/0O/FakDOsNDPc4akEdJdGeVL7q+//jJgS0WYmwFfwtlnTcjcJrgxULl0wmpQnGFhWluKZ1XwrSHdlUle5Bi233//3Yytl99c1SdN2O1l6EYqt92Qeu+hsMXIINiuRVYtqM0a5MbAM9mDldzJpY5GDBvh3VCfNGFqd95j06UGSRTJHqzkTm57e/vNmzeEtxI1kKKVJ1RFcqEqkgtVkVyoiuRClTu5Z8+ePX369PLy0qr0zfJmqELu5BYWFtjz3OLiohlerbwZRkXu5A4PD5eWlhg81vm+ffumK1orb4ZRkdc812630/ykBngE3gxGxwVuQC7flPd2zb4IsKr6/ph8VyhHR0c28Ei8GbSOC4K1RXqT8xvQ+yKAXceqUtg7iGBtyeA9efLEYtj08GYwG3SgjH4Del+E6vKf+4jmqeDs7Cw9aUK7Ae3hzWBDjtuttvMbwH0RejCEurYIacgxYAzb1NQUGuBK4M1gJMfZlK19dfA+x99YDZ0zE/mSY48EzWaTYZudnVW6D9F6M6CvQRODnFAqvwGtLwL8EYwqOYbtxYsXBmypfL0Z7FxOMp+DDjqE4t55N3Bt2e12bbFlqt6bYZTlTi4dJNncxtaWhDcUZSkvbwZ6bMTeDKOsaCsIVZFcqIrkQlUkF6oiuVAVyYUqr6eCyclJ2/QMw/BmcIj4ri5IfOihBb5P4lbwhuTNUM9Y/Uw1Jlfsfs3MzHz8+FFXdEjeDJGcs4odZwZvZ2dHWY7GmwHLkYCfZyydbZwcDcIFLSYvJsqTjOW+jn1jz9pnApKD2fn1lxf3mTaInNQBiMzKw6Y9DTwabwZVlgWcnHA4uEwOtqbqcBH+G+19JjjzE5f4XXM5yFGMJnXgRGlZZXPely9f1KWovBmkeG2UHGdWlQKFlT4N2m/kpLXfli5PqikAvVwV0IxUEqI3g5QjASPH/1SlkHvVJfqsDD1rn4nc5akhIDdcrkvqIIjYg+j79+9yAWpvBqo+h/o0GL/RzmeivBz0GPPlaJ/DRea112g0UGzgjn29GdQ5EoSpwnKeM5MTv9HeZ0JYoZQn1eguR+c5FUUaT1kdtl5+9/7eDOocCZ/LVWJ7jEOSjn6tMcEJxbLPKfI6mH0mJJcLcPqW+vLiPvsyJANzJ8ewpd7pf/75548fPyyu8PFm8Hw8cgi5ryK/gqQB7rOSiBACDd6Ovi5cVZFzvU93csvLy2yQJMam9GZwaUdwmo+DP0R1fc7tPqOtIFRFcqEqkgtVkVyoiuRClTu5t2/fbm9v256Xdf0R/lVkUatSvhnbVMchc6pFhH8kl6vIkri5uSmeeSyoFhH+kRxQkZmUwTs/V3cXf5u4EJaP2otRc3PxZrklaJEswGSProPIsgHr4fnaxLmwfNMhAEpzMzjEwHTKgd4eXQdRZuCGB5Fj8jyvQB+WD6UyfdnlyrewR9dBxFnv2WpTXcrzvALJdiPs9RnMzQORCyAGrIqTJojPK0BXp1bmZoc+V1+Rne7CyL1+/Rov4W8T51oTsxdbmZsHP1mkxhRpTlTSYUvlaRMXWxA/u0Bjbk5s5Zbk0PprJ4JTzO7cuaOd3grFCH9KVXJyYNQQVMlpnfaKEf7WiraCUBXJhapILlRFcqEqkgtVkVyo8vJxnpub63T0MTi5PL0Z5F0oNELgJsmd3NOnT9NQVTM8f2+GSE6SOzkGbHl5mcH7448/tKGqFN4MkZwkr3mugLe4uKiDR+LNEMnx8l2hQHgHB8pNKgpvhkiOE8Ha8vLykmFL57zj42N1QU9vhkiOE81TQbfbTSP8Nzc31aWIvBmEdyI5Z11dXTUaDc06kyLCX/Lk4ZIlRHKD6/T0dH19nWFjj3f7+/t4IYII/8RHgc9hIEeL3yh5kTs5OVlbW2PYHj16pMSWyjfCPytfVFIuSiO5QTUAtkzRm4FS7uRWVlZs91CihiB3crOzszMzM8TYojeDtaKtIFRFcqEqkgtV/wegdUPYC2rYmQAAAABJRU5ErkJggg=="},"$:/plugins/eucaly/popuptagger/img/tagOff":{"created":"20140915084600827","creator":"EucalyJ","modified":"20140921110223817","modifier":"EucalyJ","ref":"tagx3-OFFsvg","tags":"$:/tags/Image $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/img/tagOff","type":"text/vnd.tiddlywiki","text":"<svg class=\"tc-close-all-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<path d=\"M 79.105 4.5 C 75.131 4.5 71.312 6.0842 68.502 8.8945 L 12 65.395 C 6.2043 71.19 6.2043 80.814 12 86.609 L 41.395 115.99 C 47.19 121.79 56.81 121.79 62.605 115.99 L 119.1 59.504 C 121.91 56.694 123.5 52.873 123.5 48.896 L 123.5 30 L 123.5 19.504 C 123.5 11.309 116.69 4.5048 108.5 4.5039 L 98.154 4.5039 C 98.103 4.5036 98.052 4.5 98 4.5 C 97.948 4.5 97.897 4.5036 97.846 4.5039 L 79.107 4.5039 L 79.105 4.5 z M 98 19.5 C 103.86 19.5 108.45 24.071 108.5 29.92 L 108.5 30.08 C 108.45 35.929 103.86 40.5 98 40.5 C 92.112 40.5 87.5 35.888 87.5 30 C 87.5 24.112 92.112 19.5 98 19.5 z M 72.869 25.736 C 72.631 27.125 72.5 28.548 72.5 30 C 72.5 43.994 84.006 55.5 98 55.5 C 99.449 55.5 100.87 55.37 102.25 55.133 L 52 105.39 L 22.605 76.002 L 72.869 25.736 z \"/>\n</svg>\n\n"},"$:/plugins/eucaly/popuptagger/img/tagOn":{"created":"20140915084642817","creator":"EucalyJ","modified":"20140921105742282","modifier":"EucalyJ","ref":"tagx3-ON.svg","tags":"$:/tags/Image $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/img/tagOn","type":"text/vnd.tiddlywiki","text":"{{$:/plugins/eucaly/popuptagger/icon}}"},"$:/plugins/eucaly/popuptagger/inplace.js":{"created":"20140913152220978","creator":"EucalyJ","modified":"20140913154217527","modifier":"EucalyJ","module-type":"macro","tags":"$:/_js $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/inplace.js","type":"application/javascript","text":"/*\\\n$:/plugins/eucaly/popuptagger/inplace.js\ntype: application/javascript\nmodule-type: macro\n\n!!! Feature\nThis InPlace macro returns in-place field vaule of source tiddler (even in a transclude hierarchy)\n\n!!! Usage\n<<InPlace fieldName:\"title\">>\n* returns the field vaule of source tiddler\n* default field is title\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"InPlace\";\n\nexports.params = [{ name: \"fieldName\" }\n];\n\n/*\nRun the macro\n*/\nexports.run = function(fieldName) {\n var output = \"\",\n\tvariable_name = \"transclusion\",\n meRegex = /\\{[^|]*\\|([^|]*)\\|/,\n p = this,\n v0 = \"\";\n while (p)\n {\n var v = p.getVariable(variable_name);\n\t\tif ( v && v!=v0 )\n {\n \tvar match = meRegex.exec(v);\n if (match && match.length>1)\n {\n\t\t\t\toutput = match[1];\n if (fieldName)\n {\nvar tiddler = this.wiki.getTiddler(output);\nif(tiddler) {\n\toutput = tiddler.getFieldString(fieldName);\n}\n }\n break;\n\t\t\t}\n\t\t}\n\t\tp = p.parentWidget;\n }\n\treturn output;\n};\n\n})();"},"$:/plugins/eucaly/popuptagger/macros/auto":{"created":"20140907013822226","creator":"EucalyJ","modified":"20140914012228717","modifier":"EucalyJ","tags":"$:/_macros $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/macros/auto","type":"text/vnd.tiddlywiki","text":"\\define pptg-debug(src)\n<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_debug\" text=\"off\" default=\"on\">\n^^<$link to=\"\" tooltip=<<TitleMe>> >me</$link>\n<$link to=\"\" tooltip=<<trace-variable \"storyTiddler\">> >story</$link>\n<$link to=\"\" tooltip=<<trace-variable \"currentTiddler\">> >current</$link>\n<$link to=\"\" tooltip=<<trace-variable \"transclusion\" \"<br/>\">> >trans</$link>\n<$link to=\"\" tooltip=<<trace-variable \"listItem\">> >listItem</$link>^^\n\t$src$ \n</$reveal>\n\\end\n\n\\define pptg-tagbar()\n<!-- is tool-base itself -->\n<$reveal type=\"match\" state=\"$(pptg-tool-base)$!!title\" text=<<storyTiddler>> default=\"\">\n\t<<pptg-debug \"\"\"@@color:orange;(21-tool-base)@@ ^^@@color:#860;<$text text=\"$(pptg-tool-base)$\">@@^^\"\"\">> \n\t<<PopupTagger>>\n</$reveal>\n<!-- NOT tool-base itself -->\n<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!title\" text=<<storyTiddler>> default=\"\">\n\t<<pptg-debug \"\"\"@@color:#080;(26-tagbar)@@ ^^<$text text=\"$(pptg-tool-base)$\">^^\"\"\">>\n\t<!-- if ControlPage -->\n\t<$reveal type=\"match\" state=\"!!title\" text=\"$:/plugins/eucaly/popuptagger/ControlPage\" default=\"\">\n\t\t<<PopupTagger>>\n\t</$reveal>\n\t<!-- normal tillders -->\n\t<$reveal type=\"nomatch\" state=\"!!title\" text=\"$:/plugins/eucaly/popuptagger/ControlPage\" default=\"\">\n\t\t<<PopupTaggerIf>>\n</$reveal></$reveal>\n\\end\n\n\\define pptg-body()\n<!-- is tool-base itself -->\n<$reveal type=\"match\" state=\"$(pptg-tool-base)$!!title\" text=<<storyTiddler>> default=\"\">\n<br/>\n\t<h3>This is a __~PopupTagger tiddler__, you can visit [[PopupTagger ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]] to check the configuration.</h3>\n</$reveal>\n<!-- NOT tool-base itself -->\n<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!title\" text=<<storyTiddler>> default=\"\">\n\t<<pptg-tool-base-warning>>\n</$reveal>\n\\end\n\n\\define pptg-tool-base-warning()\n<<pptg-debug \"@@color:red;(58-tool-base-warning)@@<br/>\">>\n@@color:red;There's something wrong with ~popupTagger ...@@\n<ul>\n<li>`pptg-tool-base` -- <<InPlace>></li>\n<li>while `new title` -- <<storyTiddler>></li>\n</ul>\n\\end"},"$:/plugins/eucaly/popuptagger/macros/render":{"created":"20140914011146334","creator":"EucalyJ","modified":"20141004020308447","modifier":"EucalyJ","tags":"$:/_macros $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/macros/render","type":"text/vnd.tiddlywiki","text":"\\define pptg-tagPopup()\n<$button popup=<<qualify $:/temp/$(tagG)$>> tooltip=\"Select tags\" class=\"tc-btn-invisible\">\n ▼ $(tagG)$</$button>\n<$reveal type=popup state=<<qualify $:/temp/$(tagG)$>> >\n\t<div class=\"tc-popup tc-tiddler-info\">\n\t\t<<pptg-tagColumn>>\n\t</div>\n</$reveal>\n\\end\n\n\\define pptg-tagColumn()\n<!-- cannot use {{$(tagG)$||$:/core/ui/TagTemplate}} here, because of popup conflict -->\n<p>$(tagG)$ ( <$count filter=\"[[$(tagG)$]tagging[]!prefix[$:/temp]!has[draft.of]]\"/> )</p>\n<hr/>\n<p><$list filter=\"[tag[$(tagG)$]!prefix[$:/temp]!has[draft.of]sort[]]\" variable=\"tagA\">\n\t<$button message=\"tm-edit-tiddler\" param=<<tagA>> class=<<tv-config-toolbar-class>>>\n\t\t{{$:/core/images/edit-button}}</$button>\n\t<$checkbox tiddler=\"$(currentTiddler)$\" tag=<<tagA>>> <<tagA>></$checkbox><br/> \n</$list>\n<$list filter=\"[[$(tagG)$]regexp:title[!]]\" variable=\"test3\" emptyMessage=\"\"\"<$button set=\"new $(tagG)$ tag!!tags\" setTo=\"$(tagG)$\">New Tag</$button>\"\"\">\n<$button set=\"new tag!!tags\" setTo=\"$(tagG)$\">New Tag</$button>\n</$list></p>\n\\end\n\n\\define pptg-render()\n<div class=\"tc-popuptagger\">\n<!-- TagBar itself -->\n\t<$reveal type=\"match\" state=\"$(pptg-tool-base)$!!title\" text={{!!title}} default=\"\">\n\t\t@@color:red;=>@@\n\t</$reveal>\n<!-- in ControlPage & TagBar is selected -->\n\t<$reveal type=\"match\" state=\"$:/plugins/eucaly/popuptagger/ControlPage!!title\" text=<<storyTiddler>> default=\"\">\n\t\t<$reveal type=\"match\" state=\"$:/plugins/eucaly/popuptagger/config\" text=\"$(pptg-tool-base)$\" default=\"\">\n\t\t\t@@color:red;=>@@\n\t</$reveal></$reveal> \n<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_active\" text=\"off\" default=\"on\">\n\t<$linkcatcher message=\"tm-navigate\" set=\"$:/plugins/eucaly/popuptagger/config\" setTo=<<InPlace>> >\n\t<$button to=\"$:/plugins/eucaly/popuptagger/ControlPage\" tooltip=\"Config PopupTagger - $(pptg-tool-base)$\" class=<<tv-config-toolbar-class>> >\n\t\t{{$:/core/images/options-button}}</$button>\n\t</$linkcatcher>\n\t<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_edittag\" text=\"off\" default=\"on\">\n\t\t<$reveal type=\"nomatch\" state=\"$:/state/popuptagger/EditTags\" text=<<qualify $:/temp/EditTags>> default=\"\">\n\t\t\t<$button set=\"$:/state/popuptagger/EditTags\" setTo=<<qualify $:/temp/EditTags>> tooltip=\"Edit tags\">Edit Tags</$button>\n\t\t</$reveal>\n\t\t<$reveal type=\"match\" state=\"$:/state/popuptagger/EditTags\" text=<<qualify $:/temp/EditTags>> default=\"\">\n\t\t\t<$button tooltip=\"Hide tags\" set=\"$:/state/popuptagger/EditTags\" setTo=\"\">Hide Tags</$button>\n\t\t</$reveal>\n\t\t/\n\t</$reveal>\n\t<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_tagtable\" text=\"off\" default=\"on\">\n\t\t<<pptg-tagTable>>\n\t</$reveal>\n\t<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_tagpopup\" text=\"off\" default=\"on\">\n\t\t<$list filter=<<InPlace \"taggroup\">> variable=\"tagG\">\n\t\t\t<<pptg-tagPopup>>\n\t\t</$list>\n\t</$reveal>\n\t<$reveal type=\"nomatch\" state=\"$(pptg-tool-base)$!!_edittag\" text=\"off\" default=\"on\">\n\t\t<$reveal type=\"match\" state=\"$:/state/popuptagger/EditTags\" text=<<qualify $:/temp/EditTags>> default=\"\">\n\t\t\t<p><$edit field=\"tags\"/></p>\n\t</$reveal></$reveal>\n</$reveal>\n</div>\n\\end\n\n\\define pptg-tagTable()\n<$reveal type=popup state=<<qualify $:/temp/tagTable>> >\n<div class=\"tc-popup tc-tiddler-info\">\n\t<table><tr valign=\"top\">\n\t\t<$list filter=<<InPlace \"taggroup\">> variable=\"tagG\">\n\t\t\t<td><<pptg-tagColumn>></td>\n\t\t</$list>\n\t</tr></table>\n</div></$reveal> \n<$button popup=<<qualify $:/temp/tagTable>> tooltip=\"Tag Table\">Tag Table</$button>\n\\end"},"$:/plugins/eucaly/popuptagger/macros":{"created":"20140905060129591","creator":"EucalyJ","modified":"20140914024929144","modifier":"EucalyJ","tags":"$:/_macros $:/_popuptagger $:/tags/Macro","title":"$:/plugins/eucaly/popuptagger/macros","type":"text/vnd.tiddlywiki","text":"\\define PopupTagger()\n<$reveal state=\"$:/plugins/eucaly/popuptagger/config!!_active\" type=\"nomatch\" text=\"off\" default=\"\">\n<$importvariables filter=\"[all[shadows+tiddlers]prefix[$:/plugins/eucaly/popuptagger/macros/]]\">\n<$set name=\"pptg-tool-base\" value=<<InPlace>> >\n\t<<pptg-render>>\n</$set>\n</$importvariables>\n</$reveal>\n\\end\n\n\\define PopupTaggerIf()\n<$list filter=<<InPlace \"view-filter\">> variable=\"t1\">\n<$list filter=\"[<t1>is[current]!has[draft.of]first[]]\" variable=\"t2\">\n\t<<PopupTagger>>\n</$list></$list>\n\\end\n\n\\define PopupTaggerAuto()\n<$importvariables filter=\"[all[shadows+tiddlers]prefix[$:/plugins/eucaly/popuptagger/macros/]]\">\n<$set name=\"pptg-tool-base\" value=<<InPlace>> >\n<$list filter=\"[title<InPlace>!field:title<listItem>]\" variable=\"test14\">\n<div class=\"tc-popuptagger-body\">\t<!-- body only -->\n\t<<pptg-debug \"@@color:#080;(09-body-only)@@\">>\n\t<<pptg-body>>\n</div>\n</$list>\n\n<$list filter=\"[title<InPlace>field:title<listItem>]\" variable=\"test23\">\n<div class=\"tc-popuptagger\">\t\t<!-- tagbar only -->\n\t<<pptg-debug \"@@color:orange;(13-tagbar-only)@@\">>\n\t<<pptg-tagbar>>\n</div>\n</$list>\n</$set>\n</$importvariables>\n\\end\n\n\\define PopupTaggerSwitch()\n<span class=\"tc-popuptagger-switch\">\n<$reveal state=\"$:/plugins/eucaly/popuptagger/config!!_active\" type=\"nomatch\" text=\"off\" default=\"\">\n<$button set=\"$:/plugins/eucaly/popuptagger/config!!_active\" setTo=\"off\" tooltip=\"Hide PopupTagger\" class=<<tv-config-toolbar-class>> >{{$:/plugins/eucaly/popuptagger/img/tagOn}}</$button>\n</$reveal>\n<$reveal state=\"$:/plugins/eucaly/popuptagger/config!!_active\" type=\"match\" text=\"off\" default=\"\">\n<$button set=\"$:/plugins/eucaly/popuptagger/config!!_active\" setTo=\"on\" tooltip=\"Show PopupTagger\" class=<<tv-config-toolbar-class>> >{{$:/plugins/eucaly/popuptagger/img/tagOff}}</$button>\n</$reveal>\n</span>\n\\end\n"},"$:/plugins/eucaly/popuptagger/readme":{"caption":"~PopupTagger","created":"20140905151516651","creator":"EucalyJ","lastupdate":"20141004","modified":"20141004021911667","modifier":"EucalyJ","tags":"$:/_readme $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/readme","type":"text/vnd.tiddlywiki","text":"!![[PopupTagger Plugin|$:/plugins/eucaly/popuptagger/readme]]\n<hr>\n\nThis ''PopupTagger'' plugin provides ''~TagTable'' and ''~TagBar with popup list of tags'' for [[TiddlyWiki 5|http://tiddlywiki.com/]]. \n<p>** Inspired by [[MonkeyTaggerMacro|http://tiddlywiki.squize.org/#MonkeyTaggerMacro]] (~TiddlyWiki classic)</p>\n\n!!!Features\n\n# ''~TagBar'' with ''popup list of tags''\n# ''~TagTable'' for quick tagging \n# ''~TagEdit'' enables ''tag editing'' as in ~TiddlyWiki classic\n# Shortcut <$button class=<<tv-config-toolbar-class>>> {{$:/core/images/options-button}}</$button> for ''~PopupTagger'' setting\n# ''Global switch'' `<<PopupTaggerSwitch>>` <<PopupTaggerSwitch>>\n# ''Handy setup process'' -- central [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]]\n#* Each element can be enabled / disabled\n#* ''Custom parent tags'' to generate ''~TagBar'' and ''~TagTable''\n#* ~PopupTagger could be ''selectively available'' for certain tiddlers only -- thanks to `<$list>` filter\n#* ''Custom ~PopupTagger location'' -- thanks to `list-after` field\n# ** all above tag operations is ''real-time'' in ''View Mode''\n\n!!!Install\n* Drag&Drop package -- [[$:/plugins/eucaly/popuptagger]] (with documentation)<!--, or\n* Drag&Drop the macros <$list filter=\"[all[shadows+tiddlers]tag[$:/_macros]tag[$:/_popuptagger]!has[draft.of]sort[]]\">\n\n* <$link to={{!!title}}>{{!!title}}</$link>\n</$list>-->\n\n!!!Usage\n\n* You may start with some tag trees like :\n<<<\n{{$:/plugins/eucaly/popuptagger/img/tag-tree.png}}\n<<<\n# Goto central [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]] ( [[$:/plugins/eucaly/popuptagger/ControlPage]] )\n# Check for available ~PopupTagger, or\n# Press `Add` button\n#* Rename the new ~PopupTagger tiddler, in order not to overwrite the [[PopupTagger template|$:/plugins/eucaly/popuptagger/TagBar]]\n#* ~~Modify `\\define pptg-tool-base()` macro definition to sync with the new title~~\n#* ~~In addition to that,~~ please keep `<<PopupTaggerAuto>>` macro call there.\n# Follow the `Configure` section provided in [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]]\n# ''Global switch'' `<<PopupTaggerSwitch>>` <<PopupTaggerSwitch>> is available in [[ControlPage|$:/plugins/eucaly/popuptagger/ControlPage]], and can be added to else where as you like.\n* ** If you like to conduct a ''manual setup'', you may try `<<PopupTagger>>` or `<<PopupTaggerIf>>` macro call, instead of `<<xxxAuto>>`\n\n!!!Filter Example\n\n| <p>[tag[`$:/_readme`]] [tag[`$:/_UI`]]</p> |tagged `$:/_readme` or `$:/_UI` |\n| <p>[tag[`$:/_macros`]tag[`$:/_popuptagger`]]</p> |tagged `$:/_macros` and `$:/_popuptagger` |\n| <p>[creator/`eucaly`/(i)]</p> |with creator name contains `eucaly` |\n\n"},"$:/plugins/eucaly/popuptagger/StyleSheet":{"created":"20140906125324508","creator":"EucalyJ","modified":"20140912233930702","modifier":"EucalyJ","tags":"$:/tags/Stylesheet $:/_popuptagger $:/_macros","title":"$:/plugins/eucaly/popuptagger/StyleSheet","type":"text/css","text":".tc-popuptagger\n{\n\tbackground-color: #eee;\n}\n\n.tc-tiddler-body .tc-popuptagger\n{\n\tdisplay:none;\n}\n\n.tc-popuptagger-body\n{\n\tdisplay:none;\n}\n\n.tc-tiddler-body .tc-popuptagger-body\n{\n\tdisplay:inline;\n}\n\n.tc-popuptagger-body input\n{\n\twidth: 60%\n}\n\n.tc-popuptagger-checked\n{\n\tbackground-color: #8f8;\n}"},"$:/plugins/eucaly/popuptagger/tab-taggroup":{"caption":"Parent Tags","created":"20140907071901381","creator":"EucalyJ","modified":"20140914012411928","modifier":"EucalyJ","tags":"$:/_macros $:/_popuptagger","title":"$:/plugins/eucaly/popuptagger/tab-taggroup","type":"text/vnd.tiddlywiki","text":"!!!!Parent Tags \n\n<table>\n\t<$list filter=\"[all[shadows+tiddlers]tags[]tags[]]\">\n\t\t<tr>\n\t\t<td><$checkbox tiddler=\"$:/temp/pptg-taggroup\" tag={{!!title}}/></td>\n\t\t<td align=\"left\">{{!!title}}\n ( <$count filter=\"[{!!title}tagging[]!prefix[$:/temp]!has[draft.of]]\"/> )</td>\n\t\t</tr>\n\t</$list>\n</table>\n\nor edit in below -- <$button set=\"$:/temp/pptg-taggroup!!tags\" setTo=\"\">Clear</$button>\n{{$:/temp/pptg-taggroup||$:/core/ui/EditTemplate/tags}}\n<$edit tiddler=\"$:/temp/pptg-taggroup\" field=\"tags\"/>\n\nIf below result looks OK, please press `Proceed` above.\n<table><tr valign=\"top\">\n\t<$list filter=\"[list[$:/temp/pptg-taggroup!!tags]]\">\n\t\t<td><p>''{{!!title}}'' ( <$count filter=\"[{!!title}tagging[]!prefix[$:/temp]]\"/> )</p>\n\t\t\t<$list filter=\"[{!!title}tagging[]!prefix[$:/temp]sort[]]\">\n\t\t\t\t{{!!title}}<br/>\n\t\t\t</$list></td>\n\t</$list>\n</tr></table>"},"$:/plugins/eucaly/popuptagger/TagBar":{"_active":"on","_debug":"off","_edittag":"on","_tagpopup":"off","_tagtable":"on","created":"20140905024853346","creator":"EucalyJ","list-after":"$:/core/ui/ViewTemplate/tags","modified":"20140921091502881","modifier":"EucalyJ","taggroup":"$:/plugins/eucaly $:/_doc-type $:/_doc-edition toc","tags":"$:/tags/ViewTemplate $:/_UI $:/_popuptagger $:/_macros","title":"$:/plugins/eucaly/popuptagger/TagBar","type":"text/vnd.tiddlywiki","view-filter":"[all[tiddlers+shadows]regexp:creator[eucaly(?i)]]","text":"<<PopupTaggerAuto>>"}}}
{"tiddlers":{"$:/plugins/flibbles/relink/js/bulkops.js":{"text":"/*\\\nmodule-type: startup\n\nReplaces the relinkTiddler defined in $:/core/modules/wiki-bulkops.js\n\nThis is a startup instead of a wikimethods module-type because it's the only\nway to ensure this runs after the old relinkTiddler method is applied.\n\n\\*/\n(function(){\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar language = require('$:/plugins/flibbles/relink/js/language.js');\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils.js\");\n\nexports.name = \"redefine-relinkTiddler\";\nexports.synchronous = true;\n// load-modules is when wikimethods are applied in\n// ``$:/core/modules/startup/load-modules.js``\nexports.after = ['load-modules'];\n// We come before commands because they may do renaming, or jasmine testing\nexports.before = ['commands'];\n\nexports.startup = function() {\n\t$tw.Wiki.prototype.relinkTiddler = relinkTiddler;\n};\n\n/** Walks through all relinkable tiddlers and relinks them.\n * This replaces the existing function in core Tiddlywiki.\n */\nfunction relinkTiddler(fromTitle, toTitle, options) {\n\toptions = options || {};\n\tvar failures = [];\n\tvar indexer = utils.getIndexer(this);\n\tvar records = indexer.relinkLookup(fromTitle, toTitle, options);\n\tfor (var title in records) {\n\t\tvar entries = records[title],\n\t\t\tchanges = Object.create(null),\n\t\t\tupdate = false,\n\t\t\tfails = false;\n\t\tfor (var field in entries) {\n\t\t\tvar entry = entries[field];\n\t\t\tfails = fails || entry.impossible;\n\t\t\tif (entry.output !== undefined) {\n\t\t\t\tchanges[field] = entry.output;\n\t\t\t\tupdate = true;\n\t\t\t}\n\t\t}\n\t\tif (fails) {\n\t\t\tfailures.push(title);\n\t\t}\n\t\t// If any fields changed, update tiddler\n\t\tif (update) {\n\t\t\tconsole.log(\"Renaming '\"+fromTitle+\"' to '\"+toTitle+\"' in '\" + title + \"'\");\n\n\t\t\tvar tiddler = this.getTiddler(title);\n\t\t\tvar modifyField = utils.touchModifyField(this) ? this.getModificationFields() : undefined;\n\t\t\tvar newTiddler = new $tw.Tiddler(tiddler,changes,modifyField)\n\t\t\tnewTiddler = $tw.hooks.invokeHook(\"th-relinking-tiddler\",newTiddler,tiddler);\n\t\t\tthis.addTiddler(newTiddler);\n\t\t\t// If the title changed, we need to perform a nested rename\n\t\t\tif (newTiddler.fields.title !== title) {\n\t\t\t\tthis.deleteTiddler(title);\n\t\t\t\tthis.relinkTiddler(title, newTiddler.fields.title,options);\n\t\t\t}\n\t\t}\n\t};\n\tif (failures.length > 0) {\n\t\tvar options = $tw.utils.extend(\n\t\t\t{ variables: {to: toTitle, from: fromTitle},\n\t\t\t wiki: this},\n\t\t\toptions );\n\t\tlanguage.reportFailures(failures, options);\n\t}\n};\n\n})();\n","module-type":"startup","title":"$:/plugins/flibbles/relink/js/bulkops.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/indexer.js":{"text":"/*\\\nmodule-type: indexer\n\nIndexes results from tiddler reference reports so we don't have to call them\nso much.\n\n\\*/\n\n\"use strict\";\n\nvar utils = require(\"./utils.js\");\nvar TiddlerContext = utils.getContext('tiddler');\n\nfunction Indexer(wiki) {\n\tthis.wiki = wiki;\n};\n\nIndexer.prototype.init = function() {\n\tthis.rebuild();\n};\n\nIndexer.prototype.rebuild = function() {\n\tthis.index = null;\n\tthis.backIndex = null;\n\tthis.contexts = Object.create(null);\n\tthis.changedTiddlers = undefined;\n\tthis.lastRelinks = Object.create(null);\n};\n\nIndexer.prototype.update = function(updateDescriptor) {\n\tif (!this.index) {\n\t\treturn;\n\t}\n\tvar title;\n\tif (!this.changedTiddlers) {\n\t\tthis.changedTiddlers = Object.create(null);\n\t}\n\tif (updateDescriptor.old.exists) {\n\t\ttitle = updateDescriptor.old.tiddler.fields.title;\n\t\tthis.changedTiddlers[title] = {deleted: true};\n\t\tthis._purge(title);\n\t}\n\tif (updateDescriptor['new'].exists) {\n\t\t// If its the same tiddler as old, this overrides the 'deleted' entry\n\t\ttitle = updateDescriptor['new'].tiddler.fields.title;\n\t\tthis.changedTiddlers[title] = {modified: true};\n\t}\n};\n\nIndexer.prototype.lookup = function(title) {\n\tthis._upkeep();\n\treturn this.index[title];\n};\n\nIndexer.prototype.reverseLookup = function(title) {\n\tthis._upkeep();\n\treturn this.backIndex[title] || Object.create(null);\n};\n\nIndexer.prototype.relinkLookup = function(fromTitle, toTitle, options) {\n\tthis._upkeep();\n\tvar shortlist = undefined;\n\tvar lastRelink = this.lastRelinks[fromTitle];\n\tif (lastRelink) {\n\t\tif (lastRelink.to === toTitle) {\n\t\t\t// We need to reintroduce the relink cache, where temporary info\n\t\t\t// was stored.\n\t\t\toptions.cache = lastRelink.cache;\n\t\t\treturn lastRelink.results;\n\t\t}\n\t\tshortlist = buildShortlist(lastRelink);\n\t}\n\tvar results = utils.getRelinkResults(this.wiki, fromTitle, toTitle, this.context, shortlist, options);\n\tif (Object.keys(this.lastRelinks).length > 3) {\n\t\t// The cache got a little large. wipe it clean.\n\t\tthis.lastRelinks = Object.create(null);\n\t}\n\tthis.lastRelinks[fromTitle] = {\n\t\tfrom: fromTitle,\n\t\tresults: results,\n\t\tto: toTitle,\n\t\tcache: options.cache,\n\t\tmaybeRelevant: Object.create(null)};\n\treturn results;\n};\n\n// Returns all tiddlers that don't have anything referencing it.\nIndexer.prototype.orphans = function() {\n\tthis._upkeep();\n\tvar results = [];\n\tfor (var title in this.index) {\n\t\tif (!this.backIndex[title]\n\t\t|| Object.keys(this.backIndex[title]).length === 0) {\n\t\t\tresults.push(title);\n\t\t}\n\t}\n\treturn results;\n};\n\nIndexer.prototype._upkeep = function() {\n\tvar title;\n\tif (this.changedTiddlers && (this.context.changed(this.changedTiddlers) || this.context.parent.changed(this.changedTiddlers))) {\n\t\t// If global macro context or whitelist context changed, wipe all\n\t\tthis.rebuild();\n\t}\n\tif (!this.index) {\n\t\tthis.index = Object.create(null);\n\t\tthis.backIndex = Object.create(null);\n\t\tthis.context = utils.getWikiContext(this.wiki);\n\t\tvar titles = this.wiki.getRelinkableTitles();\n\t\tfor (var i = 0; i < titles.length; i++) {\n\t\t\tthis._populate(titles[i]);\n\t\t};\n\t} else if (this.changedTiddlers) {\n\t\t// If there are cached changes, we apply them now.\n\t\tfor (title in this.contexts) {\n\t\t\tvar tiddlerContext = this.contexts[title];\n\t\t\tif (tiddlerContext.changed(this.changedTiddlers)) {\n\t\t\t\tthis._purge(title);\n\t\t\t\tthis._populate(title);\n\t\t\t\tthis._decacheRelink(title);\n\t\t\t\t// Wipe this change, so we don't risk updating it twice.\n\t\t\t\tthis.changedTiddlers[title] = undefined;\n\t\t\t}\n\t\t}\n\t\tfor (title in this.changedTiddlers) {\n\t\t\tvar change = this.changedTiddlers[title];\n\t\t\tif (change && change.modified) {\n\t\t\t\tthis._purge(title);\n\t\t\t\tthis._populate(title);\n\t\t\t\tthis._decacheRelink(title);\n\t\t\t}\n\t\t}\n\t\tthis.changedTiddlers = undefined;\n\t}\n};\n\nIndexer.prototype._purge = function(title) {\n\tfor (var entry in this.index[title]) {\n\t\tdelete this.backIndex[entry][title];\n\t}\n\tdelete this.contexts[title];\n\tdelete this.index[title];\n};\n\n// This drops the cached relink results if unsanctioned tiddlers were changed\nIndexer.prototype._decacheRelink = function(title) {\n\tvar tiddler = this.wiki.getTiddler(title);\n\tfor (var from in this.lastRelinks) {\n\t\tvar lastRelink = this.lastRelinks[from];\n\t\tif (title !== from\n\t\t&& title !== lastRelink.to\n\t\t&& (!tiddler\n\t\t|| !$tw.utils.hop(tiddler.fields, 'draft.of') // is a draft\n\t\t|| tiddler.fields['draft.of'] !== from// draft of target\n\t\t|| references(this.index[title], from))) { // draft references target\n\t\t\t// This is not the draft of the last relinked title,\n\t\t\t// so our cached results should be wiped.\n\t\t\tlastRelink.maybeRelevant[title] = true;\n\t\t\t// Force this cached relink to partially refresh when it comes time\n\t\t\tlastRelink.to = undefined;\n\t\t}\n\t}\n};\n\nfunction references(list, item) {\n\treturn list !== undefined && list[item];\n};\n\n// Compiles a short list of tiddlers we need to check for a rename.\n// This list will be much faster to relink again.\nfunction buildShortlist(lastRelink) {\n\tvar shortlist = Object.keys(lastRelink.results);\n\tfor (var title in lastRelink.maybeRelevant) {\n\t\tif (lastRelink.results[title] === undefined) {\n\t\t\tshortlist.push(title);\n\t\t}\n\t}\n\treturn shortlist;\n};\n\nIndexer.prototype._populate = function(title) {\n\t// Fetch the report for a title, and populate the indexes with result\n\tvar tiddlerContext = new TiddlerContext(this.wiki, this.context, title);\n\tvar references = utils.getTiddlerRelinkReferences(this.wiki, title, tiddlerContext);\n\tthis.index[title] = references;\n\tif (tiddlerContext.hasImports()) {\n\t\tthis.contexts[title] = tiddlerContext;\n\t}\n\tfor (var ref in references) {\n\t\tthis.backIndex[ref] = this.backIndex[ref] || Object.create(null);\n\t\tthis.backIndex[ref][title] = references[ref];\n\t}\n};\n\nexports.RelinkIndexer = Indexer;\n","module-type":"indexer","title":"$:/plugins/flibbles/relink/js/indexer.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/language.js":{"text":"/*\\\nmodule-type: library\n\nThis handles all logging and alerts Relink emits.\n\n\\*/\n\nexports.getString = function(outputType, title, options) {\n\ttitle = \"$:/plugins/flibbles/relink/language/\" + title;\n\treturn options.wiki.renderTiddler(outputType, title, options);\n};\n\nvar logger;\n\nexports.warn = function(string, options) {\n\tif (!logger) {\n\t\tlogger = new $tw.utils.Logger(\"Relinker\");\n\t}\n\tlogger.alert(string);\n};\n\nexports.reportFailures = function(failureList, options) {\n\tvar alertString = this.getString(\"text/html\", \"Error/ReportFailedRelinks\", options)\n\tvar alreadyReported = Object.create(null);\n\tvar reportList = [];\n\t$tw.utils.each(failureList, function(f) {\n\t\tif (!alreadyReported[f]) {\n\t\t\tif ($tw.browser) {\n\t\t\t\t// This might not make the link if the title is complicated.\n\t\t\t\t// Whatever.\n\t\t\t\treportList.push(\"\\n* [[\" + f + \"]]\");\n\t\t\t} else {\n\t\t\t\treportList.push(\"\\n* \" + f);\n\t\t\t}\n\t\t\talreadyReported[f] = true;\n\t\t}\n\t});\n\tthis.warn(alertString + \"\\n\" + reportList.join(\"\"));\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/language.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/mangler.js":{"text":"/*\\\nmodule-type: widget\n\nCreates a mangler widget for field validation. This isn't meant to be used\nby the user. It's only used in Relink configuration.\n\n\\*/\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar language = require('$:/plugins/flibbles/relink/js/language.js');\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\n\nvar RelinkManglerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"relink-add-field\", handler: \"handleAddFieldEvent\"},\n\t\t{type: \"relink-add-operator\", handler: \"handleAddOperatorEvent\"},\n\t\t{type: \"relink-add-parameter\", handler: \"handleAddParameterEvent\"},\n\t\t{type: \"relink-add-attribute\", handler: \"handleAddAttributeEvent\"}\n\t]);\n};\n\nexports.relinkmangler = RelinkManglerWidget;\n\nRelinkManglerWidget.prototype = new Widget();\n\n// This wraps alert so it can be monkeypatched during testing.\nRelinkManglerWidget.prototype.alert = function(message) {\n\talert(message);\n};\n\nRelinkManglerWidget.prototype.handleAddFieldEvent = function(event) {\n\tvar param = event.paramObject;\n\tif (typeof param !== \"object\" || !param.field) {\n\t\t// Can't handle it.\n\t\treturn true;\n\t}\n\tvar trimmedName = param.field.trim();\n\tif (!trimmedName) {\n\t\t// Still can't handle it, but don't warn.\n\t\treturn true;\n\t}\n\tif(!$tw.utils.isValidFieldName(trimmedName)) {\n\t\tthis.alert($tw.language.getString(\n\t\t\t\"InvalidFieldName\",\n\t\t\t{variables:\n\t\t\t\t{fieldName: trimmedName}\n\t\t\t}\n\t\t));\n\t} else {\n\t\tadd(this.wiki, \"fields\", trimmedName);\n\t}\n\treturn true;\n};\n\n/**Not much validation, even though there are definitely illegal\n * operator names. If you input on, Relink won't relink it, but it\n * won't choke on it either. Tiddlywiki will...\n */\nRelinkManglerWidget.prototype.handleAddOperatorEvent = function(event) {\n\tvar param = event.paramObject;\n\tif (param) {\n\t\tadd(this.wiki, \"operators\", param.operator);\n\t}\n\treturn true;\n};\n\nRelinkManglerWidget.prototype.handleAddParameterEvent = function(event) {\n\tvar param = event.paramObject;\n\tif (param && param.macro && param.parameter) {\n\t\tif (/\\s/.test(param.macro.trim())) {\n\t\t\tthis.alert(language.getString(\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"Error/InvalidMacroName\",\n\t\t\t\t{ variables: {macroName: param.macro},\n\t\t\t\t wiki: this.wiki\n\t\t\t\t}\n\t\t\t));\n\t\t} else if (/[ \\/]/.test(param.parameter.trim())) {\n\t\t\tthis.alert(language.getString(\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"Error/InvalidParameterName\",\n\t\t\t\t{ variables: {parameterName: param.parameter},\n\t\t\t\t wiki: this.wiki\n\t\t\t\t}\n\t\t\t));\n\t\t} else {\n\t\t\tadd(this.wiki, \"macros\", param.macro, param.parameter);\n\t\t}\n\t}\n\treturn true;\n};\n\nRelinkManglerWidget.prototype.handleAddAttributeEvent = function(event) {\n\tvar param = event.paramObject;\n\tif (param && param.element && param.attribute) {\n\t\tif (/[ \\/]/.test(param.element.trim())) {\n\t\t\tthis.alert(language.getString(\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"Error/InvalidElementName\",\n\t\t\t\t{ variables: {elementName: param.element},\n\t\t\t\t wiki: this.wiki\n\t\t\t\t}\n\t\t\t));\n\t\t} else if (/[ \\/]/.test(param.attribute.trim())) {\n\t\t\tthis.alert(language.getString(\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"Error/InvalidAttributeName\",\n\t\t\t\t{ variables: {attributeName: param.attribute},\n\t\t\t\t wiki: this.wiki\n\t\t\t\t}\n\t\t\t));\n\t\t} else {\n\t\t\tadd(this.wiki, \"attributes\", param.element, param.attribute);\n\t\t}\n\t}\n\treturn true;\n};\n\nfunction add(wiki, category/*, path parts*/) {\n\tvar path = \"$:/config/flibbles/relink/\" + category;\n\tfor (var x = 2; x < arguments.length; x++) {\n\t\tvar part = arguments[x];\n\t\t// Abort if it's falsy, or only whitespace. Also, trim spaces\n\t\tif (!part || !(part = part.trim())) {\n\t\t\treturn;\n\t\t}\n\t\tpath = path + \"/\" + part;\n\t}\n\tvar def = utils.getDefaultType(wiki);\n\twiki.addTiddler({title: path, text: def});\n};\n","module-type":"widget","title":"$:/plugins/flibbles/relink/js/mangler.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings.js":{"text":"/*\\\nmodule-type: library\n\nThis handles the fetching and distribution of relink settings.\n\n\\*/\n\nvar utils = require('./utils');\n\n///// Legacy. You used to be able to access the type from utils.\nexports.getType = utils.getType;\n/////\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/settings.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils.js":{"text":"/*\\\nmodule-type: library\n\nUtility methods for relink.\n\n\\*/\n\nvar macroFilter = \"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\";\n\n/**This works nearly identically to $tw.modules.getModulesByTypeAsHashmap\n * except that this also takes care of migrating V1 relink modules.\n */\nexports.getModulesByTypeAsHashmap = function(moduleType, nameField) {\n\tvar results = Object.create(null);\n\t$tw.modules.forEachModuleOfType(moduleType, function(title, module) {\n\t\tvar key = module[nameField];\n\t\tif (key !== undefined) {\n\t\t\tresults[key] = module;\n\t\t} else {\n\t\t\tfor (var entry in module) {\n\t\t\t\tresults[entry] = {\n\t\t\t\t\trelink: module[entry],\n\t\t\t\t\treport: function() {}};\n\t\t\t\tresults[entry][nameField] = entry;\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\nexports.getTiddlerRelinkReferences = function(wiki, title, context) {\n\tvar tiddler = wiki.getTiddler(title),\n\t\treferences = Object.create(null),\n\t\toptions = {settings: context, wiki: wiki};\n\tif (tiddler) {\n\t\ttry {\n\t\t\tfor (var relinker in getRelinkOperators()) {\n\t\t\t\tgetRelinkOperators()[relinker].report(tiddler, function(title, blurb) {\n\t\t\t\t\treferences[title] = references[title] || [];\n\t\t\t\t\treferences[title].push(blurb || '');\n\t\t\t\t}, options);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (e.message) {\n\t\t\t\te.message = e.message + \"\\nWhen reporting '\" + title + \"' Relink references\";\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}\n\treturn references;\n};\n\n/** Returns a pair like this,\n * { title: {field: entry, ... }, ... }\n */\nexports.getRelinkResults = function(wiki, fromTitle, toTitle, context, tiddlerList, options) {\n\toptions = options || {};\n\toptions.wiki = options.wiki || wiki;\n\tfromTitle = (fromTitle || \"\").trim();\n\ttoTitle = (toTitle || \"\").trim();\n\tvar changeList = Object.create(null);\n\tif(fromTitle && toTitle !== undefined) {\n\t\tif (tiddlerList === undefined) {\n\t\t\ttiddlerList = wiki.getRelinkableTitles();\n\t\t}\n\t\tfor (var i = 0; i < tiddlerList.length; i++) {\n\t\t\tvar title = tiddlerList[i];\n\t\t\tvar tiddler = wiki.getTiddler(title);\n\t\t\tif(tiddler) {\n\t\t\t\ttry {\n\t\t\t\t\tvar entries = Object.create(null),\n\t\t\t\t\t\toperators = getRelinkOperators();\n\t\t\t\t\toptions.settings = new Contexts.tiddler(wiki, context, title);\n\t\t\t\t\tfor (var operation in operators) {\n\t\t\t\t\t\toperators[operation].relink(tiddler, fromTitle, toTitle, entries, options);\n\t\t\t\t\t}\n\t\t\t\t\tfor (var field in entries) {\n\t\t\t\t\t\t// So long as there is one key,\n\t\t\t\t\t\t// add it to the change list.\n\t\t\t\t\t\tif (tiddler.fields[\"plugin-type\"]) {\n\t\t\t\t\t\t\t// We never change plugins, even if they have links\n\t\t\t\t\t\t\tchangeList[title] = {};\n\t\t\t\t\t\t\tchangeList[title][field] = {impossible: true};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchangeList[title] = entries;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Should we test for instanceof Error instead?: yes\n\t\t\t\t\t// Does that work in the testing environment?: no\n\t\t\t\t\tif (e.message) {\n\t\t\t\t\t\te.message = e.message + \"\\nWhen relinking '\" + title + \"'\";\n\t\t\t\t\t}\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn changeList;\n};\n\nvar Contexts = $tw.modules.applyMethods('relinkcontext');\n\nexports.getContext = function(name) {\n\treturn Contexts[name];\n};\n\nexports.getWikiContext = function(wiki) {\n\t// This gives a fresh context every time. It is up to the indexer or\n\t// the cache to preserve those contexts for as long as needed.\n\tvar whitelist = new Contexts.whitelist(wiki);\n\treturn new Contexts.import(wiki, whitelist, macroFilter);\n};\n\n/** Returns the Relink indexer, or a dummy object which pretends to be one.\n */\nexports.getIndexer = function(wiki) {\n\tif (!wiki._relink_indexer) {\n\t\twiki._relink_indexer = (wiki.getIndexer && wiki.getIndexer(\"RelinkIndexer\")) || new (require('$:/plugins/flibbles/relink/js/utils/backupIndexer.js'))(wiki);\n\t}\n\treturn wiki._relink_indexer;\n};\n\n/**Relinking supports a cache that persists throughout a whole relink op.\n * This is because the Tiddlywiki caches may get wiped multiple times\n * throughout the course of a relink.\n */\nexports.getCacheForRun = function(options, cacheName, initializer) {\n\toptions.cache = options.cache || Object.create(null);\n\tif (!$tw.utils.hop(options.cache, cacheName)) {\n\t\toptions.cache[cacheName] = initializer();\n\t}\n\treturn options.cache[cacheName];\n};\n\n/**Returns a specific relinker.\n * This is useful for wikitext rules which need to parse a filter or a list\n */\nexports.getType = function(name) {\n\tvar Handler = getFieldTypes()[name];\n\treturn Handler ? new Handler() : undefined;\n};\n\nexports.getTypes = function() {\n\t// We don't return fieldTypes, because we don't want it modified,\n\t// and we need to filter out legacy names.\n\tvar rtn = Object.create(null);\n\tfor (var type in getFieldTypes()) {\n\t\tvar typeObject = getFieldTypes()[type];\n\t\trtn[typeObject.typeName] = typeObject;\n\t}\n\treturn rtn;\n};\n\nexports.getDefaultType = function(wiki) {\n\tvar tiddler = wiki.getTiddler(\"$:/config/flibbles/relink/settings/default-type\");\n\tvar defaultType = tiddler && tiddler.fields.text;\n\t// make sure the default actually exists, otherwise default\n\treturn fieldTypes[defaultType] ? defaultType : \"title\";\n};\n\nexports.touchModifyField = function(wiki) {\n\tvar tiddler = wiki.getTiddler(\"$:/config/flibbles/relink/touch-modify\");\n\treturn tiddler && tiddler.fields.text.trim() === \"yes\";\n};\n\n/**Given some text, and a param or attribute within that text, this returns\n * what type of quotation that attribute is using.\n *\n * param: An object in the form {end:, ...}\n */\nexports.determineQuote = function(text, param) {\n\tvar pos = param.end-1;\n\tif (text[pos] === \"'\") {\n\t\treturn \"'\";\n\t}\n\tif (text[pos] === '\"') {\n\t\tif (text.substr(pos-2, 3) === '\"\"\"') {\n\t\t\treturn '\"\"\"';\n\t\t} else {\n\t\t\treturn '\"';\n\t\t}\n\t}\n\tif (text.substr(pos-1,2) === ']]' && text.substr((pos-param.value.length)-3, 2) === '[[') {\n\t\treturn \"[[\";\n\t}\n\treturn '';\n};\n\nvar fieldTypes;\n\nfunction getFieldTypes() {\n\tif (!fieldTypes) {\n\t\tfieldTypes = Object.create(null);\n\t\t$tw.modules.forEachModuleOfType(\"relinkfieldtype\", function(title, exports) {\n\t\t\tfunction NewType() {};\n\t\t\tNewType.prototype = exports;\n\t\t\tNewType.typeName = exports.name;\n\t\t\tfieldTypes[exports.name] = NewType;\n\t\t\t// For legacy, if the NewType doesn't have a report method, we add one\n\t\t\tif (!exports.report) {\n\t\t\t\texports.report = function() {};\n\t\t\t}\n\t\t\t// Also for legacy, some of the field types can go by other names\n\t\t\tif (exports.aliases) {\n\t\t\t\t$tw.utils.each(exports.aliases, function(alias) {\n\t\t\t\t\tfieldTypes[alias] = NewType;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\treturn fieldTypes;\n}\n\nvar relinkOperators;\n\nfunction getRelinkOperators() {\n\tif (!relinkOperators) {\n\t\trelinkOperators = exports.getModulesByTypeAsHashmap('relinkoperator', 'name');\n\t}\n\treturn relinkOperators;\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/wikimethods.js":{"text":"/*\\\nmodule-type: wikimethod\n\nIntroduces some utility methods used by Relink.\n\n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.getTiddlerRelinkReferences = function(title) {\n\treturn utils.getIndexer(this).lookup(title);\n};\n\nexports.getTiddlerRelinkBackreferences = function(title) {\n\treturn utils.getIndexer(this).reverseLookup(title);\n};\n\nexports.getRelinkableTitles = function() {\n\tvar toUpdate = \"$:/config/flibbles/relink/to-update\";\n\tvar wiki = this;\n\treturn this.getCacheForTiddler(toUpdate, \"relink-toUpdate\", function() {\n\t\tvar tiddler = wiki.getTiddler(toUpdate);\n\t\tif (tiddler) {\n\t\t\treturn wiki.compileFilter(tiddler.fields.text);\n\t\t} else {\n\t\t\treturn wiki.allTitles;\n\t\t}\n\t})();\n};\n\nexports.getRelinkOrphans = function() {\n\treturn utils.getIndexer(this).orphans();\n};\n","module-type":"wikimethod","title":"$:/plugins/flibbles/relink/js/wikimethods.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/all_relinkable.js":{"text":"/*\\\nmodule-type: allfilteroperator\n\nFilter function for [all[relinkable]].\nReturns all tiddlers subject to relinking.\n\n\\*/\n\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.relinkable = function(source,prefix,options) {\n\treturn options.wiki.getRelinkableTitles();\n};\n\n})();\n","module-type":"allfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/all_relinkable.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/orphans.js":{"text":"/*\\\nmodule-type: relinkfilteroperator\n\nFilter function for [relink:orphans[]].\nReturns all tiddlers which are not referenced in any way\n\n\\*/\n\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.orphans = function(source,prefix,options) {\n\treturn options.wiki.getRelinkOrphans();\n};\n\n})();\n","module-type":"relinkfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/orphans.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/references.js":{"text":"/*\\\nmodule-type: relinkfilteroperator\n\nGiven a title as an operand, returns all non-shadow tiddlers that have any\nsort of updatable reference to it.\n\n`relink:backreferences[]]`\n`relink:references[]]`\n\nReturns all tiddlers that reference `fromTiddler` somewhere inside them.\n\nInput is ignored. Maybe it shouldn't do this.\n\\*/\n\nvar LinkedList = $tw.utils.LinkedList;\n\nif (!LinkedList) {\n\t/* If the linked list isn't available, make a quick crappy version. */\n\tLinkedList = function() {this.array=[];};\n\n\tLinkedList.prototype.pushTop = function(array) {\n\t\t$tw.utils.pushTop(this.array, array);\n\t};\n\n\tLinkedList.prototype.toArray = function() {\n\t\treturn this.array;\n\t};\n};\n\nexports.backreferences = function(source,operator,options) {\n\tvar results = new LinkedList();\n\tsource(function(tiddler,title) {\n\t\tresults.pushTop(Object.keys(options.wiki.getTiddlerRelinkBackreferences(title,options)));\n\t});\n\treturn results.toArray();\n};\n\nexports.references = function(source,operator,options) {\n\tvar results = new LinkedList();\n\tsource(function(tiddler,title) {\n\t\tvar refs = options.wiki.getTiddlerRelinkReferences(title,options);\n\t\tif (refs) {\n\t\t\tresults.pushTop(Object.keys(refs));\n\t\t}\n\t});\n\treturn results.toArray();\n};\n","module-type":"relinkfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/references.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/relink.js":{"text":"/*\\\nmodule-type: filteroperator\n\nThis filter acts as a namespace for several small, simple filters, such as\n\n`[relink:impossible[]]`\n\n\\*/\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar language = require('$:/plugins/flibbles/relink/js/language.js');\n\nvar relinkFilterOperators;\n\nfunction getRelinkFilterOperators() {\n\tif(!relinkFilterOperators) {\n\t\trelinkFilterOperators = {};\n\t\t$tw.modules.applyMethods(\"relinkfilteroperator\",\n\t\t relinkFilterOperators);\n\t}\n\treturn relinkFilterOperators;\n}\n\nexports.relink = function(source,operator,options) {\n\tvar suffixPair = parseSuffix(operator.suffix);\n\tvar relinkFilterOperator = getRelinkFilterOperators()[suffixPair[0]];\n\tif (relinkFilterOperator) {\n\t\tvar newOperator = $tw.utils.extend({}, operator);\n\t\tnewOperator.suffix = suffixPair[1];\n\t\treturn relinkFilterOperator(source, newOperator, options);\n\t} else {\n\t\treturn [language.getString(\"text/plain\", \"Error/RelinkFilterOperator\", options)];\n\t}\n};\n\nfunction parseSuffix(suffix) {\n\tvar index = suffix? suffix.indexOf(\":\"): -1;\n\tif (index >= 0) {\n\t\treturn [suffix.substr(0, index), suffix.substr(index+1)];\n\t} else {\n\t\treturn [suffix];\n\t}\n}\n","module-type":"filteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/relink.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/report.js":{"text":"/*\\\nmodule-type: relinkfilteroperator\n\nGiven a title as an operand, returns a string for each occurrence of that title\nwithin each input title.\n\n[[title]] +[relink:report[fromTiddler]]`\n\nReturns string representation of fromTiddler occurrences in title.\n\\*/\n\nexports.report = function(source,operator,options) {\n\tvar fromTitle = operator.operand,\n\t\tresults = [];\n\tif (fromTitle) {\n\t\tvar blurbs = options.wiki.getTiddlerRelinkBackreferences(fromTitle);\n\t\tsource(function(tiddler, title) {\n\t\t\tif (blurbs[title]) {\n\t\t\t\tresults = results.concat(blurbs[title]);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n","module-type":"relinkfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/report.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/signatures.js":{"text":"/*\\\nmodule-type: relinkfilteroperator\n\nThis filter returns all input tiddlers which are a source of\nrelink configuration.\n\n`[all[tiddlers+system]relink:source[macros]]`\n\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\n\nexports.signatures = function(source,operator,options) {\n\tvar plugin = operator.operand || null;\n\tvar set = getSet(options);\n\tif (plugin === \"$:/core\") {\n\t\t// Core doesn't actually have any settings. We mean Relink\n\t\tplugin = \"$:/plugins/flibbles/relink\";\n\t}\n\tvar signatures = [];\n\tfor (var signature in set) {\n\t\tvar source = set[signature].source;\n\t\tif (options.wiki.getShadowSource(source) === plugin) {\n\t\t\tsignatures.push(signature);\n\t\t}\n\t}\n\treturn signatures;\n};\n\nexports.type = function(source,operator,options) {\n\tvar results = [];\n\tvar set = getSet(options);\n\tsource(function(tiddler, signature) {\n\t\tif (set[signature]) {\n\t\t\tresults.push(set[signature].name);\n\t\t}\n\t});\n\treturn results;\n};\n\nexports.types = function(source,operator,options) {\n\tvar def = utils.getDefaultType(options.wiki);\n\tvar types = Object.keys(utils.getTypes());\n\ttypes.sort();\n\t// move default to front\n\ttypes.sort(function(x,y) { return x === def ? -1 : y === def ? 1 : 0; });\n\treturn types;\n};\n\nexports.source = function(source,operator,options) {\n\tvar results = [];\n\tvar category = operator.suffix;\n\tvar set = getSet(options);\n\tsource(function(tiddler, signature) {\n\t\tif (set[signature]) {\n\t\t\tresults.push(set[signature].source);\n\t\t}\n\t});\n\treturn results;\n};\n\nfunction getSet(options) {\n\treturn options.wiki.getGlobalCache(\"relink-signatures\", function() {\n\t\tvar config = utils.getWikiContext(options.wiki);\n\t\tvar set = Object.create(null);\n\t\tvar categories = {\n\t\t\tattributes: config.getAttributes(),\n\t\t\tfields: config.getFields(),\n\t\t\tmacros: config.getMacros(),\n\t\t\toperators: config.getOperators()};\n\t\t$tw.utils.each(categories, function(list, category) {\n\t\t\t$tw.utils.each(list, function(item, key) {\n\t\t\t\tset[category + \"/\" + key] = item;\n\t\t\t});\n\t\t});\n\t\treturn set;\n\t});\n};\n","module-type":"relinkfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/signatures.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/filteroperators/splitafter.js":{"text":"/*\\\ntitle: $:/core/modules/filters/splitbefore.js\ntype: application/javascript\nmodule-type: relinkfilteroperator\n\nFilter operator that splits each result on the last occurance of the specified separator and returns the last bit.\n\nWhat does this have to do with relink? Nothing. I need this so I can render\nthe configuration menu. I //could// use [splitregexp[]], but then I'd be\nlimited to Tiddlywiki v5.1.20 or later.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.splitafter = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar index = title.lastIndexOf(operator.operand);\n\t\tif(index < 0) {\n\t\t\t$tw.utils.pushTop(results,title);\n\t\t} else {\n\t\t\t$tw.utils.pushTop(results,title.substr(index+1));\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n\n","title":"$:/plugins/flibbles/relink/js/filteroperators/splitafter.js","type":"application/javascript","module-type":"relinkfilteroperator"},"$:/plugins/flibbles/relink/js/filteroperators/wouldchange.js":{"text":"/*\\\nmodule-type: relinkfilteroperator\n\nwouldchange: Generator.\n\nGiven each input title, it returns all the tiddlers that would be changed if the currentTiddler were to be renamed to the operand.\n\nimpossible: filters all source titles for ones that encounter errors on failure.\n\nTHESE ARE INTERNAL FILTER OPERATOR AND ARE NOT INTENDED TO BE USED BY USERS.\n\n\\*/\n\nvar language = require(\"$:/plugins/flibbles/relink/js/language.js\");\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils.js\");\n\nexports.wouldchange = function(source,operator,options) {\n\tvar from = options.widget && options.widget.getVariable(\"currentTiddler\"),\n\t\tto = operator.operand,\n\t\tindexer = utils.getIndexer(options.wiki),\n\t\trecords = indexer.relinkLookup(from, to, options);\n\treturn Object.keys(records);\n};\n\nexports.impossible = function(source,operator,options) {\n\tvar from = options.widget && options.widget.getVariable(\"currentTiddler\"),\n\t\tto = operator.operand,\n\t\tresults = [],\n\t\tindexer = utils.getIndexer(options.wiki),\n\t\trecords = indexer.relinkLookup(from, to, options);\n\tsource(function(tiddler, title) {\n\t\tvar fields = records[title];\n\t\tif (fields) {\n\t\t\tfor (var field in fields) {\n\t\t\t\tif (fields[field].impossible) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n","module-type":"relinkfilteroperator","title":"$:/plugins/flibbles/relink/js/filteroperators/wouldchange.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings/attributes.js":{"text":"/*\\\n\nFactory method for creating the attributes whitelist cache.\n\n\\*/\n\nvar utils = require('../utils');\n\nexports.name = \"attributes\";\n\nexports.generate = function(attributes, tiddler, key) {\n\tvar data = utils.getType(tiddler.fields.text.trim());\n\tif (data) {\n\t\tdata.source = tiddler.fields.title;\n\t\t// Secret feature. You can access a config tiddler's\n\t\t// fields from inside the fieldtype handler. Cool\n\t\t// tricks can be done with this.\n\t\tdata.fields = tiddler.fields;\n\t\tvar elem = root(key);\n\t\tvar attr = key.substr(elem.length+1);\n\t\tattributes[elem] = attributes[elem] || Object.create(null);\n\t\tattributes[elem][attr] = data;\n\t}\n};\n\n/* Returns first bit of a path. path/to/tiddler -> path\n */\nfunction root(string) {\n\tvar index = string.indexOf('/');\n\tif (index >= 0) {\n\t\treturn string.substr(0, index);\n\t}\n};\n\n","module-type":"relinksetting","title":"$:/plugins/flibbles/relink/js/settings/attributes.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings/fields.js":{"text":"/*\\\n\nFactory method for creating the fields whitelist cache.\n\n\\*/\n\nvar utils = require('../utils');\n\nexports.name = \"fields\";\n\nexports.generate = function(fields, tiddler, name) {\n\tvar data = utils.getType(tiddler.fields.text.trim());\n\tif (data) {\n\t\tdata.source = tiddler.fields.title;\n\t\t// Secret feature. You can access a config tiddler's\n\t\t// fields from inside the fieldtype handler. Cool\n\t\t// tricks can be done with this.\n\t\tdata.fields = tiddler.fields;\n\t\tfields[name] = data;\n\t}\n};\n","module-type":"relinksetting","title":"$:/plugins/flibbles/relink/js/settings/fields.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings/fieldwidgets.js":{"text":"/*\\\n\nFactory method for creating the fieldattributes regexp cache.\n\n\\*/\n\nexports.name = \"fieldattributes\";\n\nexports.generate = function(fieldattributes, tiddler, key) {\n\tfieldattributes[key] = new RegExp(tiddler.fields.text.trim());\n};\n","module-type":"relinksetting","title":"$:/plugins/flibbles/relink/js/settings/fieldwidgets.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings/macros.js":{"text":"/*\\\n\nFactory method for creating the macros whitelist cache.\n\n\\*/\n\nvar utils = require('../utils');\n\nexports.name = \"macros\";\n\nexports.generate = function(macros, tiddler, key) {\n\tvar data = utils.getType(tiddler.fields.text.trim());\n\tif (data) {\n\t\tdata.source = tiddler.fields.title;\n\t\t// Secret feature. You can access a config tiddler's\n\t\t// fields from inside the fieldtype handler. Cool\n\t\t// tricks can be done with this.\n\t\tdata.fields = tiddler.fields;\n\t\t// We take the last index, not the first, because macro\n\t\t// parameters can't have slashes, but macroNames can.\n\t\tvar name = dir(key);\n\t\tvar arg = key.substr(name.length+1);\n\t\tmacros[name] = macros[name] || Object.create(null);\n\t\tmacros[name][arg] = data;\n\t}\n};\n\n/* Returns all but the last bit of a path. path/to/tiddler -> path/to\n */\nfunction dir(string) {\n\tvar index = string.lastIndexOf('/');\n\tif (index >= 0) {\n\t\treturn string.substr(0, index);\n\t}\n}\n\n","module-type":"relinksetting","title":"$:/plugins/flibbles/relink/js/settings/macros.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/settings/operators.js":{"text":"/*\\\n\nFactory method for creating the operators whitelist cache.\n\n\\*/\n\nvar utils = require('../utils');\n\nexports.name = \"operators\";\n\nexports.generate = function(operators, tiddler, key) {\n\tvar data = utils.getType(tiddler.fields.text.trim());\n\tif (data) {\n\t\tdata.source = tiddler.fields.title;\n\t\t// Secret feature. You can access a config tiddler's\n\t\t// fields from inside the fieldtype handler. Cool\n\t\t// tricks can be done with this.\n\t\tdata.fields = tiddler.fields;\n\t\tvar pair = key.split('/');\n\t\tvar name = pair[0];\n\t\tdata.key = key;\n\t\toperators[name] = operators[name] || Object.create(null);\n\t\toperators[name][pair[1] || 1] = data;\n\t}\n};\n","module-type":"relinksetting","title":"$:/plugins/flibbles/relink/js/settings/operators.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/filter.js":{"text":"/*\\\n\nThis specifies logic for updating filters to reflect title changes.\n\n\\*/\n\nvar refHandler = require(\"$:/plugins/flibbles/relink/js/fieldtypes/reference\");\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar filterRelinkers = utils.getModulesByTypeAsHashmap('relinkfilter', 'name');\n\nexports.name = \"filter\";\n\nexports.report = function(filter, callback, options) {\n\tif (filter) {\n\t\ttry {\n\t\t\tvar parseTree = options.wiki.parseFilter(filter);\n\t\t} catch (e) {\n\t\t\t// It must have been malformed. Return without doing anything.\n\t\t\treturn;\n\t\t}\n\t\tfor (var module in filterRelinkers) {\n\t\t\tfilterRelinkers[module].report(parseTree, callback, options);\n\t\t}\n\t}\n};\n\n/**Returns undefined if no change was made.\n */\nexports.relink = function(filter, fromTitle, toTitle, options) {\n\tvar changed = false;\n\tvar results = {};\n\tvar parseTree;\n\tif (filter) {\n\t\ttry {\n\t\t\tparseTree = options.wiki.parseFilter(filter);\n\t\t} catch (e) {\n\t\t\t// It must have been malformed. Return without doing anything.\n\t\t\treturn;\n\t\t}\n\t\tfor (var module in filterRelinkers) {\n\t\t\tvar entry = filterRelinkers[module].relink(parseTree, fromTitle, toTitle, options);\n\t\t\tif (entry) {\n\t\t\t\tif (entry.changed) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tif (entry.impossible) {\n\t\t\t\t\tresults.impossible = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (changed) {\n\t\tbuilder = assembleFilterString(parseTree, filter, options);\n\t\tresults.output = builder.results();\n\t\tresults.impossible = results.impossible || builder.impossible;\n\t\treturn results;\n\t}\n\tif (results.impossible) {\n\t\treturn results;\n\t}\n\treturn undefined\n};\n\nfunction assembleFilterString(parseTree, oldFilter, options) {\n\tvar relinker = new Rebuilder(oldFilter),\n\t\twordBarrierRequired = false,\n\t\tp = 0;\n\tfor (var i = 0; i < parseTree.length; i++) {\n\t\tvar start = $tw.utils.skipWhiteSpace(oldFilter, p);\n\t\tif (start !== p) {\n\t\t\t// There's some breathing room between this run and the last.\n\t\t\t// We'll never need to insert space.\n\t\t\twordBarrierRequired = false;\n\t\t\tp = start;\n\t\t}\n\t\tvar run = parseTree[i];\n\t\tif (run.prefix) {\n\t\t\tif (wordBarrierRequired) {\n\t\t\t\trelinker.add(' ', p, p);\n\t\t\t\twordBarrierRequired = false;\n\t\t\t}\n\t\t\tp += run.prefix.length;\n\t\t}\n\t\tif (oldFilter[p] !== '['\n\t\t|| (oldFilter[p+1] === '[' && run.operators.length === 1)) {\n\t\t\t// It's a string title\n\t\t\tvar text = run.operators[0].operands[0].text,\n\t\t\t\tend,\n\t\t\t\told;\n\t\t\tswitch (oldFilter[p]) {\n\t\t\tcase \"'\":\n\t\t\tcase '\"':\n\t\t\t\t// p + 1 to skip the first quote\n\t\t\t\t// indexOf() + 1 to skip the last\n\t\t\t\tend = oldFilter.indexOf(oldFilter[p], p+1) + 1;\n\t\t\t\told = oldFilter.substring(p+1, end-1);\n\t\t\t\tbreak;\n\t\t\tcase '[':\n\t\t\t\tend = oldFilter.indexOf(']', p);\n\t\t\t\told = oldFilter.substring(p+2, end);\n\t\t\t\t// +2 to get past the ']]'\n\t\t\t\tend += 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tend = skipWord(oldFilter, p);\n\t\t\t\told = oldFilter.substring(p, end);\n\t\t\t}\n\t\t\tif (old !== text) {\n\t\t\t\tvar wrapped = wrapTitle(text, oldFilter[p] !== \"[\" ? oldFilter[p] : '', options);\n\t\t\t\tif (wrapped !== undefined) {\n\t\t\t\t\t// This is a no-quote title. If breathing room is required,\n\t\t\t\t\t// add it. Also, we may need breathing room after it.\n\t\t\t\t\tif (wordBarrierRequired && wrapped[0] !== \"[\") {\n\t\t\t\t\t\trelinker.add(' ', p, p);\n\t\t\t\t\t}\n\t\t\t\t\trelinker.add(wrapped, p, end);\n\t\t\t\t\twordBarrierRequired = wrapped === text;\n\t\t\t\t} else if (options.placeholder) {\n\t\t\t\t\tvar ph = options.placeholder.getPlaceholderFor(text);\n\t\t\t\t\trelinker.add('[<' + ph + '>]', p, end);\n\t\t\t\t} else {\n\t\t\t\t\trelinker.impossible = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (wordBarrierRequired && oldFilter[p] !== \"[\") {\n\t\t\t\t\trelinker.add(' ', p, p);\n\t\t\t\t}\n\t\t\t\twordBarrierRequired = oldFilter.indexOf(text) === p;\n\t\t\t}\n\t\t\tp = end;\n\t\t} else {\n\t\t\twordBarrierRequired = false;\n\t\t\tp++;\n\t\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\t\tvar operator = run.operators[j];\n\t\t\t\tvar start = p;\n\t\t\t\tfor (var index = 0; index < operator.operands.length; index++) {\n\t\t\t\t\tvar operand = operator.operands[index],\n\t\t\t\t\t\tskip = false;\n\t\t\t\t\t\tend,\n\t\t\t\t\t\twrapped;\n\t\t\t\t\tif (operand.indirect) {\n\t\t\t\t\t\tp = oldFilter.indexOf('{', p);\n\t\t\t\t\t\tend = oldFilter.indexOf('}', p+1);\n\t\t\t\t\t\twrapped = '{' + operand.text + '}';\n\t\t\t\t\t} else if (operand.variable) {\n\t\t\t\t\t\tp = oldFilter.indexOf('<', p);\n\t\t\t\t\t\tend = oldFilter.indexOf('>', p+1);\n\t\t\t\t\t\twrapped = '<' + operand.text + '>';\n\t\t\t\t\t} else if (operator.regexp) {\n\t\t\t\t\t\tp = oldFilter.indexOf('/', p);\n\t\t\t\t\t\tend = oldFilter.indexOf('/', p+1);\n\t\t\t\t\t\tskip = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp = oldFilter.indexOf('[', p);\n\t\t\t\t\t\tend = oldFilter.indexOf(']', p+1);\n\t\t\t\t\t\tif (!canBePrettyOperand(operand.text) || (options.inBraces && operand.text.indexOf('}}}') >= 0)) {\n\t\t\t\t\t\t\tif (options.placeholder) {\n\t\t\t\t\t\t\t\tvar ph = options.placeholder.getPlaceholderFor(operand.text, operand.handler);\n\t\t\t\t\t\t\t\twrapped = '<' + ph + '>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t\t\trelinker.impossible = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twrapped = '[' + operand.text + ']';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend++; // skip the closing brace\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t// If this is the first operand, let's first recreate the operator signature in case it was changed at all.\n\t\t\t\t\t\trelinker.add(operatorSignature(operator, oldFilter, start), start, p);\n\t\t\t\t\t}\n\t\t\t\t\tif (!skip) {\n\t\t\t\t\t\trelinker.add(wrapped, p, end);\n\t\t\t\t\t}\n\t\t\t\t\tp = end;\n\t\t\t\t}\n\t\t\t}\n\t\t\tp++; // Skip the closing brace;\n\t\t}\n\t}\n\treturn relinker;\n};\n\nfunction operatorSignature(operator, oldText, start) {\n\t// If it's a title operand, try to determine if it was a shorthand.\n\tvar prefix = operator.prefix || '';\n\tvar signature = prefix + ((operator.operator === 'title' && oldText[start + prefix.length] !== 't')? '': operator.operator);\n\tif (operator.suffix) {\n\t\tsignature += ':' + operator.suffix;\n\t}\n\treturn signature;\n}\n\nfunction skipWord(source,pos) {\n\tvar c;\n\twhile(true) {\n\t\tc = source.charAt(pos);\n\t\tif((c !== \"\") && (c !== \" \") && (c !== \"\\f\") && (c !== \"\\n\")\n\t\t&& (c !== \"\\r\") && (c !== \"\\t\")\n\t\t&& (c !== \"\\v\")&& (c !== \"\\u00a0\") // Ignores obscure unicode spaces\n\t\t&& (c !== \"[\") && (c !== \"]\")) { // Ignore brackets\n\t\t\tpos++;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n};\n\n/* Same as this.relink, except this has the added constraint that the return\n * value must be able to be wrapped in curly braces. (i.e. '{{{...}}}')\n */\nexports.relinkInBraces = function(filter, fromTitle, toTitle, options) {\n\tvar braceOptions = $tw.utils.extend({inBraces: true}, options);\n\tvar entry = this.relink(filter, fromTitle, toTitle, braceOptions);\n\tif (entry && entry.output && !canBeInBraces(entry.output)) {\n\t\t// It was possible, but it won't fit in braces, so we must give up\n\t\tdelete entry.output;\n\t\tentry.impossible = true;\n\t}\n\treturn entry;\n};\n\nfunction wrapTitle(value, preference, options) {\n\tvar choices = {\n\t\t\"\": function(v) {return /^[^\\s\\[\\]\\}\\+\\-\\~\\=\\:][^\\s\\[\\]]*[^\\s\\[\\]\\}]$/.test(v); },\n\t\t\"[\": canBePrettyOperand,\n\t\t\"'\": function(v) {return v.indexOf(\"'\") < 0; },\n\t\t'\"': function(v) {return v.indexOf('\"') < 0; }\n\t};\n\tvar wrappers = {\n\t\t\"\": function(v) {return v; },\n\t\t\"[\": function(v) {return \"[[\"+v+\"]]\"; },\n\t\t\"'\": function(v) {return \"'\"+v+\"'\"; },\n\t\t'\"': function(v) {return '\"'+v+'\"'; }\n\t};\n\tif (options.inBraces && value.indexOf('}}}') >= 0) {\n\t\t// In this particular case, it can't be wrapped in this filter,\n\t\t// even if it would have worked within the context of the filter itself\n\t\treturn undefined;\n\t}\n\tif (!choices[preference]) {\n\t\tpreference = '';\n\t}\n\tif (choices[preference](value)) {\n\t\treturn wrappers[preference](value);\n\t}\n\tfor (var quote in choices) {\n\t\tif (choices[quote](value)) {\n\t\t\treturn wrappers[quote](value);\n\t\t}\n\t}\n\t// No quotes will work on this\n\treturn undefined;\n}\n\nfunction canBePrettyOperand(value) {\n\treturn value.indexOf(']') < 0;\n};\n\nfunction canBeInBraces(value) {\n\treturn value.indexOf(\"}}}\") < 0 && value.substr(value.length-2) !== '}}';\n};\n","module-type":"relinkfieldtype","title":"$:/plugins/flibbles/relink/js/fieldtypes/filter.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/list.js":{"text":"/*\\\nThis manages replacing titles that occur within stringLists, like,\n\nTiddlerA [[Tiddler with spaces]] [[Another Title]]\n\\*/\n\nexports.name = \"list\";\n\nexports.report = function(value, callback, options) {\n\tvar list = $tw.utils.parseStringArray(value);\n\tfor (var i = 0; i < list.length; i++) {\n\t\tcallback(list[i]);\n\t}\n};\n\n/**Returns undefined if no change was made.\n * Parameter: value can literally be a list. This can happen for builtin\n * types 'list' and 'tag'. In those cases, we also return list.\n */\nexports.relink = function(value, fromTitle, toTitle, options) {\n\tvar isModified = false,\n\t\tactualList = false,\n\t\tlist;\n\tif (typeof value !== \"string\") {\n\t\t// Not a string. Must be a list.\n\t\t// clone it, since we may make changes to this possibly\n\t\t// frozen list.\n\t\tlist = (value || []).slice(0);\n\t\tactualList = true;\n\t} else {\n\t\tlist = $tw.utils.parseStringArray(value || \"\");\n\t}\n\t$tw.utils.each(list,function (title,index) {\n\t\tif(title === fromTitle) {\n\t\t\tlist[index] = toTitle;\n\t\t\tisModified = true;\n\t\t}\n\t});\n\tif (isModified) {\n\t\tvar entry = {name: \"list\"};\n\t\t// It doesn't parse correctly alone, it won't\n\t\t// parse correctly in any list.\n\t\tif (!canBeListItem(toTitle)) {\n\t\t\tentry.impossible = true;\n\t\t} else if (actualList) {\n\t\t\tentry.output = list;\n\t\t} else {\n\t\t\tentry.output = $tw.utils.stringifyList(list);\n\t\t}\n\t\treturn entry;\n\t}\n\treturn undefined;\n};\n\nfunction canBeListItem(value) {\n\tvar regexp = /\\]\\][^\\S\\xA0]/m;\n\treturn !regexp.test(value);\n};\n","module-type":"relinkfieldtype","title":"$:/plugins/flibbles/relink/js/fieldtypes/list.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/reference.js":{"text":"/*\\\nThis manages replacing titles that occur inside text references,\n\ntiddlerTitle\ntiddlerTitle!!field\n!!field\ntiddlerTitle##propertyIndex\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar referenceOperators = utils.getModulesByTypeAsHashmap('relinkreference', 'name');\n\nexports.name = \"reference\";\n\nexports.report = function(value, callback, options) {\n\tif (value) {\n\t\tvar reference = $tw.utils.parseTextReference(value);\n\t\tfor (var operator in referenceOperators) {\n\t\t\treferenceOperators[operator].report(reference, callback, options);\n\t\t}\n\t}\n};\n\nexports.relink = function(value, fromTitle, toTitle, options) {\n\tvar entry;\n\tif (value) {\n\t\tvar impossible = false;\n\t\tvar modified = false;\n\t\tvar reference = $tw.utils.parseTextReference(value);\n\t\tfor (var operator in referenceOperators) {\n\t\t\tvar result = referenceOperators[operator].relink(reference, fromTitle, toTitle, options);\n\t\t\tif (result) {\n\t\t\t\tif (result.impossible) {\n\t\t\t\t\timpossible = true;\n\t\t\t\t}\n\t\t\t\tif (result.output) {\n\t\t\t\t\tmodified = true;\n\t\t\t\t\treference = result.output;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (modified) {\n\t\t\tif (exports.canBePretty(reference.title)) {\n\t\t\t\tentry = {output: exports.toString(reference)};\n\t\t\t} else {\n\t\t\t\timpossible = true;\n\t\t\t}\n\t\t}\n\t\tif (impossible) {\n\t\t\tentry = entry || {};\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\treturn entry;\n};\n\n/* Same as this.relink, except this has the added constraint that the return\n * value must be able to be wrapped in curly braces.\n */\nexports.relinkInBraces = function(value, fromTitle, toTitle, options) {\n\tvar log = this.relink(value, fromTitle, toTitle, options);\n\tif (log && log.output && log.output.indexOf(\"}\") >= 0) {\n\t\tdelete log.output;\n\t\tlog.impossible = true;\n\t}\n\treturn log;\n};\n\nexports.toString = function(textReference) {\n\tvar title = textReference.title || '';\n\tif (textReference.field) {\n\t\treturn title + \"!!\" + textReference.field;\n\t} else if (textReference.index) {\n\t\treturn title + \"##\" + textReference.index;\n\t}\n\treturn title;\n};\n\nexports.canBePretty = function(title) {\n\treturn !title || (title.indexOf(\"!!\") < 0 && title.indexOf(\"##\") < 0);\n};\n","module-type":"relinkfieldtype","title":"$:/plugins/flibbles/relink/js/fieldtypes/reference.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/title.js":{"text":"/*\\\nThis specifies logic for replacing a single-tiddler field. This is the\nsimplest kind of field type. One title swaps out for the other.\n\\*/\n\n// NOTE TO MODDERS: If you're making your own field types, the name must be\n// alpha characters only.\nexports.name = 'title';\n\nexports.report = function(value, callback, options) {\n\tcallback(value);\n};\n\n/**Returns undefined if no change was made.\n */\nexports.relink = function(value, fromTitle, toTitle, options) {\n\tif (value === fromTitle) {\n\t\treturn {output: toTitle};\n\t}\n\treturn undefined;\n};\n\n// This is legacy support for when 'title' was known as 'field'\nexports.aliases = ['field', 'yes'];\n","module-type":"relinkfieldtype","title":"$:/plugins/flibbles/relink/js/fieldtypes/title.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/wikitext.js":{"text":"/*\\\nThis specifies logic for updating filters to reflect title changes.\n\\*/\n\nexports.name = \"wikitext\";\n\nvar type = 'text/vnd.tiddlywiki';\n\nvar WikiParser = require(\"$:/core/modules/parsers/wikiparser/wikiparser.js\")[type];\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder.js\");\nvar utils = require('$:/plugins/flibbles/relink/js/utils');\nvar WikitextContext = utils.getContext('wikitext');\n\nfunction collectRules() {\n\tvar rules = Object.create(null);\n\t$tw.modules.forEachModuleOfType(\"relinkwikitextrule\", function(title, exports) {\n\t\tvar names = exports.name;\n\t\tif (typeof names === \"string\") {\n\t\t\tnames = [names];\n\t\t}\n\t\tif (names !== undefined) {\n\t\t\tfor (var i = 0; i < names.length; i++) {\n\t\t\t\trules[names[i]] = exports;\n\t\t\t}\n\t\t}\n\t});\n\treturn rules;\n}\n\nfunction WikiWalker(type, text, options) {\n\tthis.options = options;\n\tif (!this.relinkMethodsInjected) {\n\t\tvar rules = collectRules();\n\t\t$tw.utils.each([this.pragmaRuleClasses, this.blockRuleClasses, this.inlineRuleClasses], function(classList) {\n\t\t\tfor (var name in classList) {\n\t\t\t\tif (rules[name]) {\n\t\t\t\t\tdelete rules[name].name;\n\t\t\t\t\t$tw.utils.extend(classList[name].prototype, rules[name]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tWikiWalker.prototype.relinkMethodsInjected = true;\n\t}\n\tthis.context = new WikitextContext(options.settings);\n\tWikiParser.call(this, type, text, options);\n};\n\nWikiWalker.prototype = Object.create(WikiParser.prototype);\n\nWikiWalker.prototype.parsePragmas = function() {\n\tvar entries = this.tree;\n\twhile (true) {\n\t\tthis.skipWhitespace();\n\t\tif (this.pos >= this.sourceLength) {\n\t\t\tbreak;\n\t\t}\n\t\tvar nextMatch = this.findNextMatch(this.pragmaRules, this.pos);\n\t\tif (!nextMatch || nextMatch.matchIndex !== this.pos) {\n\t\t\tbreak;\n\t\t}\n\t\tentries.push.apply(entries, this.handleRule(nextMatch));\n\t}\n\treturn entries;\n};\n\nWikiWalker.prototype.parseInlineRunUnterminated = function(options) {\n\tvar entries = [];\n\tvar nextMatch = this.findNextMatch(this.inlineRules, this.pos);\n\twhile (this.pos < this.sourceLength && nextMatch) {\n\t\tif (nextMatch.matchIndex > this.pos) {\n\t\t\tthis.pos = nextMatch.matchIndex;\n\t\t}\n\t\tentries.push.apply(entries, this.handleRule(nextMatch));\n\t\tnextMatch = this.findNextMatch(this.inlineRules, this.pos);\n\t}\n\tthis.pos = this.sourceLength;\n\treturn entries;\n};\n\nWikiWalker.prototype.parseInlineRunTerminated = function(terminatorRegExp,options) {\n\tvar entries = [];\n\toptions = options || {};\n\tterminatorRegExp.lastIndex = this.pos;\n\tvar terminatorMatch = terminatorRegExp.exec(this.source);\n\tvar inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);\n\twhile(this.pos < this.sourceLength && (terminatorMatch || inlineRuleMatch)) {\n\t\tif (terminatorMatch) {\n\t\t\tif (!inlineRuleMatch || inlineRuleMatch.matchIndex >= terminatorMatch.index) {\n\t\t\t\tthis.pos = terminatorMatch.index;\n\t\t\t\tif (options.eatTerminator) {\n\t\t\t\t\tthis.pos += terminatorMatch[0].length;\n\t\t\t\t}\n\t\t\t\treturn entries;\n\t\t\t}\n\t\t}\n\t\tif (inlineRuleMatch) {\n\t\t\tif (inlineRuleMatch.matchIndex > this.pos) {\n\t\t\t\tthis.pos = inlineRuleMatch.matchIndex;\n\t\t\t}\n\t\t\tentries.push.apply(entries, this.handleRule(inlineRuleMatch));\n\t\t\tinlineRuleMatch = this.findNextMatch(this.inlineRules, this.pos);\n\t\t\tterminatorRegExp.lastIndex = this.pos;\n\t\t\tterminatorMatch = terminatorRegExp.exec(this.source);\n\t\t}\n\t}\n\tthis.pos = this.sourceLength;\n\treturn entries;\n\n};\n\nWikiWalker.prototype.parseBlock = function(terminatorRegExpString) {\n\tvar terminatorRegExp = terminatorRegExpString ? new RegExp(\"(\" + terminatorRegExpString + \"|\\\\r?\\\\n\\\\r?\\\\n)\",\"mg\") : /(\\r?\\n\\r?\\n)/mg;\n\tthis.skipWhitespace();\n\tif (this.pos >= this.sourceLength) {\n\t\treturn [];\n\t}\n\tvar nextMatch = this.findNextMatch(this.blockRules, this.pos);\n\tif(nextMatch && nextMatch.matchIndex === this.pos) {\n\t\treturn this.handleRule(nextMatch);\n\t}\n\treturn this.parseInlineRun(terminatorRegExp);\n};\n\nWikiWalker.prototype.amendRules = function(type, names) {\n\tvar only;\n\tWikiParser.prototype.amendRules.call(this, type, names);\n\tif (type === \"only\") {\n\t\tonly = true;\n\t} else if (type === \"except\") {\n\t\tonly = false;\n\t} else {\n\t\treturn;\n\t}\n\tif (only !== (names.indexOf(\"macrodef\") >= 0) && this.options.macrodefCanBeDisabled) {\n\t\tthis.options.placeholder = undefined\n\t}\n\tif (only !== (names.indexOf(\"html\") >= 0)) {\n\t\tthis.context.allowWidgets = disabled;\n\t}\n\tif (only !== (names.indexOf(\"prettylink\") >= 0)) {\n\t\tthis.context.allowPrettylinks = disabled;\n\t}\n};\n\nfunction disabled() { return false; };\n\n/// Reporter\n\nfunction WikiReporter(type, text, callback, options) {\n\tthis.callback = callback;\n\tWikiWalker.call(this, type, text, options);\n};\n\nWikiReporter.prototype = Object.create(WikiWalker.prototype);\n\nWikiReporter.prototype.handleRule = function(ruleInfo) {\n\tif (ruleInfo.rule.report) {\n\t\truleInfo.rule.report(this.source, this.callback, this.options);\n\t} else {\n\t\tif (ruleInfo.rule.matchRegExp !== undefined) {\n\t\t\tthis.pos = ruleInfo.rule.matchRegExp.lastIndex;\n\t\t} else {\n\t\t\t// We can't easily determine the end of this\n\t\t\t// rule match. We'll \"parse\" it so that\n\t\t\t// parser.pos gets updated, but we throw away\n\t\t\t// the results.\n\t\t\truleInfo.rule.parse();\n\t\t}\n\t}\n};\n\nexports.report = function(wikitext, callback, options) {\n\t// Unfortunately it's the side-effect of creating this that reports.\n\tnew WikiReporter(options.type, wikitext, callback, options);\n};\n\n/// Relinker\n\nfunction WikiRelinker(type, text, fromTitle, toTitle, options) {\n\tthis.fromTitle = fromTitle;\n\tthis.toTitle = toTitle;\n\tthis.placeholder = options.placeholder;\n\tif (this.placeholder) {\n\t\tthis.placeholder.parser = this;\n\t}\n\tWikiWalker.call(this, type, text, options);\n};\n\nWikiRelinker.prototype = Object.create(WikiWalker.prototype);\n\nWikiRelinker.prototype.handleRule = function(ruleInfo) {\n\tif (ruleInfo.rule.relink) {\n\t\tvar start = ruleInfo.matchIndex;\n\t\tvar newEntry = ruleInfo.rule.relink(this.source, this.fromTitle, this.toTitle, this.options);\n\t\tif (newEntry !== undefined) {\n\t\t\tif (newEntry.output) {\n\t\t\t\tnewEntry.start = start;\n\t\t\t\tnewEntry.end = this.pos;\n\t\t\t}\n\t\t\treturn [newEntry];\n\t\t}\n\t} else {\n\t\tif (ruleInfo.rule.matchRegExp !== undefined) {\n\t\t\tthis.pos = ruleInfo.rule.matchRegExp.lastIndex;\n\t\t} else {\n\t\t\t// We can't easily determine the end of this\n\t\t\t// rule match. We'll \"parse\" it so that\n\t\t\t// parser.pos gets updated, but we throw away\n\t\t\t// the results.\n\t\t\truleInfo.rule.parse();\n\t\t}\n\t}\n\treturn [];\n};\n\nexports.relink = function(wikitext, fromTitle, toTitle, options) {\n\tvar parser = new WikiRelinker(options.type, wikitext, fromTitle, toTitle, options),\n\t\twikiEntry = undefined;\n\t// Now that we have an array of entries, let's produce the wikiText entry\n\t// containing them all.\n\tif (parser.tree.length > 0) {\n\t\tvar builder = new Rebuilder(wikitext);\n\t\twikiEntry = {};\n\t\tfor (var i = 0; i < parser.tree.length; i++) {\n\t\t\tvar entry = parser.tree[i];\n\t\t\tif (entry.impossible) {\n\t\t\t\twikiEntry.impossible = true;\n\t\t\t}\n\t\t\tif (entry.output) {\n\t\t\t\tbuilder.add(entry.output, entry.start, entry.end);\n\t\t\t}\n\t\t}\n\t\twikiEntry.output = builder.results();\n\t}\n\treturn wikiEntry;\n};\n","module-type":"relinkfieldtype","title":"$:/plugins/flibbles/relink/js/fieldtypes/wikitext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/filter/operators.js":{"text":"/*\\\n\nHandles reporting of filter operators.\n\n\\*/\n\nvar refHandler = require(\"$:/plugins/flibbles/relink/js/fieldtypes/reference\");\nvar titleHandler = require(\"$:/plugins/flibbles/relink/js/fieldtypes/title\");\nvar macrocall = require(\"$:/plugins/flibbles/relink/js/utils/macrocall.js\");\n\nexports.name = \"operators\";\n\nexports.report = function(filterParseTree, callback, options) {\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tfor (var index = 1; index <= operator.operands.length; index++) {\n\t\t\t\tvar operand = operator.operands[index-1];\n\t\t\t\tvar display = operator.operator === 'title'? '': operator.operator;\n\t\t\t\tif (operator.suffix) {\n\t\t\t\t\tdisplay += ':' + operator.suffix;\n\t\t\t\t}\n\t\t\t\t// Now add any commas if this is a later operand\n\t\t\t\tfor (var x = 1; x < index; x++) {\n\t\t\t\t\tdisplay += ',';\n\t\t\t\t}\n\t\t\t\tif (operand.indirect) {\n\t\t\t\t\trefHandler.report(operand.text, function(title, blurb) {\n\t\t\t\t\t\tcallback(title, (run.prefix || '') + '[' + (operator.prefix || '') + display + '{' + (blurb || '') + '}]');\n\t\t\t\t\t}, options);\n\t\t\t\t} else if (operand.variable) {\n\t\t\t\t\tvar macro = $tw.utils.parseMacroInvocation(\"<<\"+operand.text+\">>\", 0);\n\t\t\t\t\tmacrocall.report(options.settings, macro, function(title, blurb) {\n\t\t\t\t\t\tcallback(title, (run.prefix || '') + '[' + (operator.prefix || '') + display + '<' + blurb + '>]');\n\t\t\t\t\t}, options);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (operand.text) {\n\t\t\t\t\tvar handler = fieldType(options.settings, operator, index, options)\n\t\t\t\t\tif (handler) {\n\t\t\t\t\t\thandler.report(operand.text, function(title, blurb) {\n\t\t\t\t\t\t\tif (blurb || !standaloneTitleRun(run)) {\n\t\t\t\t\t\t\t\tcallback(title, (run.prefix || '') + '[' + (operator.prefix || '') + display + '[' + (blurb || '') + ']]');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcallback(title, run.prefix);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, options);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.relink = function(filterParseTree, fromTitle, toTitle, options) {\n\tvar output = {};\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tfor (var index = 1; index <= operator.operands.length; index++) {\n\t\t\t\tvar operand = operator.operands[index-1],\n\t\t\t\t\tentry = undefined;\n\t\t\t\tif (operand.indirect) {\n\t\t\t\t\tentry = refHandler.relinkInBraces(operand.text, fromTitle, toTitle, options);\n\t\t\t\t} else if (operand.variable) {\n\t\t\t\t\tentry = relinkMacro(options.settings, operand.text, fromTitle, toTitle, options);\n\t\t\t\t} else if (operand.text) {\n\t\t\t\t\tvar handler = fieldType(options.settings, operator, index, options)\n\t\t\t\t\tif (handler) {\n\t\t\t\t\t\tentry = handler.relink(operand.text, fromTitle, toTitle, options);\n\t\t\t\t\t\tif (entry && entry.output) {\n\t\t\t\t\t\t\toperand.handler = handler.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (entry) {\n\t\t\t\t\tif (entry.output) {\n\t\t\t\t\t\toutput.changed = true;\n\t\t\t\t\t\toperand.text = entry.output;\n\t\t\t\t\t}\n\t\t\t\t\tif (entry.impossible) {\n\t\t\t\t\t\toutput.impossible = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn output;\n};\n\n// Returns the relinker needed for a given operator, or returns undefined.\n// This method should really be broken into three modules called relinkfilteroperator\nfunction fieldType(context, operator, index, options) {\n\tvar op = operator.operator,\n\t\tsuffix = operator.suffix,\n\t\trtn = (suffix && context.getOperator(op + ':' + suffix, index))\n\t\t || context.getOperator(op, index);\n\tif (!rtn && op === 'contains' && index == 1) {\n\t\t// The 'contains' operator gets special handling\n\t\tsuffix = suffix || 'list';\n\t\tvar handler = context.getFields()[suffix];\n\t\tif (handler && (handler.name === 'list' || handler.name === 'filter')) {\n\t\t\t// Contains uses the title handler, but only if it's\n\t\t\t// searching a 'list' or 'filter' field.\n\t\t\treturn titleHandler;\n\t\t}\n\n\t}\n\tif (!rtn && index == 1) {\n\t\t// maybe it's a field operator?\n\t\trtn = (op === 'field' && context.getFields()[suffix])\n\t\t || (!suffix && !options.wiki.getFilterOperators()[op] && context.getFields()[op]);\n\t}\n\treturn rtn;\n};\n\nfunction standaloneTitleRun(run) {\n\tif (run.operators.length == 1) {\n\t\tvar op = run.operators[0];\n\t\treturn op.operator === 'title'\n\t\t\t&& !op.prefix\n\t\t\t&& !op.suffix;\n\t}\n\treturn false;\n};\n\n// Takes care of relinking a macro, as well as putting it back together.\nfunction relinkMacro(context, text, fromTitle, toTitle, options) {\n\ttext = \"<<\" + text + \">>\";\n\tvar macro = $tw.utils.parseMacroInvocation(text, 0);\n\tvar entry = macrocall.relink(context, macro, text, fromTitle, toTitle, false, options);\n\tif (entry && entry.output) {\n\t\tvar string = macrocall.reassemble(entry.output, text, options);\n\t\t// We remove the surrounding brackets.\n\t\tstring = string.substring(2, string.length-2);\n\t\t// And we make sure that no brackets remain\n\t\tif (string.indexOf(\">\") >= 0) {\n\t\t\tdelete entry.output;\n\t\t\tentry.impossible = true;\n\t\t} else {\n\t\t\tentry.output = string;\n\t\t}\n\t}\n\treturn entry;\n};\n","module-type":"relinkfilter","title":"$:/plugins/flibbles/relink/js/fieldtypes/filter/operators.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/fieldtypes/reference/title.js":{"text":"/*\\\n\nThis handles the title inside of references.\n\n\\*/\n\nexports.name = 'title';\n\nexports.report = function(reference, callback, options) {\n\tvar title = reference.title;\n\tif (title) {\n\t\tif (reference.field) {\n\t\t\tcallback(title, '!!' + reference.field);\n\t\t} else if (reference.index) {\n\t\t\tcallback(title, '##' + reference.index);\n\t\t} else {\n\t\t\tcallback(title);\n\t\t}\n\t}\n};\n\nexports.relink = function(reference, fromTitle, toTitle, options) {\n\tif ($tw.utils.trim(reference.title) === fromTitle) {\n\t\t// preserve user's whitespace\n\t\treference.title = reference.title.replace(fromTitle, toTitle);\n\t\treturn {output: reference};\n\t}\n};\n","module-type":"relinkreference","title":"$:/plugins/flibbles/relink/js/fieldtypes/reference/title.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/fields.js":{"text":"/*\\\n\nHandles all fields specified in the plugin configuration. Currently, this\nonly supports single-value fields.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = 'fields';\n\nexports.report = function(tiddler, callback, options) {\n\tvar fields = options.settings.getFields();\n\t$tw.utils.each(fields, function(handler, field) {\n\t\tvar input = tiddler.fields[field];\n\t\tif (input) {\n\t\t\tif (field === 'list' && tiddler.fields['plugin-type']) {\n\t\t\t\t// We have a built-in exception here. plugins use their list\n\t\t\t\t// field differently. There's a whole mechanism for what\n\t\t\t\t// they actually point to, but let's not bother with that now\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler.report(input, function(title, blurb) {\n\t\t\t\tif (blurb) {\n\t\t\t\t\tcallback(title, field + ': ' + blurb);\n\t\t\t\t} else {\n\t\t\t\t\tcallback(title, field);\n\t\t\t\t}\n\t\t\t}, options);\n\t\t}\n\t});\n};\n\nexports.relink = function(tiddler, fromTitle, toTitle, changes, options) {\n\tvar fields = options.settings.getFields();\n\t$tw.utils.each(fields, function(handler, field) {\n\t\tvar input = tiddler.fields[field];\n\t\tif (input) {\n\t\t\tif (field === 'list' && tiddler.fields['plugin-type']) {\n\t\t\t\t// Same deal as above. Skip.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar entry = handler.relink(input, fromTitle, toTitle, options);\n\t\t\tif (entry !== undefined) {\n\t\t\t\tchanges[field] = entry;\n\t\t\t}\n\t\t}\n\t});\n};\n","module-type":"relinkoperator","title":"$:/plugins/flibbles/relink/js/relinkoperations/fields.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text.js":{"text":"/*\\\n\nDepending on the tiddler type, this will apply textOperators which may\nrelink titles within the body.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar defaultOperator = \"text/vnd.tiddlywiki\";\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\n\nexports.name = 'text';\n\nvar textOperators = utils.getModulesByTypeAsHashmap('relinktext', 'type');\n\n// These are deprecated. Don't use them.\nvar oldTextOperators = utils.getModulesByTypeAsHashmap('relinktextoperator', 'type');\n\n// $:/DefaultTiddlers is a tiddler which has type \"text/vnd.tiddlywiki\",\n// but it lies. It doesn't contain wikitext. It contains a filter, so\n// we pretend it has a filter type.\n// If you want to be able to add more exceptions for your plugin, let me know.\nvar exceptions = {\n\t\"$:/DefaultTiddlers\": \"text/x-tiddler-filter\"\n};\n\nexports.report = function(tiddler, callback, options) {\n\tvar fields = tiddler.fields;\n\tif (fields.text) {\n\t\tvar type = exceptions[fields.title] || fields.type || defaultOperator;\n\t\tif (textOperators[type]) {\n\t\t\ttextOperators[type].report(tiddler.fields.text, callback, options);\n\t\t} else if (oldTextOperators[type]) {\n\t\t\t// For the deprecated text operators\n\t\t\toldTextOperators[type].report(tiddler, callback, options);\n\t\t}\n\t}\n};\n\nexports.relink = function(tiddler, fromTitle, toTitle, changes, options) {\n\tvar fields = tiddler.fields;\n\tif (fields.text) {\n\t\tvar type = exceptions[fields.title] || fields.type || defaultOperator,\n\t\t\tentry;\n\t\tif (textOperators[type]) {\n\t\t\tentry = textOperators[type].relink(tiddler.fields.text, fromTitle, toTitle, options);\n\t\t} else if (oldTextOperators[type]) {\n\t\t\t// For the deprecated text operators\n\t\t\tentry = oldTextOperators[type].relink(tiddler, fromTitle, toTitle, options);\n\t\t}\n\t\tif (entry) {\n\t\t\tchanges.text = entry;\n\t\t}\n\t}\n};\n","module-type":"relinkoperator","title":"$:/plugins/flibbles/relink/js/relinkoperations/text.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/filtertext.js":{"text":"/*\\\n\nThis relinks tiddlers which contain filters in their body, as oppose to\nwikitext.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar filterHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('filter');\n\nexports.type = 'text/x-tiddler-filter';\n\nexports.report = filterHandler.report;\nexports.relink = filterHandler.relink;\n","module-type":"relinktext","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/filtertext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/listtext.js":{"text":"/*\\\n\nThis relinks tiddlers which contain a tiddler list as their body.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar listHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('list');\n\nexports.type = 'text/x-tiddler-list';\n\nexports.report = listHandler.report;\nexports.relink = listHandler.relink;\n","module-type":"relinktext","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/listtext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/referencetext.js":{"text":"/*\\\n\nThis relinks tiddlers which contain a tiddler reference as their body.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar refHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('reference');\n\nexports.type = 'text/x-tiddler-reference';\n\nexports.report = refHandler.report;\nexports.relink = refHandler.relink;\n","module-type":"relinktext","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/referencetext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/titletext.js":{"text":"/*\\\n\nThis relinks tiddlers which contain a single title as their body.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar titleHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('title');\n\nexports.type = 'text/x-tiddler-title';\n\nexports.report = titleHandler.report;\nexports.relink = titleHandler.relink;\n","module-type":"relinktext","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/titletext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext.js":{"text":"/*\\\n\nChecks for fromTitle in text. If found, sees if it's relevant,\nand tries to swap it out if it is.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Placeholder = require(\"$:/plugins/flibbles/relink/js/utils/placeholder.js\");\nvar wikitextHandler = require('$:/plugins/flibbles/relink/js/utils.js').getType('wikitext');\n\nexports.type = 'text/vnd.tiddlywiki';\n\nexports.report = wikitextHandler.report;\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar placeholder = new Placeholder();\n\tvar currentOptions = Object.create(options);\n\tcurrentOptions.placeholder = placeholder;\n\tvar entry = wikitextHandler.relink(text, fromTitle, toTitle, currentOptions);\n\tif (entry && entry.output) {\n\t\t// If there's output, we've also got to prepend any macros\n\t\t// that the placeholder defined.\n\t\tvar preamble = placeholder.getPreamble();\n\t\tentry.output = preamble + entry.output;\n\t}\n\treturn entry;\n};\n","module-type":"relinktext","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/code.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles code blocks. Or rather //doesn't// handle them, since we should\nignore their contents.\n\n\"`` [[Renamed Title]] ``\" will remain unchanged.\n\n\\*/\n\nexports.name = [\"codeinline\", \"codeblock\"];\n\nexports.relink = function(text) {\n\tvar reEnd;\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// I'm lazy. This relink method works for both codeblock and codeinline\n\tif (this.match[0].length > 2) {\n\t\t// Must be a codeblock\n\t\treEnd = /\\r?\\n```$/mg;\n\t} else {\n\t\t// Must be a codeinline\n\t\treEnd = new RegExp(this.match[1], \"mg\");\n\t}\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(text);\n\tif (match) {\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\treturn undefined;\n};\n\n// Same thing. Just skip the pos ahead.\nexports.report = exports.relink;\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/code.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/comment.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles comment blocks. Or rather //doesn't// handle them, since we should\nignore their contents.\n\n\"<!-- [[Renamed Title]] -->\" will remain unchanged.\n\n\\*/\n\nexports.name = [\"commentinline\", \"commentblock\"];\n\nexports.relink = function(text) {\n\tthis.parser.pos = this.endMatchRegExp.lastIndex;\n\treturn undefined;\n};\n\nexports.report = exports.relink;\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/comment.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/filteredtransclude.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles replacement of filtered transclusions in wiki text like,\n\n{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class\n\nThis renames both the list and the template field.\n\n\\*/\n\nexports.name = ['filteredtranscludeinline', 'filteredtranscludeblock'];\n\nvar filterHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('filter');\nvar utils = require(\"./utils.js\");\n\nexports.report = function(text, callback, options) {\n\tvar m = this.match,\n\t\tfilter = m[1],\n\t\ttemplate = $tw.utils.trim(m[3]),\n\t\tappend = template ? '||' + template + '}}}' : '}}}';\n\tfilterHandler.report(filter, function(title, blurb) {\n\t\tcallback(title, '{{{' + blurb + append);\n\t}, options);\n\tif (template) {\n\t\tcallback(template, '{{{' + $tw.utils.trim(filter).replace(/\\r?\\n/mg, ' ') + '||}}}');\n\t}\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar m = this.match,\n\t\tfilter = m[1],\n\t\ttooltip = m[2],\n\t\ttemplate = m[3],\n\t\tstyle = m[4],\n\t\tclasses = m[5],\n\t\tparser = this.parser,\n\t\tentry = {};\n\tparser.pos = this.matchRegExp.lastIndex;\n\tvar modified = false;\n\n\tvar filterEntry = filterHandler.relink(filter, fromTitle, toTitle, options);\n\tif (filterEntry !== undefined) {\n\t\tif (filterEntry.output) {\n\t\t\tfilter = filterEntry.output;\n\t\t\tmodified = true;\n\t\t}\n\t\tif (filterEntry.impossible) {\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\n\tif ($tw.utils.trim(template) === fromTitle) {\n\t\t// preserves user-inputted whitespace\n\t\ttemplate = template.replace(fromTitle, toTitle);\n\t\tmodified = true;\n\t}\n\tif (!modified) {\n\t\tif (!entry.impossible) {\n\t\t\treturn undefined;\n\t\t}\n\t} else {\n\t\tvar output = this.makeFilteredtransclude(this.parser, filter, tooltip, template, style, classes);\n\t\tif (output === undefined) {\n\t\t\tentry.impossible = true;\n\t\t} else {\n\t\t\t// By copying over the ending newline of the original\n\t\t\t// text if present, thisrelink method thus works for\n\t\t\t// both the inline and block rule\n\t\t\tentry.output = output + utils.getEndingNewline(m[0]);\n\t\t}\n\t}\n\treturn entry;\n};\n\nexports.makeFilteredtransclude = function(parser, filter, tooltip, template, style, classes) {\n\tif (canBePretty(filter) && canBePrettyTemplate(template)) {\n\t\treturn prettyList(filter, tooltip, template, style, classes);\n\t}\n\tif (classes !== undefined) {\n\t\tclasses = classes.split('.').join(' ');\n\t}\n\treturn utils.makeWidget(parser, '$list', {\n\t\tfilter: filter,\n\t\ttooltip: tooltip,\n\t\ttemplate: template,\n\t\tstyle: style || undefined,\n\t\titemClass: classes});\n};\n\nfunction prettyList(filter, tooltip, template, style, classes) {\n\tif (tooltip === undefined) {\n\t\ttooltip = '';\n\t} else {\n\t\ttooltip = \"|\" + tooltip;\n\t}\n\tif (template === undefined) {\n\t\ttemplate = '';\n\t} else {\n\t\ttemplate = \"||\" + template;\n\t}\n\tif (classes === undefined) {\n\t\tclasses = '';\n\t} else {\n\t\tclasses = \".\" + classes;\n\t}\n\tstyle = style || '';\n\treturn \"{{{\"+filter+tooltip+template+\"}}\"+style+\"}\"+classes;\n};\n\nfunction canBePretty(filter) {\n\treturn filter.indexOf('|') < 0 && filter.indexOf('}}') < 0;\n};\n\nfunction canBePrettyTemplate(template) {\n\treturn !template || (\n\t\ttemplate.indexOf('|') < 0\n\t\t&& template.indexOf('{') < 0\n\t\t&& template.indexOf('}') < 0);\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/filteredtransclude.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles replacement in attributes of widgets and html elements\nThis is configurable to select exactly which attributes of which elements\nshould be changed.\n\n<$link to=\"TiddlerTitle\" />\n\n\\*/\n\nvar utils = require(\"./utils.js\");\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar htmlOperators = relinkUtils.getModulesByTypeAsHashmap('relinkhtml', 'name');\n\nexports.name = \"html\";\n\nexports.report = function(text, callback, options) {\n\tvar element = this.nextTag.tag;\n\tvar nestedOptions = Object.create(options);\n\tnestedOptions.settings = this.parser.context;\n\tfor (var operator in htmlOperators) {\n\t\thtmlOperators[operator].report(this.nextTag, this.parser, function(title, blurb) {\n\t\t\tcallback(title, '<' + blurb + ' />');\n\t\t}, nestedOptions);\n\t}\n\tthis.parse();\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar widgetEntry = {};\n\twidgetEntry.attributes = Object.create(null);\n\twidgetEntry.element = this.nextTag.tag;\n\tvar elem = this.nextTag;\n\tvar changed = false;\n\tvar nestedOptions = Object.create(options);\n\tnestedOptions.settings = this.parser.context;\n\tfor (var operator in htmlOperators) {\n\t\tvar entry = htmlOperators[operator].relink(this.nextTag, this.parser, fromTitle, toTitle, nestedOptions);\n\t\tif (entry) {\n\t\t\tif (entry.output) {\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tif (entry.impossible) {\n\t\t\t\twidgetEntry.impossible = true;\n\t\t\t}\n\t\t}\n\t}\n\tvar tag = this.parse()[0];\n\tif (tag.children) {\n\t\tfor (var i = 0; i < tag.children.length; i++) {\n\t\t\tvar child = tag.children[i];\n\t\t\tif (child.output) {\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tif (child.impossible) {\n\t\t\t\twidgetEntry.impossible = true;\n\t\t\t}\n\t\t}\n\t}\n\tif (changed) {\n\t\tvar builder = new Rebuilder(text, elem.start);\n\t\tfor (var attributeName in elem.attributes) {\n\t\t\tvar attr = elem.attributes[attributeName];\n\t\t\tvar quotedValue;\n\t\t\tswitch (attr.type) {\n\t\t\tcase 'string':\n\t\t\t\tif (attr.valueless) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar quote = relinkUtils.determineQuote(text, attr);\n\t\t\t\tquotedValue = utils.wrapAttributeValue(attr.value, quote)\n\t\t\t\tif (quotedValue === undefined) {\n\t\t\t\t\t// The value was unquotable. We need to make\n\t\t\t\t\t// a macro in order to replace it.\n\t\t\t\t\tif (!options.placeholder) {\n\t\t\t\t\t\t// but we can't...\n\t\t\t\t\t\twidgetEntry.impossible = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar value = options.placeholder.getPlaceholderFor(attr.value,attr.handler)\n\t\t\t\t\t\tquotedValue = \"<<\"+value+\">>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'indirect':\n\t\t\t\tquotedValue = \"{{\" + attr.textReference + \"}}\";\n\t\t\t\tbreak;\n\t\t\tcase 'filtered':\n\t\t\t\tquotedValue = \"{{{\" + attr.filter + \"}}}\";\n\t\t\t\tbreak;\n\t\t\tcase 'macro':\n\t\t\t\tif (attr.output) {\n\t\t\t\t\tquotedValue = attr.output;\n\t\t\t\t} else {\n\t\t\t\t\tquotedValue = undefined;\n\t\t\t\t}\n\t\t\t\t// Else If output isn't set, this wasn't ever changed\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar ptr = attr.start;\n\t\t\tptr = $tw.utils.skipWhiteSpace(text, ptr);\n\t\t\tif (attributeName !== attr.name) {\n\t\t\t\t// Ooh, the attribute name changed\n\t\t\t\tbuilder.add(attr.name, ptr, ptr + attributeName.length);\n\t\t\t}\n\t\t\tif (quotedValue) {\n\t\t\t\t// We have a new attribute value\n\t\t\t\tptr += attributeName.length;\n\t\t\t\tptr = $tw.utils.skipWhiteSpace(text, ptr);\n\t\t\t\tptr++; // For the equals\n\t\t\t\tptr = $tw.utils.skipWhiteSpace(text, ptr);\n\t\t\t\tbuilder.add(quotedValue, ptr, attr.end);\n\t\t\t}\n\t\t}\n\t\tif (tag.children) {\n\t\t\tfor (var i = 0; i < tag.children.length; i++) {\n\t\t\t\tvar child = tag.children[i];\n\t\t\t\tif (child.output) {\n\t\t\t\t\tbuilder.add(child.output, child.start, child.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twidgetEntry.output = builder.results(this.parser.pos);\n\t}\n\tif (widgetEntry.output || widgetEntry.impossible) {\n\t\treturn widgetEntry;\n\t}\n\treturn undefined;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/image.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles replacement in wiki text inline rules, like,\n\n[img[tiddler.jpg]]\n\n[img width=23 height=24 [Description|tiddler.jpg]]\n\n\\*/\n\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\nvar refHandler = require(\"$:/plugins/flibbles/relink/js/fieldtypes/reference\");\nvar filterHandler = require(\"$:/plugins/flibbles/relink/js/utils\").getType('filter');\nvar macrocall = require(\"./macrocall.js\");\nvar utils = require(\"./utils.js\");\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\n\nexports.name = \"image\";\n\nexports.report = function(text, callback, options) {\n\tvar ptr = this.nextImage.start + 4; //[img\n\tvar inSource = false;\n\tfor (var attributeName in this.nextImage.attributes) {\n\t\tvar attr = this.nextImage.attributes[attributeName];\n\t\tif (attributeName === \"source\" || attributeName === \"tooltip\") {\n\t\t\tif (inSource) {\n\t\t\t\tptr = text.indexOf('|', ptr);\n\t\t\t} else {\n\t\t\t\tptr = text.indexOf('[', ptr);\n\t\t\t\tinSource = true;\n\t\t\t}\n\t\t\tptr += 1;\n\t\t}\n\t\tif (attributeName === \"source\") {\n\t\t\tvar tooltip = this.nextImage.attributes.tooltip;\n\t\t\tvar blurb = '[img[' + (tooltip ? tooltip.value : '') + ']]';\n\t\t\tcallback(attr.value, blurb);\n\t\t\tptr = text.indexOf(attr.value, ptr);\n\t\t\tptr = text.indexOf(']]', ptr) + 2;\n\t\t} else if (attributeName !== \"tooltip\") {\n\t\t\tptr = reportAttribute(this.parser, attr, callback, options);\n\t\t}\n\t}\n\tthis.parser.pos = ptr;\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar ptr = this.nextImage.start,\n\t\tbuilder = new Rebuilder(text, ptr),\n\t\tmakeWidget = false,\n\t\tskipSource = false,\n\t\timageEntry;\n\tif (this.nextImage.attributes.source.value === fromTitle && !canBePretty(toTitle, this.nextImage.attributes.tooltip)) {\n\t\tif (this.parser.context.allowWidgets() && (utils.wrapAttributeValue(toTitle) || options.placeholder)) {\n\t\t\tmakeWidget = true;\n\t\t\tbuilder.add(\"<$image\", ptr, ptr+4);\n\t\t} else {\n\t\t\t// We won't be able to make a placeholder to replace\n\t\t\t// the source attribute. We check now so we don't\n\t\t\t// prematurely convert into a widget.\n\t\t\t// Keep going in case other attributes need replacing.\n\t\t\tskipSource = true;\n\t\t}\n\t}\n\tptr += 4; //[img\n\tvar inSource = false;\n\tfor (var attributeName in this.nextImage.attributes) {\n\t\tvar attr = this.nextImage.attributes[attributeName];\n\t\tif (attributeName === \"source\" || attributeName === \"tooltip\") {\n\t\t\tif (inSource) {\n\t\t\t\tptr = text.indexOf('|', ptr);\n\t\t\t} else {\n\t\t\t\tptr = text.indexOf('[', ptr);\n\t\t\t\tinSource = true;\n\t\t\t}\n\t\t\tif (makeWidget) {\n\t\t\t\tif (\" \\t\\n\".indexOf(text[ptr-1]) >= 0) {\n\t\t\t\t\tbuilder.add('', ptr, ptr+1);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder.add(' ', ptr, ptr+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tptr += 1;\n\t\t}\n\t\tif (attributeName === \"source\") {\n\t\t\tptr = text.indexOf(attr.value, ptr);\n\t\t\tif (attr.value === fromTitle) {\n\t\t\t\tif (makeWidget) {\n\t\t\t\t\tvar quotedValue = utils.wrapAttributeValue(toTitle);\n\t\t\t\t\tif (quotedValue === undefined) {\n\t\t\t\t\t\tvar key = options.placeholder.getPlaceholderFor(toTitle);\n\t\t\t\t\t\tbuilder.add(\"source=<<\"+key+\">>\", ptr, ptr+fromTitle.length);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuilder.add(\"source=\"+quotedValue, ptr, ptr+fromTitle.length);\n\t\t\t\t\t}\n\t\t\t\t} else if (!skipSource) {\n\t\t\t\t\tbuilder.add(toTitle, ptr, ptr+fromTitle.length);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder.impossible = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tptr = text.indexOf(']]', ptr);\n\t\t\tif (makeWidget) {\n\t\t\t\tbuilder.add(\"/>\", ptr, ptr+2);\n\t\t\t}\n\t\t\tptr += 2;\n\t\t} else if (attributeName === \"tooltip\") {\n\t\t\tif (makeWidget) {\n\t\t\t\tptr = text.indexOf(attr.value, ptr);\n\t\t\t\tvar quotedValue = utils.wrapAttributeValue(attr.value);\n\t\t\t\tbuilder.add(\"tooltip=\"+quotedValue, ptr, ptr+attr.value.length);\n\t\t\t}\n\t\t} else {\n\t\t\tptr = relinkAttribute(this.parser, attr, builder, fromTitle, toTitle, options);\n\t\t}\n\t}\n\tthis.parser.pos = ptr;\n\tif (builder.changed() || builder.impossible) {\n\t\timageEntry = {\n\t\t\toutput: builder.results(ptr),\n\t\t\timpossible: builder.impossible };\n\t}\n\treturn imageEntry;\n};\n\nfunction reportAttribute(parser, attribute, callback, options) {\n\tvar text = parser.source;\n\tvar ptr = text.indexOf(attribute.name, attribute.start);\n\tvar end;\n\tptr += attribute.name.length;\n\tptr = text.indexOf('=', ptr);\n\tif (attribute.type === \"string\") {\n\t\tptr = text.indexOf(attribute.value, ptr)\n\t\tvar quote = relinkUtils.determineQuote(text, attribute);\n\t\t// ignore first quote. We already passed it\n\t\tend = ptr + quote.length + attribute.value.length;\n\t} else if (attribute.type === \"indirect\") {\n\t\tptr = text.indexOf('{{', ptr);\n\t\tvar end = ptr + attribute.textReference.length + 4;\n\t\trefHandler.report(attribute.textReference, function(title, blurb) {\n\t\t\tcallback(title, '[img ' + attribute.name + '={{' + (blurb || '') + '}}]');\n\t\t}, options);\n\t} else if (attribute.type === \"filtered\") {\n\t\tptr = text.indexOf('{{{', ptr);\n\t\tvar end = ptr + attribute.filter.length + 6;\n\t\tfilterHandler.report(attribute.filter, function(title, blurb) {\n\t\t\tcallback(title, '[img ' + attribute.name + '={{{' + blurb + '}}}]');\n\t\t}, options);\n\t} else if (attribute.type === \"macro\") {\n\t\tptr = text.indexOf(\"<<\", ptr);\n\t\tvar end = attribute.value.end;\n\t\tvar macro = attribute.value;\n\t\toldValue = attribute.value;\n\t\tmacrocall.reportAttribute(parser, macro, function(title, blurb) {\n\t\t\tcallback(title, '[img ' + attribute.name + '=' + blurb + ']');\n\t\t}, options);\n\t}\n\treturn end;\n};\n\nfunction relinkAttribute(parser, attribute, builder, fromTitle, toTitle, options) {\n\tvar text = builder.text;\n\tvar ptr = text.indexOf(attribute.name, attribute.start);\n\tvar end;\n\tptr += attribute.name.length;\n\tptr = text.indexOf('=', ptr);\n\tif (attribute.type === \"string\") {\n\t\tptr = text.indexOf(attribute.value, ptr)\n\t\tvar quote = relinkUtils.determineQuote(text, attribute);\n\t\t// ignore first quote. We already passed it\n\t\tend = ptr + quote.length + attribute.value.length;\n\t} else if (attribute.type === \"indirect\") {\n\t\tptr = text.indexOf('{{', ptr);\n\t\tvar end = ptr + attribute.textReference.length + 4;\n\t\tvar ref = refHandler.relinkInBraces(attribute.textReference, fromTitle, toTitle, options);\n\t\tif (ref) {\n\t\t\tif (ref.impossible) {\n\t\t\t\tbuilder.impossible = true;\n\t\t\t}\n\t\t\tif (ref.output) {\n\t\t\t\tbuilder.add(\"{{\"+ref.output+\"}}\", ptr, end);\n\t\t\t}\n\t\t}\n\t} else if (attribute.type === \"filtered\") {\n\t\tptr = text.indexOf('{{{', ptr);\n\t\tvar end = ptr + attribute.filter.length + 6;\n\t\tvar filter = filterHandler.relinkInBraces(attribute.filter, fromTitle, toTitle, options);\n\t\tif (filter !== undefined) {\n\t\t\tif (filter.impossible) {\n\t\t\t\tbuilder.impossible = true;\n\t\t\t}\n\t\t\tif (filter.output) {\n\t\t\t\tvar quoted = \"{{{\"+filter.output+\"}}}\";\n\t\t\t\tbuilder.add(quoted, ptr, end);\n\t\t\t}\n\t\t}\n\t} else if (attribute.type === \"macro\") {\n\t\tptr = text.indexOf(\"<<\", ptr);\n\t\tvar end = attribute.value.end;\n\t\tvar macro = attribute.value;\n\t\toldValue = attribute.value;\n\t\tvar macroEntry = macrocall.relinkAttribute(parser, macro, text, fromTitle, toTitle, options);\n\t\tif (macroEntry !== undefined) {\n\t\t\tif (macroEntry.impossible) {\n\t\t\t\tbuilder.impossible = true;\n\t\t\t}\n\t\t\tif (macroEntry.output) {\n\t\t\t\tbuilder.add(macroEntry.output, ptr, end);\n\t\t\t}\n\t\t}\n\t}\n\treturn end;\n};\n\nfunction canBePretty(title, tooltip) {\n\treturn title.indexOf(']') < 0 && (tooltip || title.indexOf('|') < 0);\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/image.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/import.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles import pragmas\n\n\\import [tag[MyTiddler]]\n\\*/\n\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils.js\");\nvar filterRelinker = utils.getType('filter');\nvar ImportContext = utils.getContext('import');\n\nexports.name = \"import\";\n\nexports.report = function(text, callback, options) {\n\t// This moves the pos for us\n\tvar parseTree = this.parse();\n\tvar filter = parseTree[0].attributes.filter.value || '';\n\tfilterRelinker.report(filter, function(title, blurb) {\n\t\tif (blurb) {\n\t\t\tblurb = '\\\\import ' + blurb;\n\t\t} else {\n\t\t\tblurb = '\\\\import';\n\t\t}\n\t\tcallback(title, blurb);\n\t}, options);\n\t// Before we go, we need to actually import the variables\n\t// it's calling for, and any /relink pragma\n\tthis.parser.context = new ImportContext(options.wiki, this.parser.context, filter);\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\t// In this one case, I'll let the parser parse out the filter and move\n\t// the ptr.\n\tvar start = this.matchRegExp.lastIndex,\n\t\tparseTree = this.parse(),\n\t\tfilter = parseTree[0].attributes.filter.value || '',\n\t\tentry = filterRelinker.relink(filter, fromTitle, toTitle, options);\n\tif (entry !== undefined && entry.output) {\n\t\tvar newline = text.substring(start+filter.length, this.parser.pos);\n\t\tfilter = entry.output;\n\t\tentry.output = \"\\\\import \" + filter + newline;\n\t}\n\n\t// Before we go, we need to actually import the variables\n\t// it's calling for, and any /relink pragma\n\tthis.parser.context = new ImportContext(options.wiki, this.parser.context, filter);\n\n\treturn entry;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/import.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/macrocall.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles macro calls.\n\n<<myMacro '[[MyFilter]]' 'myTitle'>>\n\n\\*/\n\nvar utils = require(\"./utils.js\");\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar macrocall = require('$:/plugins/flibbles/relink/js/utils/macrocall.js');\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\nvar EntryNode = require('$:/plugins/flibbles/relink/js/utils/entry');\n\nexports.name = [\"macrocallinline\", \"macrocallblock\"];\n\nexports.report = function(text, callback, options) {\n\tvar macroInfo = getInfoFromRule(this);\n\tthis.parser.pos = macroInfo.end;\n\tthis.reportAttribute(this.parser, macroInfo, callback, options);\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar macroInfo = getInfoFromRule(this);\n\tvar managedMacro = this.parser.context.getMacro(macroInfo.name);\n\tthis.parser.pos = macroInfo.end;\n\tif (!managedMacro) {\n\t\t// We don't manage this macro. Bye.\n\t\treturn undefined;\n\t}\n\tvar mayBeWidget = this.parser.context.allowWidgets();\n\tvar names = getParamNames(this.parser, macroInfo.name, macroInfo.params, options);\n\tif (names === undefined) {\n\t\t// Needed the definition, and couldn't find it. So if a single\n\t\t// parameter needs to placeholder, just fail.\n\t\tmayBeWidget = false;\n\t}\n\tvar entry = macrocall.relink(this.parser.context, macroInfo, text, fromTitle, toTitle, mayBeWidget, options);\n\tif (entry && entry.output) {\n\t\tentry.output = macroToString(entry.output, text, names, options);\n\t}\n\treturn entry;\n};\n\n/** Relinks macros that occur as attributes, like <$element attr=<<...>> />\n * Processes the same, except it can't downgrade into a widget if the title\n * is complicated.\n * Kept for backward compatibility reasons\n */\nexports.relinkAttribute = function(parser, macro, text, fromTitle, toTitle, options) {\n\tvar entry = macrocall.relink(parser.context, macro, text, fromTitle, toTitle, false, options);\n\tif (entry && entry.output) {\n\t\tentry.output = macrocall.reassemble(entry.output, text, options);\n\t}\n\treturn entry;\n};\n\n/** As in, report a macrocall invocation that is an html attribute.\n * Kept for backward compatibility reasons\n */\nexports.reportAttribute = function(parser, macro, callback, options) {\n\tmacrocall.report(parser.context, macro, function(title, blurb) {\n\t\tcallback(title, \"<<\" + blurb + \">>\");\n\t}, options);\n};\n\nfunction getInfoFromRule(rule) {\n\t// Get all the details of the match\n\tvar macroInfo = rule.nextCall;\n\tif (!macroInfo) {\n\t\t// rule.match is used <v5.1.24\n\t\tvar match = rule.match,\n\t\t\toffset = $tw.utils.skipWhiteSpace(match[0], match[1].length+2);\n\t\tmacroInfo = {\n\t\t\tname: match[1],\n\t\t\tstart: rule.matchRegExp.lastIndex - match[0].length,\n\t\t\tend: rule.matchRegExp.lastIndex,\n\t\t};\n\t\tmacroInfo.params = parseParams(match[2], offset+macroInfo.start);\n\t}\n\treturn macroInfo;\n};\n\nfunction mustBeAWidget(macro) {\n\tfor (var i = 0; i < macro.params.length; i++) {\n\t\tif (macro.params[i].type === \"macro\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false\n};\n\n/**Given a macro object ({name:, params:, start: end:}), and the text where\n * it was parsed from, returns a new macro that maintains any syntactic\n * structuring.\n */\nfunction macroToString(macro, text, names, options) {\n\tif (mustBeAWidget(macro)) {\n\t\tvar attrs = [];\n\t\tfor (var i = 0; i < macro.params.length; i++) {\n\t\t\tvar p = macro.params[i];\n\t\t\tvar val;\n\t\t\tif (p.newValue) {\n\t\t\t\tval = p.newValue;\n\t\t\t} else {\n\t\t\t\tval = utils.wrapAttributeValue(p.value);\n\t\t\t}\n\t\t\tattrs.push(\" \"+names[i]+\"=\"+val);\n\t\t}\n\t\treturn \"<$macrocall $name=\"+utils.wrapAttributeValue(macro.name)+attrs.join('')+\"/>\";\n\t} else {\n\t\treturn macrocall.reassemble(macro, text, options);\n\t}\n};\n\nfunction getParamNames(parser, macroName, params, options) {\n\tvar used = Object.create(null);\n\tvar rtn = new Array(params.length);\n\tvar anonsExist = false;\n\tvar i;\n\tfor (i = 0; i < params.length; i++) {\n\t\tvar name = params[i].name;\n\t\tif (name) {\n\t\t\trtn[i] = name;\n\t\t\tused[name] = true;\n\t\t} else {\n\t\t\tanonsExist = true;\n\t\t}\n\t}\n\tif (anonsExist) {\n\t\tvar def = parser.context.getMacroDefinition(macroName);\n\t\tif (def === undefined) {\n\t\t\t// If there are anonymous parameters, and we can't\n\t\t\t// find the definition, then we can't hope to create\n\t\t\t// a widget.\n\t\t\treturn undefined;\n\t\t}\n\t\tvar defParams = def.params || [];\n\t\tvar defPtr = 0;\n\t\tfor (i = 0; i < params.length; i++) {\n\t\t\tif (rtn[i] === undefined) {\n\t\t\t\twhile(defPtr < defParams.length && used[defParams[defPtr].name]) {\n\t\t\t\t\tdefPtr++;\n\t\t\t\t}\n\t\t\t\tif (defPtr >= defParams.length) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trtn[i] = defParams[defPtr].name;\n\t\t\t\tused[defParams[defPtr].name] = true;\n\t\t\t}\n\t\t}\n\t}\n\treturn rtn;\n};\n\nfunction parseParams(paramString, pos) {\n\tvar params = [],\n\t\treParam = /\\s*(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))/mg,\n\t\tparamMatch = reParam.exec(paramString);\n\twhile(paramMatch) {\n\t\t// Process this parameter\n\t\tvar paramInfo = { };\n\t\t// We need to find the group match that isn't undefined.\n\t\tfor (var i = 2; i <= 6; i++) {\n\t\t\tif (paramMatch[i] !== undefined) {\n\t\t\t\tparamInfo.value = paramMatch[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(paramMatch[1]) {\n\t\t\tparamInfo.name = paramMatch[1];\n\t\t}\n\t\t//paramInfo.start = pos;\n\t\tparamInfo.end = reParam.lastIndex + pos;\n\t\tparams.push(paramInfo);\n\t\t// Find the next match\n\t\tparamMatch = reParam.exec(paramString);\n\t}\n\treturn params;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/macrocall.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/macrodef.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles pragma macro definitions. Except we only update placeholder macros\nthat we may have previously install.\n\n\\define relink-?() Tough title\n\n\\*/\n\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils\");\nvar VariableContext = utils.getContext('variable');\n\nexports.name = \"macrodef\";\n\nexports.report = function(text, callback, options) {\n\tvar setParseTreeNode = this.parse(),\n\t\tm = this.match,\n\t\tname = m[1];\n\tthis.parser.context = new VariableContext(this.parser.context, setParseTreeNode[0]);\n\t// Parse set the pos pointer, but we don't want to skip the macro body.\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar endMatch = getBodyMatch(text, this.parser.pos, m[3]);\n\tif (endMatch) {\n\t\tvar value = endMatch[2],\n\t\t\thandler = utils.getType(getActiveType(name, m[2]) || 'wikitext');\n\t\tif (handler) {\n\t\t\tvar entry = handler.report(value, function(title, blurb) {\n\t\t\t\tvar macroStr = '\\\\define ' + name + '()';\n\t\t\t\tif (blurb) {\n\t\t\t\t\tmacroStr += ' ' + blurb;\n\t\t\t\t}\n\t\t\t\tcallback(title, macroStr);\n\t\t\t}, options);\n\t\t}\n\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar setParseTreeNode = this.parse(),\n\t\tentry,\n\t\tm = this.match,\n\t\tname = m[1],\n\t\tparams = m[2],\n\t\tmultiline = m[3];\n\tthis.parser.context = new VariableContext(this.parser.context, setParseTreeNode[0]);\n\t// Parse set the pos pointer, but we don't want to skip the macro body.\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar endMatch = getBodyMatch(text, this.parser.pos, multiline);\n\tif (endMatch) {\n\t\tvar value = endMatch[2],\n\t\t\ttype = getActiveType(name, params),\n\t\t\thandler = utils.getType(type || 'wikitext');\n\t\tif (handler) {\n\t\t\t// If this is an active relink placeholder, then let's remember it\n\t\t\tif (type && options.placeholder) {\n\t\t\t\toptions.placeholder.registerExisting(name, value);\n\t\t\t}\n\t\t\t// Relink the contents\n\t\t\tentry = handler.relink(value, fromTitle, toTitle, options);\n\t\t\tif (entry && entry.output) {\n\t\t\t\tentry.output = m[0] + endMatch[1] + entry.output + endMatch[0];\n\t\t\t}\n\t\t}\n\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t}\n\treturn entry;\n};\n\n// Return another match for the body, but tooled uniquely\n// m[1] = whitespace before body\n// m[2] = body\n// m.index + m[0].length -> end of match\nfunction getBodyMatch(text, pos, isMultiline) {\n\tvar whitespace,\n\t\tvalueRegExp;\n\tif (isMultiline) {\n\t\tvalueRegExp = /\\r?\\n\\\\end[^\\S\\n\\r]*(?:\\r?\\n|$)/mg;\n\t\twhitespace = '';\n\t} else {\n\t\tvalueRegExp = /(?:\\r?\\n|$)/mg;\n\t\tvar newPos = $tw.utils.skipWhiteSpace(text, pos);\n\t\twhitespace = text.substring(pos, newPos);\n\t\tpos = newPos;\n\t}\n\tvalueRegExp.lastIndex = pos;\n\tvar match = valueRegExp.exec(text);\n\tif (match) {\n\t\tmatch[1] = whitespace;\n\t\tmatch[2] = text.substring(pos, match.index);\n\t}\n\treturn match;\n};\n\nfunction getActiveType(macroName, parameters) {\n\tvar placeholder = /^relink-(?:(\\w+)-)?\\d+$/.exec(macroName);\n\t// normal macro or special placeholder?\n\tif (placeholder && parameters === '') {\n\t\treturn placeholder[1] || 'title';\n\t}\n\treturn undefined;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/macrodef.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/prettylink.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles replacement in wiki text inline rules, like,\n\n[[Introduction]]\n\n[[link description|TiddlerTitle]]\n\n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.name = \"prettylink\";\n\nexports.report = function(text, callback, options) {\n\tvar text = this.match[1],\n\t\tlink = this.match[2] || text;\n\tif (!$tw.utils.isLinkExternal(link)) {\n\t\tcallback(link, '[[' + text + ']]');\n\t}\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar caption, m = this.match;\n\tif (m[2] === fromTitle) {\n\t\t// format is [[caption|MyTiddler]]\n\t\tcaption = m[1];\n\t} else if (m[2] !== undefined || m[1] !== fromTitle) {\n\t\t// format is [[MyTiddler]], and it doesn't match\n\t\treturn undefined;\n\t}\n\tvar entry = { output: utils.makePrettylink(this.parser, toTitle, caption) };\n\tif (entry.output === undefined) {\n\t\tentry.impossible = true;\n\t}\n\treturn entry;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/prettylink.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/quoteblock.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles the quote blocks, as in:\n\n<<<\n...\n<<<\n\n\\*/\n\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\n\nexports.name = \"quoteblock\";\n\nexports.type = {block: true};\n\nexports.report = function(text, callback, options) {\n\tvar reEndString = \"^\" + this.match[1] + \"(?!<)\";\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\tthis.parser.parseClasses();\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\n\t// Parse the optional cite\n\treportCite(this.parser, this.match[1]);\n\t// Now parse the body of the quote\n\tthis.parser.parseBlocks(reEndString);\n\tif (this.match) {\n\t\t// Now parse the closing cite\n\t\treportCite(this.parser, this.match[1]);\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar reEndString = \"^\" + this.match[1] + \"(?!<)\";\n\tvar builder = new Rebuilder(text, this.parser.pos);\n\tvar entry;\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\tthis.parser.parseClasses();\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\n\t// Parse the optional cite\n\tmergeRelinks(builder, this.parser.parseInlineRun(/(\\r?\\n)/mg));\n\t// Now parse the body of the quote\n\tmergeRelinks(builder, this.parser.parseBlocks(reEndString));\n\t// Now parse the closing cite\n\tmergeRelinks(builder, this.parser.parseInlineRun(/(\\r?\\n)/mg));\n\n\tif (builder.changed() || builder.impossible) {\n\t\tentry = {};\n\t\tentry.output = builder.results(this.parser.pos);\n\t\tif (builder.impossible) {\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\treturn entry;\n};\n\nfunction reportCite(parser, delimeter) {\n\tvar callback = parser.callback;\n\ttry {\n\t\tparser.callback = function(title, blurb) {\n\t\t\treturn callback(title, delimeter + \" \" + blurb);\n\t\t};\n\t\tparser.parseInlineRun(/(\\r?\\n)/mg);\n\t} finally {\n\t\tparser.callback = callback;\n\t}\n};\n\nfunction mergeRelinks(builder, output) {\n\tif (output.length > 0) {\n\t\tfor (var i = 0; i < output.length; i++) {\n\t\t\tvar o = output[i];\n\t\t\tif (o.output) {\n\t\t\t\tbuilder.add(o.output, o.start, o.end);\n\t\t\t}\n\t\t\tif (o.impossible) {\n\t\t\t\tbuilder.impossible = true;\n\t\t\t}\n\t\t}\n\t}\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/quoteblock.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/relink.js":{"text":"/*\\\nmodule-type: wikirule\n\nThis defines the \\relink inline pragma used to locally declare\nrelink rules for macros.\n\nIt takes care of providing its own relink and report rules.\n\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar language = require('$:/plugins/flibbles/relink/js/language.js');\n\nexports.name = \"relink\";\nexports.types = {pragma: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\tthis.matchRegExp = /^\\\\relink[^\\S\\n]+([^(\\s]+)([^\\r\\n]*)(\\r?\\n)?/mg;\n};\n\n/**This makes the widget that the macro library will later parse to determine\n * new macro relink state.\n *\n * It's a <$set> widget so it can appear BEFORE \\define pragma and not\n * prevent that pragma from being scooped up by importvariables.\n * (importvariables stops scooping as soon as it sees something besides $set) */\nexports.parse = function() {\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar macroName;\n\tvar macroParams = Object.create(null);\n\tvar error = undefined;\n\tvar rtn = [];\n\tvar self = this;\n\tthis.interpretSettings(function(macro, parameter, type) {\n\t\tmacroName = macro;\n\t\tif (type && !utils.getType(type)) {\n\t\t\terror = language.getString(\"text/plain\", \"Error/UnrecognizedType\",\n\t\t\t\t{variables: {type: type}, wiki: self.parser.wiki});\n\t\t}\n\t\tmacroParams[parameter] = type;\n\t});\n\t// If no macroname. Return nothing, this rule will be ignored by parsers\n\tif (macroName) {\n\t\tvar relink = Object.create(null);\n\t\trelink[macroName] = macroParams;\n\t\trtn.push({\n\t\t\ttype: \"set\",\n\t\t\tattributes: {\n\t\t\t\tname: {type: \"string\", value: \"\"}\n\t\t\t},\n\t\t\tchildren: [],\n\t\t\tisMacroDefinition: true,\n\t\t\trelink: relink});\n\t}\n\tif (error) {\n\t\trtn.push({\n\t\t\ttype: \"element\", tag: \"span\", attributes: {\n\t\t\t\t\"class\": {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: \"tc-error tc-relink-error\"\n\t\t\t\t}\n\t\t\t}, children: [\n\t\t\t\t{type: \"text\", text: error}\n\t\t\t]});\n\t}\n\treturn rtn;\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar parser = this.parser;\n\tvar currentTiddler = parser.context.widget.variables.currentTiddler.value;\n\tparser.pos = this.matchRegExp.lastIndex;\n\tthis.interpretSettings(function(macro, parameter, type) {\n\t\toptions.settings.addSetting(parser.wiki, macro, parameter, type, currentTiddler);\n\t});\n\t// Return nothing, because this rule is ignored by the parser\n\treturn undefined;\n};\n\nexports.interpretSettings = function(block) {\n\tvar paramString = this.match[2];\n\tif (paramString !== \"\") {\n\t\tvar macro = this.match[1];\n\t\tvar reParam = /\\s*([A-Za-z0-9\\-_]+)(?:\\s*:\\s*([^\\s]+))?/mg;\n\t\tvar paramMatch = reParam.exec(paramString);\n\t\twhile (paramMatch) {\n\t\t\tvar parameter = paramMatch[1];\n\t\t\tvar type = paramMatch[2];\n\t\t\tblock(macro, parameter, type);\n\t\t\tparamMatch = reParam.exec(paramString);\n\t\t}\n\t}\n};\n","module-type":"wikirule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/relink.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/rules.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nParses and acknowledges any pragma rules a tiddler has.\n\n\\rules except html wikilink\n\n\\*/\n\nexports.name = \"rules\";\n\n/**This is all we have to do. The rules rule doesn't parse. It just amends\n * the rules, which is exactly what I want it to do too.\n * It also takes care of moving the pos pointer forward.\n */\nexports.relink = function() {\n\tthis.parse();\n\treturn undefined;\n};\n\n// Same deal\nexports.report = exports.relink;\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/rules.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/syslink.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles sys links\n\n$:/sys/link\n\nbut not:\n\n~$:/sys/link\n\n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.name = \"syslink\";\n\nexports.report = function(text, callback, options) {\n\tvar title = this.match[0];\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tif (title[0] !== \"~\") {\n\t\tcallback(title, '~' + title);\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar entry = undefined;\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tif (this.match[0] === fromTitle && this.match[0][0] !== \"~\") {\n\t\tentry = {output: this.makeSyslink(toTitle, options)};\n\t\tif (entry.output === undefined) {\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\treturn entry;\n};\n\nexports.makeSyslink = function(title, options) {\n\tvar match = title.match(this.matchRegExp);\n\tif (match && match[0] === title && title[0] !== \"~\") {\n\t\treturn title;\n\t} else {\n\t\treturn utils.makePrettylink(this.parser, title);\n\t}\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/syslink.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/table.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles tables. Or rather handles the cells inside the tables, since tables\nthemselves aren't relinked.\n\n\\*/\n\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\n\nexports.name = \"table\";\n\nexports.types = {block: true};\n\nexports.report = function(text, callback, options) {\n\tvar rowRegExp = /^\\|([^\\n]*)\\|([fhck]?)\\r?(?:\\n|$)/mg,\n\t\trowTermRegExp = /(\\|(?:[fhck]?)\\r?(?:\\n|$))/mg;\n\t// Match the row\n\trowRegExp.lastIndex = this.parser.pos;\n\tvar rowMatch = rowRegExp.exec(this.parser.source);\n\twhile(rowMatch && rowMatch.index === this.parser.pos) {\n\t\tvar rowType = rowMatch[2];\n\t\t// Check if it is a class assignment\n\t\tif(rowType === \"k\") {\n\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t} else if(rowType === \"c\") {\n\t\t\t// Is this a caption row?\n\t\t\t// If so, move past the opening `|` of the row\n\t\t\tthis.parser.pos++;\n\t\t\t// Parse the caption\n\t\t\tvar oldCallback = this.parser.callback;\n\t\t\tthis.parser.callback = function(title, blurb) {\n\t\t\t\tcallback(title, '|' + blurb + '|c');\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tthis.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});\n\t\t\t} finally {\n\t\t\t\tthis.parser.callback = oldCallback;\n\t\t\t}\n\t\t} else {\n\t\t\t// Process the row\n\t\t\tprocessRow.call(this, rowType, callback);\n\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t}\n\t\trowMatch = rowRegExp.exec(this.parser.source);\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar rowRegExp = /^\\|([^\\n]*)\\|([fhck]?)\\r?(?:\\n|$)/mg,\n\t\trowTermRegExp = /(\\|(?:[fhck]?)\\r?(?:\\n|$))/mg,\n\t\tbuilder = new Rebuilder(text, this.parser.pos),\n\t\timpossible = false,\n\t\toutput,\n\t\tentry;\n\t// Match the row\n\trowRegExp.lastIndex = this.parser.pos;\n\tvar rowMatch = rowRegExp.exec(this.parser.source);\n\twhile(rowMatch && rowMatch.index === this.parser.pos) {\n\t\tvar rowType = rowMatch[2];\n\t\t// Check if it is a class assignment\n\t\tif(rowType === \"k\") {\n\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t} else {\n\t\t\t// Is this a caption row?\n\t\t\tif(rowType === \"c\") {\n\t\t\t\t// If so, move past the opening `|` of the row\n\t\t\t\tthis.parser.pos++;\n\t\t\t\t// Parse the caption\n\t\t\t\toutput = this.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});\n\t\t\t} else {\n\t\t\t\t// Process the row\n\t\t\t\toutput = processRow.call(this);\n\t\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t\t}\n\t\t\tif (output.length > 0) {\n\t\t\t\tfor (var i = 0; i < output.length; i++) {\n\t\t\t\t\tvar o = output[i];\n\t\t\t\t\tif (o.output) {\n\t\t\t\t\t\tbuilder.add(o.output, o.start, o.end);\n\t\t\t\t\t}\n\t\t\t\t\tif (o.impossible) {\n\t\t\t\t\t\timpossible = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trowMatch = rowRegExp.exec(this.parser.source);\n\t}\n\tif (builder.changed() || impossible) {\n\t\tentry = {}\n\t\tentry.output = builder.results(this.parser.pos);\n\t\tif (impossible) {\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\treturn entry;\n};\n\nvar processRow = function(rowType, callback) {\n\tvar cellRegExp = /(?:\\|([^\\n\\|]*)\\|)|(\\|[fhck]?\\r?(?:\\n|$))/mg,\n\t\tcellTermRegExp = /((?:\\x20*)\\|)/mg,\n\t\tchildren = [];\n\t// Match a single cell\n\tcellRegExp.lastIndex = this.parser.pos;\n\tvar cellMatch = cellRegExp.exec(this.parser.source);\n\twhile(cellMatch && cellMatch.index === this.parser.pos) {\n\t\tif(cellMatch[2]) {\n\t\t\t// End of row\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t\tbreak;\n\t\t}\n\t\tswitch (cellMatch[1]) {\n\t\tcase '~':\n\t\tcase '>':\n\t\tcase '<':\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// For ordinary cells, step beyond the opening `|`\n\t\t\tthis.parser.pos++;\n\t\t\t// Look for a space at the start of the cell\n\t\t\tvar spaceLeft = false;\n\t\t\tvar prefix = '|';\n\t\t\tvar suffix = '|';\n\t\t\tif(this.parser.source.substr(this.parser.pos).search(/^\\^([^\\^]|\\^\\^)/) === 0) {\n\t\t\t\tprefix += '^';\n\t\t\t\tthis.parser.pos++;\n\t\t\t} else if(this.parser.source.substr(this.parser.pos).search(/^,([^,]|,,)/) === 0) {\n\t\t\t\tprefix += ',';\n\t\t\t\tthis.parser.pos++;\n\t\t\t}\n\t\t\tvar chr = this.parser.source.substr(this.parser.pos,1);\n\t\t\twhile(chr === \" \") {\n\t\t\t\tspaceLeft = true;\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tchr = this.parser.source.substr(this.parser.pos,1);\n\t\t\t}\n\t\t\tif (spaceLeft) {\n\t\t\t\tprefix += ' ';\n\t\t\t}\n\t\t\t// Check whether this is a heading cell\n\t\t\tif(chr === \"!\") {\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tprefix += '!';\n\t\t\t}\n\t\t\t// Parse the cell\n\t\t\tvar oldCallback = this.parser.callback;\n\t\t\tvar reports = [];\n\t\t\tthis.parser.callback = function(title, blurb) {\n\t\t\t\treports.push(title, blurb);\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar output = this.parser.parseInlineRun(cellTermRegExp,{eatTerminator: true});\n\t\t\t\tif (output.length > 0) {\n\t\t\t\t\tchildren.push(output[0]);\n\t\t\t\t}\n\t\t\t\tif(this.parser.source.substr(this.parser.pos - 2,1) === \" \") { // spaceRight\n\t\t\t\t\tsuffix = ' |';\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < reports.length; i += 2) {\n\t\t\t\t\tcallback(reports[i], prefix + reports[i+1] + suffix + rowType);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.parser.callback = oldCallback;\n\t\t\t}\n\t\t\t// Move back to the closing `|`\n\t\t\tthis.parser.pos--;\n\t\t}\n\t\tcellRegExp.lastIndex = this.parser.pos;\n\t\tcellMatch = cellRegExp.exec(this.parser.source);\n\t}\n\treturn children;\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/table.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/transclude.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles replacement of transclusions in wiki text like,\n\n{{RenamedTiddler}}\n{{RenamedTiddler||TemplateTitle}}\n\nThis renames both the tiddler and the template field.\n\n\\*/\n\nvar refHandler = require(\"$:/plugins/flibbles/relink/js/fieldtypes/reference\");\nvar utils = require(\"./utils.js\");\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar referenceOperators = relinkUtils.getModulesByTypeAsHashmap('relinkreference', 'name');\n\nexports.name = ['transcludeinline', 'transcludeblock'];\n\nexports.report = function(text, callback, options) {\n\tvar m = this.match,\n\t\trefString = $tw.utils.trim(m[1]),\n\t\tref = parseTextReference(refString);\n\t\ttemplate = $tw.utils.trim(m[2]);\n\tfor (var operator in referenceOperators) {\n\t\treferenceOperators[operator].report(ref, function(title, blurb) {\n\t\t\tblurb = blurb || \"\";\n\t\t\tif (template) {\n\t\t\t\tblurb += '||' + template;\n\t\t\t}\n\t\t\tcallback(title, \"{{\" + blurb + \"}}\");\n\t\t}, options);\n\t}\n\tif (template) {\n\t\tcallback(template, '{{' + refString + '||}}');\n\t}\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar m = this.match,\n\t\treference = parseTextReference(m[1]),\n\t\ttemplate = m[2],\n\t\tentry = undefined,\n\t\timpossible = false,\n\t\tmodified = false;\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tfor (var operator in referenceOperators) {\n\t\tvar result = referenceOperators[operator].relink(reference, fromTitle, toTitle, options);\n\t\tif (result !== undefined) {\n\t\t\tif (result.impossible) {\n\t\t\t\timpossible = true;\n\t\t\t}\n\t\t\tif (result.output) {\n\t\t\t\treference = result.output;\n\t\t\t\tmodified = true\n\t\t\t}\n\t\t}\n\t}\n\tif ($tw.utils.trim(template) === fromTitle) {\n\t\ttemplate = template.replace(fromTitle, toTitle);\n\t\tmodified = true;\n\t}\n\tif (modified) {\n\t\tvar output = this.makeTransclude(this.parser, reference, template);\n\t\tif (output) {\n\t\t\t// Adding any newline that might have existed is\n\t\t\t// what allows this relink method to work for both\n\t\t\t// the block and inline filter wikitext rule.\n\t\t\tentry = {output: output + utils.getEndingNewline(m[0])};\n\t\t} else {\n\t\t\timpossible = true;\n\t\t}\n\t}\n\tif (impossible) {\n\t\tentry = entry || {};\n\t\tentry.impossible = true;\n\t}\n\treturn entry;\n};\n\n// I have my own because the core one is deficient for my needs.\nfunction parseTextReference(textRef) {\n\t// Separate out the title, field name and/or JSON indices\n\tvar reTextRef = /^([\\w\\W]*?)(?:!!(\\S[\\w\\W]*)|##(\\S[\\w\\W]*))?$/g;\n\t\tmatch = reTextRef.exec(textRef),\n\t\tresult = {};\n\tif(match) {\n\t\t// Return the parts\n\t\tresult.title = match[1];\n\t\tresult.field = match[2];\n\t\tresult.index = match[3];\n\t} else {\n\t\t// If we couldn't parse it\n\t\tresult.title = textRef\n\t}\n\treturn result;\n};\n\n/** This converts a reference and a template into a string representation\n * of a transclude.\n */\nexports.makeTransclude = function(parser, reference, template) {\n\tvar rtn;\n\tif (!canBePrettyTemplate(template)) {\n\t\tvar widget = utils.makeWidget(parser, '$transclude', {\n\t\t\ttiddler: $tw.utils.trim(template),\n\t\t\tfield: reference.field,\n\t\t\tindex: reference.index});\n\t\tif (reference.title && widget !== undefined) {\n\t\t\trtn = utils.makeWidget(parser, '$tiddler', {tiddler: $tw.utils.trim(reference.title)}, widget);\n\t\t} else {\n\t\t\trtn = widget;\n\t\t}\n\t} else if (!canBePrettyTitle(reference.title) || !canBePrettyField(reference.field)) {\n\t\t// This block and the next account for the 1%...\n\t\tvar transclude;\n\t\tif (canBePrettyField(reference.field)) {\n\t\t\tvar reducedRef = {field: reference.field, index: reference.index};\n\t\t\ttransclude = prettyTransclude(reducedRef, template);\n\t\t} else {\n\t\t\ttransclude = utils.makeWidget(parser, \"$transclude\", {tiddler: $tw.utils.trim(reference.title), field: reference.field});\n\t\t}\n\t\trtn = utils.makeWidget(parser, '$tiddler', {tiddler: $tw.utils.trim(reference.title)}, transclude);\n\t} else {\n\t\t// This block takes care of 99% of all cases\n\t\trtn = prettyTransclude(reference, template);\n\t}\n\treturn rtn;\n};\n\nfunction canBePrettyTitle(value) {\n\treturn refHandler.canBePretty(value) && canBePrettyTemplate(value);\n};\n\nfunction canBePrettyField(value) {\n\treturn !/[\\|\\}\\{]/.test(value);\n};\n\nfunction canBePrettyTemplate(value) {\n\treturn !value || (value.indexOf('}') < 0 && value.indexOf('{') < 0 && value.indexOf('|') < 0);\n};\n\nfunction prettyTransclude(textReference, template) {\n\tif (typeof textReference !== \"string\") {\n\t\ttextReference = refHandler.toString(textReference);\n\t}\n\tif (!textReference) {\n\t\ttextReference = '';\n\t}\n\tif (template !== undefined) {\n\t\treturn \"{{\"+textReference+\"||\"+template+\"}}\";\n\t} else {\n\t\treturn \"{{\"+textReference+\"}}\";\n\t}\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/transclude.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/typedblock.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles the typeed blocks, as in:\n\n$$$text/vnd.tiddlywiki>text/html\n...\n$$$\n\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\nvar language = require('$:/plugins/flibbles/relink/js/language.js');\n\nexports.name = \"typedblock\";\n\nexports.types = {block: true};\n\nvar textOperators;\nvar oldTextOperators;\n\nfunction getTextOperator(type, options) {\n\tvar operator;\n\tif (textOperators === undefined) {\n\t\ttextOperators = utils.getModulesByTypeAsHashmap('relinktext', 'type');\n\t\toldTextOperators = utils.getModulesByTypeAsHashmap('relinktextoperator', 'type');\n\t}\n\toperator = textOperators[type];\n\tif (operator) {\n\t\treturn operator;\n\t}\n\tvar info = $tw.utils.getFileExtensionInfo(type);\n\tif (info && textOperators[info.type]) {\n\t\treturn textOperators[info.type];\n\t}\n\tvar old = oldTextOperators[type] || (info && oldTextOperators[info.type]);\n\tif (old) {\n\t\tvar vars = Object.create(options);\n\t\tvars.variables = {type: old.type, keyword: type};\n\t\tvar warnString = language.getString(\"text/html\", \"Warning/OldRelinkTextOperator\", vars)\n\t\tlanguage.warn(warnString);\n\t\toldTextOperators[type] = undefined;\n\t}\n};\n\nfunction getText() {\n\tvar reEnd = /\\r?\\n\\$\\$\\$\\r?(?:\\n|$)/mg;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Look for the end of the block\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the block\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\treturn text;\n};\n\nexports.report = function(text, callback, options) {\n\tvar innerText = getText.call(this),\n\t\toperator = getTextOperator(this.match[1], options);\n\tif (operator) {\n\t\treturn operator.report(innerText, callback, options);\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar start = this.parser.pos,\n\t\tinnerStart = this.matchRegExp.lastIndex,\n\t\tinnerText = getText.call(this),\n\t\toperator = getTextOperator(this.match[1], options);\n\tif (operator) {\n\t\tvar innerOptions = Object.create(options);\n\t\tinnerOptions.settings = this.parser.context;\n\t\tvar results = operator.relink(innerText, fromTitle, toTitle, innerOptions);\n\t\tif (results && results.output) {\n\t\t\tvar builder = new Rebuilder(text, start);\n\t\t\tbuilder.add(results.output, innerStart, innerStart + innerText.length);\n\t\t\tresults.output = builder.results(this.parser.pos);\n\t\t}\n\t\treturn results;\n\t}\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/typedblock.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/utils.js":{"text":"/*\\\nmodule-type: library\n\nUtility methods for the wikitext relink rules.\n\n\\*/\n\nexports.makeWidget = function(parser, tag, attributes, body) {\n\tif (!parser.context.allowWidgets()) {\n\t\treturn undefined;\n\t}\n\tvar string = '<' + tag;\n\tfor (var attr in attributes) {\n\t\tvar value = attributes[attr];\n\t\tif (value !== undefined) {\n\t\t\tvar quoted = exports.wrapAttributeValue(value);\n\t\t\tif (!quoted) {\n\t\t\t\tif (!parser.options.placeholder) {\n\t\t\t\t\t// It's not possible to make this widget\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tvar category = getPlaceholderCategory(parser.context, tag, attr);\n\t\t\t\tquoted = '<<' + parser.placeholder.getPlaceholderFor(value, category) + '>>';\n\t\t\t}\n\t\t\tstring += ' ' + attr + '=' + quoted;\n\t\t}\n\t}\n\tif (body !== undefined) {\n\t\tstring += '>' + body + '</' + tag + '>';\n\t} else {\n\t\tstring += '/>';\n\t}\n\treturn string;\n};\n\nfunction getPlaceholderCategory(context, tag, attribute) {\n\tvar element = context.getAttribute(tag);\n\tvar rule = element && element[attribute];\n\t// titles go to relink-\\d\n\t// plaintext goes to relink-plaintext-\\d\n\t// because titles are way more common, also legacy\n\tif (rule === undefined) {\n\t\treturn 'plaintext';\n\t} else {\n\t\trule = rule.fields.text;\n\t\tif (rule === 'title') {\n\t\t\trule = undefined;\n\t\t}\n\t\treturn rule;\n\t}\n};\n\nexports.makePrettylink = function(parser, title, caption) {\n\tvar output;\n\tif (parser.context.allowPrettylinks() && canBePrettylink(title, caption)) {\n\t\tif (caption !== undefined) {\n\t\t\toutput = \"[[\" + caption + \"|\" + title + \"]]\";\n\t\t} else {\n\t\t\toutput = \"[[\" + title + \"]]\";\n\t\t}\n\t} else if (caption !== undefined) {\n\t\tvar safeCaption = sanitizeCaption(parser, caption);\n\t\tif (safeCaption !== undefined) {\n\t\t\toutput = exports.makeWidget(parser, '$link', {to: title}, safeCaption);\n\t\t}\n\t} else if (exports.shorthandPrettylinksSupported(parser.wiki)) {\n\t\toutput = exports.makeWidget(parser, '$link', {to: title});\n\t} else if (parser.context.allowWidgets() && parser.placeholder) {\n\t\t// If we don't have a caption, we must resort to\n\t\t// placeholders anyway to prevent link/caption desync\n\t\t// from later relinks.\n\t\t// It doesn't matter whether the tiddler is quotable.\n\t\tvar ph = parser.placeholder.getPlaceholderFor(title);\n\t\toutput = \"<$link to=<<\"+ph+\">>><$text text=<<\"+ph+\">>/></$link>\";\n\t}\n\treturn output;\n};\n\n/**In version 5.1.20, Tiddlywiki made it so <$link to\"something\" /> would\n * use \"something\" as a caption. This is preferable. However, Relink works\n * going back to 5.1.14, so we need to have different handling for both\n * cases.\n */\nvar _supported;\nexports.shorthandPrettylinksSupported = function(wiki) {\n\tif (_supported === undefined) {\n\t\tvar test = wiki.renderText(\"text/plain\", \"text/vnd.tiddlywiki\", \"<$link to=test/>\");\n\t\t_supported = (test === \"test\");\n\t}\n\treturn _supported;\n};\n\n/**Return true if value can be used inside a prettylink.\n */\nfunction canBePrettylink(value, customCaption) {\n\treturn value.indexOf(\"]]\") < 0 && value[value.length-1] !== ']' && (customCaption !== undefined || value.indexOf('|') < 0);\n};\n\nfunction sanitizeCaption(parser, caption) {\n\tvar plaintext = parser.wiki.renderText(\"text/plain\", \"text/vnd.tiddlywiki\", caption);\n\tif (plaintext === caption && caption.indexOf(\"</$link>\") <= 0) {\n\t\treturn caption;\n\t} else {\n\t\treturn exports.makeWidget(parser, '$text', {text: caption});\n\t}\n};\n\n/**Finds an appropriate quote mark for a given value.\n *\n *Tiddlywiki doesn't have escape characters for attribute values. Instead,\n * we just have to find the type of quotes that'll work for the given title.\n * There exist titles that simply can't be quoted.\n * If it can stick with the preference, it will.\n *\n * return: Returns the wrapped value, or undefined if it's impossible to wrap\n */\nexports.wrapAttributeValue = function(value, preference) {\n\tvar whitelist = [\"\", \"'\", '\"', '\"\"\"'];\n\tvar choices = {\n\t\t\"\": function(v) {return !/([\\/\\s<>\"'=])/.test(v) && v.length > 0; },\n\t\t\"'\": function(v) {return v.indexOf(\"'\") < 0; },\n\t\t'\"': function(v) {return v.indexOf('\"') < 0; },\n\t\t'\"\"\"': function(v) {return v.indexOf('\"\"\"') < 0 && v[v.length-1] != '\"';}\n\t};\n\tif (choices[preference] && choices[preference](value)) {\n\t\treturn wrap(value, preference);\n\t}\n\tfor (var i = 0; i < whitelist.length; i++) {\n\t\tvar quote = whitelist[i];\n\t\tif (choices[quote](value)) {\n\t\t\treturn wrap(value, quote);\n\t\t}\n\t}\n\t// No quotes will work on this\n\treturn undefined;\n};\n\nfunction wrap(value, wrapper) {\n\tvar wrappers = {\n\t\t\"\": function(v) {return v; },\n\t\t\"'\": function(v) {return \"'\"+v+\"'\"; },\n\t\t'\"': function(v) {return '\"'+v+'\"'; },\n\t\t'\"\"\"': function(v) {return '\"\"\"'+v+'\"\"\"'; },\n\t\t\"[[\": function(v) {return \"[[\"+v+\"]]\"; }\n\t};\n\tvar chosen = wrappers[wrapper];\n\tif (chosen) {\n\t\treturn chosen(value);\n\t} else {\n\t\treturn undefined;\n\t}\n};\n\nfunction canBePrettyOperand(value) {\n\treturn value.indexOf(']') < 0;\n};\n\n// Finds the newline at the end of a string and returns it. Empty string if\n// none exists.\nexports.getEndingNewline = function(string) {\n\tvar l = string.length;\n\tif (string[l-1] === '\\n') {\n\t\treturn (string[l-2] === '\\r') ? \"\\r\\n\" : \"\\n\";\n\t}\n\treturn \"\";\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/utils.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/wikilink.js":{"text":"/*\\\nmodule-type: relinkwikitextrule\n\nHandles CamelCase links\n\nWikiLink\n\nbut not:\n\n~WikiLink\n\n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.name = \"wikilink\";\n\nexports.report = function(text, callback, options) {\n\tvar title = this.match[0],\n\t\tunlink = $tw.config.textPrimitives.unWikiLink;\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tif (title[0] !== unlink) {\n\t\tcallback(title, unlink + title);\n\t}\n};\n\nexports.relink = function(text, fromTitle, toTitle, options) {\n\tvar entry = undefined,\n\t\ttitle = this.match[0];\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tif (title === fromTitle && title[0] !== $tw.config.textPrimitives.unWikiLink) {\n\t\tentry = { output: this.makeWikilink(toTitle, options) };\n\t\tif (entry.output === undefined) {\n\t\t\tentry.impossible = true;\n\t\t}\n\t}\n\treturn entry;\n};\n\nexports.makeWikilink = function(title, options) {\n\tif (title.match(this.matchRegExp) && title[0] !== $tw.config.textPrimitives.unWikiLink) {\n\t\treturn title;\n\t} else {\n\t\treturn utils.makePrettylink(this.parser, title);\n\t}\n};\n","module-type":"relinkwikitextrule","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/wikilink.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes.js":{"text":"/*\\\n\nHandles all element attribute values. Most widget relinking happens here.\n\n\\*/\n\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar refHandler = relinkUtils.getType('reference');\nvar filterHandler = relinkUtils.getType('filter');\nvar macrocall = require(\"$:/plugins/flibbles/relink/js/utils/macrocall.js\");\nvar attributeOperators = relinkUtils.getModulesByTypeAsHashmap('relinkhtmlattributes', 'name');\n\nexports.name = \"attributes\";\n\nexports.report = function(element, parser, callback, options) {\n\tfor (var attributeName in element.attributes) {\n\t\tvar attr = element.attributes[attributeName];\n\t\tvar nextEql = parser.source.indexOf('=', attr.start);\n\t\t// This is the rare case of changing tiddler\n\t\t// \"true\" to something else when \"true\" is\n\t\t// implicit, like <$link to /> We ignore those.\n\t\tif (nextEql < 0 || nextEql > attr.end) {\n\t\t\tcontinue;\n\t\t}\n\t\tvar entry;\n\t\tswitch (attr.type) {\n\t\tcase \"string\":\n\t\t\tfor (var operatorName in attributeOperators) {\n\t\t\t\tvar operator = attributeOperators[operatorName];\n\t\t\t\tvar handler = operator.getHandler(element, attr, options);\n\t\t\t\tif (handler) {\n\t\t\t\t\thandler.report(attr.value, function(title, blurb) {\n\t\t\t\t\t\tif (operator.formBlurb) {\n\t\t\t\t\t\t\tcallback(title, operator.formBlurb(element, attr, blurb, options));\n\t\t\t\t\t\t} else if (blurb) {\n\t\t\t\t\t\t\tcallback(title, element.tag + ' ' + attributeName + '=\"' + blurb + '\"');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcallback(title, element.tag + ' ' + attributeName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, options);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"indirect\":\n\t\t\tentry = refHandler.report(attr.textReference, function(title, blurb) {\n\t\t\t\tcallback(title, element.tag + ' ' + attributeName + '={{' + (blurb || '') + '}}');\n\t\t\t}, options);\n\t\t\tbreak;\n\t\tcase \"filtered\":\n\t\t\tentry = filterHandler.report(attr.filter, function(title, blurb) {\n\t\t\t\tcallback(title, element.tag + ' ' + attributeName + '={{{' + blurb + '}}}');\n\t\t\t}, options);\n\t\t\tbreak;\n\t\tcase \"macro\":\n\t\t\tvar macro = attr.value;\n\t\t\tentry = macrocall.report(options.settings, macro, function(title, blurb) {\n\t\t\t\tcallback(title, element.tag + ' ' + attributeName + '=<<' + blurb + '>>');\n\t\t\t}, options);\n\t\t\tbreak;\n\t\t}\n\t}\n};\n\nexports.relink = function(element, parser, fromTitle, toTitle, options) {\n\tvar changed = undefined, impossible = undefined;\n\tfor (var attributeName in element.attributes) {\n\t\tvar attr = element.attributes[attributeName];\n\t\tvar nextEql = parser.source.indexOf('=', attr.start);\n\t\t// This is the rare case of changing tiddler\n\t\t// \"true\" to something else when \"true\" is\n\t\t// implicit, like <$link to /> We ignore those.\n\t\tif (nextEql < 0 || nextEql > attr.end) {\n\t\t\tattr.valueless = true;\n\t\t\tcontinue;\n\t\t}\n\t\tvar entry;\n\t\tswitch (attr.type) {\n\t\tcase 'string':\n\t\t\tfor (var operatorName in attributeOperators) {\n\t\t\t\tvar operator = attributeOperators[operatorName];\n\t\t\t\tvar handler = operator.getHandler(element, attr, options);\n\t\t\t\tif (handler) {\n\t\t\t\t\tentry = handler.relink(attr.value, fromTitle, toTitle, options);\n\t\t\t\t\tif (entry && entry.output) {\n\t\t\t\t\t\tattr.value = entry.output;\n\t\t\t\t\t\tattr.handler = handler.name;\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'indirect':\n\t\t\tentry = refHandler.relinkInBraces(attr.textReference, fromTitle, toTitle, options);\n\t\t\tif (entry && entry.output) {\n\t\t\t\tattr.textReference = entry.output;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'filtered':\n\t\t\tentry = filterHandler.relinkInBraces(attr.filter, fromTitle, toTitle, options);\n\t\t\tif (entry && entry.output) {\n\t\t\t\tattr.filter = entry.output;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'macro':\n\t\t\tvar macro = attr.value;\n\t\t\tentry = macrocall.relink(options.settings, macro, parser.source, fromTitle, toTitle, false, options);\n\t\t\tif (entry && entry.output) {\n\t\t\t\tattr.output = macrocall.reassemble(entry.output, parser.source, options);\n\t\t\t\tattr.value = entry.output;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif (entry && entry.impossible) {\n\t\t\timpossible = true;\n\t\t}\n\t}\n\tif (changed || impossible) {\n\t\treturn {output: changed, impossible: impossible};\n\t}\n};\n","module-type":"relinkhtml","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/importvariables.js":{"text":"/*\\\n\nHandles state updating required for $importvariables widgets\n\n\\*/\n\nvar relinkUtils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar ImportContext = relinkUtils.getContext('import');\n\nexports.name = \"importvariables\";\n\nexports.report = function(element, parser, callback, options) {\n\tif (element.tag === \"$importvariables\") {\n\t\tprocessImport(element, parser, options);\n\t}\n};\n\nexports.relink = function(element, parser, fromTitle, toTitle, options) {\n\tif (element.tag === \"$importvariables\") {\n\t\tprocessImport(element, parser, options);\n\t}\n};\n\nfunction processImport(element, parser, options) {\n\tvar importFilterAttr = element.attributes.filter;\n\tif (importFilterAttr) {\n\t\tprocessImportFilter(parser, importFilterAttr, options);\n\t}\n};\n\n// This processes a <$importvariables> filter attribute and adds any new\n// variables to our parser.\nfunction processImportFilter(parser, importAttribute, options) {\n\tif (typeof importAttribute === \"string\") {\n\t\t// It was changed. Reparse it. It'll be a quoted\n\t\t// attribute value. Add a dummy attribute name.\n\t\timportAttribute = $tw.utils.parseAttribute(\"p=\"+importAttribute, 0)\n\t}\n\tvar context = parser.context;\n\tvar importFilter = computeAttribute(context, importAttribute, options);\n\tparser.context = new ImportContext(options.wiki, context, importFilter);\n};\n\nfunction computeAttribute(context, attribute, options) {\n\tvar value;\n\tif(attribute.type === \"filtered\") {\n\t\tvar parentWidget = context.widget;\n\t\tvalue = options.wiki.filterTiddlers(attribute.filter,parentWidget)[0] || \"\";\n\t} else if(attribute.type === \"indirect\") {\n\t\tvar parentWidget = context.widget;\n\t\tvalue = options.wiki.getTextReference(attribute.textReference,\"\",parentWidget.variables.currentTiddler.value);\n\t} else if(attribute.type === \"macro\") {\n\t\tvar parentWidget = context.widget;\n\t\tvalue = parentWidget.getVariable(attribute.value.name,{params: attribute.value.params});\n\t} else { // String attribute\n\t\tvalue = attribute.value;\n\t}\n\treturn value;\n};\n","module-type":"relinkhtml","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/importvariables.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/fields.js":{"text":"/*\\ \nHandles replacement in widgets which allow arbitrary attributes that\ncorrespond to tiddler fields.\n\n\\*/\n\nexports.name = \"fields\";\n\nexports.getHandler = function(element, attribute, options) {\n\tvar regexp = options.settings.getConfig(\"fieldattributes\")[element.tag];\n\tif (regexp) {\n\t\tvar results = regexp.exec(attribute.name);\n\t\tif (results && results[0] === attribute.name) {\n\t\t\treturn options.settings.getFields()[results[1]];\n\t\t}\n\t}\n};\n","module-type":"relinkhtmlattributes","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/fields.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/macrocall.js":{"text":"/*\\\n\nHandles replacement in $macrocall widgets\n\n\\*/\n\nexports.name = \"macrocall\";\n\nexports.getHandler = function(element, attribute, options) {\n\tif (element.tag === \"$macrocall\") {\n\t\tvar nameAttr = element.attributes[\"$name\"];\n\t\tif (nameAttr) {\n\t\t\tvar setting = options.settings.getMacro(nameAttr.value);\n\t\t\treturn setting && setting[attribute.name];\n\t\t}\n\t}\n};\n\nexports.formBlurb = function(element, attribute, blurb, options) {\n\tvar nameAttr = element.attributes[\"$name\"];\n\tvar newBlurb = '<' + nameAttr.value + ' ' + attribute.name;\n\tif (blurb) {\n\t\tnewBlurb += '=\"' + blurb + '\"';\n\t}\n\treturn newBlurb;\n};\n","module-type":"relinkhtmlattributes","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/macrocall.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/whitelist.js":{"text":"/*\\ \n\nHandles replacement of widget attributes that are specified in the whitelist.\n\n\\*/\n\nexports.name = \"whitelist\";\n\nexports.getHandler = function(element, attribute, options) {\n\tvar setting = options.settings.getAttribute(element.tag);\n\treturn setting && setting[attribute.name];\n};\n","module-type":"relinkhtmlattributes","title":"$:/plugins/flibbles/relink/js/relinkoperations/text/wikitext/html/attributes/whitelist.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/context.js":{"text":"/*\\\n\nBase class for relink contexts.\n\n\\*/\n\nfunction Context() {\n};\n\nexports.context = Context;\n\n// This class does no special handling of fields, operators, or attributes.\n// we pass it along to the parent.\nContext.prototype.getFields = function() {\n\treturn this.parent.getFields();\n};\n\nContext.prototype.getOperator = function(name, index) {\n\treturn this.parent.getOperator(name, index);\n};\n\nContext.prototype.getOperators = function() {\n\treturn this.parent.getOperators();\n};\n\nContext.prototype.getAttribute = function(elementName) {\n\treturn this.parent.getAttribute(elementName);\n};\n\nContext.prototype.getAttributes = function() {\n\treturn this.parent.getAttributes();\n};\n\nContext.prototype.getConfig = function(category) {\n\treturn this.parent.getConfig(category);\n};\n\nContext.prototype.getMacro = function(macroName) {\n\treturn this.parent.getMacro(macroName);\n};\n\nContext.prototype.getMacros = function() {\n\treturn this.parent.getMacros();\n};\n\nContext.prototype.allowPrettylinks = function() {\n\treturn this.parent.allowPrettylinks();\n};\n\nContext.prototype.allowWidgets = function() {\n\treturn this.parent.allowWidgets();\n};\n\nContext.prototype.hasImports = function(value) {\n\treturn this.parent.hasImports(value);\n};\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/context.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/import.js":{"text":"/*\\\n\nThis handles the fetching and distribution of relink settings.\n\n\\*/\n\nvar WidgetContext = require('./widget').widget;\n\nfunction ImportContext(wiki, parent, filter) {\n\tthis.parent = parent;\n\tthis.wiki = wiki;\n\tvar importWidget = createImportWidget(filter, this.wiki, this.parent.widget);\n\tthis._compileList(importWidget.tiddlerList);\n\t// This only works if only one filter is imported\n\tthis.widget = this.getBottom(importWidget);\n\t// Trickle this up, so that any containing tiddlercontext knows that this\n\t// tiddler does some importing, and must be checked regularly.\n\tparent.hasImports(true);\n};\n\nexports.import = ImportContext;\n\nImportContext.prototype = new WidgetContext();\n\nImportContext.prototype.changed = function(changes) {\n\treturn this.widget && this.widget.refresh(changes)\n};\n\nfunction createImportWidget(filter, wiki, parent) {\n\tvar widget = wiki.makeWidget( { tree: [{\n\t\ttype: \"importvariables\",\n\t\tattributes: {\n\t\t\t\"filter\": {\n\t\t\t\ttype: \"string\",\n\t\t\t\tvalue: filter\n\t\t\t}\n\t\t}\n\t}] }, { parentWidget: parent} );\n\tif (parent) {\n\t\tparent.children.push(widget);\n\t}\n\twidget.execute();\n\twidget.renderChildren();\n\tvar importWidget = widget.children[0];\n\treturn importWidget;\n};\n\nImportContext.prototype._compileList = function(titleList) {\n\tfor (var i = 0; i < titleList.length; i++) {\n\t\tvar parser = this.wiki.parseTiddler(titleList[i]);\n\t\tif (parser) {\n\t\t\tvar parseTreeNode = parser.tree[0];\n\t\t\twhile (parseTreeNode && parseTreeNode.type === \"set\") {\n\t\t\t\tif (parseTreeNode.relink) {\n\t\t\t\t\tfor (var macroName in parseTreeNode.relink) {\n\t\t\t\t\t\tvar parameters = parseTreeNode.relink[macroName];\n\t\t\t\t\t\tfor (paramName in parameters) {\n\t\t\t\t\t\t\tthis.addSetting(this.wiki, macroName, paramName, parameters[paramName], titleList[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparseTreeNode = parseTreeNode.children && parseTreeNode.children[0];\n\t\t\t}\n\t\t}\n\t}\n};\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/import.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/tiddler.js":{"text":"/*\\\n\nContext for a tiddler. Defines nothing but makes an entry point to test if\na tiddler must be refreshed.\n\n\\*/\n\nvar WidgetContext = require('./widget.js').widget;\n\nfunction TiddlerContext(wiki, parentContext, title) {\n\tthis.title = title;\n\tthis.parent = parentContext;\n\tvar globalWidget = parentContext && parentContext.widget;\n\tvar parentWidget = wiki.makeWidget(null, {parentWidget: globalWidget});\n\tparentWidget.setVariable('currentTiddler', title);\n\tthis.widget = wiki.makeWidget(null, {parentWidget: parentWidget});\n};\n\nexports.tiddler = TiddlerContext;\n\nTiddlerContext.prototype = new WidgetContext();\n\nTiddlerContext.prototype.changed = function(changes) {\n\treturn this.widget && this.widget.refresh(changes);\n};\n\n// By default, a tiddler context does not use imports, unless an import\n// statement is later discovered somewhere in the fields.\nTiddlerContext.prototype.hasImports = function(value) {\n\treturn this._hasImports || (this._hasImports = value);\n};\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/tiddler.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/variable.js":{"text":"/*\\\n\nThis handles the context for variables. Either from $set, $vars, or \\define\n\n\\*/\n\nvar WidgetContext = require('./widget').widget;\n\nfunction VariableContext(parent, setParseTreeNode) {\n\tthis.parent = parent;\n\t// Now create a new widget and attach it.\n\tvar attachPoint = parent.widget;\n\tvar setWidget = attachPoint.makeChildWidget(setParseTreeNode);\n\tattachPoint.children.push(setWidget);\n\tsetWidget.computeAttributes();\n\tsetWidget.execute();\n\t// point our widget to bottom, where any other contexts would attach to\n\tthis.widget = this.getBottom(setWidget);\n};\n\nexports.variable = VariableContext;\n\nVariableContext.prototype = new WidgetContext();\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/variable.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/whitelist.js":{"text":"/*\\\n\nThis top-level context manages settings inside the whitelist. It never has\na parent.\n\n\\*/\n\nvar utils = require('../utils');\nvar Context = require('./context').context;\n\nvar prefix = \"$:/config/flibbles/relink/\";\n\n/**Factories define methods that create settings given config tiddlers.\n * for factory method 'example', it will be called once for each:\n * \"$:/config/flibbles/relink/example/...\" tiddler that exists.\n * the argument \"key\" will be set to the contents of \"...\"\n *\n * The reason I build relink settings in this convoluted way is to minimize\n * the number of times tiddlywiki has to run through EVERY tiddler looking\n * for relink config tiddlers.\n */\nvar settingsGenerators = utils.getModulesByTypeAsHashmap('relinksetting', 'name');\n\nfunction WhitelistContext(wiki) {\n\tbuild(this, wiki);\n};\n\nexports.whitelist = WhitelistContext;\n\nWhitelistContext.prototype = new Context();\n\n/**Hot directories are directories for which if anything changes inside them,\n * then Relink must completely rebuild its index.\n * By default, this includes the whitelist settings, but relink-titles also\n * includes its rules disabling directory.\n * This is the FIRST solution I came up with to this problem. If you're\n * looking at this, please make a github issue so I have a chance to understand\n * your needs. This is currently a HACK solution.\n */\nWhitelistContext.hotDirectories = [prefix];\n\nWhitelistContext.prototype.getAttribute = function(elementName) {\n\treturn this.attributes[elementName];\n};\n\nWhitelistContext.prototype.getAttributes = function() {\n\treturn flatten(this.attributes);\n};\n\nWhitelistContext.prototype.getFields = function() {\n\treturn this.fields;\n};\n\nWhitelistContext.prototype.getConfig = function(category) {\n\treturn this[category];\n};\n\nWhitelistContext.prototype.getOperator = function(operatorName, operandIndex) {\n\tvar op = this.operators[operatorName];\n\treturn op && op[operandIndex || 1];\n};\n\nWhitelistContext.prototype.getOperators = function() {\n\tvar signatures = Object.create(null);\n\tfor (var op in this.operators) {\n\t\tvar operandSet = this.operators[op];\n\t\tfor (var index in operandSet) {\n\t\t\tvar entry = operandSet[index];\n\t\t\tsignatures[entry.key] = entry;\n\t\t}\n\t}\n\treturn signatures;\n};\n\nWhitelistContext.prototype.getMacro = function(macroName) {\n\treturn this.macros[macroName];\n};\n\nWhitelistContext.prototype.getMacros = function() {\n\treturn flatten(this.macros);\n};\n\nWhitelistContext.prototype.changed = function(changedTiddlers) {\n\tfor (var i = 0; i < WhitelistContext.hotDirectories.length; i++) {\n\t\tvar dir = WhitelistContext.hotDirectories[i];\n\t\tfor (var title in changedTiddlers) {\n\t\t\tif (title.substr(0, dir.length) === dir) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\nWhitelistContext.prototype.hasImports = function(value) {\n\t// We don't care if imports are used. This is the global level.\n\treturn false;\n};\n\nfunction build(settings, wiki) {\n\tfor (var name in settingsGenerators) {\n\t\tsettings[name] = Object.create(null);\n\t}\n\twiki.eachShadowPlusTiddlers(function(tiddler, title) {\n\t\tif (title.substr(0, prefix.length) === prefix) {\n\t\t\tvar remainder = title.substr(prefix.length);\n\t\t\tvar category = root(remainder);\n\t\t\tvar factory = settingsGenerators[category];\n\t\t\tif (factory) {\n\t\t\t\tvar name = remainder.substr(category.length+1);\n\t\t\t\tfactory.generate(settings[category], tiddler, name, wiki);\n\t\t\t}\n\t\t}\n\t});\n};\n\n/* Returns first bit of a path. path/to/tiddler -> path\n */\nfunction root(string) {\n\tvar index = string.indexOf('/');\n\tif (index >= 0) {\n\t\treturn string.substr(0, index);\n\t}\n};\n\n/* Turns {dir: {file1: 'value1', file2: 'value2'}}\n * into {dir/file1: 'value1', dir/file2: 'value2'}\n */\nfunction flatten(set) {\n\tvar signatures = Object.create(null);\n\tfor (var outerName in set) {\n\t\tvar setItem = set[outerName];\n\t\tfor (var innerName in setItem) {\n\t\t\tsignatures[outerName + \"/\" + innerName] = setItem[innerName];\n\t\t}\n\t}\n\treturn signatures;\n};\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/whitelist.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/widget.js":{"text":"/*\\\n\nThis is a virtual subclass of context for contexts that exist within widgets\nof a specific tiddler.\n\nAll widget contexts must have a widget member.\n\n\\*/\n\nvar Context = require('./context.js').context;\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\n\nfunction WidgetContext() {};\n\nexports.widget = WidgetContext;\n\nWidgetContext.prototype = new Context();\n\nWidgetContext.prototype.getMacroDefinition = function(variableName) {\n\t// widget.variables is prototyped, so it looks up into all its parents too\n\treturn this.widget.variables[variableName] || $tw.macros[variableName];\n};\n\nWidgetContext.prototype.addSetting = function(wiki, macroName, parameter, type, sourceTitle) {\n\tthis.macros = this.macros || Object.create(null);\n\tvar macro = this.macros[macroName];\n\ttype = type || utils.getDefaultType(wiki);\n\tif (macro === undefined) {\n\t\tmacro = this.macros[macroName] = Object.create(null);\n\t}\n\tvar handler = utils.getType(type);\n\tif (handler) {\n\t\thandler.source = sourceTitle;\n\t\t// We attach the fields of the defining tiddler for the benefit\n\t\t// of any 3rd party field types that want access to them.\n\t\tvar tiddler = wiki.getTiddler(sourceTitle);\n\t\thandler.fields = tiddler.fields;\n\t\tmacro[parameter] = handler;\n\t}\n};\n\nWidgetContext.prototype.getMacros = function() {\n\tvar signatures = this.parent.getMacros();\n\tif (this.macros) {\n\t\tfor (var macroName in this.macros) {\n\t\t\tvar macro = this.macros[macroName];\n\t\t\tfor (var param in macro) {\n\t\t\t\tsignatures[macroName + \"/\" + param] = macro[param];\n\t\t\t}\n\t\t}\n\t}\n\treturn signatures;\n};\n\n/**This does strange handling because it's possible for a macro to have\n * its individual parameters whitelisted in separate places.\n * Don't know WHY someone would do this, but it can happen.\n */\nWidgetContext.prototype.getMacro = function(macroName) {\n\tvar theseSettings = this.macros && this.macros[macroName];\n\tvar parentSettings;\n\tif (this.parent) {\n\t\tparentSettings = this.parent.getMacro(macroName);\n\t}\n\tif (theseSettings && parentSettings) {\n\t\t// gotta merge them without changing either. This is expensive,\n\t\t// but it'll happen rarely.\n\t\tvar rtnSettings = $tw.utils.extend(Object.create(null), theseSettings, parentSettings);\n\t\treturn rtnSettings;\n\t}\n\treturn theseSettings || parentSettings;\n};\n\n/**Returns the deepest descendant of the given widget.\n */\nWidgetContext.prototype.getBottom = function(widget) {\n\twhile (widget.children.length > 0) {\n\t\twidget = widget.children[0];\n\t}\n\treturn widget;\n};\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/widget.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/contexts/wikitext.js":{"text":"/*\\\n\nContext for wikitext. It can contain rules about what's allowed in this\ncurrent layer of wikitext.\n\n\\*/\n\nvar WidgetContext = require('./widget.js').widget;\n\nfunction WikitextContext(parentContext) {\n\tthis.parent = parentContext;\n\tthis.widget = parentContext.widget;\n};\n\nexports.wikitext = WikitextContext;\n\nWikitextContext.prototype = new WidgetContext();\n\n// Unless this specific context has rules about it, widgets and prettyLInks are allowed.\nWikitextContext.prototype.allowWidgets = enabled;\nWikitextContext.prototype.allowPrettylinks = enabled;\n\nfunction enabled() { return true; };\n","module-type":"relinkcontext","title":"$:/plugins/flibbles/relink/js/contexts/wikitext.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils/backupIndexer.js":{"text":"/*\\\nmodule-type: library\n\nThis is a backup indexer Relink uses if the real one is disabled, or we're\n<V5.1.23. It's not nearly as good, but it caches some.\n\n\\*/\n\n\"use strict\";\n\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils.js\");\nvar TiddlerContext = utils.getContext('tiddler');\n\n// This is the indexer we use if the current wiki doesn't support indexers.\nfunction BackupIndexer(wiki) {\n\tthis.wiki = wiki;\n};\n\nmodule.exports = BackupIndexer;\n\nBackupIndexer.prototype.lookup = function(title) {\n\treturn getCache(this.wiki).lookup[title];\n};\n\nBackupIndexer.prototype.reverseLookup = function(title) {\n\tvar index = getCache(this.wiki);\n\tif (!index.reverse[title]) {\n\t\tvar record = Object.create(null);\n\t\tfor (var other in index.lookup) {\n\t\t\tif (index.lookup[other][title]) {\n\t\t\t\trecord[other] = index.lookup[other][title];\n\t\t\t}\n\t\t}\n\t\tindex.reverse[title] = record;\n\t}\n\treturn index.reverse[title];\n};\n\n/* The backup indexer doesn't bother caching relink reports. It would always\n * be called after a draft tiddler had changed, which would defeat the point.\n */\nBackupIndexer.prototype.relinkLookup = function(fromTitle, toTitle, options) {\n\tvar cache = getCache(this.wiki);\n\tif (cache.lastRelinkFrom === fromTitle && cache.lastRelinkTo === toTitle) {\n\t\toptions.cache = cache.lastRelinkCache;\n\t\treturn cache.lastRelink;\n\t}\n\tcache.lastRelink = utils.getRelinkResults(this.wiki, fromTitle, toTitle, cache.context, undefined, options);\n\tcache.lastRelinkFrom = fromTitle;\n\tcache.lastRelinkTo = toTitle;\n\tcache.lastRelinkCache = options.cache;\n\treturn cache.lastRelink;\n};\n\nBackupIndexer.prototype.orphans = function() {\n\tvar index = getCache(this.wiki).lookup;\n\tvar results = [];\n\tfor (var title in index) {\n\t\tvar found = false;\n\t\tfor (var anything in this.reverseLookup(title)) {\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!found) {\n\t\t\tresults.push(title);\n\t\t}\n\t}\n\treturn results;\n};\n\nfunction getCache(wiki) {\n\treturn wiki.getGlobalCache('relink', function() {\n\t\tvar tiddlerList = wiki.getRelinkableTitles();\n\t\tvar index = Object.create(null);\n\t\tvar wikiContext = utils.getWikiContext(wiki);\n\t\tfor (var i = 0; i < tiddlerList.length; i++) {\n\t\t\tvar title = tiddlerList[i];\n\t\t\tvar tiddler = wiki.getTiddler(title);\n\t\t\tif (tiddler && !tiddler.fields[\"plugin-type\"]) {\n\t\t\t\tvar context = new TiddlerContext(wiki, wikiContext, title);\n\t\t\t\tindex[title] = utils.getTiddlerRelinkReferences(wiki, title, context);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tlookup: index,\n\t\t\treverse: Object.create(null),\n\t\t\tcontext: wikiContext};\n\t});\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils/backupIndexer.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils/entry.js":{"text":"/*\\\n\nEntries are deprecated. Don't use them. These classes are here just so that\nany 3rd party modules built for Relink V1 don't break.\n\nJust return an object like, {output: \"string\", impossible: true|undefined}\n\n\\*/\n\nfunction EntryNode() {\n\tthis.children = [];\n};\n\nmodule.exports = EntryNode;\n\n/** PURE VIRTUAL\n * EntryNode.prototype.report = function() -> [\"string\", ...]\n */\n\nEntryNode.newType = function() {\n\treturn EntryNode;\n};\n\nEntryNode.prototype.add = function(entry) {\n\tthis.children.push(entry);\n};\n\nfunction EntryCollection() {\n\tthis.children = Object.create(null);\n\tthis.types = Object.create(null);\n};\n\nEntryNode.newCollection = function(name) {\n\treturn EntryCollection;\n};\n\n// Again. I reiterate. Don't use this. All this is just legacy support.\nObject.defineProperty(EntryCollection, 'impossible', {\n\tget: function() {\n\t\tvar imp = this._impossible;\n\t\tthis.eachChild(function(child) { imp = imp || child.impossible; });\n\t\treturn imp;\n\t},\n\tset: function(impossible) {\n\t\tthis._impossible = true;\n\t}\n});\n\nEntryCollection.prototype.eachChild = function(method) {\n\tfor (var child in this.children) {\n\t\tmethod(this.children[child]);\n\t}\n};\n\nEntryCollection.prototype.addChild = function(child, name, type) {\n\tthis.children[name] = child;\n\tthis.types[name] = type;\n};\n\nEntryCollection.prototype.hasChildren = function() {\n\treturn Object.keys(this.children).length > 0;\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils/entry.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils/macrocall.js":{"text":"/*\\\n\nMethods for reporting and relinking macros. Behaves much like a fieldtype, except that it's not.\n\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\nvar Rebuilder = require(\"$:/plugins/flibbles/relink/js/utils/rebuilder\");\n\n// Error thrown when a macro's definition is needed, but can't be found.\nfunction CannotFindMacroDef() {};\nCannotFindMacroDef.prototype.impossible = true;\nCannotFindMacroDef.prototype.name = \"macroparam\";\n// Failed relinks due to missing definitions aren't reported for now.\n// I may want to do something special later on.\nCannotFindMacroDef.prototype.report = function() { return []; };\n\n/** As in, report a macrocall invocation that is an html attribute.\n * macro: must be a macro object.*/\nexports.report = function(context, macro, callback, options) {\n\tvar managedMacro = context.getMacro(macro.name);\n\tif (!managedMacro) {\n\t\t// We don't manage this macro. Bye.\n\t\treturn undefined;\n\t}\n\tfor (var managedArg in managedMacro) {\n\t\tvar index;\n\t\ttry {\n\t\t\tindex = getParamIndexWithinMacrocall(context, macro.name, managedArg, macro.params, options);\n\t\t} catch (e) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (index < 0) {\n\t\t\t// The argument was not supplied. Move on to next.\n\t\t\tcontinue;\n\t\t}\n\t\tvar param = macro.params[index];\n\t\tvar handler = managedMacro[managedArg];\n\t\tvar nestedOptions = Object.create(options);\n\t\tnestedOptions.settings = context;\n\t\tvar entry = handler.report(param.value, function(title, blurb) {\n\t\t\tvar rtn = managedArg;\n\t\t\tif (blurb) {\n\t\t\t\trtn += ': \"' + blurb + '\"';\n\t\t\t}\n\t\t\tcallback(title, macro.name + ' ' + rtn);\n\t\t}, nestedOptions);\n\t}\n};\n\n/**Processes the given macro,\n * macro: {name:, params:, start:, end:}\n * each parameters: {name:, end:, value:}\n * Macro invocation returned is the same, but relinked, and may have new keys:\n * parameters: {type: macro, start:, newValue: (quoted replacement value)}\n * Output of the returned entry isn't a string, but a macro object. It needs\n * to be converted.\n */\nexports.relink = function(context, macro, text, fromTitle, toTitle, mayBeWidget, options) {\n\tvar managedMacro = context.getMacro(macro.name);\n\tvar modified = false;\n\tif (!managedMacro) {\n\t\t// We don't manage this macro. Bye.\n\t\treturn undefined;\n\t}\n\tvar outMacro = $tw.utils.extend({}, macro);\n\tvar macroEntry = {};\n\toutMacro.params = macro.params.slice();\n\tfor (var managedArg in managedMacro) {\n\t\tvar index;\n\t\ttry {\n\t\t\tindex = getParamIndexWithinMacrocall(context, macro.name, managedArg, macro.params, options);\n\t\t} catch (e) {\n\t\t\tif (e instanceof CannotFindMacroDef) {\n\t\t\t\tmacroEntry.impossible = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (index < 0) {\n\t\t\t// this arg either was not supplied, or we can't find\n\t\t\t// the definition, so we can't tie it to an anonymous\n\t\t\t// argument. Either way, move on to the next.\n\t\t\tcontinue;\n\t\t}\n\t\tvar param = macro.params[index];\n\t\tvar handler = managedMacro[managedArg];\n\t\tvar nestedOptions = Object.create(options);\n\t\tnestedOptions.settings = context;\n\t\tvar entry = handler.relink(param.value, fromTitle, toTitle, nestedOptions);\n\t\tif (entry === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\t// Macro parameters can only be string parameters, not\n\t\t// indirect, or macro, or filtered\n\t\tif (entry.impossible) {\n\t\t\tmacroEntry.impossible = true;\n\t\t}\n\t\tif (!entry.output) {\n\t\t\tcontinue;\n\t\t}\n\t\tvar quote = utils.determineQuote(text, param);\n\t\tvar quoted = wrapParameterValue(entry.output, quote);\n\t\tvar newParam = $tw.utils.extend({}, param);\n\t\tif (quoted === undefined) {\n\t\t\tif (!mayBeWidget || !options.placeholder) {\n\t\t\t\tmacroEntry.impossible = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar ph = options.placeholder.getPlaceholderFor(entry.output,handler.name);\n\t\t\tnewParam.newValue = \"<<\"+ph+\">>\";\n\t\t\tnewParam.type = \"macro\";\n\t\t} else {\n\t\t\tnewParam.start = newParam.end - (newParam.value.length + (quote.length*2));\n\t\t\tnewParam.value = entry.output;\n\t\t\tnewParam.newValue = quoted;\n\t\t}\n\t\toutMacro.params[index] = newParam;\n\t\tmodified = true;\n\t}\n\tif (modified || macroEntry.impossible) {\n\t\tif (modified) {\n\t\t\tmacroEntry.output = outMacro;\n\t\t}\n\t\treturn macroEntry;\n\t}\n\treturn undefined;\n};\n\n/**Converts the macro object into a string, includes the <<..>>.\n * The text is the old text the macro was formed from. It's used to preserve\n * whitespace.\n */\nexports.reassemble = function(macro, text, options) {\n\tvar builder = new Rebuilder(text, macro.start);\n\tfor (var i = 0; i < macro.params.length; i++) {\n\t\tvar param = macro.params[i];\n\t\tif (param.newValue) {\n\t\t\tbuilder.add(param.newValue, param.start, param.end);\n\t\t}\n\t}\n\treturn builder.results(macro.end);\n};\n\n\n/** Returns -1 if param definitely isn't in macrocall.\n */\nfunction getParamIndexWithinMacrocall(context, macroName, param, params, options) {\n\tvar index, i, anonsExist = false;\n\tfor (i = 0; i < params.length; i++) {\n\t\tvar name = params[i].name;\n\t\tif (name === param) {\n\t\t\treturn i;\n\t\t}\n\t\tif (name === undefined) {\n\t\t\tanonsExist = true;\n\t\t}\n\t}\n\tif (!anonsExist) {\n\t\t// If no anonymous parameters are present, and we didn't find\n\t\t// it among the named ones, it must not be there.\n\t\treturn -1;\n\t}\n\tvar expectedIndex = indexOfParameterDef(context, macroName, param, options);\n\t// We've got to skip over all the named parameter instances.\n\tif (expectedIndex >= 0) {\n\t\tvar anonI = 0;\n\t\tfor (i = 0; i < params.length; i++) {\n\t\t\tif (params[i].name === undefined) {\n\t\t\t\tif (anonI === expectedIndex) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tanonI++;\n\t\t\t} else {\n\t\t\t\tvar indexOfOther = indexOfParameterDef(context, macroName, params[i].name, options);\n\t\t\t\tif (indexOfOther < expectedIndex) {\n\t\t\t\t\tanonI++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n};\n\n// Looks up the definition of a macro, and figures out what the expected index\n// is for the given parameter.\nfunction indexOfParameterDef(context, macroName, paramName, options) {\n\tvar def = context.getMacroDefinition(macroName);\n\tif (def === undefined) {\n\t\tthrow new CannotFindMacroDef();\n\t}\n\tvar params = def.params || [];\n\tfor (var i = 0; i < params.length; i++) {\n\t\tif (params[i].name === paramName) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\n\n// Looks up the definition of a macro, and figures out what the expected index\n// is for the given parameter.\nfunction indexOfParameterDef(context, macroName, paramName, options) {\n\tvar def = context.getMacroDefinition(macroName);\n\tif (def === undefined) {\n\t\tthrow new CannotFindMacroDef();\n\t}\n\tvar params = def.params || [];\n\tfor (var i = 0; i < params.length; i++) {\n\t\tif (params[i].name === paramName) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\n\n/**Like wrapAttribute value, except for macro parameters, not attributes.\n *\n * These are more permissive. Allows brackets,\n * and slashes and '<' in unquoted values.\n */\nfunction wrapParameterValue(value, preference) {\n\tvar whitelist = [\"\", \"'\", '\"', '[[', '\"\"\"'];\n\tvar choices = {\n\t\t\"\": function(v) {return !/([\\s>\"'=])/.test(v); },\n\t\t\"'\": function(v) {return v.indexOf(\"'\") < 0; },\n\t\t'\"': function(v) {return v.indexOf('\"') < 0; },\n\t\t\"[[\": canBePrettyOperand,\n\t\t'\"\"\"': function(v) {return v.indexOf('\"\"\"') < 0 && v[v.length-1] != '\"';}\n\t};\n\tif (choices[preference] && choices[preference](value)) {\n\t\treturn wrap(value, preference);\n\t}\n\tfor (var i = 0; i < whitelist.length; i++) {\n\t\tvar quote = whitelist[i];\n\t\tif (choices[quote](value)) {\n\t\t\treturn wrap(value, quote);\n\t\t}\n\t}\n\t// No quotes will work on this\n\treturn undefined;\n};\n\nfunction canBePrettyOperand(value) {\n\treturn value.indexOf(']') < 0;\n};\n\n\nfunction wrap(value, wrapper) {\n\tvar wrappers = {\n\t\t\"\": function(v) {return v; },\n\t\t\"'\": function(v) {return \"'\"+v+\"'\"; },\n\t\t'\"': function(v) {return '\"'+v+'\"'; },\n\t\t'\"\"\"': function(v) {return '\"\"\"'+v+'\"\"\"'; },\n\t\t\"[[\": function(v) {return \"[[\"+v+\"]]\"; }\n\t};\n\tvar chosen = wrappers[wrapper];\n\tif (chosen) {\n\t\treturn chosen(value);\n\t} else {\n\t\treturn undefined;\n\t}\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils/macrocall.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils/placeholder.js":{"text":"/*\\\n\nA method which doles out placeholders when requested, and constructs\nthe necessary supporting pragma when requested.\n\n\\*/\n\nvar utils = require('../utils');\n\nfunction Placeholder() {\n\tthis.placeholders = Object.create(null);\n\tthis.reverseMap = {};\n\tthis.used = Object.create(null);\n};\n\nmodule.exports = Placeholder;\n\nPlaceholder.prototype.getPlaceholderFor = function(value, category) {\n\tthis.reverseMap[category] = this.reverseMap[category] || Object.create(null);\n\tvar placeholder = this.reverseMap[category][value];\n\tif (placeholder) {\n\t\treturn placeholder;\n\t}\n\tvar config = (this.parser && this.parser.context) || utils.getWikiContext(this.parser.wiki);\n\tvar number = 0;\n\tvar prefix = \"relink-\"\n\tif (category && category !== \"title\") {\n\t\t// I don't like \"relink-title-1\". \"relink-1\" should be for\n\t\t// titles. lists, and filters can have descriptors though.\n\t\tprefix += category + \"-\";\n\t}\n\tdo {\n\t\tnumber += 1;\n\t\tplaceholder = prefix + number;\n\t} while (config.getMacroDefinition(placeholder) || this.used[placeholder]);\n\tthis.placeholders[placeholder] = value;\n\tthis.reverseMap[category][value] = placeholder;\n\tthis.used[placeholder] = true;\n\treturn placeholder;\n};\n\n// For registering placeholders that already existed\nPlaceholder.prototype.registerExisting = function(key, value) {\n\tthis.reverseMap[value] = key;\n\tthis.used[key] = true;\n};\n\nPlaceholder.prototype.getPreamble = function() {\n\tvar results = [];\n\tvar keys = Object.keys(this.placeholders);\n\tif (keys.length > 0) {\n\t\tkeys.sort();\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tvar name = keys[i];\n\t\t\tvar val = this.placeholders[name];\n\t\t\tresults.push(\"\\\\define \"+name+\"() \"+val+\"\\n\");\n\t\t}\n\t}\n\treturn results.join('');\n};\n\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils/placeholder.js","type":"application/javascript"},"$:/plugins/flibbles/relink/js/utils/rebuilder.js":{"text":"/*\\\n\nThis helper class aids in reconstructing an existing string with new parts.\n\n\\*/\n\nfunction Rebuilder(text, start) {\n\tthis.text = text;\n\tthis.index = start || 0;\n\tthis.pieces = [];\n};\n\nmodule.exports = Rebuilder;\n\n/**Pieces must be added consecutively.\n * Start and end are the indices in the old string specifying where to graft\n * in the new piece.\n */\nRebuilder.prototype.add = function(value, start, end) {\n\tthis.pieces.push(this.text.substring(this.index, start), value);\n\tthis.index = end;\n};\n\nRebuilder.prototype.changed = function() {\n\treturn this.pieces.length > 0;\n};\n\nRebuilder.prototype.results = function(end) {\n\tif (this.changed()) {\n\t\tthis.pieces.push(this.text.substring(this.index, end));\n\t\treturn this.pieces.join('');\n\t}\n\treturn undefined;\n};\n","module-type":"library","title":"$:/plugins/flibbles/relink/js/utils/rebuilder.js","type":"application/javascript"},"$:/plugins/flibbles/relink/Filters/Missing":{"title":"$:/plugins/flibbles/relink/Filters/Missing","description":"{{$:/plugins/flibbles/relink/language/Filters/Missing}}","filter":"[all[]!is[system]relink:references[]!is[tiddler]!is[shadow]!prefix[$:/tags/]sort[title]] -[[]]","tags":"$:/tags/Filter"},"$:/plugins/flibbles/relink/Filters/Orphans":{"title":"$:/plugins/flibbles/relink/Filters/Orphans","description":"{{$:/plugins/flibbles/relink/language/Filters/Orphans}}","filter":"[relink:orphans[]!is[system]sort[title]]","tags":"$:/tags/Filter"},"$:/config/flibbles/relink/attributes/$action-deletefield/$tiddler":{"title":"$:/config/flibbles/relink/attributes/$action-deletefield/$tiddler","text":"filter"},"$:/config/flibbles/relink/attributes/$action-deletetiddler/$filter":{"title":"$:/config/flibbles/relink/attributes/$action-deletetiddler/$filter","text":"filter"},"$:/config/flibbles/relink/attributes/$action-deletetiddler/$tiddler":{"title":"$:/config/flibbles/relink/attributes/$action-deletetiddler/$tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$action-listops/$filter":{"title":"$:/config/flibbles/relink/attributes/$action-listops/$filter","text":"filter"},"$:/config/flibbles/relink/attributes/$action-listops/$tiddler":{"title":"$:/config/flibbles/relink/attributes/$action-listops/$tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$action-log/$$filter":{"title":"$:/config/flibbles/relink/attributes/$action-log/$$filter","text":"filter"},"$:/config/flibbles/relink/attributes/$action-navigate/$to":{"title":"$:/config/flibbles/relink/attributes/$action-navigate/$to","text":"title"},"$:/config/flibbles/relink/attributes/$action-popup/$state":{"title":"$:/config/flibbles/relink/attributes/$action-popup/$state","text":"title"},"$:/config/flibbles/relink/attributes/$action-sendmessage/$names":{"title":"$:/config/flibbles/relink/attributes/$action-sendmessage/$names","text":"filter"},"$:/config/flibbles/relink/attributes/$action-sendmessage/$values":{"title":"$:/config/flibbles/relink/attributes/$action-sendmessage/$values","text":"filter"},"$:/config/flibbles/relink/attributes/$action-setfield/$tiddler":{"title":"$:/config/flibbles/relink/attributes/$action-setfield/$tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$tiddler":{"title":"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$fields":{"title":"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$fields","text":"filter"},"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$indexes":{"title":"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$indexes","text":"filter"},"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$values":{"title":"$:/config/flibbles/relink/attributes/$action-setmultiplefields/$values","text":"filter"},"$:/config/flibbles/relink/attributes/$button/actions":{"title":"$:/config/flibbles/relink/attributes/$button/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$button/set":{"title":"$:/config/flibbles/relink/attributes/$button/set","text":"reference"},"$:/config/flibbles/relink/attributes/$button/setTo":{"title":"$:/config/flibbles/relink/attributes/$button/setTo","text":"title"},"$:/config/flibbles/relink/attributes/$button/to":{"title":"$:/config/flibbles/relink/attributes/$button/to","text":"title"},"$:/config/flibbles/relink/attributes/$checkbox/actions":{"title":"$:/config/flibbles/relink/attributes/$checkbox/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$checkbox/checkactions":{"title":"$:/config/flibbles/relink/attributes/$checkbox/checkactions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$checkbox/tiddler":{"title":"$:/config/flibbles/relink/attributes/$checkbox/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$checkbox/tag":{"title":"$:/config/flibbles/relink/attributes/$checkbox/tag","text":"title"},"$:/config/flibbles/relink/attributes/$checkbox/uncheckactions":{"title":"$:/config/flibbles/relink/attributes/$checkbox/uncheckactions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$count/filter":{"title":"$:/config/flibbles/relink/attributes/$count/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$draggable/tiddler":{"title":"$:/config/flibbles/relink/attributes/$draggable/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$draggable/filter":{"title":"$:/config/flibbles/relink/attributes/$draggable/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$droppable/actions":{"title":"$:/config/flibbles/relink/attributes/$droppable/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$dropzone/actions":{"title":"$:/config/flibbles/relink/attributes/$dropzone/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$edit-bitmap/tiddler":{"title":"$:/config/flibbles/relink/attributes/$edit-bitmap/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$edit-text/tiddler":{"title":"$:/config/flibbles/relink/attributes/$edit-text/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$edit/inputActions":{"title":"$:/config/flibbles/relink/attributes/$edit/inputActions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$edit/refreshTitle":{"title":"$:/config/flibbles/relink/attributes/$edit/refreshTitle","text":"title"},"$:/config/flibbles/relink/attributes/$edit/tiddler":{"title":"$:/config/flibbles/relink/attributes/$edit/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$encrypt/filter":{"title":"$:/config/flibbles/relink/attributes/$encrypt/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$fieldmangler/tiddler":{"title":"$:/config/flibbles/relink/attributes/$fieldmangler/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$fields/tiddler":{"title":"$:/config/flibbles/relink/attributes/$fields/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$genesis/$names":{"title":"$:/config/flibbles/relink/attributes/$genesis/$names","text":"filter"},"$:/config/flibbles/relink/attributes/$genesis/$values":{"title":"$:/config/flibbles/relink/attributes/$genesis/$values","text":"filter"},"$:/config/flibbles/relink/attributes/$image/source":{"title":"$:/config/flibbles/relink/attributes/$image/source","text":"title"},"$:/config/flibbles/relink/attributes/$importvariables/filter":{"title":"$:/config/flibbles/relink/attributes/$importvariables/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$jsontiddler/tiddler":{"title":"$:/config/flibbles/relink/attributes/$jsontiddler/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$keyboard/actions":{"title":"$:/config/flibbles/relink/attributes/$keyboard/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$linkcatcher/to":{"title":"$:/config/flibbles/relink/attributes/$linkcatcher/to","text":"title"},"$:/config/flibbles/relink/attributes/$linkcatcher/set":{"title":"$:/config/flibbles/relink/attributes/$linkcatcher/set","text":"title"},"$:/config/flibbles/relink/attributes/$link/to":{"title":"$:/config/flibbles/relink/attributes/$link/to","text":"title"},"$:/config/flibbles/relink/attributes/$link/tooltip":{"title":"$:/config/flibbles/relink/attributes/$link/tooltip","text":"wikitext"},"$:/config/flibbles/relink/attributes/$linkcatcher/actions":{"title":"$:/config/flibbles/relink/attributes/$linkcatcher/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$list/filter":{"title":"$:/config/flibbles/relink/attributes/$list/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$list/template":{"title":"$:/config/flibbles/relink/attributes/$list/template","text":"title"},"$:/config/flibbles/relink/attributes/$list/editTemplate":{"title":"$:/config/flibbles/relink/attributes/$list/editTemplate","text":"title"},"$:/config/flibbles/relink/attributes/$list/emptyMessage":{"title":"$:/config/flibbles/relink/attributes/$list/emptyMessage","text":"wikitext"},"$:/config/flibbles/relink/attributes/$list/history":{"title":"$:/config/flibbles/relink/attributes/$list/history","text":"title"},"$:/config/flibbles/relink/attributes/$log/$$filter":{"title":"$:/config/flibbles/relink/attributes/$log/$$filter","text":"filter"},"$:/config/flibbles/relink/attributes/$messagecatcher/actions":{"title":"$:/config/flibbles/relink/attributes/$messagecatcher/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$navigator/story":{"title":"$:/config/flibbles/relink/attributes/$navigator/story","text":"title"},"$:/config/flibbles/relink/attributes/$navigator/history":{"title":"$:/config/flibbles/relink/attributes/$navigator/history","text":"title"},"$:/config/flibbles/relink/attributes/$radio/actions":{"title":"$:/config/flibbles/relink/attributes/$radio/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$radio/tiddler":{"title":"$:/config/flibbles/relink/attributes/$radio/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$range/actions":{"title":"$:/config/flibbles/relink/attributes/$range/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$range/actionsStart":{"title":"$:/config/flibbles/relink/attributes/$range/actionsStart","text":"wikitext"},"$:/config/flibbles/relink/attributes/$range/actionsStop":{"title":"$:/config/flibbles/relink/attributes/$range/actionsStop","text":"wikitext"},"$:/config/flibbles/relink/attributes/$range/tiddler":{"title":"$:/config/flibbles/relink/attributes/$range/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$reveal/state":{"title":"$:/config/flibbles/relink/attributes/$reveal/state","text":"reference"},"$:/config/flibbles/relink/attributes/$reveal/stateTitle":{"title":"$:/config/flibbles/relink/attributes/$reveal/stateTitle","text":"title"},"$:/config/flibbles/relink/attributes/$select/actions":{"title":"$:/config/flibbles/relink/attributes/$select/actions","text":"wikitext"},"$:/config/flibbles/relink/attributes/$select/tiddler":{"title":"$:/config/flibbles/relink/attributes/$select/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$setvariable/tiddler":{"title":"$:/config/flibbles/relink/attributes/$setvariable/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$setvariable/subtiddler":{"title":"$:/config/flibbles/relink/attributes/$setvariable/subtiddler","text":"title"},"$:/config/flibbles/relink/attributes/$setvariable/filter":{"title":"$:/config/flibbles/relink/attributes/$setvariable/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$set/tiddler":{"title":"$:/config/flibbles/relink/attributes/$set/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$set/subtiddler":{"title":"$:/config/flibbles/relink/attributes/$set/subtiddler","text":"title"},"$:/config/flibbles/relink/attributes/$set/filter":{"title":"$:/config/flibbles/relink/attributes/$set/filter","text":"filter"},"$:/config/flibbles/relink/attributes/$setmultiplevariables/$names":{"title":"$:/config/flibbles/relink/attributes/$setmultiplevariables/$names","text":"filter"},"$:/config/flibbles/relink/attributes/$setmultiplevariables/$values":{"title":"$:/config/flibbles/relink/attributes/$setmultiplevariables/$values","text":"filter"},"$:/config/flibbles/relink/attributes/$tiddler/tiddler":{"title":"$:/config/flibbles/relink/attributes/$tiddler/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$transclude/tiddler":{"title":"$:/config/flibbles/relink/attributes/$transclude/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$transclude/subtiddler":{"title":"$:/config/flibbles/relink/attributes/$transclude/subtiddler","text":"title"},"$:/config/flibbles/relink/attributes/$view/tiddler":{"title":"$:/config/flibbles/relink/attributes/$view/tiddler","text":"title"},"$:/config/flibbles/relink/attributes/$view/subtiddler":{"title":"$:/config/flibbles/relink/attributes/$view/subtiddler","text":"title"},"$:/config/flibbles/relink/attributes/$wikify/text":{"title":"$:/config/flibbles/relink/attributes/$wikify/text","text":"wikitext"},"$:/plugins/flibbles/relink/configuration":{"title":"$:/plugins/flibbles/relink/configuration","text":"\\whitespace trim\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/flibbles/relink/Configuration]!has[draft.of]]\" \"$:/plugins/flibbles/relink/ui/configuration/Fields\">>\n</div>\n"},"$:/config/flibbles/relink/fieldattributes/$action-createtiddler":{"title":"$:/config/flibbles/relink/fieldattributes/$action-createtiddler","text":"([^$].*)"},"$:/config/flibbles/relink/fieldattributes/$action-deletefield":{"title":"$:/config/flibbles/relink/fieldattributes/$action-deletefield","text":"([^$].*)"},"$:/config/flibbles/relink/fieldattributes/$action-setfield":{"title":"$:/config/flibbles/relink/fieldattributes/$action-setfield","text":"([^$].*)"},"$:/config/flibbles/relink/fieldattributes/$jsontiddler":{"title":"$:/config/flibbles/relink/fieldattributes/$jsontiddler","text":"\\$(.*)"},"$:/config/flibbles/relink/fields/caption":{"title":"$:/config/flibbles/relink/fields/caption","text":"wikitext"},"$:/config/flibbles/relink/fields/filter":{"title":"$:/config/flibbles/relink/fields/filter","text":"filter"},"$:/config/flibbles/relink/fields/list":{"title":"$:/config/flibbles/relink/fields/list","text":"list"},"$:/config/flibbles/relink/fields/list-after":{"title":"$:/config/flibbles/relink/fields/list-after","text":"title"},"$:/config/flibbles/relink/fields/list-before":{"title":"$:/config/flibbles/relink/fields/list-before","text":"title"},"$:/config/flibbles/relink/fields/tags":{"title":"$:/config/flibbles/relink/fields/tags","text":"list"},"$:/plugins/flibbles/relink/language/Buttons/Delete/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/Delete/Hint","text":"delete"},"$:/plugins/flibbles/relink/language/Buttons/LinkToInline/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/LinkToInline/Hint","text":"go to defining tiddler"},"$:/plugins/flibbles/relink/language/Buttons/NewAttribute/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewAttribute/Hint","text":"Specify a new widget/element attribute to be updated whenever a tiddler is renamed"},"$:/plugins/flibbles/relink/language/Buttons/NewAttribute/Caption":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewAttribute/Caption","text":"add"},"$:/plugins/flibbles/relink/language/Buttons/NewField/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewField/Hint","text":"Specify a new field to be updated whenever a tiddler is renamed"},"$:/plugins/flibbles/relink/language/Buttons/NewField/Caption":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewField/Caption","text":"add"},"$:/plugins/flibbles/relink/language/Buttons/NewOperator/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewOperator/Hint","text":"Specify a new filter operator to be considered whenever a tiddler is renamed"},"$:/plugins/flibbles/relink/language/Buttons/NewOperator/Caption":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewOperator/Caption","text":"add"},"$:/plugins/flibbles/relink/language/Buttons/NewParameter/Hint":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewParameter/Hint","text":"Specify a new macro parameter to be updated whenever a tiddler is renamed"},"$:/plugins/flibbles/relink/language/Buttons/NewParameter/Caption":{"title":"$:/plugins/flibbles/relink/language/Buttons/NewParameter/Caption","text":"add"},"$:/plugins/flibbles/relink/language/Error/InvalidAttributeName":{"title":"$:/plugins/flibbles/relink/language/Error/InvalidAttributeName","text":"Illegal characters in attribute name \"<$text text=<<attributeName>>/>\". Attributes cannot contain slashes ('/'), closing angle or square brackets ('>' or ']'), quotes or apostrophes ('\"' or \"'\"), equals ('='), or whitespace"},"$:/plugins/flibbles/relink/language/Error/InvalidElementName":{"title":"$:/plugins/flibbles/relink/language/Error/InvalidElementName","text":"Illegal characters in element/widget name \"<$text text=<<elementName>>/>\". Element tags can only contain letters and the characters hyphen (`-`) and dollar sign (`$`)"},"$:/plugins/flibbles/relink/language/Error/InvalidMacroName":{"title":"$:/plugins/flibbles/relink/language/Error/InvalidMacroName","text":"Illegal characters in macro name \"<$text text=<<macroName>>/>\". Macros cannot contain whitespace"},"$:/plugins/flibbles/relink/language/Error/InvalidParameterName":{"title":"$:/plugins/flibbles/relink/language/Error/InvalidParameterName","text":"Illegal characters in parameter name \"<$text text=<<parameterName>>/>\". Parameters can only contain letters, digits, and the characters underscore (`_`) and hyphen (`-`)"},"$:/plugins/flibbles/relink/language/Error/RelinkFilterOperator":{"title":"$:/plugins/flibbles/relink/language/Error/RelinkFilterOperator","text":"Filter Error: Unknown suffix for the 'relink' filter operator"},"$:/plugins/flibbles/relink/language/Error/ReportFailedRelinks":{"title":"$:/plugins/flibbles/relink/language/Error/ReportFailedRelinks","text":"Relink could not update '<<from>>' to '<<to>>' inside the following tiddlers:"},"$:/plugins/flibbles/relink/language/Error/UnrecognizedType":{"title":"$:/plugins/flibbles/relink/language/Error/UnrecognizedType","text":"Relink parse error: Unrecognized field type '<<type>>'"},"$:/plugins/flibbles/relink/language/Filters/Missing":{"title":"$:/plugins/flibbles/relink/language/Filters/Missing","text":"//Relink// Missing tiddlers"},"$:/plugins/flibbles/relink/language/Filters/Orphans":{"title":"$:/plugins/flibbles/relink/language/Filters/Orphans","text":"//Relink// Orphans tiddlers"},"$:/plugins/flibbles/relink/language/Help/Attributes":{"title":"$:/plugins/flibbles/relink/language/Help/Attributes","text":"See the <a href={{{[{$:/plugins/flibbles/relink!!demo}addsuffix[#Attributes]]}}} class=\"tc-tiddlylink-external\">Attributes documentation page</a> for details."},"$:/plugins/flibbles/relink/language/Help/Fields":{"title":"$:/plugins/flibbles/relink/language/Help/Fields","text":"See the <a href={{{[{$:/plugins/flibbles/relink!!demo}addsuffix[#Fields]]}}} class=\"tc-tiddlylink-external\">Fields documentation page</a> for details."},"$:/plugins/flibbles/relink/language/Help/Macros":{"title":"$:/plugins/flibbles/relink/language/Help/Macros","text":"See the <a href={{{[{$:/plugins/flibbles/relink!!demo}addsuffix[#Macros]]}}} class=\"tc-tiddlylink-external\">Macros documentation page</a> for details."},"$:/plugins/flibbles/relink/language/Help/Operators":{"title":"$:/plugins/flibbles/relink/language/Help/Operators","text":"See the <a href={{{[{$:/plugins/flibbles/relink!!demo}addsuffix[#Operators]]}}} class=\"tc-tiddlylink-external\">Operators documentation page</a> for details."},"$:/plugins/flibbles/relink/language/SideBar/Missing/Caption":{"title":"$:/plugins/flibbles/relink/language/SideBar/Missing/Caption","text":"//Relink//<br>Missing"},"$:/plugins/flibbles/relink/language/SideBar/Orphans/Caption":{"title":"$:/plugins/flibbles/relink/language/SideBar/Orphans/Caption","text":"//Relink//<br>Orphans"},"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Empty":{"title":"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Empty","text":"No tiddlers contain any fields, links, macros, transclusions, or widgets referencing this one"},"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Description":{"title":"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Description","text":"The following tiddlers contain fields, links, macros, transclusions, or widgets referencing this one:"},"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Caption":{"title":"$:/plugins/flibbles/relink/language/TiddlerInfo/References/Caption","text":"//Relink// References"},"$:/plugins/flibbles/relink/language/ui/Attributes/Caption":{"title":"$:/plugins/flibbles/relink/language/ui/Attributes/Caption","text":"Attributes"},"$:/plugins/flibbles/relink/language/ui/Fields/Caption":{"title":"$:/plugins/flibbles/relink/language/ui/Fields/Caption","text":"Fields"},"$:/plugins/flibbles/relink/language/ui/Macros/Caption":{"title":"$:/plugins/flibbles/relink/language/ui/Macros/Caption","text":"Macros"},"$:/plugins/flibbles/relink/language/ui/Operators/Caption":{"title":"$:/plugins/flibbles/relink/language/ui/Operators/Caption","text":"Operators"},"$:/plugins/flibbles/relink/language/Warning/OldRelinkTextOperator":{"title":"$:/plugins/flibbles/relink/language/Warning/OldRelinkTextOperator","text":"Relink cannot parse your <code>$$$<<keyword>></code> wikitext until you migrate your \"<<type>>\" relink module from the deprecated ''relinktextoperator'' module-type to ''relinktext''.<br><br>See <a href={{{ [[Versions/2.1.0]addprefix[#]addprefix{$:/plugins/flibbles/relink!!demo}encodeuri[]] }}} class=\"tc-tiddlylink-external\">the online documentation</a> for details."},"$:/plugins/flibbles/relink/license":{"title":"$:/plugins/flibbles/relink/license","type":"text/vnd.tiddlywiki","text":"<a href={{$:/plugins/flibbles/relink!!demo}} class=\"tc-tiddlylink-external\">Relink Plugin</a> Copyright (c) 2019-<<now YYYY>> Cameron Fischer\n\n[[BSD 3-Clause License|https://raw.githubusercontent.com/flibbles/tw5-relink/master/LICENSE]]\n"},"$:/config/flibbles/relink/macros/colour-picker/actions":{"title":"$:/config/flibbles/relink/macros/colour-picker/actions","text":"wikitext"},"$:/config/flibbles/relink/macros/csvtiddlers/filter":{"title":"$:/config/flibbles/relink/macros/csvtiddlers/filter","text":"filter"},"$:/config/flibbles/relink/macros/datauri/title":{"title":"$:/config/flibbles/relink/macros/datauri/title","text":"title"},"$:/config/flibbles/relink/macros/image-picker/actions":{"title":"$:/config/flibbles/relink/macros/image-picker/actions","text":"wikitext"},"$:/config/flibbles/relink/macros/jsontiddler/title":{"title":"$:/config/flibbles/relink/macros/jsontiddler/title","text":"title"},"$:/config/flibbles/relink/macros/jsontiddlers/filter":{"title":"$:/config/flibbles/relink/macros/jsontiddlers/filter","text":"filter"},"$:/config/flibbles/relink/macros/keyboard-driven-input/configTiddlerFilter":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/configTiddlerFilter","text":"filter"},"$:/config/flibbles/relink/macros/keyboard-driven-input/inputAcceptActions":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/inputAcceptActions","text":"wikitext"},"$:/config/flibbles/relink/macros/keyboard-driven-input/inputAcceptVariantActions":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/inputAcceptVariantActions","text":"wikitext"},"$:/config/flibbles/relink/macros/keyboard-driven-input/inputCancelActions":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/inputCancelActions","text":"wikitext"},"$:/config/flibbles/relink/macros/keyboard-driven-input/selectionStateTitle":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/selectionStateTitle","text":"title"},"$:/config/flibbles/relink/macros/keyboard-driven-input/storeTitle":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/storeTitle","text":"title"},"$:/config/flibbles/relink/macros/keyboard-driven-input/tiddler":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/tiddler","text":"title"},"$:/config/flibbles/relink/macros/list-links/filter":{"title":"$:/config/flibbles/relink/macros/list-links/filter","text":"filter"},"$:/config/flibbles/relink/macros/list-links/emptyMessage":{"title":"$:/config/flibbles/relink/macros/list-links/emptyMessage","text":"wikitext"},"$:/config/flibbles/relink/macros/list-links-draggable/tiddler":{"title":"$:/config/flibbles/relink/macros/list-links-draggable/tiddler","text":"title"},"$:/config/flibbles/relink/macros/list-links-draggable/itemTemplate":{"title":"$:/config/flibbles/relink/macros/list-links-draggable/itemTemplate","text":"title"},"$:/config/flibbles/relink/macros/list-tagged-draggable/tag":{"title":"$:/config/flibbles/relink/macros/list-tagged-draggable/tag","text":"title"},"$:/config/flibbles/relink/macros/list-tagged-draggable/emptyMessage":{"title":"$:/config/flibbles/relink/macros/list-tagged-draggable/emptyMessage","text":"wikitext"},"$:/config/flibbles/relink/macros/list-tagged-draggable/itemTemplate":{"title":"$:/config/flibbles/relink/macros/list-tagged-draggable/itemTemplate","text":"title"},"$:/config/flibbles/relink/macros/list-thumbnails/filter":{"title":"$:/config/flibbles/relink/macros/list-thumbnails/filter","text":"filter"},"$:/config/flibbles/relink/macros/tabs/actions":{"title":"$:/config/flibbles/relink/macros/tabs/actions","text":"wikitext"},"$:/config/flibbles/relink/macros/tabs/buttonTemplate":{"title":"$:/config/flibbles/relink/macros/tabs/buttonTemplate","text":"title"},"$:/config/flibbles/relink/macros/tabs/default":{"title":"$:/config/flibbles/relink/macros/tabs/default","text":"title"},"$:/config/flibbles/relink/macros/tabs/tabsList":{"title":"$:/config/flibbles/relink/macros/tabs/tabsList","text":"filter"},"$:/config/flibbles/relink/macros/tabs/template":{"title":"$:/config/flibbles/relink/macros/tabs/template","text":"title"},"$:/config/flibbles/relink/macros/tag/tag":{"title":"$:/config/flibbles/relink/macros/tag/tag","text":"title"},"$:/config/flibbles/relink/macros/tag-picker/actions":{"title":"$:/config/flibbles/relink/macros/tag-picker/actions","text":"wikitext"},"$:/config/flibbles/relink/macros/tag-pill/actions":{"title":"$:/config/flibbles/relink/macros/tag-pill/actions","text":"wikitext"},"$:/config/flibbles/relink/macros/tag-pill/tag":{"title":"$:/config/flibbles/relink/macros/tag-pill/tag","text":"title"},"$:/config/flibbles/relink/macros/toc/tag":{"title":"$:/config/flibbles/relink/macros/toc/tag","text":"title"},"$:/config/flibbles/relink/macros/toc/itemClassFilter":{"title":"$:/config/flibbles/relink/macros/toc/itemClassFilter","text":"filter"},"$:/config/flibbles/relink/macros/toc-expandable/tag":{"title":"$:/config/flibbles/relink/macros/toc-expandable/tag","text":"title"},"$:/config/flibbles/relink/macros/toc-expandable/itemClassFilter":{"title":"$:/config/flibbles/relink/macros/toc-expandable/itemClassFilter","text":"filter"},"$:/config/flibbles/relink/macros/toc-expandable/exclude":{"title":"$:/config/flibbles/relink/macros/toc-expandable/exclude","text":"list"},"$:/config/flibbles/relink/macros/toc-selective-expandable/tag":{"title":"$:/config/flibbles/relink/macros/toc-selective-expandable/tag","text":"title"},"$:/config/flibbles/relink/macros/toc-selective-expandable/itemClassFilter":{"title":"$:/config/flibbles/relink/macros/toc-selective-expandable/itemClassFilter","text":"filter"},"$:/config/flibbles/relink/macros/toc-selective-expandable/exclude":{"title":"$:/config/flibbles/relink/macros/toc-selective-expandable/exclude","text":"list"},"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/tag":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/tag","text":"title"},"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/selectedTiddler":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/selectedTiddler","text":"title"},"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/unselectedText":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/unselectedText","text":"wikitext"},"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/missingText":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/missingText","text":"wikitext"},"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/template":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-external-nav/template","text":"title"},"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/tag":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/tag","text":"title"},"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/selectedTiddler":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/selectedTiddler","text":"title"},"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/unselectedText":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/unselectedText","text":"wikitext"},"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/missingText":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/missingText","text":"wikitext"},"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/template":{"title":"$:/config/flibbles/relink/macros/toc-tabbed-internal-nav/template","text":"title"},"$:/config/flibbles/relink/operators/filter":{"title":"$:/config/flibbles/relink/operators/filter","text":"filter"},"$:/config/flibbles/relink/operators/list":{"title":"$:/config/flibbles/relink/operators/list","text":"reference"},"$:/config/flibbles/relink/operators/subfilter":{"title":"$:/config/flibbles/relink/operators/subfilter","text":"filter"},"$:/config/flibbles/relink/operators/tag":{"title":"$:/config/flibbles/relink/operators/tag","text":"title"},"$:/config/flibbles/relink/operators/title":{"title":"$:/config/flibbles/relink/operators/title","text":"title"},"$:/config/flibbles/relink/operators/field:title":{"title":"$:/config/flibbles/relink/operators/field:title","text":"title"},"$:/config/flibbles/relink/operators/relink:report":{"title":"$:/config/flibbles/relink/operators/relink:report","text":"title"},"$:/language/EditTemplate/Title/Impossibles/Prompt":{"title":"$:/language/EditTemplate/Title/Impossibles/Prompt","text":"''Warning:'' Not all references in the following tiddlers can be updated by //Relink// due to the complexity of the new title:"},"$:/language/EditTemplate/Title/References/Prompt":{"title":"$:/language/EditTemplate/Title/References/Prompt","text":"The following tiddlers will be updated if relinking:"},"$:/language/EditTemplate/Title/Relink/Prompt":{"title":"$:/language/EditTemplate/Title/Relink/Prompt","text":"Use //Relink// to update ''<$text text=<<fromTitle>>/>'' to ''<$text text=<<toTitle>>/>'' across all other tiddlers"},"$:/core/ui/EditTemplate/title":{"title":"$:/core/ui/EditTemplate/title","tags":"$:/tags/EditTemplate","text":"\\whitespace trim\n<$edit-text field=\"draft.title\" class=\"tc-titlebar tc-edit-texteditor\" focus=\"true\" tabindex={{$:/config/EditTabIndex}}/>\n\n<$reveal state=\"!!draft.title\" type=\"nomatch\" text={{!!draft.of}} tag=\"div\">\n\n<$vars pattern=\"\"\"[\\|\\[\\]{}]\"\"\" bad-chars=\"\"\"`| [ ] { }`\"\"\">\n\n<$list filter=\"[all[current]regexp:draft.title<pattern>]\" variable=\"listItem\">\n\n<div class=\"tc-message-box\">\n\n{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}}\n\n</div>\n\n</$list>\n\n</$vars>\n\n<$list filter=\"[{!!draft.title}!is[missing]]\" variable=\"listItem\">\n\n<div class=\"tc-message-box\">\n\n{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/Exists/Prompt}}\n\n</div>\n\n</$list>\n\n<$list filter=\"[{!!draft.of}!is[missing]]\" variable=\"listItem\">\n\n<$vars fromTitle={{!!draft.of}} toTitle={{!!draft.title}}>\n\n<$checkbox tiddler=\"$:/config/RelinkOnRename\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> {{$:/language/EditTemplate/Title/Relink/Prompt}}</$checkbox>\n\n<$tiddler tiddler=<<fromTitle>> >\n\n<$list filter=\"[relink:wouldchange<toTitle>limit[1]]\" variable=\"listItem\">\n\n<$vars stateTiddler=<<qualify \"$:/state/edit/references\">> >\n\n<$set\n\tname=\"prompt\"\n\tfilter=\"[relink:wouldchange<toTitle>relink:impossible<toTitle>]\"\n\tvalue=\"EditTemplate/Title/Impossibles/Prompt\"\n\temptyValue=\"EditTemplate/Title/References/Prompt\" >\n<$reveal type=\"nomatch\" state=<<stateTiddler>> text=\"show\">\n<$button set=<<stateTiddler>> setTo=\"show\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n \n<$macrocall $name=lingo title=<<prompt>> />\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<stateTiddler>> text=\"show\">\n<$button set=<<stateTiddler>> setTo=\"hide\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n \n<$macrocall $name=lingo title=<<prompt>> />\n</$button>\n</$reveal>\n</$set>\n\n<$reveal type=\"match\" state=<<stateTiddler>> text=\"show\">\n<$list variable=\"listItem\" filter=\"[relink:wouldchange<toTitle>!title[$:/StoryList]sort[title]]\" template=\"$:/plugins/flibbles/relink/ui/ListItemTemplate\">\n</$list>\n</$reveal>\n\n</$vars>\n\n</$list>\n\n</$tiddler>\n\n</$vars>\n\n</$list>\n\n</$reveal>\n"},"$:/config/flibbles/relink/PluginLibrary":{"title":"$:/config/flibbles/relink/PluginLibrary","caption":"//Relink// Library","url":"https://flibbles.github.io/tw5-relink/library/index.html","tags":"$:/tags/PluginLibrary","text":"The //Relink// library contains //Relink// as well as its supplemental plugins. It is maintained by Flibbles. See the [[github page|https://github.com/flibbles/tw5-relink]] for more information.\n"},"$:/plugins/flibbles/relink/readme":{"title":"$:/plugins/flibbles/relink/readme","type":"text/vnd.tiddlywiki","text":"When renaming a tiddler, Relink can update the fields, filters, and widgets\nof all other tiddlers. However, it works through whitelisting.\n\nIt's already configured to update tiddler titles for all core widgets, filters,\nand fields, but the whitelists can be customized for each of this in the\nconfiguration panel.\n\nSee <a href={{$:/plugins/flibbles/relink!!source}} class=\"tc-tiddlylink-external\">the tw5-relink website</a> for more details and examples.\n"},"$:/config/flibbles/relink/settings/default-type":{"title":"$:/config/flibbles/relink/settings/default-type","text":"title"},"$:/config/flibbles/relink/touch-modify":{"title":"$:/config/flibbles/relink/touch-modify","text":"yes"},"$:/config/DefaultColourMappings/relink-impossible":{"title":"$:/config/DefaultColourMappings/relink-impossible","text":"<<colour dirty-indicator>>"},"$:/language/Docs/PaletteColours/relink-impossible":{"title":"$:/language/Docs/PaletteColours/relink-impossible","text":"Relink link impossible"},"$:/plugins/flibbles/relink/ui/ListItemTemplate":{"title":"$:/plugins/flibbles/relink/ui/ListItemTemplate","text":"\\whitespace trim\n<$set\n\tname=\"classes\"\n\tfilter=\"[<listItem>relink:impossible<toTitle>]\"\n\tvalue=\"tc-menu-list-item tc-relink-impossible\"\n\temptyValue=\"tc-menu-list-item\">\n<div class=<<classes>>>\n<$link to=<<listItem>>><$text text=<<listItem>> /></$link>\n</div>\n</$set>\n"},"$:/plugins/flibbles/relink/ui/ListItemWithBlurbTemplate":{"title":"$:/plugins/flibbles/relink/ui/ListItemWithBlurbTemplate","text":"<div class=\"tc-menu-list-item\"><$link /></div>\n<$list variable=blurb filter=\"[<currentTiddler>relink:report<missingTiddler>]\"><div class=\"tc-relink-menu-missing-blurb\"><$text text=<<blurb>> /></div>\n"},"$:/plugins/flibbles/relink/ui/MissingTemplate":{"title":"$:/plugins/flibbles/relink/ui/MissingTemplate","text":"\\whitespace trim\n<$set name=\"missingTiddler\" value=<<currentTiddler>> >\n<div class=\"tc-tiddler-missing\">\n<$button popup=<<qualify \"$:/state/relink/popup/missing\">> class=\"tc-btn-invisible tc-missing-tiddler-label\">\n<$view field=\"title\" format=\"text\" />\n</$button>\n<$reveal state=<<qualify \"$:/state/relink/popup/missing\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n<hr>\n<$list filter=\"[all[current]relink:backreferences[]sort[title]]\" template=\"$:/plugins/flibbles/relink/ui/ListItemWithBlurbTemplate\"/>\n</div>\n</$reveal>\n</div>\n</$set>\n"},"$:/plugins/flibbles/relink/ui/MoreSideBar/Missing":{"title":"$:/plugins/flibbles/relink/ui/MoreSideBar/Missing","caption":"{{$:/plugins/flibbles/relink/language/SideBar/Missing/Caption}}","tags":"$:/tags/MoreSideBar","text":"<$list filter={{$:/plugins/flibbles/relink/Filters/Missing!!filter}} template=\"$:/plugins/flibbles/relink/ui/MissingTemplate\" />\n"},"$:/plugins/flibbles/relink/ui/MoreSideBar/Orphans":{"title":"$:/plugins/flibbles/relink/ui/MoreSideBar/Orphans","caption":"{{$:/plugins/flibbles/relink/language/SideBar/Orphans/Caption}}","tags":"$:/tags/MoreSideBar","text":"<$list filter={{$:/plugins/flibbles/relink/Filters/Orphans!!filter}} template=\"$:/core/ui/ListItemTemplate\" />\n"},"$:/plugins/flibbles/relink/ui/TiddlerInfo/References":{"title":"$:/plugins/flibbles/relink/ui/TiddlerInfo/References","caption":"{{$:/plugins/flibbles/relink/language/TiddlerInfo/References/Caption}}","tags":"$:/tags/TiddlerInfo","text":"\\define lingo-base() $:/plugins/flibbles/relink/language/TiddlerInfo/\n\\define filter() [all[current]relink:backreferences[]!title[$:/StoryList]!prefix[$:/temp/]sort[title]]\n\\whitespace trim\n<$list filter=\"[subfilter<filter>first[]]\">\n<<lingo References/Description>>\n</$list>\n<table class=\"tc-relink-references-table\">\n<tbody>\n<$list filter=<<filter>> emptyMessage=<<lingo References/Empty>> variable=\"listItem\" template=\"$:/plugins/flibbles/relink/ui/TiddlerInfo/ReferencesTemplate\" />\n</tbody>\n</table>\n"},"$:/plugins/flibbles/relink/ui/TiddlerInfo/ReferencesTemplate":{"title":"$:/plugins/flibbles/relink/ui/TiddlerInfo/ReferencesTemplate","text":"\\whitespace trim\n<tr class=\"tc-relink-references\">\n<td class=\"tc-relink-references-title\">\n<$link to=<<listItem>>/>\n</td>\n<td class=\"tc-relink-references-report\">\n<$list filter=\"[<listItem>relink:report<currentTiddler>]\">\n\n<$text text=<<currentTiddler>> />\n</$list>\n\n</td>\n</tr>\n"},"$:/plugins/flibbles/relink/ui/components/button-delete":{"title":"$:/plugins/flibbles/relink/ui/components/button-delete","text":"\\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/\n\\define prefix() $:/config/flibbles/relink/\n\\whitespace trim\n\n<$list\n\tfilter=\"[all[current]prefix<prefix>]\"\n\temptyMessage=\"<$link><$button class='tc-btn-invisible' tooltip={{$:/plugins/flibbles/relink/language/Buttons/LinkToInline/Hint}}>{{$:/core/images/link}}</$button></$link>\">\n<$button class=\"tc-btn-invisible\" tooltip={{$:/plugins/flibbles/relink/language/Buttons/Delete/Hint}}><$list filter=\"[all[current]is[tiddler]]\">\n<$action-deletetiddler $tiddler=<<currentTiddler>> />\n</$list><$list filter=\"[all[current]is[shadow]]\">\n<$action-setfield $tiddler=<<tiddlerName>> text=\"\" />\n</$list>\n{{$:/core/images/delete-button}}\n</$button>\n</$list>\n"},"$:/plugins/flibbles/relink/ui/components/select-fieldtype":{"title":"$:/plugins/flibbles/relink/ui/components/select-fieldtype","text":"\\define prefix() $:/config/flibbles/relink/\n\\whitespace trim\n\n<$vars type={{{ [<signature>relink:type[]] }}} >\n<$list filter=\"[all[current]prefix<prefix>]\" >\n<$select tiddler=<<currentTiddler>> >\n<$list variable=\"option\" filter=\"[relink:types[]]\">\n<option><$text text=<<option>> /></option>\n</$list>\n</$select>\n</$list><$list filter=\"[all[current]!prefix<prefix>]\">\n<$text text=<<type>> />\n</$list>\n</$vars>\n"},"$:/plugins/flibbles/relink/ui/components/tables":{"title":"$:/plugins/flibbles/relink/ui/components/tables","text":"\\define .make-table(title, plugin, default-table-state:yes)\n\\whitespace trim\n\n<$list variable=\"render\" filter=\"[relink:signatures<__plugin__>prefix<__category__>first[]]\">\n<$set name=\"table-state\" value=<<qualify \"\"\"$:/state/flibbles/relink/tables/$title$\"\"\">>>\n<tr><th class=\"tc-relink-header-plugin\" colspan=<<column-count>> >\n<$reveal type=\"nomatch\" state=<<table-state>> text=\"yes\" default=\"\"\"$default-table-state$\"\"\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<table-state>> setTo=\"yes\">\n{{$:/core/images/right-arrow}} $title$\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<table-state>> text=\"yes\" default=\"\"\"$default-table-state$\"\"\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<table-state>> setTo=\"no\">\n{{$:/core/images/down-arrow}} $title$\n</$button>\n</$reveal>\n</th></tr>\n<$list\n\tvariable=\"signature\"\n\tfilter=\"[relink:signatures<__plugin__>prefix<__category__>sort[]]\">\n<$vars key={{{ [<signature>removeprefix<__category__>removeprefix[/]] }}} >\n<$tiddler tiddler={{{[<signature>relink:source[]]}}} >\n<$reveal tag=\"tr\" type=\"match\" state=<<table-state>> text=\"yes\" default=\"\"\"$default-table-state$\"\"\">\n<$macrocall $name=<<__list-row-macro__>> signature=<<signature>> />\n<td class=\"tc-relink-column-type\">{{||$:/plugins/flibbles/relink/ui/components/select-fieldtype}}</td>\n<td class=\"tc-relink-column-delete\">{{||$:/plugins/flibbles/relink/ui/components/button-delete}}</td>\n</$reveal>\n</$tiddler>\n</$vars>\n</$list>\n</$set>\n</$list>\n\\end\n\n\\define tables(category, list-row-macro, header-list)\n\\whitespace trim\n<$vars\n\tcolumn-count={{{[enlist<__header-list__>] [[DeleteColumn]] +[count[]]}}}>\n<table class=\"tc-relink-whitelist\"><tbody>\n<tr>\n<$list variable=\"header\" filter=\"[enlist<__header-list__>butlast[]]\"><th><<header>></th></$list>\n<!-- We have the last column extend into the delete/link column, which is unlabeled. -->\n<th colspan=2><$text text={{{ [enlist<__header-list__>last[]] }}} /></th>\n</tr>\n<<.make-table Custom \"\" yes>>\n\n<$list\n\tfilter=\"[plugin-type[plugin]![$:/core]![$:/plugins/flibbles/relink]]\">\n<$set name=\"subtitle\" filter=\"[all[current]has[description]]\" value=\"''{{!!name}}'': <$text text={{!!description}}/>\" emptyValue=\"''{{!!name}}''\" >\n<$macrocall $name=\".make-table\" title=<<subtitle>> plugin=<<currentTiddler>> />\n</$set>\n</$list>\n<<.make-table Core \"$:/plugins/flibbles/relink\">>\n\n</tbody></table>\n</$vars>\n\\end\n"},"$:/plugins/flibbles/relink/ui/configuration/Attributes":{"title":"$:/plugins/flibbles/relink/ui/configuration/Attributes","caption":"{{$:/plugins/flibbles/relink/language/ui/Attributes/Caption}}","tags":"$:/tags/flibbles/relink/Configuration","text":"\\import $:/plugins/flibbles/relink/ui/components/tables\n\\define prefix-attr() $:/config/flibbles/relink/attributes/\n\\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/\n\\define element-name-tiddler() $:/state/flibbles/relink/element-name\n\\define attribute-name-tiddler() $:/state/flibbles/relink/attribute-name\n\n\\define row()\n\\whitespace trim\n<$set name='element'\n value={{{[<key>splitbefore[/]removesuffix[/]]}}}>\n<$set name=\"attribute\"\n value={{{[<key>removeprefix<element>removeprefix[/]]}}}>\n<td><$text text=<<element>> /></td>\n<td><$text text=<<attribute>> /></td>\n</$set></$set>\n\\end\n\\define body()\n\\whitespace trim\n\n<em class=\"tc-edit\">Add a new attribute:</em>\n \n<$edit-text\n\ttiddler=<<element-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"widget/element\" />\n \n<$edit-text\n\ttiddler=<<attribute-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"attribute\" />\n \n<$reveal type=\"nomatch\" text=\"\" state=<<element-name-tiddler>> >\n<$reveal type=\"nomatch\" text=\"\" state=<<attribute-name-tiddler>> >\n<$relinkmangler>\n<$button\n\ttooltip={{$(lingo-base)$NewAttribute/Hint}}\n\taria-label={{$(lingo-base)$NewAttribute/Caption}}>\n<$action-sendmessage\n\t$message=\"relink-add-attribute\"\n\telement={{$(element-name-tiddler)$}}\n\tattribute={{$(attribute-name-tiddler)$}} />\n<$action-deletetiddler $tiddler=<<attribute-name-tiddler>> />\n<$action-deletetiddler $tiddler=<<element-name-tiddler>> />\n<$text text={{$(lingo-base)$NewAttribute/Caption}}/>\n</$button>\n</$relinkmangler>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<attribute-name-tiddler>> >\n<$button>\n<$text text={{$(lingo-base)$NewAttribute/Caption}}/>\n</$button>\n</$reveal>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<element-name-tiddler>> >\n<$button>\n<$text text={{$(lingo-base)$NewAttribute/Caption}}/>\n</$button>\n</$reveal>\n<$macrocall\n\t$name=tables\n\tcategory=\"attributes\"\n\theader-list=\"[[Widget/HTML Element]] Attribute Type\"\n\tlist-row-macro=\"row\" />\n\\end\n\n{{$:/plugins/flibbles/relink/language/Help/Attributes}}\n\n<<body>>\n"},"$:/plugins/flibbles/relink/ui/configuration/Fields":{"title":"$:/plugins/flibbles/relink/ui/configuration/Fields","caption":"{{$:/plugins/flibbles/relink/language/ui/Fields/Caption}}","tags":"$:/tags/flibbles/relink/Configuration","text":"\\import $:/plugins/flibbles/relink/ui/components/tables\n\\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/\n\\define field-name-tiddler() $:/state/flibbles/relink/field-name\n\n\\define row()\n<td><$text text=<<key>> /></td>\n\\end\n\n\\define body()\n\\whitespace trim\n\n<em class='tc-edit'>Add a new field:</em>\n \n<$edit-text\n\ttiddler=<<field-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"field name\" />\n \n<$reveal type=\"nomatch\" text=\"\" state=<<field-name-tiddler>> >\n<$relinkmangler>\n<$button\n\ttooltip={{$(lingo-base)$NewField/Hint}}\n\taria-label={{$(lingo-base)$NewField/Caption}}>\n<$action-sendmessage\n\t$message=\"relink-add-field\"\n\tfield={{$(field-name-tiddler)$}} />\n<$action-deletetiddler $tiddler=<<field-name-tiddler>> />\n<$text text={{$(lingo-base)$NewField/Caption}}/>\n</$button>\n</$relinkmangler>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<field-name-tiddler>> >\n<$button>\n<$text text={{$(lingo-base)$NewField/Caption}}/>\n</$button>\n</$reveal>\n<$macrocall\n\t$name=tables\n\tcategory=\"fields\"\n\theader-list=\"[[Field Name]] [[Field Type]]\"\n\tlist-row-macro=\"row\" />\n\\end\n\n{{$:/plugins/flibbles/relink/language/Help/Fields}}\n\n<<body>>\n"},"$:/plugins/flibbles/relink/ui/configuration/Macros":{"title":"$:/plugins/flibbles/relink/ui/configuration/Macros","caption":"{{$:/plugins/flibbles/relink/language/ui/Macros/Caption}}","tags":"$:/tags/flibbles/relink/Configuration","text":"\\import $:/plugins/flibbles/relink/ui/components/tables\n\\define prefix-macro() $:/config/flibbles/relink/macros/\n\\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/\n\\define macro-name-tiddler() $:/state/flibbles/relink/macro-name\n\\define parameter-name-tiddler() $:/state/flibbles/relink/parameter-name\n\n\\define row()\n\\whitespace trim\n<$set name=\"parameter\"\n value={{{[<key>relink:splitafter[/]]}}}>\n<$set name='macro'\n value={{{[<key>removesuffix<parameter>removesuffix[/]]}}}>\n<td><$text text=<<macro>> /></td>\n<td><$text text=<<parameter>> /></td>\n</$set></$set>\n\\end\n\n\\define body()\n\\whitespace trim\n\n<em class=\"tc-edit\">Add a new macro parameter:</em>\n \n<$edit-text\n\ttiddler=<<macro-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"macro\" />\n \n<$edit-text\n\ttiddler=<<parameter-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"parameter\" />\n \n<$reveal type=\"nomatch\" text=\"\" state=<<macro-name-tiddler>> >\n<$reveal type=\"nomatch\" text=\"\" state=<<parameter-name-tiddler>> >\n<$relinkmangler>\n<$button\n\ttooltip={{$(lingo-base)$NewParameter/Hint}}\n\taria-label={{$(lingo-base)$NewParameter/Caption}}>\n<$action-sendmessage\n\t$message=\"relink-add-parameter\"\n\tmacro={{$(macro-name-tiddler)$}}\n\tparameter={{$(parameter-name-tiddler)$}} />\n<$action-deletetiddler $tiddler=<<parameter-name-tiddler>> />\n<$action-deletetiddler $tiddler=<<macro-name-tiddler>> />\n<$text text={{$(lingo-base)$NewParameter/Caption}}/>\n</$button>\n</$relinkmangler>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<parameter-name-tiddler>> >\n<$button>\n<$text text={{$(lingo-base)$NewParameter/Caption}}/>\n</$button>\n</$reveal>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<macro-name-tiddler>> >\n<$button>\n<$text text={{$(lingo-base)$NewParameter/Caption}}/>\n</$button>\n</$reveal>\n<$macrocall\n\t$name=tables\n\tcategory=\"macros\"\n\theader-list=\"Macro Parameter Type\"\n\tlist-row-macro=\"row\" />\n\\end\n\n{{$:/plugins/flibbles/relink/language/Help/Macros}}\n\n<<body>>\n"},"$:/plugins/flibbles/relink/ui/configuration/Operators":{"title":"$:/plugins/flibbles/relink/ui/configuration/Operators","caption":"{{$:/plugins/flibbles/relink/language/ui/Operators/Caption}}","tags":"$:/tags/flibbles/relink/Configuration","text":"\\import $:/plugins/flibbles/relink/ui/components/tables\n\\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/\n\\define operator-name-tiddler() $:/state/flibbles/relink/operator-name\n\n\\define row()\n<td><$text text=<<key>> /></td>\n\\end\n\n\\define body()\n\\whitespace trim\n\n<em class='tc-edit'>Add a new filter operator:</em>\n \n<$edit-text\n\ttiddler=<<operator-name-tiddler>>\n\ttag=\"input\"\n\tdefault=\"\"\n\tplaceholder=\"operator name\" />\n \n<$reveal type=\"nomatch\" text=\"\" state=<<operator-name-tiddler>>>\n<$relinkmangler>\n<$button\n\ttooltip={{$(lingo-base)$NewOperator/Hint}}\n\taria-label={{$(lingo-base)$NewOperator/Caption}}>\n<$action-sendmessage\n\t$message=\"relink-add-operator\"\n\toperator={{$(operator-name-tiddler)$}} />\n<$action-deletetiddler $tiddler=<<operator-name-tiddler>> />\n<$text text={{$(lingo-base)$NewOperator/Caption}}/>\n</$button>\n</$relinkmangler>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=<<operator-name-tiddler>>>\n<$button>\n<$text text={{$(lingo-base)$NewOperator/Caption}}/>\n</$button>\n</$reveal>\n<$macrocall\n\t$name=tables\n\tcategory=\"operators\"\n\theader-list=\"[[Filter Operator]] [[Operand Type]]\"\n\tlist-row-macro=\"row\" />\n\\end\n\n{{$:/plugins/flibbles/relink/language/Help/Operators}}\n\n<<body>>\n"},"$:/plugins/flibbles/relink/ui/stylesheet.css":{"title":"$:/plugins/flibbles/relink/ui/stylesheet.css","tags":"$:/tags/Stylesheet","text":".tc-relink-references {\n}\n\n.tc-relink-references-table {\n\twidth: 100%;\n\tborder: none;\n}\n\n.tc-relink-references-table td {\n\tborder-left: none;\n}\n\n.tc-relink-references-table tr:first-child td {\n\tborder-top: none;\n}\n\n.tc-relink-references-title {\n\ttext-align: left;\n\tvertical-align: top;\n}\n\n.tc-relink-references-occurrence {\n\tfont-style: italic;\n\ttext-align: left;\n\tfont-weight: 200;\n\tpadding-left: 25px;\n\tvertical-align: top;\n}\n\n.tc-relink-header-plugin {\n\ttext-align: left;\n}\n\n.tc-relink-header-plugin button {\n\twidth: 100%\n}\n\n.tc-relink-column-type {\n\twidth: 8em;\n}\n\n.tc-relink-column-type select {\n\twidth: 100%;\n}\n\n.tc-relink-column-delete {\n\tborder-left: none;\n\ttext-align: left;\n}\n\n.tc-relink-column-delete button {\n\tpadding-left: 1em;\n}\n\n.tc-relink-impossible a.tc-tiddlylink {\n\tcolor: <<colour relink-impossible>>;\n}\n\n.tc-relink-menu-missing-blurb {\n\tmargin-left: 30pt;\n}\n"}}}
{"tiddlers":{"$:/plugins/kookma/shiraz/history":{"title":"$:/plugins/kookma/shiraz/history","created":"20210225163850252","modified":"20220802180108923","tags":"","type":"text/vnd.tiddlywiki","text":"Full change log: [[https://kookma.github.io/TW-Shiraz/#ChangeLog]]\n\n* ''2.5.0'' -- 2022.08.02 -- new data block, updated to Tiddlywiki 5.2.3\n* ''2.4.4'' -- 2021.09.19 -- added css class for tbl-expand customization\n* ''2.4.2'' -- 2021.09.10 -- quick table with bunch of column formatting\n* ''2.3.3'' -- 2021.05.20 -- small bug fixes in switch palette\n* ''2.3.1'' -- 2021.05.19 -- tbl-linktype template to be used for generating node-explorer\n* ''2.3.0'' -- 2021.05.10 -- switch palette for dim/dark and light palette selection\n* ''2.2.2'' -- 2021.04.22 -- several issues fixed for pagination, notebook and image classes\n* ''2.2.0'' -- 2021.02.26 -- updated to TW 5.1.23 and pagination added to dynamic tables\n* ''2.1.1'' -- 2020.03.25 -- slider macro with initial status\n* ''2.1.0'' -- 2020.03.23 -- stable release on TW-5.1.22pre\n* ''1.0.0'' -- 2018.10.05 -- first public release\n"},"$:/plugins/kookma/shiraz/images/palette-switch":{"title":"$:/plugins/kookma/shiraz/images/palette-switch","created":"20210510155317562","modified":"20210808052511840","tags":"","type":"text/vnd.tiddlywiki","text":"<svg width=\"22pt\" height=\"22pt\" class=\"tc-image-palette-button tc-image-button\" viewBox=\"0 0 16 16\"><path d=\"M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z\"/></svg>"},"$:/plugins/kookma/shiraz/license":{"title":"$:/plugins/kookma/shiraz/license","created":"20210225163850253","modified":"20220726105824045","tags":"","type":"text/vnd.tiddlywiki","text":"Distributed under an MIT license.\n\nCopyright (c) 2018-2022 [[Mohammad Rahmani|https://github.com/kookma]]\n\n<<<\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n<<<"},"$:/plugins/kookma/shiraz/macros/alerts":{"title":"$:/plugins/kookma/shiraz/macros/alerts","created":"20180821095049685","modified":"20210808052511127","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define alert(type:\"primary\" src:\"\", width:\"100%\", class:\"\")\n<div class=\"alert alert-$type$ $class$\" style=\"width:$width$;\">\n$src$\n</div>\n\\end\n\n\\define alert-leftbar(type:\"primary\" src:\"\", width:\"100%\", class:\"\")\n<div class=\"alert alert-$type$ bg-transparent leftbar border-$type$ $class$\" style=\"width:$width$;\">\n$src$\n</div>\n\\end\n"},"$:/plugins/kookma/shiraz/macros/badge":{"title":"$:/plugins/kookma/shiraz/macros/badge","created":"20181124042103310","modified":"20210808052511132","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define badge(type:\"primary\" src:\"\")\n<span class=\"badge badge-$type$\">$src$</span>\n\\end\n\n\\define badge-pill(type:\"primary\" src:\"\")\n<span class=\"badge badge-pill badge-$type$\">$src$</span>\n\\end\n"},"$:/plugins/kookma/shiraz/macros/card":{"title":"$:/plugins/kookma/shiraz/macros/card","created":"20181124111624466","modified":"20210808052511138","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define card(header:\"Empty\", title:\"Empty\" subtitle:\"Empty\" text:\"Empty\",footer:\"Empty\", width:\"100%\" class:\"\")\n<div class=\"card mb-3 $class$\" style=\"width:$width$;\">\n<$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__header__>> >\n <div class=\"card-header\">$header$</div>\n</$reveal>\n<div class=\"card-body\">\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__title__>> >\n <div class=\"h5 card-title\">$title$</div>\n </$reveal>\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__subtitle__>> >\n <div class=\"h6 card-subtitle mb-2 text-muted\">$subtitle$</div>\n </$reveal>\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__text__>> >\n <div class=\"card-text\"><<__text__>></div>\n </$reveal>\n</div>\n<$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__footer__>> >\n <div class=\"card-footer text-muted\">$footer$</div>\n</$reveal>\n</div>\n\\end"},"$:/plugins/kookma/shiraz/macros/csvtables/apps":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/apps","created":"20210913061439446","modified":"20210914163550428","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define nomenclature(id:nomenclature)\n<<table-csv id:\"$id$\" format:\"katex-inline transclude pu\" class:\"table-borderless\" header:no>>\n\\end\n\n\\define mathbox(id:\"\", format:\"\", delimiter:\",\")\n<<table-csv id:\"$id$\" format:\"transclude katex $format$\" class:\"table-borderless table-mathbox\" header:no delimiter:\"\"\"$delimiter$\"\"\">>\n\\end\n\n\n<!-- \n- these macros uses the table-csv to display nice looking outputs\n- apps means application\n-->"},"$:/plugins/kookma/shiraz/macros/csvtables/formats-basic":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/formats-basic","created":"20210910071657253","modified":"20210910081659382","tags":"","type":"text/vnd.tiddlywiki","text":"\\define text() <$text text=<<entry>> />\n\\define code() <code><<text>></code>\n\\define transclude() <$transclude tiddler=<<entry>> field=title/>\n\n\n<!-- these macro are used by table-csv to display entries -->"},"$:/plugins/kookma/shiraz/macros/csvtables/formats-date":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/formats-date","created":"20210910072339252","modified":"20210910081720853","tags":"","type":"text/vnd.tiddlywiki","text":"\\define date() <$view field=title tiddler={{{[<entry>splitregexp[\\D+]!is[blank]join[]]}}} format=date template=\"YYYY-0MM-0DD\"/>\n\\define shortdate() <$view field=title tiddler={{{[<entry>splitregexp[\\D+]!is[blank]join[]]}}} format=date template=\"mmm DDth, YYYY\"/>\n\\define longdate() <$view field=title tiddler={{{[<entry>splitregexp[\\D+]!is[blank]join[]]}}} format=date template=\"DDD, MMM 0DD, YYYY\"/>\n\n<!-- these macro are used by table-csv to display entries -->"},"$:/plugins/kookma/shiraz/macros/csvtables/formats-math":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/formats-math","created":"20210913061042429","modified":"20220722160253916","tags":"","type":"text/vnd.tiddlywiki","text":"\\define katex() <span class=\"falign\"><$latex text=<<entry>> displayMode=\"true\"></$latex></span>\n\\define katex-inline() <$latex text=<<entry>> displayMode=\"false\"></$latex>\n\\define pu() <$latex text={{{ [<entry>addprefix[\\pu{]addsuffix[}]] }}} displayMode=\"false\"></$latex>\n\\define equation() <$latex text={{{ [<entry>addprefix[\\begin{equation}]addsuffix[\\end{equation}]] }}} displayMode=\"true\"></$latex>\n\n<!-- \n- these macros are used by table-csv to display entries KaTeX\n- pu stands for physical uints\n- the math formating require the official KaTeX plugin is installed!\n- see $:/plugins/kookma/shiraz/styles/csvtable-katex\n-->"},"$:/plugins/kookma/shiraz/macros/csvtables/formats-misc":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/formats-misc","created":"20210910072420649","modified":"20210913204706883","tags":"","type":"text/vnd.tiddlywiki","text":"\\define email() <a class=\"tc-tiddlylink-external\" href=\"mailto:$(entry)$\" rel=\"noopener noreferrer\" target=\"_blank\"><<text>></a>\n\n\\define rate()\n<$list filter=\"[<entry>split[]match[*]]\" variable=ignore>\n<span class=\"shiraz-star\"><$transclude tiddler=\"$:/core/images/star-filled\" /></span>\n</$list>\n\\end\n\n<!-- these macro are used by table-csv to display entries -->"},"$:/plugins/kookma/shiraz/macros/csvtables/formats-task":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/formats-task","created":"20210910071727034","modified":"20220724122008067","tags":"","type":"text/vnd.tiddlywiki","text":"\\define checkbox()\n<!-- show done item -->\n<$list filter=\"[<entry>trim[]match[x]]\" variable=ignore><input type=checkbox checked disabled/></$list>\n<!-- show task item -->\n<$list filter=\"[<entry>trim[]match[-]]\" variable=ignore><input type=checkbox disabled/></$list>\n\\end\n\n\n\\define todo-action(param)\n<!-- toggle a line done (x) / undone (-) . the lbr is used to prevent replace \"x, Hi\" with \"x, Hi Jeremy\"-->\n<$vars lbr=\"\n\">\n <$vars in={{{ [<row>addsuffix<lbr>] }}} out={{{[<row>splitregexp<delimiter>rest[]join[,]addprefix[$param$,]addsuffix<lbr>]}}} >\n <$action-setfield $tiddler=<<src>> text={{{ [<src>get[text]search-replace:g:<in>,<out>] }}}/>\n </$vars>\n</$vars>\t\n\\end\n\n\\define todo()\n<!-- show task item -->\n<$list filter=\"[<entry>trim[]match[-]]\" variable=ignore>\n<$button class=\"tc-btn-invisible\" actions=<<todo-action \"x\">>><input type=checkbox/></$button>\n</$list>\n<!-- show done item -->\n<$list filter=\"[<entry>trim[]match[x]]\" variable=ignore>\n<$button class=\"tc-btn-invisible\" actions=<<todo-action \"-\">>><input type=checkbox checked/></$button>\n</$list>\n\n\\end\n\n<!-- these macro are used by table-csv to display entries -->"},"$:/plugins/kookma/shiraz/macros/csvtables/table-csv":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/table-csv","created":"20210806160408697","modified":"20220725145558979","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define table-csv(tiddler:\"\", delimiter:\",\", sortType:\"alphanumeric\", format:\"\", caption:\"\", class:\"\", header:\"yes\", stateTiddler:\"\", id:\"\", dclass:\"dblock\" )\n\\whitespace trim\n\\import [[$:/plugins/kookma/shiraz/macros/csvtables/table-csv-utility]]\n\\import [all[tiddlers+shadows]prefix[$:/plugins/kookma/shiraz/macros/csvtables/formats]]\n\n<$vars src = {{{ [<__tiddler__>is[tiddler]then<__tiddler__>else<currentTiddler>] }}} \n stateTiddler = {{{ [<__stateTiddler__>!is[blank]then<__stateTiddler__>else[01]] }}} >\n<$vars sortCol = {{{ [<tempTableSort>getindex[sortIndex]] }}} \n sortNegate = {{{ [<tempTableSort>getindex[negate]] }}} \n delimiter = {{{ [<__delimiter__>match[\\t]then[°≡°]else<__delimiter__>] }}}\n dataBlockStartDelimiter ={{{ [<__id__>is[blank]then[@@.$dclass$]] ~[[@.$dclass$.]addsuffix<__id__>] }}}\n dataBlockEndDelimiter = \"@@\" >\n\n<!-- extract the data block -->\n<$let dblock0 = {{{ [<src>get[text]splitregexp<dataBlockStartDelimiter>butfirst[1]] }}}\n dblock1 = {{{ [<dblock0>splitregexp<dataBlockEndDelimiter>butlast[1]] }}}\n dblock = {{{ [<delimiter>!match[°≡°]then<dblock1>] :else[<dblock1>search-replace:g:regexp[\\t],[°≡°]] }}} >\n\n<!-- create table -->\n<table class=\"$class$\">\n<$list filter=\"[<__caption__>!is[blank]]\" variable=ignorw><caption>$caption$</caption></$list>\n<!--check if there is a header row-->\n<$list filter=\"[<__header__>match[yes]then[1]else[0]]\" variable=header_row>\n<!-- process all extracted rows-->\n<$vars allRows=\"[<dblock>splitregexp[\\n]!is[blank]]\">\n<!--create table header-->\n<$list filter=\"[subfilter<allRows>first<header_row>]\" variable=row >\n<tr><$list filter=\"[<row>splitregexp<delimiter>!is[blank]trim[]]\" variable=currentColumn><<column-header-template>></$list></tr>\n</$list>\n<!--create table body-->\n<$vars sortPos = {{{ [subfilter<allRows>first<header_row>splitregexp<delimiter>!is[blank]trim[]] +[allbefore:include<sortCol>count[]] }}} >\n<$vars sortType = {{{ [enlist:raw<__sortType__>nth<sortPos>else[alphanumeric]] }}} >\n<$list filter=<<mainFilter>> variable=row><!-- parse all other rows -->\n<tr><$list filter=\"[<row>splitregexp<delimiter>!is[blank]trim[]]\" variable=entry counter=pos>\n<td><$macrocall $name={{{ [enlist:raw<__format__>nth<pos>else[text]] }}} /></td>\n</$list></tr>\n</$list><!-- end of parse all other rows -->\n</$vars>\n</$vars><!-- sorPs-->\n</$vars> <!-- end of process all extracted rows-->\n</$list><!-- end of check header -->\n</table>\n\n</$let><!-- dblock0-->\n</$vars><!-- sortCol-->\n</$vars>\n\\end\n\n<!--\n- the default format is text, if format is not set for any column\n- the default sort type is alphanumeric, if the sort type is not sent \n- tab delimited data cannot be processed as enlist list them as sparate title on tab and do not keep them as a single row, so befor processing the \\tab is replaced with a rarely used combination like `°≡°`\n- leading and trailing blanks (spaces) are always trimmed\n- when use column header, you cannot have two column with the same header, this causes problem with sort routine\n-->"},"$:/plugins/kookma/shiraz/macros/csvtables/table-csv-utility":{"title":"$:/plugins/kookma/shiraz/macros/csvtables/table-csv-utility","created":"20210806160339977","modified":"20220724180943956","tags":"","type":"text/vnd.tiddlywiki","text":"\\whitespace trim\n\n\\define mainFilter() [subfilter<allRows>butfirst<header_row>] :sort:$(sortType)$:$(sortNegate)$[split<delimiter>!is[blank]trim[]nth<sortPos>]\n\\define tempTableSort() $:/state/tablecsv/$(currentTiddler)$/$(stateTiddler)$\n\n\n\\define column-header-template()\n<$reveal type=\"nomatch\" stateTitle=<<tempTableSort>> stateIndex=\"sortIndex\" text=<<currentColumn>> tag=\"th\">\n<$button setTitle=<<tempTableSort>> setIndex=\"sortIndex\" setTo=<<currentColumn>> class=\"tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"hasnegate\" $value=\"false\"/>\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span>\n</$button>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableSort>> stateIndex=\"sortIndex\" text=<<currentColumn>> tag=\"th\">\n<$list filter=\"[<tempTableSort>getindex[hasnegate]match[false]]\" variable=ignore><!--set negate for sort-->\n<$button setTitle=<<tempTableSort>> setIndex=\"hasnegate\" setTo=\"true\" class=\"tbl-sort-svg tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"reverse\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span> {{$:/core/images/down-arrow}}\n</$button>\n</$list>\n<$list filter=\"[<tempTableSort>getindex[hasnegate]match[true]]\" variable=ignore><!--remove negate for sort-->\n<$button setTitle=<<tempTableSort>> setIndex=\"hasnegate\" setTo=\"false\" class=\"tbl-sort-svg tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span> {{$:/core/images/up-arrow}}\n</$button>\n</$list>\n</$reveal>\n\\end\n\n<!-- these macro are used by table-csv to display entries -->"},"$:/plugins/kookma/shiraz/macros/dbadge":{"title":"$:/plugins/kookma/shiraz/macros/dbadge","created":"20181203212737578","modified":"20210808052511146","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define dbadge(subject,status, type:\"primary\")\n<div class=\"dbadge\"><span class=\"dbadge-subject\">$subject$</span><span class=\"dbadge-status dbadge-$type$ \">$status$</span></div>\n\\end\n"},"$:/plugins/kookma/shiraz/macros/details":{"title":"$:/plugins/kookma/shiraz/macros/details","created":"20181101185833098","modified":"20210808052511151","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define details(label:\"\", src:\"source\", status:\"\", labelClass:\"\", srcClass:\"\")\n<$vars source = {{{ [<__src__>get[text]else<__src__>] }}} >\n<details $status$>\n <summary class=\"$labelClass$\">$label$</summary>\n <div class=\"$srcClass$\">\n\t\n <<source>>\n </div>\n</details>\n</$vars>\n\\end"},"$:/plugins/kookma/shiraz/macros/dtables/confirm-delete":{"title":"$:/plugins/kookma/shiraz/macros/dtables/confirm-delete","created":"20191129201531051","modified":"20210808052511159","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define confirm-delete()\n<!-- reveals deletion confirmation -->\n<$list filter=\"[subfilter<inputFilter>limit[1]]\" variable=ignore>\n<$reveal class=\"tbl-delete-confirm\" type=\"match\" state=\"$:/temp/tables/delete-all!!text\" text=<<currentTable>> tag=\"tr\">\n<th colspan=<<ncols>> >\n<$list filter=\"[[$:/temp/tables/delete-all]get[confirm]match[yes]]\" \n variable=ignore emptyMessage=<<ask-for-delete>> >\n <<perform-delete>>\n</$list>\n</th>\n</$reveal>\n</$list>\n\\end\n\n\\define ask-for-delete()\n<$set name=ntids filter=\"[subfilter<inputFilter>count[]]\">\n Delete all <<ntids>> records?\n\t<$button class=\"tc-btn-invisible\">\n <$action-setfield $tiddler=\"$:/temp/tables/delete-all\" $field=\"confirm\" $value=\"yes\"/>\n {{$:/core/images/delete-button}} yes\n </$button> or \n <$button class=\"tc-btn-invisible\">\n <$action-deletetiddler $tiddler=\"$:/temp/tables/delete-all\"/>\n {{$:/core/images/close-button}} no\n </$button>\n</$set>\t\t\t\t\n\\end\n\n\\define perform-delete()\n Warning! this action cannot be undone!\n\t<$button class=\"tc-btn-invisible\">\n <$action-deletetiddler $tiddler=\"$:/temp/tables/delete-all\"/>\n <$list filter=<<inputFilter>> variable=\"currentRecord\">\n <$action-deletetiddler $tiddler=<<currentRecord>>/>\n </$list>\n\t\t {{$:/core/images/delete-button}} delete\n </$button> or \n <$button class=\"tc-btn-invisible\">\n <$action-deletetiddler $tiddler=\"$:/temp/tables/delete-all\"/>\n\t\t\t{{$:/core/images/close-button}} cancel \n </$button>\n\\end"},"$:/plugins/kookma/shiraz/macros/dtables/helper":{"title":"$:/plugins/kookma/shiraz/macros/dtables/helper","created":"20191203102929722","modified":"20210808052511172","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define columnFilter() $(columns)$ tbl-clone tbl-delete\n\n\\define tempTable() $:/state/dynamictables/$(currentTable)$\n\n\\define tempTableSort() $(tempTable)$/sortby\n\\define tempTagPopup() $(tempTable)$/$(currentRecord)$/$(currentTiddler)$\n\\define tempTableExpand() $(tempTable)$/expand\n\\define tempPathExpand() $(tempTableExpand)$##$(currentRecord)$\n\\define tempTableEdit() $(tempTable)$/edit-view-status\n\n\\define keepstate() $:/keepstate/dynamictables/$(currentTable)$\n\n\\define tempTableFooter() $(keepstate)$/footer\n\\define tempTableStyle() $(keepstate)$/style\n\\define tempWarningMsg() $(keepstate)$/warning\n\n\\define pageStateTiddler() $(keepstate)$/page-number\n\\define entryPerPageStateTiddler() $(keepstate)$/entry-per-page\n\n<!-- \n Those tiddlers based on keepstate are permanent.\n These are tiddlers hold the data and setting for footer, styles and warning (needs to be hold).\n These state and temporary tiddlers are independent of currentTiddler (host tiddler) and on changing\n the title of host tiddler will not disconnected to table\n-->"},"$:/plugins/kookma/shiraz/macros/dtables/maths":{"title":"$:/plugins/kookma/shiraz/macros/dtables/maths","created":"20200209153246553","modified":"20210808073255865","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define average(pn:0) <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>average[]] }}}/>\n\\define median(pn:0) <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>median[]] }}}/>\n\n\\define count() <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>count[]] }}}/>\n\\define sum() <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>sum[]] }}}/>\n\\define product() <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>product[]] }}}/>\n\n\\define minall() <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>minall[]] }}}/>\n\\define maxall() <$text text={{{ [subfilter<inputFilter>$(getFieldOrIndex)$<currentColumn>maxall[]] }}}/>\n\n\n\n\n\n"},"$:/plugins/kookma/shiraz/macros/dtables/pagination":{"title":"$:/plugins/kookma/shiraz/macros/dtables/pagination","created":"20210224180410216","modified":"20210808052511185","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define prev-button()\n<!-- create previous page button --->\n<$list filter=\"[<page-number>compare:number:lt[2]then[yes]else[no]]\" variable=state>\n<$button disabled=<<state>> class=\"shiraz-dtable-page-prev tc-btn-invisible\">\n{{$:/core/images/chevron-left}} <strong>Prev</strong>\n<$action-listops $tiddler=<<pageStateTiddler>> $field=text $subfilter=\"+[subtract[1]] ~[[1]]\"/>\n</$button>\n</$list>\n\\end\n\n\\define next-button()\n<!-- create next page button --->\n<$list filter=\"[<high>compare:number:gteq<total-entries>then[yes]else[no]]\" variable=state> \n<$button disabled=<<state>> class=\"shiraz-dtable-page-next tc-btn-invisible\">\n<strong>Next</strong> {{$:/core/images/chevron-right}} \n<$action-listops $tiddler=<<pageStateTiddler>> $field=text $subfilter=\"+[add[1]] ~[[2]]\"/>\n</$button>\n</$list>\n\\end\n\n\\define limit-entries()\n<!-- set number of entries per page -->\n<$select tiddler=<<entryPerPageStateTiddler>> default=25 actions=\"\"\"<$action-setfield $tiddler=<<pageStateTiddler>> text=1/>\"\"\">\n<$list filter='5 10 15 20 25 30 40 50' variable=num>\n<option value=<<num>>>Limit <$text text=<<num>>/></option>\n</$list>\n<option value=<<total-entries>> >Show all</option>\n</$select>\n\\end"},"$:/plugins/kookma/shiraz/macros/dtables/show-edit-cell":{"title":"$:/plugins/kookma/shiraz/macros/dtables/show-edit-cell","created":"20200209135600453","modified":"20210808052511192","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define showCell()\n <$list filter=\"[<fieldOrIndex>]-index\">\n <$transclude tiddler=<<currentRecord>> field=<<currentColumn>> mode=\"inline\" />\n </$list>\n <$list filter=\"[<fieldOrIndex>]-field\">\n <$transclude tiddler=<<currentRecord>> index=<<currentColumn>> mode=\"inline\" />\n </$list>\n\\end\t\n\\define editCell()\n <$list filter=\"[<fieldOrIndex>]-index\">\n <$edit-text tiddler=<<currentRecord>> field=<<currentColumn>> tag=\"input\" class=\"shiraz-dtable-textbox\"/>\n </$list>\n <$list filter=\"[<fieldOrIndex>]-field\">\n <$edit-text tiddler=<<currentRecord>> index=<<currentColumn>> tag=\"input\" class=\"shiraz-dtable-textbox\"/>\n </$list>\n\\end\n\n\\define showCell_Locked()\n <span style=\"font-style:oblique;\"><<showCell>></span>\n\\end "},"$:/plugins/kookma/shiraz/macros/dtables/table-dynamic":{"title":"$:/plugins/kookma/shiraz/macros/dtables/table-dynamic","created":"20200209100939116","modified":"20210808052511219","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define table-dynamic(filter, fields:\"\", indexes:\"\", sortOp:\"sort\", caption:\"\", class:\"\",\n footerRows:\"0\", stateTiddler:\"\", editButton:\"yes\", pagination:\"no\", emptyMessage:\"filter input is empty\")\n\n\\import [all[shadows+tiddlers]tag[$:/tags/Table/Macro]]\n\n<!--above commands import utility macros-->\n<$vars \n inputFilter=\"[subfilter<__filter__>!has[draft.of]]\"\n sortType=<<__sortOp__>>\n pagination=<<__pagination__>>\n> \n<$set name=currentTable value=<<__stateTiddler__>> emptyValue=<<currentTiddler>> >\n<!-- check what type of columns are sent, fileds or indexes (data tiddlers as records) -->\n<$set name=fieldOrIndex filter=\"[<__fields__>!is[blank]]\" value=\"field\" emptyValue=\"index\">\n<<check_tiddlers_type_for_table_from_indexes isEditable:\"$editButton$\">>\n<$set name=columns filter=\"[<fieldOrIndex>]-index\" value=<<__fields__>> emptyValue=<<__indexes__>> >\n<!--check input filter parameter-->\n<$list filter=\"[subfilter<inputFilter>limit[1]]\" emptyMessage=<<__emptyMessage__>> variable=ignore>\n<$set name=sortneg tiddler=<<tempTableSort>> index=\"negate\">\n<!--calculate the number of columns in edit and view mode -->\n<$set name=ncols filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" value={{{ [subfilter<columnFilter>count[]] }}} emptyValue= {{{ [subfilter<columnFilter>count[]subtract[2]] }}}>\n<div class=\"tbl-container\" style=\"max-width:100%;\">\n<table class=<<__class__>> style=\"caption-side:top\">\n<!-- reveal caption and edit button -------------------->\n<caption style=\"text-align:left;\">\n<$list filter=\"[<__editButton__>match[yes]]\" variavle=ignore>\n<span style=\"padding-right:5px;padding-left:3px;\"><<toggle-edit-view>></span></$list>\n$caption$</caption>\n\n<!-- create header -------------------->\n<thead>\n<<confirm-delete>>\n<tr>\n<$list filter=<<columnFilter>> variable=currentColumn>\n<$set name=\"headerLookup\" filter=\"[all[tiddlers+shadows]tag[$:/tags/Table/HeaderTemplate]contains:tbl-column-list<currentColumn>limit[1]get[title]]\" value=<<headerLookup>> emptyValue=\"$:/plugins/kookma/shiraz/templates/header/default\">\n <$transclude tiddler=<<headerLookup>> field=\"text\" mode=\"inline\"/>\n</$set>\n</$list>\n</tr>\n</thead>\n\n<!-- create footer -------------------->\n<$reveal type=\"gt\" default=<<__footerRows__>> text=\"0\" tag=\"tfoot\" class=\"shiraz-dtable-footer\">\n<tr><td colspan=<<ncols>> style=\"font-weight:bold;background-color:transparent;\">Numerical summary</td></tr>\n<$list filter=\"[range[1,$footerRows$]addprefix[footer-]]\" variable=footerRow>\n<tr>\n<$list filter=<<columnFilter>> variable=currentColumn>\n<$set name=\"footerLookup\" filter=\"[all[tiddlers+shadows]tag[$:/tags/Table/FooterTemplate]contains:tbl-column-list<currentColumn>limit[1]get[title]]\" value=<<footerLookup>> emptyValue=\"$:/plugins/kookma/shiraz/templates/footer/default\">\n<$transclude tiddler=<<footerLookup>> field=\"text\" mode=\"inline\"/>\n</$set>\n</$list>\n</tr>\n</$list>\n</$reveal>\n\n<!-- reveal main body of table (generate records) -------------------->\n<tbody>\n<$set name=tableBody filter=\"[<fieldOrIndex>]-index\" value=\"display_body_fields\" emptyValue=\"display_body_indexes\" >\n<!-- setup pagination variables -->\n<$vars total-entries={{{[subfilter<inputFilter>count[]] }}}\n\t\t\t page-number={{{[<pageStateTiddler>get[text]] ~[[1]]}}} \n\t\t\t entries-per-page={{{ [<entryPerPageStateTiddler>get[text]] ~[[25]] }}} >\n<$vars low={{{ [<page-number>subtract[1]multiply<entries-per-page>] }}} \n high={{{[<page-number>multiply<entries-per-page>] }}} >\t \n<$macrocall $name=<<tableBody>> />\n<!--on demand display the pagination row-->\n<$reveal type=\"match\" default=<<pagination>> text=\"yes\" tag=\"tr\" class=\"shiraz-dtable-page-footer\">\n<td colspan=<<ncols>> >\n<<prev-button>>\nDisplaying <$text text={{{[<low>add[1]]}}}/> through <$text text={{{ [<high>compare:number:lt<total-entries>then<high>else<total-entries>] }}}/> of <<total-entries>> Results | <<limit-entries>>\n<<next-button>>\n</td>\n</$reveal><!-- end of pagination ui -->\n</$vars>\n</$vars>\n</$set>\n</tbody>\n</table>\n</div><!-- container-->\n</$set>\n</$set>\n</$list><!--check input filter parameter-->\n</$set>\n</$set>\n</$set>\n</$vars>\n\\end\n\n"},"$:/plugins/kookma/shiraz/macros/dtables/table-utility":{"title":"$:/plugins/kookma/shiraz/macros/dtables/table-utility","created":"20200209195541061","modified":"20210918193243499","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define tableFilter_fields() $(inputFilter)$+[$(sortneg)$$(sortType)${$(tempTableSort)$##sortIndex}]\n\\define tableFilter_indexes() [enlist<items>]+[$(sortneg)$$(sortType)$[]]\n\n\\define getitems()\n<$set name=Index tiddler=<<tempTableSort>> index=\"sortIndex\">\n<$list filter=\"[subfilter<inputFilter>!has[draft.of]]\" >\n<$text text=\"[[\"/>{{{ [<currentTiddler>getindex<Index>addsuffix[°≡°]] }}}<<currentTiddler>><$text text=\"]]\"/>\n</$list>\n</$set>\n\\end\n\n\\define display_one_record()\n<$wikify name=\"rowStyle\" text=\"\"\"<$transclude tiddler=<<tempTableStyle>> index=<<currentRecord>> />\"\"\" mode=\"inline\">\n<tr style=<<rowStyle>>>\n<$list filter=<<columnFilter>> variable=currentColumn>\n<$set name=\"bodyLookup\" \n filter=\"[all[tiddlers+shadows]tag[$:/tags/Table/BodyTemplate]contains:tbl-column-list<currentColumn>]\n +[limit[1]get[title]]\"\n value=<<bodyLookup>> \n emptyValue=\"$:/plugins/kookma/shiraz/templates/body/default\">\n<$transclude tiddler=<<bodyLookup>> field=\"text\" mode=\"inline\"/>\n</$set>\n</$list>\n</tr>\n<!-- reveal expanded record-->\n<$reveal type=\"match\" state=<<tempPathExpand>> text=\"show\" tag=\"tr\">\n<<display-expanded-record>>\n</$reveal>\n</$wikify>\n\\end\n\n\\define display_body_fields() \n<$set name=finalFilter filter=\"[<pagination>match[yes]]\" value=\"[subfilter<tableFilter_fields>first<high>] -[subfilter<tableFilter_fields>first<low>]\" emptyValue=\"[subfilter<tableFilter_fields>]\">\n<$list filter=\"[subfilter<finalFilter>]\" variable=\"currentRecord\">\n<<display_one_record>>\n</$list>\n</$set>\n\\end\n\n\\define display_body_indexes()\n<$wikify name=\"items\" text=<<getitems>> > \n<$set name=finalFilter filter=\"[<pagination>match[yes]]\" value=\"[subfilter<tableFilter_indexes>first<high>] -[subfilter<tableFilter_indexes>first<low>]\" emptyValue=\"[subfilter<tableFilter_indexes>]\">\n<$list filter=\"[subfilter<finalFilter>]\" variable=\"currentItem\">\n<$list filter=\"[<currentItem>split[°≡°]last[]]\" variable=\"currentRecord\">\n <<display_one_record>>\n</$list>\n</$list>\n</$set>\n</$wikify>\n\\end\n\n"},"$:/plugins/kookma/shiraz/macros/dtables/tbl-expand":{"title":"$:/plugins/kookma/shiraz/macros/dtables/tbl-expand","created":"20191203155802107","modified":"20210918193738145","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define display-expanded-record()\n<td colspan=<<ncols>> class=\"shiraz-dtable-expanded-record\">\n<$tiddler tiddler=<<currentRecord>> >\n<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore\n emptyMessage=\"\"\"<$transclude tiddler=<<currentRecord>> field=text mode=block/>\"\"\" >\n <$edit-text class=\"tbl-inpt-edit\" tiddler=<<currentRecord>> field=\"text\" tag=textarea/>\n</$list>\n</$tiddler>\n</td>\n\\end"},"$:/plugins/kookma/shiraz/macros/dtables/toggle-edit-view":{"title":"$:/plugins/kookma/shiraz/macros/dtables/toggle-edit-view","created":"20191128215812372","modified":"20210808052511239","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define toggle-edit-view()\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\">\n<$button class=\"tc-btn-invisible tc-tiddlylink\" setTitle=<<tempTableEdit>> setIndex=\"mode\" setTo=\"edit\">{{$:/core/images/edit-button}}</$button>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\">\n<$button class=\"tc-btn-invisible tc-tiddlylink\" setTitle=<<tempTableEdit>> setIndex=\"mode\" setTo=\"view\">{{$:/core/images/done-button}}</$button>\n</$reveal>\n\\end"},"$:/plugins/kookma/shiraz/macros/dtables/warning_message":{"title":"$:/plugins/kookma/shiraz/macros/dtables/warning_message","created":"20200210083402839","modified":"20210808052511245","tags":"$:/tags/Table/Macro","type":"text/vnd.tiddlywiki","text":"\\define show_tiddler_types()\n<details>\n <summary>List tiddlers with wrong type</summary>\n\t<dl>\n <$list filter=\"[subfilter<inputFilter>]\">\n\t<$list filter=\"[<currentTiddler>get[type]match[application/x-tiddler-dictionary]][<currentTiddler>get[type]match[application/json]]\" variable=ignore\n\temptyMessage=\"\"\"<dt><$link/></dt><dd><$view field=type/></dd>\"\"\">\n\t</$list>\n\t</$list>\n\t</dl>\n</details>\n\\end\n\n\n\\define show_warning_message()\nDynamic editable table from ''indexes'' expects all input tiddlers are of dataTiddler (json or dictionary) types. Using tiddlers of non //json// or //x-tiddler-dictionary// types as input can unintentionally overwrite the data in the text field of those tiddlers.<br>\n<br>\nCheck the tiddler types to find which tiddlers are not of dataTiddler types!<br>\n<<show_tiddler_types>>\n\\end\n\n\n\\define check_tiddlers_type_for_table_from_indexes(isEditable)\n <$list filter=\"[<fieldOrIndex>]-field\" variable=ignore><!-- only dataTiddler -->\n\t<$list filter=\"[<__isEditable__>match[yes]]\" variable=ignore> <!-- only editable table -->\n\t<$list filter=\"[<tempWarningMsg>is[missing]]\" variable=ignore><!-- dismiss if tempWarningMsg is set -->\n\t<$list filter=\"[subfilter<inputFilter>each[type]get[type]]-[[application/x-tiddler-dictionary]]-[[application/json]]\" variable=ignore>\n\t <div style=\"color: white;background-color:#ff0033;padding:8px;text-align:center;width:100%;\">\n\t Danger: Editable dynamic table from idexes with mixed types of tiddlers! \n\t <$button class=\"tc-btn-invisible tc-tiddlylink\" style=\"fill:white;\" tooltip=\"Dismiss alert and continue with the current selection!\">{{$:/core/images/close-button}}\n <$action-setfield $tiddler=<<tempWarningMsg>> text=\"dissmiss\"/>\n </$button>\n\t </div>\n\t <div style=\"border:1px solid #ff0033;padding:8px;\">\n\t <<show_warning_message>>\n\t </div>\n </$list>\n\t</$list>\n\t</$list>\n\t</$list>\n\\end\t\n"},"$:/plugins/kookma/shiraz/macros/image-basic":{"title":"$:/plugins/kookma/shiraz/macros/image-basic","created":"20181119183704246","modified":"20210808052511253","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-basic(img, width:\"30%\", align:\"none\", caption:\"\", tooltip:\"\", alt:\"\")\n<figure class=\"image-basic image-align-$align$\" style=\"width:$width$;\">\n <$image source=<<__img__>> tooltip=<<__tooltip__>> alt=<<__alt__>> /> \n <figcaption>$caption$</figcaption>\n</figure> \n\\end"},"$:/plugins/kookma/shiraz/macros/image-card":{"title":"$:/plugins/kookma/shiraz/macros/image-card","created":"20190913094619863","modified":"20210808052511263","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-card(img, width:\"30%\", align:\"none\", title:\"Empty\", text:\"Empty\", footer:\"Empty\", pos:\"top\", alt:\"\")\n\\import $:/plugins/kookma/shiraz/macros/image-card-utility\n<$reveal tag=\"div\" type=\"match\" default=\"top\" text=<<__pos__>> >\n<$macrocall $name=image-card-top img=<<__img__>> title=<<__title__>> text=<<__text__>>\n footer=<<__footer__>> width=<<__width__>> align=<<__align__>> alt=<<__alt__>> />\n</$reveal>\n<$reveal tag=\"div\" type=\"nomatch\" default=\"top\" text=<<__pos__>> >\n<$macrocall $name=image-card-bottom img=<<__img__>> title=<<__title__>> text=<<__text__>>\n footer=<<__footer__>> width=<<__width__>> align=<<__align__>> alt=<<__alt__>> />\n</$reveal>\n\\end\n\n\\define image-card-top(img, width:\"30%\", align:\"none\", title:\"Empty\", text:\"Empty\", footer:\"Empty\", alt:\"\")\n<div class=\"card image-align-$align$\" style=\"width:$width$;\">\n <$image class=\"card-img-top\" source=<<__img__>> alt=<<__alt__>> />\n <div class=\"card-body\">\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__title__>> >\n <div class=\"h5 card-title\">$title$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__text__>> >\n <div class=\"card-text\">$text$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__footer__>> >\n <p class=\"card-text\"><small class=\"text-muted\">$footer$</small></p>\n </$reveal>\n </div> \n</div>\n\\end\n\n\\define image-card-bottom(img, width:\"30%\", align:\"none\", title:\"Empty\", text:\"Empty\", footer:\"Empty\", alt:\"\")\n<div class=\"card image-align-$align$\" style=\"width:$width$;\">\n <div class=\"card-body\">\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__title__>> >\n <div class=\"h5 card-title\">$title$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__text__>> >\n <div class=\"card-text\">$text$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__footer__>> >\n <p class=\"card-text\"><small class=\"text-muted\">$footer$</small></p>\n </$reveal>\n </div> \n <$image class=\"card-img-bottom\" source=<<__img__>> alt=<<__alt__>> />\n</div>\n\\end"},"$:/plugins/kookma/shiraz/macros/image-card-utility":{"title":"$:/plugins/kookma/shiraz/macros/image-card-utility","created":"20191209113750505","modified":"20210808052511268","type":"text/vnd.tiddlywiki","text":"\\define image-card-top(img, width:\"30%\", align:\"none\", title:\"Empty\", text:\"Empty\", footer:\"Empty\", alt:\"\")\n<div class=\"card image-align-$align$\" style=\"width:$width$;\">\n <$image class=\"card-img-top\" source=<<__img__>> alt=<<__alt__>> />\n <div class=\"card-body\">\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__title__>> >\n <div class=\"h5 card-title\">$title$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__text__>> >\n <div class=\"card-text\">$text$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__footer__>> >\n <p class=\"card-text\"><small class=\"text-muted\">$footer$</small></p>\n </$reveal>\n </div> \n</div>\n\\end\n\n\\define image-card-bottom(img, width:\"30%\", align:\"none\", title:\"Empty\", text:\"Empty\", footer:\"Empty\", alt:\"\")\n<div class=\"card image-align-$align$\" style=\"width:$width$;\">\n <div class=\"card-body\">\n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__title__>> >\n <div class=\"h5 card-title\">$title$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__text__>> >\n <div class=\"card-text\">$text$</div>\n </$reveal> \n <$reveal tag=\"div\" type=\"nomatch\" default=\"Empty\" text=<<__footer__>> >\n <p class=\"card-text\"><small class=\"text-muted\">$footer$</small></p>\n </$reveal>\n </div> \n <$image class=\"card-img-bottom\" source=<<__img__>> alt=<<__alt__>> />\n</div>\n\\end"},"$:/plugins/kookma/shiraz/macros/image-overlay":{"title":"$:/plugins/kookma/shiraz/macros/image-overlay","created":"20181117203737197","modified":"20210808052511276","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-overlay(img, width:\"30%\", align:\"none\", caption:\"\", title:\"\", text:\"\", fadein:\"left\", alt:\"\")\n\\import $:/plugins/kookma/shiraz/macros/image-overlay-utility\n<div class=\"image-overlay-container image-align-$align$\" style=\"width:$width$;\">\n <h3 class=\"image-overlay-title\">$caption$</h3>\n <div class=\"image-overlay-content\">\n <div class=\"image-overlay-content-overlay\"></div>\n <$image class=\"image-overlay-content-image\" source=<<__img__>> alt=<<__alt__>>/>\n <$set name=\"fdcls\" filter=\"$fadein$ +[splitbefore[ ]] +[addprefix[image-overlay-fadeIn-]]\">\n <div class=<<_cls-content-details>> >\n <h3 class=\"image-overlay-content-title\">$title$</h3>\n <p class=\"image-overlay-content-text\">$text$</p>\n </div>\n </$set>\n </div>\n</div>\n\\end"},"$:/plugins/kookma/shiraz/macros/image-overlay-utility":{"title":"$:/plugins/kookma/shiraz/macros/image-overlay-utility","created":"20191209114338849","modified":"20210808052511284","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define _cls-content-details() image-overlay-content-details $(fdcls)$"},"$:/plugins/kookma/shiraz/macros/image-polaroid":{"title":"$:/plugins/kookma/shiraz/macros/image-polaroid","created":"20181117203654803","modified":"20210808052511292","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-polaroid(img, width:\"30%\", align:\"none\", caption:\"\", tooltip:\"\", alt:\"\")\n<figure class=\"image-polaroid image-align-$align$\" style=\"width:$width$;\">\n <$image source=\"\"\"$img$\"\"\" tooltip=\"\"\"$tooltip$\"\"\"/>\n <figcaption class=\"image-polaroid-caption\">$caption$</figcaption>\n</figure> \n\\end"},"$:/plugins/kookma/shiraz/macros/image-pretty":{"title":"$:/plugins/kookma/shiraz/macros/image-pretty","created":"20181117203541398","modified":"20210808052511297","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-pretty(img, width:\"30%\", align:\"none\", caption:\"\", tooltip:\"\", alt:\"\")\n<figure class=\"image-pretty image-align-$align$\" style=\"width:$width$;\">\n <$image source=<<__img__>> tooltip=<<__tooltip__>> alt=<<__alt__>> /> \n <figcaption class=\"image-pretty-caption\">$caption$</figcaption>\n</figure> \n\\end"},"$:/plugins/kookma/shiraz/macros/image-slidein":{"title":"$:/plugins/kookma/shiraz/macros/image-slidein","created":"20181117040544570","modified":"20210808052511301","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define image-slidein(img, width:\"30%\", align:\"none\", caption:\"\", tooltip:\"\", slidein:\"left\", alt:\"\")\n<figure class=\"image-slidein mr-cap-$slidein$ image-align-$align$\" style=\"width:$width$;\">\n <$image source=<<__img__>> tooltip=<<__tooltip__>> alt=<<__alt__>>/>\n <figcaption>$caption$</figcaption>\n</figure> \n\\end"},"$:/plugins/kookma/shiraz/macros/list-search":{"title":"$:/plugins/kookma/shiraz/macros/list-search","author":"Jeremy Ruston","created":"20191209101857832","creator":"Mohammad","description":"creates few paragraphs of dumy text","modified":"20210808052511310","modifier":"Mohammad","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define list-search( filter:\"[!is[system]]\", search:\"search:title\", template:\"$:/core/ui/ListItemTemplate\",\n class:\"\", stateTiddler:\"\", placeholder:\"keywords\")\n<$set name=\"state\" filter=\"[[$:/temp/list-search]addsuffix[/$stateTiddler$]addsuffix<qualify>]\">\n<div class=<<__class__>> >\n<$edit-text tiddler=<<state>> type=\"search\" tag=\"input\" default=\"\" placeholder=\"$placeholder$\"/>\n</div>\n<$reveal state=<<state>> type=\"match\" text=\"\" class=<<__class__>> tag=div>\n<$list filter=\"$filter$\" template=<<__template__>>/>\n</$reveal>\n<$reveal state=<<state>> type=\"nomatch\" text=\"\" class=<<__class__>> tag=div>\n<$set name=term tiddler=<<state>> field=\"text\">\n<$list filter=\"$filter$+[$search$<term>]\" template=<<__template__>>/>\n</$set>\n</$reveal>\n</$set>\n\\end\n<!-- from Tobias Beer list-search with modification-->"},"$:/plugins/kookma/shiraz/macros/multicol":{"title":"$:/plugins/kookma/shiraz/macros/multicol","created":"20191018063242993","modified":"20210808052511318","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define multicol(src, ncol:\"\", class:\"\")\n<div class=\"sh-multicol$ncol$ $class$\">\n\n$src$\n</div>\n\\end"},"$:/plugins/kookma/shiraz/macros/slider":{"title":"$:/plugins/kookma/shiraz/macros/slider","created":"20190322161929431","description":"Slider macro shows (hides) its content.","modified":"20210808052511326","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define slider(label, src, labelClass, srcClass, status:\"closed\")\n<$vars revealState = \"\"\"$:/state/shiraz/slider-macro/$(currentTiddler)$/$label$\"\"\"\n source = {{{ [<__src__>get[text]else<__src__>] }}} >\n\n\n<h2 class=\"$labelClass$\">\n <$reveal type=\"nomatch\" state=<<revealState>> text=\"open\" default=\"$status$\">\n <$button class=\"tc-btn-invisible tc-tiddlylink\" set=<<revealState>> setTo=\"open\">\n <span class=\"kk-sh-slider\"><$transclude tiddler=\"$:/core/images/right-arrow\" /></span>\n </$button>\n </$reveal>\n <$reveal type=\"match\" state=<<revealState>> text=\"open\" default=\"$status$\">\n <$button class=\"tc-btn-invisible tc-tiddlylink\" set=<<revealState>> setTo=\"closed\">\n <span class=\"kk-sh-slider\"><$transclude tiddler=\"$:/core/images/down-arrow\" /></span>\n </$button>\n </$reveal>\n $label$\n</h2>\n\n<$reveal type=\"match\" state=<<revealState>> text=\"open\" default=\"$status$\" class=\"$srcClass$\" tag=div>\n\n<<source>>\n</$reveal>\n\n</$vars>\n\\end"},"$:/plugins/kookma/shiraz/macros/space":{"title":"$:/plugins/kookma/shiraz/macros/space","created":"20170629183034888","modified":"20210808052511332","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define vspace(height:\"25px\")\n<p style=\"margin-bottom: $height$;\"></p>\n\\end\n\n\\define hspace(width:\"25px\")\n<span style=\"margin-left: $width$;\"></span>\n\\end\n"},"$:/plugins/kookma/shiraz/macros/text-utility":{"title":"$:/plugins/kookma/shiraz/macros/text-utility","created":"20181101154956345","modified":"20210808052511341","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define tc(src:\"\", color:\"red\") <span style=\"color:$color$;\">$src$</span>\n\\define bc(src:\"\", color:\"yellow\") <span style=\"background-color:$color$;\">$src$</span>\n\\define mono(src:\"\", class:\"\") <code class=\"mono $class$\">$src$</code>\n\\define transform(case:\"\", src:\"\", class:\"\") <span class=\"text-$case$ $class$\">$src$</span>"},"$:/plugins/kookma/shiraz/readme":{"title":"$:/plugins/kookma/shiraz/readme","created":"20210225163850254","modified":"20220726105755934","tags":"","type":"text/vnd.tiddlywiki","text":"; Shiraz\nShiraz is a small framework of stylesheets, templates and macros to create stylish contents in Tiddlywiki. Shiraz has customized elements like alerts, cards, panels, images, static tables, dynamic tables, quick table, badges, texts, etc. Shiraz uses some modified CSS classes from [[Bootstrap|https://getbootstrap.com/]] 4.3.1.\n\n;Code and demo\nFor learning plugin features, syntax, tutorial and examples see the plugin demo and code pages\n\n* Demo: https://kookma.github.io/TW-Shiraz/\n* Code: https://github.com/kookma/TW-Shiraz\n"},"$:/plugins/kookma/shiraz/styles/alerts-leftbar":{"title":"$:/plugins/kookma/shiraz/styles/alerts-leftbar","text":".leftbar{\n border-width:0px !important;\n border-radius:0px !important;\n border-left-width: 5px !important;\n}","created":"20181208184228896","modified":"20210808052511357","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bglowtone-colors":{"title":"$:/plugins/kookma/shiraz/styles/bglowtone-colors","text":"/* Colors taked from [1] https://www.bg-w3schools.bg-com/colors/colors_names.bg-asp \n[2] http://www.bg-workwithcolor.bg-com/color-chart-full-01.bg-htm*/\n/*Low tone background colors*/\n.bg-mistyrose{background-color:#ffe4e1;}\n.bg-lemonchiffon{background-color:#fffacd;}\n.bg-lavenderblush{background-color:#fff0f5;}\n.bg-lavender{background-color:#e6e6fa;}\n.bg-honeydew{background-color:#f0fff0;}\n.bg-lightcyan{background-color:#e0ffff;}\n.bg-aliceblue{background-color:#f0f8ff;}\n.bg-cornsilk{background-color:#fff8dc;}\n.bg-gainsboro{background-color:#dcdcdc;}\n.bg-bisque{background-color:#ffe4c4;}\n.bg-snow{background-color:#fffafa;}","created":"20181029071532524","list":"mistyrose lemonchiffon lavenderblush lavender honeydew lightcyan aliceblue cornsilk gainsboro bisque snow","modified":"20210808052511365","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/alerts":{"title":"$:/plugins/kookma/shiraz/styles/bs/alerts","text":"/*Was taken from bootstrap 4.1.3*/\n.alert {\n position: relative;\n padding: 0.75rem 1.25rem;\n margin-bottom: 1rem;\n border: 1px solid transparent;\n border-radius: 0.25rem;\n}\n.alert-primary {\n color: #004085;\n background-color: #cce5ff;\n border-color: #b8daff;\n}\n\n.alert-primary hr {\n border-top-color: #9fcdff;\n}\n.alert-secondary {\n color: #383d41;\n background-color: #e2e3e5;\n border-color: #d6d8db;\n}\n\n.alert-secondary hr {\n border-top-color: #c8cbcf;\n}\n\n.alert-success {\n color: #155724;\n background-color: #d4edda;\n border-color: #c3e6cb;\n}\n\n.alert-success hr {\n border-top-color: #b1dfbb;\n}\n.alert-info {\n color: #0c5460;\n background-color: #d1ecf1;\n border-color: #bee5eb;\n}\n\n.alert-info hr {\n border-top-color: #abdde5;\n}\n.alert-warning {\n color: #856404;\n background-color: #fff3cd;\n border-color: #ffeeba;\n}\n\n.alert-warning hr {\n border-top-color: #ffe8a1;\n}\n\n.alert-danger {\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n}\n\n.alert-danger hr {\n border-top-color: #f1b0b7;\n}\n.alert-light {\n color: #818182;\n background-color: #fefefe;\n border-color: #fdfdfe;\n}\n\n.alert-light hr {\n border-top-color: #ececf6;\n}\n.alert-dark {\n color: #1b1e21;\n background-color: #d6d8d9;\n border-color: #c6c8ca;\n}\n\n.alert-dark hr {\n border-top-color: #b9bbbe;\n}\n","created":"20180820171551129","modified":"20210808052511374","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/background-colors":{"title":"$:/plugins/kookma/shiraz/styles/bs/background-colors","text":".bg-primary {\n background-color: #007bff !important;\n}\n\na.bg-primary:hover, a.bg-primary:focus,\nbutton.bg-primary:hover,\nbutton.bg-primary:focus {\n background-color: #0062cc !important;\n}\n\n.bg-secondary {\n background-color: #6c757d !important;\n}\n\na.bg-secondary:hover, a.bg-secondary:focus,\nbutton.bg-secondary:hover,\nbutton.bg-secondary:focus {\n background-color: #545b62 !important;\n}\n\n.bg-success {\n background-color: #28a745 !important;\n}\n\na.bg-success:hover, a.bg-success:focus,\nbutton.bg-success:hover,\nbutton.bg-success:focus {\n background-color: #1e7e34 !important;\n}\n\n.bg-info {\n background-color: #17a2b8 !important;\n}\n\na.bg-info:hover, a.bg-info:focus,\nbutton.bg-info:hover,\nbutton.bg-info:focus {\n background-color: #117a8b !important;\n}\n\n.bg-warning {\n background-color: #ffc107 !important;\n}\n\na.bg-warning:hover, a.bg-warning:focus,\nbutton.bg-warning:hover,\nbutton.bg-warning:focus {\n background-color: #d39e00 !important;\n}\n\n.bg-danger {\n background-color: #dc3545 !important;\n}\n\na.bg-danger:hover, a.bg-danger:focus,\nbutton.bg-danger:hover,\nbutton.bg-danger:focus {\n background-color: #bd2130 !important;\n}\n\n.bg-light {\n background-color: #f8f9fa !important;\n}\n\na.bg-light:hover, a.bg-light:focus,\nbutton.bg-light:hover,\nbutton.bg-light:focus {\n background-color: #dae0e5 !important;\n}\n\n.bg-dark {\n background-color: #343a40 !important;\n}\n\na.bg-dark:hover, a.bg-dark:focus,\nbutton.bg-dark:hover,\nbutton.bg-dark:focus {\n background-color: #1d2124 !important;\n}\n\n.bg-white {\n background-color: #fff !important;\n}\n\n.bg-transparent {\n background-color: transparent !important;\n}","created":"20180820170518161","modified":"20210808052511382","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/badge":{"title":"$:/plugins/kookma/shiraz/styles/bs/badge","text":"/* Extracted from bootstrap 4.1.3 */\n.badge {\n display: inline-block;\n padding: 0.25em 0.4em;\n font-size: 75%;\n font-weight: 700;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: 0.25rem;\n}\n\n.badge:empty {\n display: none;\n}\n\n.btn .badge {\n position: relative;\n top: -1px;\n}\n\n.badge-pill {\n padding-right: 0.6em;\n padding-left: 0.6em;\n border-radius: 10rem;\n}\n\n.badge-primary {\n color: #fff;\n background-color: #007bff;\n}\n\n.badge-primary[href]:hover, .badge-primary[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #0062cc;\n}\n\n.badge-secondary {\n color: #fff;\n background-color: #6c757d;\n}\n\n.badge-secondary[href]:hover, .badge-secondary[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #545b62;\n}\n\n.badge-success {\n color: #fff;\n background-color: #28a745;\n}\n\n.badge-success[href]:hover, .badge-success[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #1e7e34;\n}\n\n.badge-info {\n color: #fff;\n background-color: #17a2b8;\n}\n\n.badge-info[href]:hover, .badge-info[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #117a8b;\n}\n\n.badge-warning {\n color: #212529;\n background-color: #ffc107;\n}\n\n.badge-warning[href]:hover, .badge-warning[href]:focus {\n color: #212529;\n text-decoration: none;\n background-color: #d39e00;\n}\n\n.badge-danger {\n color: #fff;\n background-color: #dc3545;\n}\n\n.badge-danger[href]:hover, .badge-danger[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #bd2130;\n}\n\n.badge-light {\n color: #212529;\n background-color: #f8f9fa;\n}\n\n.badge-light[href]:hover, .badge-light[href]:focus {\n color: #212529;\n text-decoration: none;\n background-color: #dae0e5;\n}\n\n.badge-dark {\n color: #fff;\n background-color: #343a40;\n}\n\n.badge-dark[href]:hover, .badge-dark[href]:focus {\n color: #fff;\n text-decoration: none;\n background-color: #1d2124;\n}\n\n","created":"20181122140031075","modified":"20210808052511390","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/borders":{"title":"$:/plugins/kookma/shiraz/styles/bs/borders","text":".border {\n border: 1px solid #dee2e6 !important;\n}\n\n.border-top {\n border-top: 1px solid #dee2e6 !important;\n}\n\n.border-right {\n border-right: 1px solid #dee2e6 !important;\n}\n\n.border-bottom {\n border-bottom: 1px solid #dee2e6 !important;\n}\n\n.border-left {\n border-left: 1px solid #dee2e6 !important;\n}\n\n.border-0 {\n border: 0 !important;\n}\n\n.border-top-0 {\n border-top: 0 !important;\n}\n\n.border-right-0 {\n border-right: 0 !important;\n}\n\n.border-bottom-0 {\n border-bottom: 0 !important;\n}\n\n.border-left-0 {\n border-left: 0 !important;\n}\n\n.border-primary {\n border-color: #007bff !important;\n}\n\n.border-secondary {\n border-color: #6c757d !important;\n}\n\n.border-success {\n border-color: #28a745 !important;\n}\n\n.border-info {\n border-color: #17a2b8 !important;\n}\n\n.border-warning {\n border-color: #ffc107 !important;\n}\n\n.border-danger {\n border-color: #dc3545 !important;\n}\n\n.border-light {\n border-color: #f8f9fa !important;\n}\n\n.border-dark {\n border-color: #343a40 !important;\n}\n\n.border-white {\n border-color: #fff !important;\n}\n\n.rounded {\n border-radius: 0.25rem !important;\n}\n\n.rounded-top {\n border-top-left-radius: 0.25rem !important;\n border-top-right-radius: 0.25rem !important;\n}\n\n.rounded-right {\n border-top-right-radius: 0.25rem !important;\n border-bottom-right-radius: 0.25rem !important;\n}\n\n.rounded-bottom {\n border-bottom-right-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-left {\n border-top-left-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-circle {\n border-radius: 50% !important;\n}\n\n.rounded-0 {\n border-radius: 0 !important;\n}\n","created":"20180820174710383","modified":"20210808052511397","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/btn":{"title":"$:/plugins/kookma/shiraz/styles/bs/btn","text":"/* Button and btn classes Mohammad*/\n.btn {\n display: inline-block;\n font-weight: 400;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n border: 1px solid transparent;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n line-height: 1.5;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n\n.btn:hover, .btn:focus {\n text-decoration: none;\n}\n\n.btn:focus, .btn.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.btn.disabled, .btn:disabled {\n opacity: 0.65;\n}\n\n.btn:not(:disabled):not(.disabled) {\n cursor: pointer;\n}\n\na.btn.disabled,\nfieldset:disabled a.btn {\n pointer-events: none;\n}\n\n.btn-primary {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-primary:hover {\n color: #fff;\n background-color: #0069d9;\n border-color: #0062cc;\n}\n\n.btn-primary:focus, .btn-primary.focus {\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);\n}\n\n.btn-primary.disabled, .btn-primary:disabled {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-secondary {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-secondary:hover {\n color: #fff;\n background-color: #5a6268;\n border-color: #545b62;\n}\n\n.btn-secondary:focus, .btn-secondary.focus {\n box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);\n}\n\n.btn-secondary.disabled, .btn-secondary:disabled {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-success {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-success:hover {\n color: #fff;\n background-color: #218838;\n border-color: #1e7e34;\n}\n\n.btn-success:focus, .btn-success.focus {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);\n}\n\n.btn-success.disabled, .btn-success:disabled {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-info {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-info:hover {\n color: #fff;\n background-color: #138496;\n border-color: #117a8b;\n}\n\n.btn-info:focus, .btn-info.focus {\n box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);\n}\n\n.btn-info.disabled, .btn-info:disabled {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-warning {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-warning:hover {\n color: #212529;\n background-color: #e0a800;\n border-color: #d39e00;\n}\n\n.btn-warning:focus, .btn-warning.focus {\n box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);\n}\n\n.btn-warning.disabled, .btn-warning:disabled {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-danger {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-danger:hover {\n color: #fff;\n background-color: #c82333;\n border-color: #bd2130;\n}\n\n.btn-danger:focus, .btn-danger.focus {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);\n}\n\n.btn-danger.disabled, .btn-danger:disabled {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-light {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-light:hover {\n color: #212529;\n background-color: #e2e6ea;\n border-color: #dae0e5;\n}\n\n.btn-light:focus, .btn-light.focus {\n box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);\n}\n\n.btn-light.disabled, .btn-light:disabled {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-dark {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-dark:hover {\n color: #fff;\n background-color: #23272b;\n border-color: #1d2124;\n}\n\n.btn-dark:focus, .btn-dark.focus {\n box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);\n}\n\n.btn-dark.disabled, .btn-dark:disabled {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-link {\n font-weight: 400;\n color: #007bff;\n background-color: transparent;\n}\n\n.btn-link:hover {\n color: #0056b3;\n text-decoration: underline;\n background-color: transparent;\n border-color: transparent;\n}\n\n.btn-link:focus, .btn-link.focus {\n text-decoration: underline;\n border-color: transparent;\n box-shadow: none;\n}\n\n.btn-link:disabled, .btn-link.disabled {\n color: #6c757d;\n pointer-events: none;\n}\n\n/* button size */\n\n.btn-lg{\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\n.btn-sm{\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}","created":"20180822044340070","modified":"20210808052511406","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/card":{"title":"$:/plugins/kookma/shiraz/styles/bs/card","text":"/* Extracted from bootstrap 4.1.3 */\n.card {\n position: relative;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n min-width: 0;\n word-wrap: break-word;\n background-color: #fff;\n background-clip: border-box;\n border: 1px solid rgba(0, 0, 0, 0.125);\n border-radius: 0.25rem;\n}\n\n.card > hr {\n margin-right: 0;\n margin-left: 0;\n}\n\n.card > .list-group:first-child .list-group-item:first-child {\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.card > .list-group:last-child .list-group-item:last-child {\n border-bottom-right-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.card-body {\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n padding: 1.25rem;\n}\n\n.card-title {\n margin-bottom: 0.75rem;\n}\n\n.card-subtitle {\n margin-top: -0.375rem;\n margin-bottom: 0;\n}\n\n.card-text:last-child {\n margin-bottom: 0;\n}\n\n.card-link:hover {\n text-decoration: none;\n}\n\n.card-link + .card-link {\n margin-left: 1.25rem;\n}\n\n.card-header {\n padding: 0.75rem 1.25rem;\n margin-bottom: 0;\n background-color: rgba(0, 0, 0, 0.03);\n border-bottom: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-header:first-child {\n border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;\n}\n\n.card-header + .list-group .list-group-item:first-child {\n border-top: 0;\n}\n\n.card-footer {\n padding: 0.75rem 1.25rem;\n background-color: rgba(0, 0, 0, 0.03);\n border-top: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-footer:last-child {\n border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);\n}\n\n.card-header-tabs {\n margin-right: -0.625rem;\n margin-bottom: -0.75rem;\n margin-left: -0.625rem;\n border-bottom: 0;\n}\n\n.card-header-pills {\n margin-right: -0.625rem;\n margin-left: -0.625rem;\n}\n\n.card-img-overlay {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: 1.25rem;\n}\n\n.card-img {\n width: 100%;\n border-radius: calc(0.25rem - 1px);\n}\n\n.card-img-top {\n width: 100%;\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px);\n}\n\n.card-img-bottom {\n width: 100%;\n border-bottom-right-radius: calc(0.25rem - 1px);\n border-bottom-left-radius: calc(0.25rem - 1px);\n}\n","created":"20180822174608965","modified":"20210808052511411","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/card-column":{"title":"$:/plugins/kookma/shiraz/styles/bs/card-column","text":"/* Extracted from bootstrap 4.3.1 */\n.card-columns .card {\n margin-bottom: 0.75rem;\n}\n\n@media (min-width: 576px) {\n .card-columns {\n -webkit-column-count: 3;\n -moz-column-count: 3;\n column-count: 3;\n -webkit-column-gap: 1.25rem;\n -moz-column-gap: 1.25rem;\n column-gap: 1.25rem;\n orphans: 1;\n widows: 1;\n }\n .card-columns .card {\n display: inline-block;\n width: 100%;\n }\n}","created":"20181122175345419","modified":"20210808052511418","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/card-deck":{"title":"$:/plugins/kookma/shiraz/styles/bs/card-deck","text":"/* Extracted from bootstrap 4.1.3 */\n\n.card-deck {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n\n.card-deck .card {\n margin-bottom: 15px;\n}\n\n@media (min-width: 576px) {\n .card-deck {\n -ms-flex-flow: row wrap;\n flex-flow: row wrap;\n margin-right: -15px;\n margin-left: -15px;\n }\n .card-deck .card {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 1 0 0%;\n flex: 1 0 0%;\n -ms-flex-direction: column;\n flex-direction: column;\n margin-right: 15px;\n margin-bottom: 0;\n margin-left: 15px;\n }\n}","created":"20180822174847352","modified":"20210808052511426","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/card-group":{"title":"$:/plugins/kookma/shiraz/styles/bs/card-group","text":"/* Extracted from bootstrap 4.1.3 */\n.card-group {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n\n.card-group > .card {\n margin-bottom: 15px;\n}\n\n@media (min-width: 576px) {\n .card-group {\n -ms-flex-flow: row wrap;\n flex-flow: row wrap;\n }\n .card-group > .card {\n -ms-flex: 1 0 0%;\n flex: 1 0 0%;\n margin-bottom: 0;\n }\n .card-group > .card + .card {\n margin-left: 0;\n border-left: 0;\n }\n .card-group > .card:first-child {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n .card-group > .card:first-child .card-img-top,\n .card-group > .card:first-child .card-header {\n border-top-right-radius: 0;\n }\n .card-group > .card:first-child .card-img-bottom,\n .card-group > .card:first-child .card-footer {\n border-bottom-right-radius: 0;\n }\n .card-group > .card:last-child {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n .card-group > .card:last-child .card-img-top,\n .card-group > .card:last-child .card-header {\n border-top-left-radius: 0;\n }\n .card-group > .card:last-child .card-img-bottom,\n .card-group > .card:last-child .card-footer {\n border-bottom-left-radius: 0;\n }\n .card-group > .card:only-child {\n border-radius: 0.25rem;\n }\n .card-group > .card:only-child .card-img-top,\n .card-group > .card:only-child .card-header {\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n }\n .card-group > .card:only-child .card-img-bottom,\n .card-group > .card:only-child .card-footer {\n border-bottom-right-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n }\n .card-group > .card:not(:first-child):not(:last-child):not(:only-child) {\n border-radius: 0;\n }\n .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top,\n .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,\n .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-header,\n .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-footer {\n border-radius: 0;\n }\n}\n","created":"20181122175111676","modified":"20210808052511431","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/clearfix":{"title":"$:/plugins/kookma/shiraz/styles/bs/clearfix","text":".clearfix::after {\n display: block;\n clear: both;\n content: \"\";\n}","created":"20190919042042391","modified":"20210808052511439","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/float":{"title":"$:/plugins/kookma/shiraz/styles/bs/float","text":".float-left {\n float: left;\n}\n\n.float-right {\n float: right;\n}\n\n.float-none {\n float: none;\n}\n","created":"20180823142040855","modified":"20210808052511446","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/my-adjustment":{"title":"$:/plugins/kookma/shiraz/styles/bs/my-adjustment","text":"/* My adjustments to bootstrap 4.1.3 css classes */\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n/* Link is hacked to be compatible with bootstrap \nclasses remove it if the TW core objects break\n*/\n\n","created":"20180822044831813","modified":"20210808052511454","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/shadow":{"title":"$:/plugins/kookma/shiraz/styles/bs/shadow","text":".shadow-sm {\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n}\n\n.shadow {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n}\n\n.shadow-lg {\n box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;\n}\n\n.shadow-none {\n box-shadow: none !important;\n}","created":"20180823114259911","modified":"20210808052511462","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/sizing-spacing":{"title":"$:/plugins/kookma/shiraz/styles/bs/sizing-spacing","text":"/* Extracted from bootstrap 4.3.1 */\n/*Defines margins, paddings, width and height*/\n.w-25 {\n width: 25% !important;\n}\n.w-50 {\n width: 50% !important;\n}\n.w-75 {\n width: 75% !important;\n}\n.w-100 {\n width: 100% !important;\n}\n.w-auto {\n width: auto !important;\n}\n.h-25 {\n height: 25% !important;\n}\n.h-50 {\n height: 50% !important;\n}\n.h-75 {\n height: 75% !important;\n}\n.h-100 {\n height: 100% !important;\n}\n.h-auto {\n height: auto !important;\n}\n.mw-100 {\n max-width: 100% !important;\n}\n.mh-100 {\n max-height: 100% !important;\n}\n.m-0 {\n margin: 0 !important;\n}\n.mt-0,\n.my-0 {\n margin-top: 0 !important;\n}\n.mr-0,\n.mx-0 {\n margin-right: 0 !important;\n}\n.mb-0,\n.my-0 {\n margin-bottom: 0 !important;\n}\n.ml-0,\n.mx-0 {\n margin-left: 0 !important;\n}\n.m-1 {\n margin: 0.25rem !important;\n}\n.mt-1,\n.my-1 {\n margin-top: 0.25rem !important;\n}\n.mr-1,\n.mx-1 {\n margin-right: 0.25rem !important;\n}\n.mb-1,\n.my-1 {\n margin-bottom: 0.25rem !important;\n}\n.ml-1,\n.mx-1 {\n margin-left: 0.25rem !important;\n}\n.m-2 {\n margin: 0.5rem !important;\n}\n.mt-2,\n.my-2 {\n margin-top: 0.5rem !important;\n}\n.mr-2,\n.mx-2 {\n margin-right: 0.5rem !important;\n}\n.mb-2,\n.my-2 {\n margin-bottom: 0.5rem !important;\n}\n.ml-2,\n.mx-2 {\n margin-left: 0.5rem !important;\n}\n\n.m-3 {\n margin: 1rem !important;\n}\n\n.mt-3,\n.my-3 {\n margin-top: 1rem !important;\n}\n\n.mr-3,\n.mx-3 {\n margin-right: 1rem !important;\n}\n\n.mb-3,\n.my-3 {\n margin-bottom: 1rem !important;\n}\n\n.ml-3,\n.mx-3 {\n margin-left: 1rem !important;\n}\n\n.m-4 {\n margin: 1.5rem !important;\n}\n\n.mt-4,\n.my-4 {\n margin-top: 1.5rem !important;\n}\n\n.mr-4,\n.mx-4 {\n margin-right: 1.5rem !important;\n}\n\n.mb-4,\n.my-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.ml-4,\n.mx-4 {\n margin-left: 1.5rem !important;\n}\n\n.m-5 {\n margin: 3rem !important;\n}\n\n.mt-5,\n.my-5 {\n margin-top: 3rem !important;\n}\n\n.mr-5,\n.mx-5 {\n margin-right: 3rem !important;\n}\n\n.mb-5,\n.my-5 {\n margin-bottom: 3rem !important;\n}\n\n.ml-5,\n.mx-5 {\n margin-left: 3rem !important;\n}\n\n.p-0 {\n padding: 0 !important;\n}\n\n.pt-0,\n.py-0 {\n padding-top: 0 !important;\n}\n\n.pr-0,\n.px-0 {\n padding-right: 0 !important;\n}\n\n.pb-0,\n.py-0 {\n padding-bottom: 0 !important;\n}\n\n.pl-0,\n.px-0 {\n padding-left: 0 !important;\n}\n\n.p-1 {\n padding: 0.25rem !important;\n}\n\n.pt-1,\n.py-1 {\n padding-top: 0.25rem !important;\n}\n\n.pr-1,\n.px-1 {\n padding-right: 0.25rem !important;\n}\n\n.pb-1,\n.py-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.pl-1,\n.px-1 {\n padding-left: 0.25rem !important;\n}\n\n.p-2 {\n padding: 0.5rem !important;\n}\n\n.pt-2,\n.py-2 {\n padding-top: 0.5rem !important;\n}\n\n.pr-2,\n.px-2 {\n padding-right: 0.5rem !important;\n}\n\n.pb-2,\n.py-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.pl-2,\n.px-2 {\n padding-left: 0.5rem !important;\n}\n\n.p-3 {\n padding: 1rem !important;\n}\n\n.pt-3,\n.py-3 {\n padding-top: 1rem !important;\n}\n\n.pr-3,\n.px-3 {\n padding-right: 1rem !important;\n}\n\n.pb-3,\n.py-3 {\n padding-bottom: 1rem !important;\n}\n\n.pl-3,\n.px-3 {\n padding-left: 1rem !important;\n}\n\n.p-4 {\n padding: 1.5rem !important;\n}\n\n.pt-4,\n.py-4 {\n padding-top: 1.5rem !important;\n}\n\n.pr-4,\n.px-4 {\n padding-right: 1.5rem !important;\n}\n\n.pb-4,\n.py-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.pl-4,\n.px-4 {\n padding-left: 1.5rem !important;\n}\n\n.p-5 {\n padding: 3rem !important;\n}\n\n.pt-5,\n.py-5 {\n padding-top: 3rem !important;\n}\n\n.pr-5,\n.px-5 {\n padding-right: 3rem !important;\n}\n\n.pb-5,\n.py-5 {\n padding-bottom: 3rem !important;\n}\n\n.pl-5,\n.px-5 {\n padding-left: 3rem !important;\n}\n\n.m-auto {\n margin: auto !important;\n}\n\n.mt-auto,\n.my-auto {\n margin-top: auto !important;\n}\n\n.mr-auto,\n.mx-auto {\n margin-right: auto !important;\n}\n\n.mb-auto,\n.my-auto {\n margin-bottom: auto !important;\n}\n\n.ml-auto,\n.mx-auto {\n margin-left: auto !important;\n}\n","created":"20180822191952379","modified":"20210808052511469","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/text-alignment":{"title":"$:/plugins/kookma/shiraz/styles/bs/text-alignment","text":".text-justify {\n text-align: justify !important;\n}\n\n.text-nowrap {\n white-space: nowrap !important;\n}\n\n.text-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.text-left {\n text-align: left !important;\n}\n\n.text-right {\n text-align: right !important;\n}\n\n.text-center {\n text-align: center !important;\n}","created":"20180822051223866","modified":"20210808052511477","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/text-colors":{"title":"$:/plugins/kookma/shiraz/styles/bs/text-colors","text":"/* from bootstrap 4.1.3 */\n\n.text-white {\n color: #fff !important;\n}\n\n.text-primary {\n color: #007bff !important;\n}\n\na.text-primary:hover, a.text-primary:focus {\n color: #0062cc !important;\n}\n\n.text-secondary {\n color: #6c757d !important;\n}\n\na.text-secondary:hover, a.text-secondary:focus {\n color: #545b62 !important;\n}\n\n.text-success {\n color: #28a745 !important;\n}\n\na.text-success:hover, a.text-success:focus {\n color: #1e7e34 !important;\n}\n\n.text-info {\n color: #17a2b8 !important;\n}\n\na.text-info:hover, a.text-info:focus {\n color: #117a8b !important;\n}\n\n.text-warning {\n color: #ffc107 !important;\n}\n\na.text-warning:hover, a.text-warning:focus {\n color: #d39e00 !important;\n}\n\n.text-danger {\n color: #dc3545 !important;\n}\n\na.text-danger:hover, a.text-danger:focus {\n color: #bd2130 !important;\n}\n\n.text-light {\n color: #f8f9fa !important;\n}\n\na.text-light:hover, a.text-light:focus {\n color: #dae0e5 !important;\n}\n\n.text-dark {\n color: #343a40 !important;\n}\n\na.text-dark:hover, a.text-dark:focus {\n color: #1d2124 !important;\n}\n\n.text-body {\n color: #212529 !important;\n}\n\n.text-muted {\n color: #6c757d !important;\n}\n\n.text-black-50 {\n color: rgba(0, 0, 0, 0.5) !important;\n}\n\n.text-white-50 {\n color: rgba(255, 255, 255, 0.5) !important;\n}\n\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n","created":"20180820173351023","modified":"20210808052511485","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/bs/text-utility":{"title":"$:/plugins/kookma/shiraz/styles/bs/text-utility","text":"/* Can be removed latter. This is used for illustration of bootstrap cards */\n\n.text-lowercase {\n text-transform: lowercase !important;\n}\n\n.text-uppercase {\n text-transform: uppercase !important;\n}\n\n.text-capitalize {\n text-transform: capitalize !important;\n}\n\n.font-weight-light {\n font-weight: 300 !important;\n}\n\n.font-weight-normal {\n font-weight: 400 !important;\n}\n\n.font-weight-bold {\n font-weight: 700 !important;\n}\n\n.font-italic {\n font-style: italic !important;\n}\n\n\n.h1, .h2, .h3, .h4, .h5, .h6 {\n margin-bottom: 0.5rem;\n font-family: inherit;\n font-weight: 500;\n line-height: 1.2;\n color: inherit;\n}\n\n.h1 {\n font-size: 2.5rem;\n}\n\n.h2 {\n font-size: 2rem;\n}\n\n.h3 {\n font-size: 1.75rem;\n}\n\n.h4 {\n font-size: 1.5rem;\n}\n\n.h5 {\n font-size: 1.25rem;\n}\n\n.h6 {\n font-size: 1rem;\n}\n\n.lead {\n font-size: 1.25rem;\n font-weight: 300;\n}\n\n.display-1 {\n font-size: 6rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-2 {\n font-size: 5.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-3 {\n font-size: 4.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-4 {\n font-size: 3.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.hr {\n margin-top: 1rem;\n margin-bottom: 1rem;\n border: 0;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n\n.small {\n font-size: 80%;\n font-weight: 400;\n}\n\n.mark {\n padding: 0.2em;\n background-color: #fcf8e3;\n}\n","created":"20180822130528002","modified":"20210808052511493","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/clear-float":{"title":"$:/plugins/kookma/shiraz/styles/clear-float","text":"/* Resolve issue for floating objects which cross the tiddler frame!\nThe below code should force the tiddler to always wrap around floating elements, so that they are always inside\nRef: https://groups.google.com/d/msg/tiddlywiki/5bZwwj6cyac/2LzFeA7AAwAJ\n*/\n\n.tc-tiddler-body:before, .tc-tiddler-body:after {\n content: \"\";\n display: table;\n}\n.tc-tiddler-body:after {\n clear: both;\n}\n.tc-tiddler-body {\n zoom: 1;\n}","created":"20190902043605186","modified":"20210808052511498","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/colorful-sidebar-tab":{"title":"$:/plugins/kookma/shiraz/styles/colorful-sidebar-tab","text":".tc-sidebar-lists .tc-tab-buttons button.tc-tab-selected {\n background: none;\n border: none;\n border-bottom: solid 1px #737373;\n font-weight: bold;\n color: #DB4C3F;\n}","created":"20191209105546612","modified":"20211117172558880","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/csvtable":{"title":"$:/plugins/kookma/shiraz/styles/csvtable","text":"/* todo section ------------*/\n.tc-tiddler-body p.dblock {\n\tdisplay:none;\n}\n\n/*\nOnly used with csv table\nSee $:/plugins/kookma/shiraz/macros/csvtables/table-csv\nThe @@ produces a p tag.\n*/","created":"20220724164156072","modified":"20220804042939414","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/csvtable-katex":{"title":"$:/plugins/kookma/shiraz/styles/csvtable-katex","text":".falign .katex-display > .katex {text-align:left;}\n.ralign .katex-display > .katex {text-align:right;}\n.table-mathbox tr td{vertical-align: baseline;} /* baseline aligned text and fomula in table cell*/\n\n/*\nOnly used with csv table + katex\nSee $:/plugins/kookma/shiraz/macros/csvtables/formats-math\n*/","created":"20210913204223405","modified":"20210914150205318","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/csvtable-star":{"title":"$:/plugins/kookma/shiraz/styles/csvtable-star","text":"/* Styles for star rating used with table-csv macro */\n.shiraz-star svg{\nwidth: 1.2em;\nheight: 1.2em;\nvertical-align: middle;\nfill:#FF9529; /*Deep Saffron*/\n}","created":"20210808144209865","modified":"20220801113747091","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/dbadge":{"title":"$:/plugins/kookma/shiraz/styles/dbadge","text":"/*Credits: \nNishant Srivastava https://codepen.io/nisrulz/pen/bpQWLW\nMohammad Rahmani: https://github.com/kookma\n*/\n.dbadge {\n display: inline-block;\n margin: 0.0em;\n}\n.dbadge > span {\n color: #ffffff;\n font-size: 0.8em;\n font-weight: 400;\n line-height: 1;\n padding: .2em .6em;\n text-align: center;\n vertical-align: baseline;\n white-space: nowrap;}\n\n.dbadge-subject{\n background-color: #656565;\n border-bottom-left-radius: 0.25em;\n border-top-left-radius: 0.25em;}\n.dbadge-status {\n border-bottom-right-radius: 0.25em;\n border-top-right-radius: 0.25em;}\n\n.dbadge-primary {\n background-color: #337ab7;}\n.dbadge-success {\n background-color: #5cb85c;}\n.dbadge-info {\n background-color: #5bc0de;}\n.dbadge-warning {\n background-color: #f0ad4e;}\n.dbadge-danger {\n background-color: #d9534f;}","created":"20181204192835967","modified":"20210808052511511","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/details-slider":{"title":"$:/plugins/kookma/shiraz/styles/details-slider","text":"/*details html5 macro*/\ndetails > summary {\n padding: 2px 6px;\n font-weight:500;\n outline:none;\n}\ndetails > div {\n padding: 2px 6px;\n margin: 0;\n}\n\n\n/* Styles for summary cursor\nurl: https://css-tricks.com/two-issues-styling-the-details-element-and-how-to-solve-them/\n*/\n\nsummary {\n cursor: pointer;\n}\n\nsummary > * {\n display: inline;\n}\n\n\nbutton .kk-sh-slider svg{\nwidth: 0.8em;\nheight: 0.8em;\nvertical-align: middle;\n}\n\n","created":"20181101185908941","modified":"20220801113903959","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/dynamic-tables":{"title":"$:/plugins/kookma/shiraz/styles/dynamic-tables","text":"/* edit-text box for dynamic table */\n.shiraz-dtable-textbox {\n width:100%;\n padding-left: 5px;\n border: none;\n}\n\n.shiraz-dtable-textbox:focus {\n outline: none;\n border: 1px solid #5778d8;\n background: transparent;\n}\n\n.tbl-inpt-edit { width: 100%; background-color: transparent; border: none; color: #000000;}\n\nbutton.tbl-sort-svg > svg { text-shadow: none; fill:#000000; height:10px; padding:0 0 2px 0; }\n\nth .tc-tiddlylink, th a { text-shadow: none; margin: 0 0 0 0; padding: 0 0 0 0; color:#000000; font-weight: bold; }\n\n\n/* DELETE CONFIRMATION */\ntable thead .tbl-delete-confirm > th {\n color: white;\n background-color:#ff0033;\n padding: 8px;\n margin: 0px;\n text-align:center;\n\tfont-weight:normal;\n}\n\ntable thead .tbl-delete-confirm > th > button {\n color: white;\n fill: white;\n}\n\n/* -- pagination --*/\n.shiraz-dtable-page-footer td{\n\tmargin: 0 0 0 0;\n\tpadding: 4px 7px 4px 7px;\n}\n\n.shiraz-dtable-page-footer select{\n\tpadding:0;\n\tmargin:0;\n\tborder:none;\t\n}\n\n.shiraz-dtable-page-footer {\n\ttext-align:center;\n}\n\n.shiraz-dtable-page-prev{\n\tfloat:left;\n\tmargin-right:8px;\n}\n\n.shiraz-dtable-page-next{\n\tfloat:right;\n\tmargin-left:8px;\n}\n\n.shiraz-dtable-page-footer button svg {height:0.7em;}\n.shiraz-dtable-page-footer button {outline: none; line-height:normal;}\n.shiraz-dtable-page-footer button:disabled {display:none;}\n\n/* to format the expanded record (tiddler body) - for local customization like KaTeX numbering */\n.shiraz-dtable-expanded-record{ }\n\n/*to adjust the column width for date/due-date fields*/\n.shiraz-dtable-date{\n\twidth:7em;\n}","created":"20191128184537594","modified":"20211117172018885","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/dynamic-tables-var":{"title":"$:/plugins/kookma/shiraz/styles/dynamic-tables-var","created":"20210224171009495","modified":"20220803192224020","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":"/* these are dynamic or variable properties based on the tiddlywiki palette */\n\n.shiraz-dtable-page-footer select{\n\tbackground-color: <<color table-header-background>>;\n\tcolor:<<color foreground>>;\n}\n\n.shiraz-dtable-page-footer > td{\n\tbackground-color: <<color table-header-background>>;\n}\n\n/* customize the table footer used for numerical summary*/\n.shiraz-dtable-footer tr td{\n\tbackground-color: <<color table-footer-background>>;\n\tborder:none;\n}\n\n/* correct button color to support dark theme */\n.tbl-container table thead th button{\n\tcolor:<<colour button-foreground>>\n}\n.tbl-container table thead th button svg {\n\tfill:<<colour button-foreground>>;\n}"},"$:/plugins/kookma/shiraz/styles/image-alignment":{"title":"$:/plugins/kookma/shiraz/styles/image-alignment","text":"/*Image aligning classes*/\n.image-align-right{\n float:right;\n margin:0.5em 0 1.3em 1.4em;\n}\n.image-align-left{\n float:left;\n margin: 0.5em 1.4em 1.3em 0;\n}\n.image-align-center{\n display:block;\n margin: 0.5em auto 1.3em; \n}\n\n.image-float-none {\n float: none !important;\n}","created":"20190918193736314","modified":"20210808052511534","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/image-basic":{"title":"$:/plugins/kookma/shiraz/styles/image-basic","text":".image-basic {\n text-align: center;\n font-style: italic;\n font-size: smaller;\n text-indent: 0;\n padding: 0.5em;\n}","created":"20181119182848505","modified":"20210808052511542","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/image-overlay":{"title":"$:/plugins/kookma/shiraz/styles/image-overlay","text":".image-overlay-container{\n width: 50%; \n box-sizing: border-box;\n}\n\n@media screen and (max-width: 640px){\n .image-overlay-container{\n display: block;\n width: 100%;\n }\n}\n\n@media screen and (min-width: 900px){\n .image-overlay-container{\n width: 33.33%;\n }\n}\n\n.image-overlay-container .image-overlay-title{\n color: #1a1a1a;\n text-align: center;\n margin-bottom:10px;\n}\n\n.image-overlay-content {\n position: relative;\n width: 90%;\n max-width: 400px;\n margin: auto;\n overflow: hidden;\n}\n\n.image-overlay-content .image-overlay-content-overlay {\n background: rgba(0,0,0,0.7);\n position: absolute;\n height: 99%;\n width: 100%;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n -webkit-transition: all 0.4s ease-in-out 0s;\n -moz-transition: all 0.4s ease-in-out 0s;\n transition: all 0.4s ease-in-out 0s;\n}\n\n.image-overlay-content:hover .image-overlay-content-overlay{\n opacity: 1;\n}\n\n.image-overlay-content-image{\n width: 100%;\n}\n\n.image-overlay-content-details {\n position: absolute;\n text-align: center;\n padding-left: 1em;\n padding-right: 1em;\n width: 100%;\n top: 50%;\n left: 50%;\n opacity: 0;\n -webkit-transform: translate(-50%, -50%);\n -moz-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transition: all 0.3s ease-in-out 0s;\n -moz-transition: all 0.3s ease-in-out 0s;\n transition: all 0.3s ease-in-out 0s;\n}\n\n.image-overlay-content:hover .image-overlay-content-details{\n top: 50%;\n left: 50%;\n opacity: 1;\n}\n\n.image-overlay-content-details h3{\n color: #fff;\n font-weight: 500;\n letter-spacing: 0.15em;\n margin-bottom: 0.5em;\n text-transform: uppercase;\n}\n\n.image-overlay-content-details p{\n color: #fff;\n font-size: 0.8em;\n}\n\n.image-overlay-fadeIn-bottom{\n top: 80%;\n}\n\n.image-overlay-fadeIn-top{\n top: 20%;\n}\n\n.image-overlay-fadeIn-left{\n left: 20%;\n}\n\n.image-overlay-fadeIn-right{\n left: 80%;\n}","created":"20181116173704182","modified":"20210808052511547","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/image-polaroid":{"title":"$:/plugins/kookma/shiraz/styles/image-polaroid","text":".image-polaroid {\n min-width:64px;\n background-color: #f8f9fa;\n box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n}\n.image-polaroid img {\n width: 100%;\n padding:10px;\n height: auto;\n}\n.image-polaroid .image-polaroid-caption {\n padding:10px 15px 10px;\n text-align: center; \n line-height: 1.4em;\n font-weight:300;\n font-size: 0.9em; \n}","created":"20181116094450565","modified":"20210808052511555","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/image-pretty":{"title":"$:/plugins/kookma/shiraz/styles/image-pretty","text":".image-pretty {\n min-width:64px;\n border: 1px solid #c8ccd1;\n background-color:#f8f9fa;\n}\n.image-pretty:hover {\n border: 1px solid #777;\n}\n.image-pretty img {\n padding:2px;\n width: 100%;\n height: auto;\n}\n.image-pretty .image-pretty-caption {\n padding:10px 15px 10px;\n text-align: center; \n line-height: 1.4em;\n font-weight:300;\n font-size: 0.9em; \n}\n\n","created":"20181115182806512","modified":"20210808052511563","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/image-slidein":{"title":"$:/plugins/kookma/shiraz/styles/image-slidein","text":".image-slidein { \n display: block; \n position: relative; \n /*float: left;*/\n overflow: hidden; \n /* margin: 0 20px 20px 0;*/\n}\n\n.image-slidein img {\n width: 100%;\n height: auto;\n}\n\n.image-slidein figcaption { \n position: absolute; \n background: rgba(0,0,0,0.75); \n color: white; \n padding: 10px 20px; \n opacity: 0;\n -webkit-transition: all 0.6s ease;\n -moz-transition: all 0.6s ease;\n -o-transition: all 0.6s ease;\n}\n.image-slidein:hover figcaption {\n opacity: 1;\n}\n.image-slidein:before { \n content: \"?\"; \n position: absolute; \n font-weight: 800; \n background: rgba(255,255,255,0.75); \n text-shadow: 0 0 5px white;\n color: black;\n width: 24px;\n height: 24px;\n -webkit-border-radius: 12px;\n -moz-border-radius: 12px;\n border-radius: 12px;\n text-align: center;\n font-size: 14px;\n line-height: 24px;\n -moz-transition: all 0.6s ease;\n opacity: 0.75;\t\n}\n.image-slidein:hover:before {\n opacity: 0;\n}\n\n.mr-cap-left:before { bottom: 10px; left: 10px; }\n.mr-cap-left figcaption { bottom: 0; left: -30%; }\n.mr-cap-left:hover figcaption { left: 0; }\n\n.mr-cap-right:before { bottom: 10px; right: 10px; }\n.mr-cap-right figcaption { bottom: 0; right: -30%; }\n.mr-cap-right:hover figcaption { right: 0; }\n\n.mr-cap-top:before { top: 10px; left: 10px; }\n.mr-cap-top figcaption { left: 0; top: -30%; }\n.mr-cap-top:hover figcaption { top: 0; }\n\n.mr-cap-bottom:before { bottom: 10px; left: 10px; }\n.mr-cap-bottom figcaption { left: 0; bottom: -30%;}\n.mr-cap-bottom:hover figcaption { bottom: 0; }\n","created":"20181117040213926","modified":"20210808052511579","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/mono":{"title":"$:/plugins/kookma/shiraz/styles/mono","text":".mono {\n\tcolor:unset;\n\tbackground-color: #f7f7f9;\n\tborder: 1px solid #e1e1e8;\n\twhite-space: pre-wrap;\n\tpadding: 0 3px 2px;\n\tborder-radius: 3px;\n\tfont-family: \"SFMono-Regular\",Consolas,\"Liberation Mono\",Menlo,Courier,monospace;\n}","created":"20181010192406005","modified":"20210808052511602","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/multicols/column":{"title":"$:/plugins/kookma/shiraz/styles/multicols/column","text":"/* multicolumn layouts with fixed column number works on the whole tiddler */\n.multicol .tc-tiddler-body {\n column-width: 14em;\n column-rule: 1px solid #ccc;\n}\n/* two columns responsive*/\n.multicol2 .tc-tiddler-body {\n\tcolumn-count:2; \n\tcolumn-width:15em;\n}\n/* three columns responsive*/\n.multicol3 .tc-tiddler-body {\n\tcolumn-count:3; \n\tcolumn-width:10em;\n}\n\n\n/* remove the extra space from first paragraph */\n.multicol .tc-tiddler-body > :first-child, \n.multicol2 .tc-tiddler-body > :first-child, \n.multicol3 .tc-tiddler-body > :first-child { margin-top: 0;}\n\n/*-------------------------------------------------------------------------------*/\n/* Classes for using with macro and div elements */\n.sh-multicol {\n column-width: 14em;\n column-rule: 1px solid #ccc;\n}\n/* two columns responsive*/\n.sh-multicol2 {\n\tcolumn-count:2; \n\tcolumn-width:15em;\n}\n/* three columns responsive*/\n.sh-multicol3 {\n\tcolumn-count:3; \n\tcolumn-width:10em;\n}\n\n/* remove the extra space from first paragraph */\n.sh-multicol > :first-child,\n.sh-multicol2 > :first-child,\n.sh-multicol3 > :first-child { margin-top: 0;}","created":"20190627204703061","modified":"20210808052511607","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/multicols/flex":{"title":"$:/plugins/kookma/shiraz/styles/multicols/flex","text":"/* multicolumn layout using flexbox courtesy from Bootstrap 4.3.1*/\n.flex-row {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n/* margin-right: -15px;\n margin-left: -15px;*/\n}\n\n.flex-col,\n.flex-col-1, \n.flex-col-2, \n.flex-col-3,\n.flex-col-4 {\n position: relative;\n width: 100%;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n/* for small screen width>=576px\nhttps://getbootstrap.com/docs/4.3/layout/grid/\n*/\n@media (min-width: 576px) {\n.flex-col {flex: 1 1 0; max-width: 100%;}\n.flex-col-1 {flex: 0 0 25%; max-width:25%}\n.flex-col-2 {flex: 0 0 50%; max-width:50%}\n.flex-col-3 {flex: 0 0 75%; max-width:75%}\n.flex-col-4 {flex: 0 0 100%; max-width:100%}\n}\n\n.flex-col > :first-child,\n.flex-col-1 > :first-child,\n.flex-col-2 > :first-child,\n.flex-col-3 > :first-child,\n.flex-col-4 > :first-child {\n margin-top: 0;}\n\n\n/* Alignment */\n.flex-align-items-center {\n align-items: center !important;\n}\n.flex-justify-content-center {\n justify-content: center !important;\n}\n\n.flex-no-gutters {\n margin-right: 0;\n margin-left: 0;\n}","created":"20191014193910006","modified":"20210808052511613","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/multicols/flex backup":{"title":"$:/plugins/kookma/shiraz/styles/multicols/flex backup","text":"/* multicolumn layout using flexbox courtesy from Bootstrap 4.3.1*/\n.flex-row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -15px;\n margin-left: -15px;\n}\n.flex-col-1, \n.flex-col-2, \n.flex-col-3 {\n position: relative;\n width: 100%;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n.flex-col-1{flex: 1 1 0;}\n.flex-col-2{flex: 2 1 0;}\n.flex-col-3{flex: 3 1 0;}\n\n.flex-col-1 > :first-child,\n.flex-col-2 > :first-child,\n.flex-col-3 > :first-child {\n\tmargin-top: 0;}","created":"20191030140900552","modified":"20210808052511618","type":"text/css"},"$:/plugins/kookma/shiraz/styles/multicols/storyriver":{"title":"$:/plugins/kookma/shiraz/styles/multicols/storyriver","text":"/* create story river in two column layout */\n.tc-story-river {\n display: flex;\n flex-wrap: wrap;\n}\n\n.tc-tiddler-frame\n{\n max-width: 49%; margin-right: 1%;\n /*max-width: 32%; margin-right: 1%; */\n}\n","created":"20140523214749659","modified":"20210808150936240","tags":"","type":"text/css"},"$:/plugins/kookma/shiraz/styles/notebook":{"title":"$:/plugins/kookma/shiraz/styles/notebook","text":"@media print{\n .notebook .tc-tiddler-body {\n padding-left:60px;\n margin-top:25px;\n }\n .notebook .tc-tiddler-title,\n .notebook .tc-subtitle,\n\t.notebook .tc-tags-wrapper {\n padding-left:60px;\n }\n}\n\n@media screen{\n .notebook .tc-tiddler-title,\n .notebook .tc-subtitle,\n\t.notebook .tc-tags-wrapper,\n\t.notebook .tc-tiddler-body {\n padding-left:30px;\n }\n\n}\t\n\n@media screen and (max-width:960px) {\n .notebook .tc-tiddler-title,\n .notebook .tc-subtitle,\n .notebook .tc-tags-wrapper,\n .notebook .tc-tiddler-body {\n padding-left:60px;\n }\n\n}\n/*prevent applying left border in edit mode */\n.notebook:not([data-tiddler-title^=\"Draft of\"]):before {\n content: '';\n position: absolute;\n top: 0; bottom: 0; left: 0;\n width: 50px;\n background: radial-gradient(#575450 6px, transparent 7px) repeat-y;\n background-size: 30px 30px;\n border-right: 3px solid #D44147;\n\t z-index:1;\n}\n\n.notebook .tc-tiddler-body {\n\t position: relative;\n background: linear-gradient(transparent, transparent 1.95em, #91D1D3 1.95em);\n background-size: 2em 2em;\n\t min-height:90px; \n}\n\n.notebook .tc-tiddler-body{\n\t padding-top:20px;\n font-family: \"Handlee\", cursive;\n font-weight:300;\n line-height:2em;\n color:#696969;\n}\n\n/* Setting font for other elements */\n.notebook .tc-tiddler-body pre,\n.notebook .tc-tiddler-body code,\n.notebook .tc-tiddler-body pre code\n{\n font-family: \"Handlee\", cursive;\n font-weight:300;\n}","created":"20210420164111716","modified":"20210808052511631","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/sticky-footer":{"title":"$:/plugins/kookma/shiraz/styles/sticky-footer","text":".sticky-footer {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n padding: 0.5rem;\n background-color: #efefef;\n text-align: center;\n margin-top: 5px;\n box-sizing: border-box;\n width: 100%;\n}\n","created":"20180907070611557","modified":"20210808052511635","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/tables":{"title":"$:/plugins/kookma/shiraz/styles/tables","text":".table-tight{\n\tfont-size:0.8em;\n}\n\n\n/*\nThis tiddler defines the custom stylesheet for tables \nApril 13, 2018\n*/\n\n/*center aligned table*/\n.table-center {\n margin:0 auto;\n}\n\n/* Table caption at top */\n.table-caption-top caption {\n caption-side:top;\n margin-bottom:0.2rem;\n}\n\n/* Striped row table */\n.table-striped-row tr:nth-child(even) td{\n background-color:#F3F6F6; \n}\n\n/* Striped column table */\n.table-striped-col tbody tr td:nth-child(odd) {\n\tbackground-color: #F3F6F6;\n}\n\n/*Borderless table*/\n.table-borderless, \n.table-borderless thead td, \n.table-borderless th, \n.table-borderless tr, \n.table-borderless td{\n border:0;\n}\n\n/* Table lines should be used with table-borderless for abbreviations and two column layout */\n\n.table-lines thead td, .table-lines th{\n border-bottom: 2px solid #dddddd;\n\t background-color:unset;\n }\n.table-lines td{\n border-bottom: 1px solid #dddddd;\n background-color:unset;\n }\n\n/* Table hover (yellow background on mouse over) */\n.table-hover tbody tr:hover{\n color: #212529;\n background-color: #e6e6e6;\n}\n.table-hover-yellow tbody tr:hover{background-color: #ffffcc;}\n.table-hover-cyan tbody tr:hover{background-color: #e6ffff;}\n\n/* Table with colored header */\n.thead-primary thead td, .thead-primary th{background-color: #007bff; color: #fff;}\n.thead-secondary thead td, .thead-secondary th{background-color: #6c757d; color: #fff;}\n.thead-success thead td, .thead-success th{background-color: #28a745; color: #fff;}\n.thead-warning thead td, .thead-warning th{background-color: #ffc107; color: #fff;}\n.thead-danger thead td, .thead-danger th{background-color: #dc3545; color: #fff;}\n.thead-info thead td, .thead-info th{background-color: #17a2b8; color: #fff;}\n.thead-dark thead td, .thead-dark th{background-color: #343a40; color: #fff;}\n.thead-light thead td, .thead-light th{background-color: #f8f9fa; color: #212529;}\n\n/* Table with colored header correct to fill svgs with white color */\n.thead-primary > thead> tr > td svg, .thead-primary > thead> tr > th svg,\n.thead-secondary > thead> tr > td svg, .thead-secondary > thead> tr > th svg,\n.thead-success > thead> tr > td svg, .thead-success > thead> tr > th svg,\n.thead-warning > thead> tr > td svg, .thead-warning > thead> tr > th svg,\n.thead-danger > thead> tr > td svg, .thead-danger > thead> tr > th svg,\n.thead-info > thead> tr > td svg, .thead-info > thead> tr > th svg,\n.thead-dark > thead> tr > td svg, .thead-dark > thead> tr > th svg\n {fill:#ffffff; padding:0 0 3px 0; }\n\n\n.thead-primary th .tc-tiddlylink, .thead-primary th a,\n.thead-secondary th .tc-tiddlylink, .thead-primary th a,\n.thead-success th .tc-tiddlylink, .thead-primary th a,\n.thead-warning th .tc-tiddlylink, .thead-primary th a,\n.thead-danger th .tc-tiddlylink, .thead-primary th a,\n.thead-info th .tc-tiddlylink, .thead-primary th a,\n.thead-dark th .tc-tiddlylink, .thead-primary th a{color:#ffffff}\n","created":"20180413092232257","modified":"20210808052511640","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/tiddler-title-class":{"title":"$:/plugins/kookma/shiraz/styles/tiddler-title-class","text":".title-primary .tc-title {\n color: #007bff;\n}\n.title-secondary .tc-title {\n color: #6c757d;\n}\n.title-success .tc-title {\n color: #28a745;\n}\n.title-info .tc-title {\n color: #17a2b8;\n}\n.title-warning .tc-title {\n color: #ffc107;\n}\n.title-danger .tc-title {\n color: #dc3545;\n}\n.title-light .tc-title {\n color: #f8f9fa;\n}\n.title-dark .tc-title {\n color: #343a40;\n}\n.title-white .tc-title {\n color: #fff;\n}","created":"20191101112257846","modified":"20210808052511648","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/ui/colorify-buttons":{"title":"$:/plugins/kookma/shiraz/styles/ui/colorify-buttons","text":"/* These css rules makes page control buttons in beatiful color */\n\n/*page control buttons*/\n.tc-page-controls .tc-image-new-button { fill: #5EB95E; } /*New tiddler button*/\n.tc-page-controls .tc-image-options-button { fill:#8058A5; } /*Open control pannel*/\n\n/* These css rules makes tiddler viewtoolbar buttons in beatiful color */\n\n.tc-tiddler-controls .tc-image-edit-button{fill:#f37b1d}\n.tc-tiddler-controls .tc-image-info-button{fill:#0e90d2}","created":"20191029092047069","modified":"20220801115310318","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/shiraz/styles/ui/edit-toolbar-buttons":{"title":"$:/plugins/kookma/shiraz/styles/ui/edit-toolbar-buttons","text":"/*Tiddler edit toolbar buttons as traffic lights*/\n.tc-tiddler-controls .tc-image-delete-button {fill:#ebb;}\n.tc-tiddler-controls .tc-image-cancel-button {fill:#ed9;}\n.tc-tiddler-controls .tc-image-done-button {fill:#beb;}","created":"20191029091851469","modified":"20220801114726830","tags":"","type":"text/css"},"$:/plugins/kookma/shiraz/styles/ui/view-toolbar-button-visibility":{"title":"$:/plugins/kookma/shiraz/styles/ui/view-toolbar-button-visibility","text":"/* Mouseover toolbar visibility: courtesy from Tobias Beer*/\n.tc-tiddler-frame .tc-titlebar button {\n opacity: 0;\n transition: opacity .5s ease-in-out;\n}\n.tc-tiddler-frame:hover .tc-titlebar button {\n zoom: 1;\n filter: alpha(opacity=100);\n opacity: 1;\n}\n","created":"20191029094209435","modified":"20220801114522318","tags":"","type":"text/css"},"$:/plugins/kookma/shiraz/templates/body/color":{"title":"$:/plugins/kookma/shiraz/templates/body/color","created":"20200210160016959","modified":"20210808052511653","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"color","type":"text/vnd.tiddlywiki","text":"\\define showCell()\n<style>\n.dt:not(:disabled):dt(.disabled) {cursor: pointer;}\na.dt.disabled,fieldset:disabled a.dt {pointer-events: none;}\n</style>\n<$link overrideClass=\"dt disabled\" to=\"\">\n<$edit-text tag=input type=color tiddler=<<currentRecord>> field=color/>\n</$link>\n\\end\n\n\\define edit_color() <$edit-text tag=input type=color tiddler=<<currentRecord>> field=<<currentColumn>>/>\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<<showCell>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<edit_color>> >\n <<showCell_Locked>>\n</$list>\n</$reveal>"},"$:/plugins/kookma/shiraz/templates/body/date":{"title":"$:/plugins/kookma/shiraz/templates/body/date","created":"20170128100657312","modified":"20211117172100619","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"created modified","type":"text/vnd.tiddlywiki","text":"<td class=\"shiraz-dtable-date\">\n<$view tiddler=<<currentRecord>> field=<<currentColumn>> format=\"date\" template=\"YYYY.0MM.0DD\"/>\n</td>"},"$:/plugins/kookma/shiraz/templates/body/default":{"title":"$:/plugins/kookma/shiraz/templates/body/default","created":"20191125202328213","modified":"20210808052511665","tags":"$:/tags/Table/BodyTemplate","type":"text/vnd.tiddlywiki","text":"<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<<showCell>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<editCell>> >\n <<showCell_Locked>>\n</$list>\n</$reveal>"},"$:/plugins/kookma/shiraz/templates/body/due-date":{"title":"$:/plugins/kookma/shiraz/templates/body/due-date","created":"20200206191120454","modified":"20211117172046922","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"due-date","type":"text/vnd.tiddlywiki","text":"\\define showCell()\n<$set tiddler=<<currentRecord>> field=<<currentColumn>> name=due-date>\n<$text text={{{[<due-date>split[-]split[.]join[]format:date[YYYY.0MM.0DD]]}}} />\n</$set>\n\\end\n\\define showCell_Locked() <span style=\"font-style:oblique;\"><<showCell>></span>\n\\define edit_date() <$edit-text tag=input type=date tiddler=<<currentRecord>> field=<<currentColumn>>/>\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\" class=\"shiraz-dtable-date\">\n<<showCell>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<edit_date>> >\n <<showCell_Locked>>\n</$list>\n</$reveal>\n\n<!-- Part of Task Manager\n this template ALWAYS works on fields -->"},"$:/plugins/kookma/shiraz/templates/body/email":{"title":"$:/plugins/kookma/shiraz/templates/body/email","created":"20191202210913762","modified":"20210808052511678","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"email","type":"text/vnd.tiddlywiki","text":"\\define display-email-address()\n<a class=\"tc-tiddlylink-external\" href=\"mailto:$(currentRecord)$!!$(currentColumn)$\" rel=\"noopener noreferrer\" target=\"_blank\">\n<<showCell>>\n</a>\n\\end\n\\define display-email-address_Locked()\n<a class=\"tc-tiddlylink-external\" href=\"mailto:$(currentRecord)$!!$(currentColumn)$\" rel=\"noopener noreferrer\" target=\"_blank\">\n<<showCell_Locked>>\n</a>\n\\end\n\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<<display-email-address>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<editCell>> >\n<<display-email-address_Locked>>\n</$list>\n</$reveal>\n\n"},"$:/plugins/kookma/shiraz/templates/body/priority":{"title":"$:/plugins/kookma/shiraz/templates/body/priority","created":"20200424102701026","modified":"20210808052511686","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"priority","type":"text/vnd.tiddlywiki","text":"\\define circle(color, fill)\n<svg width=\"12\" height=\"12\" >\n<circle cx=\"6\" cy=\"6\" r=\"5\" stroke=<<__color__>> fill=<<__fill__>> stroke-width=\"1\"/>\n</svg>\n\\end\n\n\\define showCell()\n<$list filter=\"[<currentRecord>get<currentColumn>match[very high]]\" variable=ignore>\n<$macrocall $name=\"circle\" color=\"#dc3545\" fill=\"#f8d7da\"/>\n</$list>\n<$list filter=\"[<currentRecord>get<currentColumn>match[high]]\" variable=ignore>\n<$macrocall $name=\"circle\" color=\"#ff8c00\" fill=\"#fff3cd\"/>\n</$list>\n<$list filter=\"[<currentRecord>get<currentColumn>match[normal]]\" variable=ignore>\n<$macrocall $name=\"circle\" color=\"#17a2b8\" fill=\"#d1ecf1\"/>\n</$list>\n<$list filter=\"[<currentRecord>get<currentColumn>match[low]]\" variable=ignore>\n<$macrocall $name=\"circle\" color=\"#007bff\" fill=\"#cce5ff\"/>\n</$list>\n<$list filter=\"[<currentRecord>get<currentColumn>match[very low]]\" variable=ignore>\n<$macrocall $name=\"circle\" color=\"#6c757d\" fill=\"#e2e3e5\"/>\n</$list>\n <$transclude tiddler=<<currentRecord>> field=<<currentColumn>> />\n\\end\n\n\\define showCell_Locked() <span style=\"font-style:oblique;\"><<showCell>></span>\n\n\\define select_priority()\n<$select tiddler=<<currentRecord>> field=<<currentColumn>> default=\"\"><option value=''>Select...</option><option value='very high'>very high</option><option value='high'>high</option><option value='normal'>normal</option><option value='low'>low</option><option value='very low'>very low</option><option value=''>no priority</option></$select>\n\\end\n\n\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<<showCell>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<select_priority>> >\n <<showCell_Locked>>\n</$list>\n<$reveal>\n\n<!-- Part of Task Manager\n this template ALWAYS works on fields\n -->"},"$:/plugins/kookma/shiraz/templates/body/status":{"title":"$:/plugins/kookma/shiraz/templates/body/status","created":"20200424100127763","modified":"20210808052511690","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"status","type":"text/vnd.tiddlywiki","text":"\\define showCell() <$transclude tiddler=<<currentRecord>> field=<<currentColumn>> mode=\"inline\" />\n\\define showCell_Locked() <span style=\"font-style:oblique;\"><<showCell>></span>\n\\define select_status()\n<$select tiddler=<<currentRecord>> field=<<currentColumn>> default=\"\"><option value=''>Select...</option><option value='open'>open</option><option value='not started'>not started</option><option value='in-work'>in-work</option><option value='on-hold'>on-hold</option><option value='complete'>complete</option><option value='rework'>rework</option><option value='closed'>closed</option></$select>\n\\end\n\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<<showCell>>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<select_status>> >\n <<showCell_Locked>>\n</$list>\n</$reveal>\n\n<!-- Part of Task Manager\n this template ALWAYS works on fields -->"},"$:/plugins/kookma/shiraz/templates/body/tags":{"title":"$:/plugins/kookma/shiraz/templates/body/tags","created":"20191125193831767","modified":"20210808052511699","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tags","type":"text/vnd.tiddlywiki","text":"<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<$list filter=\"[title<currentRecord>tags[]]\">\n<span class=\"tc-tag-list-item\" >\n<$set name=\"transclusion\" value=<<currentTiddler>>>\n<$macrocall $name=\"tag-pill-body\" tag=<<currentTiddler>> icon={{!!icon}} color={{!!color}} palette={{$:/palette}} element-tag=\"\"\"$button\"\"\" element-attributes=\"\"\"popup=<<tempTagPopup>> dragFilter='[all[current]tagging[]]' tag='span'\"\"\"/>\n<$reveal state=<<tempTagPopup>> style=\"position:absolute; z-index:9999;\" type=\"popup\" position=\"below\" animate=\"yes\" class=\"tc-drop-down\">\n<$set name=\"tv-show-missing-links\" value=\"yes\">\n<$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n</$set>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]\" variable=\"listItem\"> \n<$transclude tiddler=<<listItem>>/> \n</$list>\n<hr>\n<$macrocall $name=\"list-tagged-draggable\" tag=<<currentTiddler>>/>\n</$reveal>\n</$set>\n</span>\n</$list>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<!--check if the current column is not selected for sorting-->\n<$list filter=\"[<tempTableSort>getindex[sortIndex]match<currentColumn>]\" variable=ignore\nemptyMessage=<<editCell>> >\n <<showCell_Locked>>\n</$list>\n</$reveal>"},"$:/plugins/kookma/shiraz/templates/body/tbl-checkbox":{"title":"$:/plugins/kookma/shiraz/templates/body/tbl-checkbox","created":"20200206150644636","modified":"20220803160452747","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tbl-checkbox","type":"text/vnd.tiddlywiki","text":"\\define rowStyle() color:<<colour foreground>>; background-color:<<colour table-header-background>>;\n<td style=\"width:28px;text-align:center;\">\n<$checkbox tiddler=<<currentRecord>> tag=\"Done\"\ncheckactions=\"\"\"<$action-setfield $tiddler=<<tempTableStyle>> $index=<<currentRecord>> $value=<<rowStyle>> /><$action-setfield $tiddler=<<currentRecord>> status=\"complete\"/>\"\"\"\nuncheckactions=\"\"\"<$action-setfield $tiddler=<<tempTableStyle>> $index=<<currentRecord>> /><$action-setfield $tiddler=<<currentRecord>> status=\"rework\"/>\"\"\" />\n</td>\n\n<!-- classic style\n\"color:#155724;background-color:#d4edda;\"\n<<colour tab-foreground>>; background-color:<<colour tab-background>>\n-->"},"$:/plugins/kookma/shiraz/templates/body/tbl-clone":{"title":"$:/plugins/kookma/shiraz/templates/body/tbl-clone","created":"20201203153613838","modified":"20210808052511708","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tbl-clone","type":"text/vnd.tiddlywiki","text":"\\define cloneTiddler() <$action-createtiddler $basetitle=<<currentRecord>> $template=<<currentRecord>> />\n\n<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<td style=\"width:28px;text-align:center;\">\n <$button actions=<<cloneTiddler>> class=\"tc-btn-invisible\">\n\t {{$:/core/images/clone-button}}\n\t</$button>\n</td>\n</$list>"},"$:/plugins/kookma/shiraz/templates/body/tbl-delete":{"title":"$:/plugins/kookma/shiraz/templates/body/tbl-delete","created":"20170212101814663","modified":"20210808052511715","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tbl-delete","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<td style=\"width:28px;text-align:center;\">\n <$button class=\"tc-btn-invisible\">\n <$action-sendmessage $message=\"tm-delete-tiddler\" $param=<<currentRecord>>/>\n {{$:/core/images/delete-button}}\n </$button>\n</td>\n</$list>"},"$:/plugins/kookma/shiraz/templates/body/tbl-expand":{"title":"$:/plugins/kookma/shiraz/templates/body/tbl-expand","created":"20200209072642825","modified":"20210808052511720","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tbl-expand","type":"text/vnd.tiddlywiki","text":"<$reveal type=\"nomatch\" state=<<tempPathExpand>> text=\"show\" tag=\"td\">\n <$button class=\"tc-btn-invisible tc-tiddlylink\">\n <$action-setfield $tiddler=<<tempTableExpand>> $index=<<currentRecord>> $value=\"show\" />\n {{$:/core/images/right-arrow}}\n </$button>\n</$reveal>\n<$reveal type=\"match\" state=<<tempPathExpand>> text=\"show\" tag=\"td\">\n <$button class=\"tc-btn-invisible tc-tiddlylink\">\n <$action-setfield $tiddler=<<tempTableExpand>> $index=<<currentRecord>>/>\n {{$:/core/images/down-arrow}}\n </$button>\n</$reveal>"},"$:/plugins/kookma/shiraz/templates/body/tbl-linktype":{"title":"$:/plugins/kookma/shiraz/templates/body/tbl-linktype","created":"20210501184147078","modified":"20210808052511724","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"tbl-linktype","type":"text/vnd.tiddlywiki","text":"<td>\n<$text text={{{ [all[current]links[]match<currentRecord>then[link]] [all[current]backlinks[]match<currentRecord>then[backlink]] [all[current]tagging[]match<currentRecord>then[tagging]] ~[[transclusion]] }}} />\n</td>\n<!-- \ntb-linktype is not sortable not editable. The priority is as below:\nlink, backlink, tagging, transclusion\n-->"},"$:/plugins/kookma/shiraz/templates/body/title":{"title":"$:/plugins/kookma/shiraz/templates/body/title","created":"20170128100357203","modified":"20210808052511731","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"title","type":"text/vnd.tiddlywiki","text":"<td>\n<$link to=<<currentRecord>>><$text text=<<currentRecord>> /></$link>\n</td>"},"$:/plugins/kookma/shiraz/templates/body/type":{"title":"$:/plugins/kookma/shiraz/templates/body/type","created":"20200210063953546","modified":"20210808052511737","tags":"$:/tags/Table/BodyTemplate","tbl-column-list":"type","type":"text/vnd.tiddlywiki","text":"\\define showCell() <$transclude tiddler=<<currentRecord>> field=<<currentColumn>> mode=\"inline\" />\n<td>\n<<showCell>>\n</td>\n<!-- Note that the showCell here overrides the global showCell from table-dynamic macro -->"},"$:/plugins/kookma/shiraz/templates/footer/default":{"title":"$:/plugins/kookma/shiraz/templates/footer/default","created":"20200130171717175","modified":"20210808052511744","tags":"$:/tags/Table/FooterTemplate","type":"text/vnd.tiddlywiki","text":"<$vars idx={{{ [<currentColumn>addsuffix[/]addsuffix<footerRow>] }}}>\n<$set name=getFieldOrIndex filter=\"[<fieldOrIndex>]-index\" value=\"get\" emptyValue=\"getindex\">\n<$reveal type=\"nomatch\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<$transclude tiddler=<<tempTableFooter>> index=<<idx>> mode=\"inline\" />\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableEdit>> stateIndex=\"mode\" text=\"edit\" tag=\"td\">\n<$edit-text tiddler=<<tempTableFooter>> index=<<idx>> tag=\"input\" class=\"shiraz-dtable-textbox\"/>\n</$reveal>\n</$set>\n</$vars>"},"$:/plugins/kookma/shiraz/templates/footer/tbl-clone":{"title":"$:/plugins/kookma/shiraz/templates/footer/tbl-clone","created":"20201203155343568","modified":"20210808052511749","tags":"$:/tags/Table/FooterTemplate","tbl-column-list":"tbl-clone","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<td></td>\n</$list>"},"$:/plugins/kookma/shiraz/templates/footer/tbl-delete":{"title":"$:/plugins/kookma/shiraz/templates/footer/tbl-delete","created":"20200130174835714","modified":"20210808052511757","tags":"$:/tags/Table/FooterTemplate","tbl-column-list":"tbl-delete","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<td></td>\n</$list>"},"$:/plugins/kookma/shiraz/templates/footer/tbl-expand":{"title":"$:/plugins/kookma/shiraz/templates/footer/tbl-expand","created":"20200130173518861","modified":"20210808052511762","tags":"$:/tags/Table/FooterTemplate","tbl-column-list":"tbl-expand","type":"text/vnd.tiddlywiki","text":"<td style=\"width:28px;\"></td>"},"$:/plugins/kookma/shiraz/templates/header/default":{"title":"$:/plugins/kookma/shiraz/templates/header/default","created":"20170205223914688","modified":"20210808165151493","tags":"$:/tags/Table/HeaderTemplate","type":"text/vnd.tiddlywiki","text":"<$reveal type=\"nomatch\" stateTitle=<<tempTableSort>> stateIndex=\"sortIndex\" text=<<currentColumn>> tag=\"th\">\n<$button setTitle=<<tempTableSort>> setIndex=\"sortIndex\" setTo=<<currentColumn>> class=\"tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"hasnegate\" $value=\"false\"/>\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span>\n</$button>\n</$reveal>\n<$reveal type=\"match\" stateTitle=<<tempTableSort>> stateIndex=\"sortIndex\" text=<<currentColumn>> tag=\"th\">\n<$list filter=\"[<tempTableSort>getindex[hasnegate]match[false]]\" variable=ignore><!--set negate for sort-->\n<$button setTitle=<<tempTableSort>> setIndex=\"hasnegate\" setTo=\"true\" class=\"tbl-sort-svg tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"!\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span> {{$:/core/images/down-arrow}}\n</$button>\n</$list>\n<$list filter=\"[<tempTableSort>getindex[hasnegate]match[true]]\" variable=ignore><!--remove negate for sort-->\n<$button setTitle=<<tempTableSort>> setIndex=\"hasnegate\" setTo=\"false\" class=\"tbl-sort-svg tc-btn-invisible tc-tiddlylink\" >\n<$action-setfield $tiddler=<<tempTableSort>> $index=\"negate\" $value=\"\"/>\n<span style=\"text-transform: capitalize;\"><$text text=<<currentColumn>>/></span> {{$:/core/images/up-arrow}}\n</$button>\n</$list>\n</$reveal>\n"},"$:/plugins/kookma/shiraz/templates/header/tbl-checkbox":{"title":"$:/plugins/kookma/shiraz/templates/header/tbl-checkbox","created":"20200206151157578","modified":"20220803160745475","tags":"$:/tags/Table/HeaderTemplate","tbl-column-list":"tbl-checkbox","type":"text/vnd.tiddlywiki","text":"\\define rowStyle() color:<<colour foreground>>; background-color:<<colour table-header-background>>;\n\n\\define chk-checkactions()\n<$list filter=\"[subfilter<inputFilter>]\" variable=\"currentRecord\">\n<$action-listops $tiddler=<<currentRecord>> $tags=\"+[append[Done]]\" />\n<$action-setfield $tiddler=<<currentRecord>> status=\"complete\"/>\n<$action-setfield $tiddler=<<tempTableStyle>> $index=<<currentRecord>> $value=<<rowStyle>> />\n</$list>\n\\end\n\\define chk-uncheckactions()\n<$list filter=\"[subfilter<inputFilter>]\" variable=\"currentRecord\">\n<$action-listops $tiddler=<<currentRecord>> $tags=\"+[remove[Done]]\" />\n<$action-setfield $tiddler=<<currentRecord>> status=\"rework\"/>\n<$action-setfield $tiddler=<<tempTableStyle>> $index=<<currentRecord>> />\n</$list>\n\\end\n\n<th style=\"width:28px;min-width:28px;\">\n<$checkbox checkactions=<<chk-checkactions>> uncheckactions=<<chk-uncheckactions>> />\n</th>\n\n<!-- old style for checked row\n\"color:#155724;background-color:#d4edda;\"\n-->"},"$:/plugins/kookma/shiraz/templates/header/tbl-clone":{"title":"$:/plugins/kookma/shiraz/templates/header/tbl-clone","created":"20201203155440168","modified":"20210808052511782","tags":"$:/tags/Table/HeaderTemplate","tbl-column-list":"tbl-clone","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<th style=\"width:28px;text-align:center;\">\n<span>\n<$button class=\"tc-btn-invisible\" disabled=yes tooltip=\"disabled button\" style=\"cursor:default\">\n{{$:/core/images/clone-button}}\n</$button>\n</span>\n</th>\n</$list>"},"$:/plugins/kookma/shiraz/templates/header/tbl-delete":{"title":"$:/plugins/kookma/shiraz/templates/header/tbl-delete","created":"20170212102107998","modified":"20210808052511788","tags":"$:/tags/Table/HeaderTemplate","tbl-column-list":"tbl-delete","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[<tempTableEdit>getindex[mode]match[edit]]\" variable=ignore>\n<th style=\"width:28px;text-align:center;\">\n <span>\n <$button class=\"tc-btn-invisible\">\n <$action-setfield $tiddler=\"$:/temp/tables/delete-all\" text=<<currentTable>>/>\n {{$:/core/images/delete-button}}\n </$button>\n </span>\n</th>\n</$list>"},"$:/plugins/kookma/shiraz/templates/header/tbl-expand":{"title":"$:/plugins/kookma/shiraz/templates/header/tbl-expand","created":"20200209072944418","modified":"20220109164215950","tags":"$:/tags/Table/HeaderTemplate","tbl-column-list":"tbl-expand","type":"text/vnd.tiddlywiki","text":"<th style=\"width:28px;min-width:28px;\">\n <$list filter=\"[<tempTableExpand>indexes[]limit[1]]\">\n <$button class=\"tc-btn-invisible\">{{$:/core/images/fold-button}}\n <$action-setfield $tiddler=<<tempTableExpand>> text=\"\"/>\n </$button>\n </$list>\n</th>"},"$:/plugins/kookma/shiraz/templates/header/tbl-linktype":{"title":"$:/plugins/kookma/shiraz/templates/header/tbl-linktype","created":"20210517200330994","modified":"20210808052511806","tags":"$:/tags/Table/HeaderTemplate","tbl-column-list":"tbl-linktype","type":"text/vnd.tiddlywiki","text":"<th style=\"width:32px;text-align:center;cursor:default;\">Linktype</th>\n<!-- \ntb-linktype is not sortable not editable\n-->"},"$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette":{"title":"$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette","caption":"{{$:/plugins/kookma/shiraz/images/palette-switch}} {{$:/language/Buttons/Shiraz/Caption}}","created":"20201210171047824","dark-palette":"$:/palettes/SolarFlare","description":"Toggle between light/dark color palette","light-palette":"$:/palettes/Vanilla","list-after":"","modified":"20220803185853934","tags":"$:/tags/PageControls","type":"text/vnd.tiddlywiki","text":"\\whitespace trim\n<$vars \ndarkPalette ={{$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette!!dark-palette}}\nlightPalette={{$:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette!!light-palette}}\n> \n<$button \n tooltip={{$:/language/Buttons/Shiraz/Hint}} \n aria-label={{$:/language/Buttons/Shiraz/Caption}} \n class=<<tv-config-toolbar-class>>\n>\n <$list filter=\"[<tv-config-toolbar-icons>match[yes]]\">\n {{$:/plugins/kookma/shiraz/images/palette-switch}}\n </$list>\n\n <$list filter=\"[<tv-config-toolbar-text>match[yes]]\">\n <span class=\"tc-btn-text\">switch palettes</span>\n </$list>\n\n <$reveal type=\"match\" state=\"$:/palette\" text=<<darkPalette>> > \n <$action-setfield $tiddler=\"$:/palette\" text=<<lightPalette>> />\n </$reveal>\n <$reveal type=\"nomatch\" state=\"$:/palette\" text=<<darkPalette>> >\n <$action-setfield $tiddler=\"$:/palette\" text=<<darkPalette>> >\n </$reveal>\n</$button>\n</$vars>"},"$:/plugins/kookma/shiraz/ui/ControlPanel/Settings":{"title":"$:/plugins/kookma/shiraz/ui/ControlPanel/Settings","caption":"Shiraz","created":"20191018054657077","list-after":"$:/core/ui/ControlPanel/Settings/TiddlyWiki","modified":"20220801115256994","tags":"$:/tags/ControlPanel/SettingsTab $:/tags/MoreSideBar","type":"text/vnd.tiddlywiki","text":"These settings let you customise the behaviour of Shiraz plugin.\n\n---\n\n;Show Shiraz setting in more sidebar\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/ui/ControlPanel/Settings\" tag=\"$:/tags/MoreSideBar\"> Show setting in more sidebar</$checkbox>\n\n;Options\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/styles/multicols/storyriver\" tag=\"$:/tags/Stylesheet\"> Multicolumn story river</$checkbox>\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/styles/ui/colorify-buttons\" tag=\"$:/tags/Stylesheet\"> Colorful UI buttons</$checkbox>\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/styles/ui/view-toolbar-button-visibility\" tag=\"$:/tags/Stylesheet\"> Tiddler visibility on mouse hover</$checkbox>\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/styles/ui/edit-toolbar-buttons\" tag=\"$:/tags/Stylesheet\"> Traffic lights for edit toolbar buttons</$checkbox>\n:<$checkbox tiddler=\"$:/plugins/kookma/shiraz/styles/colorful-sidebar-tab\" tag=\"$:/tags/Stylesheet\"> Colorify sidebar tabs</$checkbox>\n\n;Set dark and light palettes\n{{$:/plugins/kookma/shiraz/ui/set-dark-light-palette}}\n\n\n"},"$:/plugins/kookma/shiraz/ui/set-dark-light-palette":{"title":"$:/plugins/kookma/shiraz/ui/set-dark-light-palette","created":"20210510155820574","dark-palette":"$:/palettes/SolarFlare","light-palette":"$:/palettes/Vanilla","modified":"20210808052511827","tags":"","type":"text/vnd.tiddlywiki","text":"\\define switchpaletteTid() $:/plugins/kookma/shiraz/ui/Buttons/SwitchPalette\n\n\\define selectPelette(title, default, tiddler, field)\n<label class=\"kk-switch-label\">$title$</label>\n<$select tiddler=<<__tiddler__>> field=<<__field__>> default=\"\">\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/Palette]]\" >\n<option value=<<currentTiddler>> >\n<$view field='name'>\n <$view field='title'/>\n</$view>\n</option>\n</$list>\n</$list>\n\\end\n\n<div style=\"margin-left:40px\">\n\n<$macrocall $name=selectPelette \n title=\"Dark palette\" filter=<<filterNight>> \n\tdefault=\"$:/palettes/SolarizedDark\" field=\"dark-palette\" \n\ttiddler=<<switchpaletteTid>> /><br>\n\n<$macrocall $name=selectPelette \n title=\"Light palette\" filter=<<filterDay>> \n\tdefault=\"$:/palettes/Vanilla\" field=\"light-palette\" \n\ttiddler=<<switchpaletteTid>> />\n\n<label class=\"kk-switch-label\">Reset to default</label>\n<$button> {{$:/core/images/erase}}\n<$action-setfield \n $tiddler=<<switchpaletteTid>> \n\t$field=dark-palette \n\t$value={{!!dark-palette}} />\n<$action-setfield \n $tiddler=<<switchpaletteTid>> \n\t$field=light-palette \n\t$value={{!!light-palette}} />\t\n\t\n<$action-setfield \n $tiddler=\"$:/palette\" \n\t$field=text\n\t$value={{!!light-palette}} />\t\t\n</$button>\n</div>\n<style>\n.kk-switch-label{\n width:105px;\n display: inline-block;\n}\n</style>\t"},"$:/plugins/kookma/shiraz/viewtemplates/sticky-footer":{"title":"$:/plugins/kookma/shiraz/viewtemplates/sticky-footer","created":"20180907071314793","modified":"20210808052511833","tags":"$:/tags/ViewTemplate","type":"text/vnd.tiddlywiki","text":"<$list filter=\"[all[current]has[sticky-footer]]\">\n<div class=\"sticky-footer\">\n{{!!sticky-footer}}\n</div>\n</$list>\n"},"$:/language/Buttons/Shiraz/Hint":{"title":"$:/language/Buttons/Shiraz/Hint","created":"20210520125309893","modified":"20210808054302552","tags":"","type":"text/vnd.tiddlywiki","text":"Switch dark/light color palette"},"$:/language/Buttons/Shiraz/Caption":{"title":"$:/language/Buttons/Shiraz/Caption","created":"20210520125335245","modified":"20210808054312009","tags":"","type":"text/vnd.tiddlywiki","text":"Switch dark/light color palette"}}}
{"tiddlers":{"$:/plugins/kookma/tamasha/animations/slideIn":{"title":"$:/plugins/kookma/tamasha/animations/slideIn","text":"/* https://www.w3schools.com/w3css/w3css_animate.asp*/\n.tamasha-animation-slidedown{position:relative;animation:animatetop 0.4s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}\n.tamasha-animation-slideleft{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}}\n.tamasha-animation-slideright{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}}\n.tamasha-animation-slideup{position:relative;animation:animatebottom 0.4s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}}\n.tamasha-animation-slidezoom {animation:animatezoom 0.8s ease-out}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}}","created":"20210130184033628","modified":"20210131150814704","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/history":{"title":"$:/plugins/kookma/tamasha/history","created":"20210107204722366","modified":"20210202174123721","tags":"","type":"text/vnd.tiddlywiki","text":"Full change log https://kookma.github.io/TW-Tamasha/#ChangeLog\n\n* ''0.4.2'' -- 2021.02.02 -- linear scaling of font size, new kimia theme\n* ''0.4.2'' -- 2021.02.01 -- css and ui cleanup\n* ''0.4.0'' -- 2021.01.27 -- dynamic font size for slide\n* ''0.3.0'' -- 2021.01.25 -- new shortcut keys, new transition effects for progress bar\n* ''0.2.0'' -- 2021.01.24 -- beta release\n* ''0.1.0'' -- 2020.12.12 -- alpha release\n"},"$:/plugins/kookma/tamasha/license":{"title":"$:/plugins/kookma/tamasha/license","created":"20210107204722371","modified":"20210129140611672","tags":"","type":"text/vnd.tiddlywiki","text":"Distributed under an MIT license.\n\nCopyright (c) 2020 - 2021 [[Mohammad Rahmani|https://github.com/kookma]]\n\n<<<\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n<<<"},"$:/plugins/kookma/tamasha/macros/frame":{"title":"$:/plugins/kookma/tamasha/macros/frame","created":"20210119143256561","modified":"20210131165620152","tags":"$:/tags/Macro/Tamasha","type":"text/vnd.tiddlywiki","text":"\\define presentation-frame-focus-selector() .$(myState)$\n\\define presentation-frame-class() tamasha-presentation-frame $(myState)$\n\n\\define slideBackground() [<stateNavigatorTid>get[text]] ~[tag<mainTag>first[]] :and[get[background]addprefix[background-color:]addsuffix[;]]\n"},"$:/plugins/kookma/tamasha/macros/navigator":{"title":"$:/plugins/kookma/tamasha/macros/navigator","created":"20201231071150623","modified":"20210129140329956","tags":"$:/tags/Macro/Tamasha","type":"text/vnd.tiddlywiki","text":"\\define stateNavigatorTid() $:/state/tamasha/navigator/$(currentTiddler)$/$(myState)$\n\\define loopSlides() [tag<mainTag>$(loopState)$[]]\n\n\\define goHome() <$action-setfield $tiddler=<<stateNavigatorTid>> text={{{[tag<mainTag>first[]]}}}/>\n\\define goEnd() <$action-setfield $tiddler=<<stateNavigatorTid>> text={{{[tag<mainTag>last[]]}}}/>\n\n\n\n\\define nextSlide() \n<$vars currentTid={{{[<stateNavigatorTid>get[text]] ~[tag<mainTag>first[]]}}}>\n<$list filter=\"[<loopShow>match[yes]then[first]else[last]]\" variable=\"loopState\">\n<$action-setfield $tiddler=<<stateNavigatorTid>> \n text={{{ [tag<mainTag>after<currentTid>] ~[subfilter<loopSlides>] }}} />\n</$list>\t\n</$vars>\n\\end\n\n\\define previousSlide()\n<$vars currentTid={{{[<stateNavigatorTid>get[text]]}}}>\n<$list filter=\"[<loopShow>match[yes]then[last]else[first]]\" variable=\"loopState\">\n<$action-setfield $tiddler=<<stateNavigatorTid>> \n text={{{ [tag<mainTag>before<currentTid>] ~[subfilter<loopSlides>] }}} />\n</$list>\t\t\n</$vars>\n\\end\n\n\\define navigator()\n<$list filter=\"[<stateNavigatorTid>get[text]] ~[tag<mainTag>first[]]\" variable=\"currentSlide\" emptyMessage=\"No slide existed or wrong input\">\n\t<div class=<<animationClass>> ><!-- this div also used for flexbox layout -->\n\t<$transclude tiddler=<<myTemplate>> mode=block/>\n\t</div>\n</$list> \n\\end"},"$:/plugins/kookma/tamasha/macros/presenter":{"title":"$:/plugins/kookma/tamasha/macros/presenter","created":"20210122151112086","modified":"20210131195124929","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define presenter(tag, loop:\"no\", footer:\"\", template:\"vanilla\", theme:\"vanda\", animation, state)\n\\import [all[tiddlers+shadows]tag[$:/tags/Macro/Tamasha]]\n<$vars\n mainTag=<<__tag__>>\n loopShow=<<__loop__>>\n slideFooter=<<__footer__>> \n myTemplate={{{ [all[tiddlers+shadows]tag[$:/tags/Tamasha/Template]search:title<__template__>] ~$:/plugins/kookma/tamasha/templates/vanilla }}} \n myTheme={{{ [all[tiddlers+shadows]tag[$:/tags/Tamasha/Theme]getindex<__theme__>] ~[<__theme__>] }}}\n animationClass={{{[<__animation__>trim[]!is[blank]addprefix[tamasha-animation-]]}}}\n myState={{{ [<__state__>trim[]is[blank]then[presenter]else<__state__>addsuffix<qualify>] }}}\n SlidesCount={{{[tag<__tag__>count[]]}}}\n >\n<$keyboard key=\"F\" actions=<<toggle-presentation-mode>> >\n<$keyboard key=\"escape\" actions=<<toggle-author-mode>> >\n<$keyboard key=\"H\" actions=<<goHome>> >\n<$keyboard key=\"E\" actions=<<goEnd>> >\n<$keyboard key=\"right down enter space\" actions=<<nextSlide>> >\n<$keyboard key=\"left up backspace\" actions=<<previousSlide>> >\n\n<div class=<<myTheme>> ><!-- apply theme -->\n<div class=<<presentation-frame-class>> tabindex=1 style={{{[subfilter<slideBackground>]}}} >\n\n<!-- Presentation Mode -->\n<div class={{{[<statePresentTid>getindex[overlayClass]] ~[[tamasha-overlay]]}}} style={{{[subfilter<slideBackground>]}}} >\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/slide\" mode=block/>\n</div>\n\n<!-- Author mode -->\n<div><!-- reserved for further development-->\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/slide\" mode=block/>\n</div>\n\n</div>\n</div>\n\n</$keyboard>\n</$keyboard>\n</$keyboard>\n</$keyboard>\n</$keyboard>\n</$keyboard>\n\n<$reveal type=\"match\" stateTitle=<<statePresentTid>> stateIndex=\"mode\" text=\"presentation-mode\">\n<style>body { overflow: hidden; /* Hide scrollbars */ }</style>\n</$reveal>\n\n</$vars>\n\\end\n"},"$:/plugins/kookma/tamasha/macros/toggle":{"title":"$:/plugins/kookma/tamasha/macros/toggle","created":"20201231090618034","modified":"20210129122518224","tags":"$:/tags/Macro/Tamasha","type":"text/vnd.tiddlywiki","text":"\\define statePresentTid() $:/state/tamasha/presentation/$(currentTiddler)$/$(myState)$\n\n\\define toggle-presentation-mode() \n<$action-setfield $tiddler=<<statePresentTid>> $index=\"overlayClass\" $value=\"tamasha-overlay open\"/>\n<$action-setfield $tiddler=<<statePresentTid>> $index=\"mode\" $value=\"presentation-mode\"/>\n<$action-sendmessage $message=\"tm-focus-selector\" $param=<<presentation-frame-focus-selector>> />\n\\end\n\\define toggle-author-mode()\n<$action-setfield $tiddler=<<statePresentTid>> $index=\"overlayClass\" $value=\"tamasha-overlay\"/>\n<$action-setfield $tiddler=<<statePresentTid>> $index=\"mode\" $value=\"author-mode\"/>\n<$action-sendmessage $message=\"tm-focus-selector\" $param=<<presentation-frame-focus-selector>> />\n\\end"},"$:/plugins/kookma/tamasha/readme":{"title":"$:/plugins/kookma/tamasha/readme","created":"20210107204722374","modified":"20210129122518233","tags":"","type":"text/vnd.tiddlywiki","text":"; Tamasha\nTamasha is a presentation app based on Tiddlywiki 5.1.23+\n\n;Code and demo\nFor learning plugin features, syntax, tutorial and examples see the plugin demo and code pages\n\n* Demo: https://kookma.github.io/TW-Tamasha/\n* Code: https://github.com/kookma/TW-Tamasha\n"},"$:/plugins/kookma/tamasha/styles/buttons":{"title":"$:/plugins/kookma/tamasha/styles/buttons","created":"20201231045002172","modified":"20210129122518307","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".tamasha-viewer-nav {\n\tvisibility: hidden;\n\topacity: 0.02;\n transition: visibility 0.5s, opacity 0.75s linear;\n\n\tfont-size:1.3em;\n\tbackground-color: <<colour background>>;\n\t/*border: 2px solid #9a9a9aaa;*/\n}\n\n.tamasha-presentation-frame:hover .tamasha-viewer-nav {\n\tvisibility: visible;\n\topacity: 0.6;\n}\n\n.tamasha-nav-button svg{\n\tfill: #9a9a9a;\n}\n\n.tamasha-nav-button:hover svg{\n/*\tfill: #ffffff; */\n fill: <<color foreground>>\n}\n.tamasha-nav-button,\n.tamasha-nav-button:focus {\n\toutline:none;\n}\n\n.tamasha-viewer-nav .tamasha-toolbar-separator {\n\tbackground-color:#9a9a9a;\n}\n\n"},"$:/plugins/kookma/tamasha/styles/content":{"title":"$:/plugins/kookma/tamasha/styles/content","text":".tamasha-slide-content{\t\n/*\tborder:1px dotted orange;*/ /*for debug purpose*/\n}","created":"20201231044947045","modified":"20210129174303521","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/footer":{"title":"$:/plugins/kookma/tamasha/styles/footer","text":".tamasha-slide-footer{\t\n/*\tborder-bottom: 1px dotted green;*/\n/*\t font-size:18px;\n line-height:24px;\t\n\tfont-weight:400; */\n\n}\n\n.tamasha-slide-footer span{\n\topacity: 0.8;\n/*\tcolor: darkblue;*/\n}","created":"20210115133308688","modified":"20210129122518323","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/frame":{"title":"$:/plugins/kookma/tamasha/styles/frame","created":"20210117164656409","modified":"20210129122518330","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".tamasha-presentation-frame{\n border: 1px solid #B2FBF6CC;\n}\n.tamasha-presentation-frame:focus{\n\toutline:none;\n}"},"$:/plugins/kookma/tamasha/styles/layout/buttons":{"title":"$:/plugins/kookma/tamasha/styles/layout/buttons","text":"/* buttons, slidenumber and progressbar are positioned based on\n .tamasha-presentation-frame\n*/\n\n.tamasha-viewer-nav {\n\tleft: 1.5rem;\n\tposition: absolute;\n\tbottom: 1rem;\n\tborder-radius:2px;\n\tpadding:4px 10px;\n}\n\n.tamasha-viewer-nav .tamasha-toolbar-separator {\n\tdisplay:inline-block;\n\twidth:2px;\n\theight:1.3em;\n\tmargin:0 4px;\n\tvertical-align: top;\n}","created":"20210106134346667","modified":"20210129122518339","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/content":{"title":"$:/plugins/kookma/tamasha/styles/layout/content","text":".tamasha-slide-content {\n font-size: 1.3rem;\n line-height: 1.85rem;\n padding: 30px;\n margin: 0 auto;\n max-width: 900px;\n height: 480px;\n overflow: hidden;\n margin-bottom: 4rem;\n}\n\n.tamasha-overlay .tamasha-slide-content {\n font-size: 3vh;\n line-height: 5vh;\n height: auto;\n padding: 8vh;\n}\n","created":"20210106135745822","modified":"20210202180141281","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/footer":{"title":"$:/plugins/kookma/tamasha/styles/layout/footer","text":".tamasha-slide-footer{\t\n\tposition: absolute; \n\tleft: 0; \n\tright: 0; \n\tmargin-left: auto; \n\tmargin-right: auto; \n\tbottom:1rem;\n\tmax-width:100%;\n\toverflow:hidden;\n\ttext-align:center;\n\tdisplay:inline-block;\n\tmax-width:40%;\n}","created":"20210115104602585","modified":"20210129122518356","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/frame":{"title":"$:/plugins/kookma/tamasha/styles/layout/frame","text":".tamasha-presentation-frame{\n\tposition:relative;\t\t\n\twidth:100%;\n\theight:100%;\n}","created":"20210117092237012","modified":"20210129122518364","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/overlay":{"title":"$:/plugins/kookma/tamasha/styles/layout/overlay","text":".tamasha-overlay {\n\theight: 0px; \n\tposition:fixed;\n\ttop:0; left:0;\n\tz-index:1500;\n\toverflow-y: hidden;\n\twidth:100%;\n}\n\n.tamasha-overlay.open {\n\theight: 100%; /* use full screen height */\n\tmax-height:100%;\n}","created":"20210106134000981","modified":"20210129122518382","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/progressbar":{"title":"$:/plugins/kookma/tamasha/styles/layout/progressbar","text":".tamasha-progress{\n\tleft:0;\n\tbottom: 0;\n\tposition: absolute;\n\twidth:100%;\n\theight:4px;\n}\n\n.tamasha-progress .bar{\n\tdisplay: block;\n\theight:100%;\n\twidth:100%; \n\ttransform-origin:0 0;\n\ttransform:sclaeX(0);\n\ttransition: transform 0.8s ease-in-out;\n}","created":"20210115133910870","modified":"20210129153532287","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/slidelist":{"title":"$:/plugins/kookma/tamasha/styles/layout/slidelist","text":".tamasha-popup{\n\tleft: 50px;\n\tposition: absolute;\n\tbottom: 60px;\n\n\tpadding-right:30px; /* to adapt with ol used inside popup */\n\tborder-radius:4px;\n\n\tmax-height:50%;\n\toverflow-y:auto;\n\tmax-width:50%;\n}\n\n.tamasha-popup .tc-btn-invisible{\n\ttext-align:left;\n}","created":"20210106140729502","modified":"20210131180409213","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/layout/slidenumber":{"title":"$:/plugins/kookma/tamasha/styles/layout/slidenumber","text":".tamasha-slide-number {\n\tposition: absolute;\n\tbottom: 1rem;\n\tright: 1.5rem;\n}\n\n.tamasha-number-circle {\n\tbox-sizing: content-box; \n\twidth: 1.5em;\n\theight: 1.5em;\n\tline-height: 1.5em;\n\ttext-align: center;\n\tborder-radius: 50%; \n}\n/* change the circle size: increase line-height=width=height */","created":"20210106140007444","modified":"20210129122518399","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/overlay":{"title":"$:/plugins/kookma/tamasha/styles/overlay","created":"20201231041850064","modified":"20210131122746614","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".tamasha-overlay {\n\ttransition-property: all;\n\ttransition-duration: 1s;\n\ttransition-timing-function: cubic-bezier(0, 1, 0.5, 1);\n\tbackground-color:<<colour background>>;\n}\n"},"$:/plugins/kookma/tamasha/styles/progressbar":{"title":"$:/plugins/kookma/tamasha/styles/progressbar","created":"20210110170610895","modified":"20210131184913509","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":"\\define progress-light() #e5e5e5\n\\define progress-dark() #494949\n\\define bar-light() #9a9a9a\n\\define bar-dark() #d79921\n\n<$vars \nlight=\"Blanca Blue Muted ContrastLight DesertSand Rocker SolarFlare SolarizedLight SpartanDay Vanilla [[Notebook Beige]] [[Notebook Grey]]\"\ndark=\"ContrastDark CupertinoDark DarkPhotos GruvboxDark Nord SolarizedDark SpartanNight Twilight\"\npalette={{{ [[$:/palette]get[text]removeprefix[$:/palettes/]] }}}\n>\n<$list filter=\"[enlist<dark>search:title<palette>then[dark]else[light]]\" variable=colorMacro>\n\n.tamasha-progress{\n\tbackground-color:<$macrocall $name={{{[<colorMacro>addprefix[progress-]]}}} />;\n}\n.tamasha-progress .bar{\n\tbackground-color:<$macrocall $name={{{[<colorMacro>addprefix[bar-]]}}} />;\n}\n</$list>\n</$vars>"},"$:/plugins/kookma/tamasha/styles/scrollbars":{"title":"$:/plugins/kookma/tamasha/styles/scrollbars","text":"/* custom scrollbar */\n.tamasha-popup::-webkit-scrollbar {\n width: 20px;\n}\n\n.tamasha-popup::-webkit-scrollbar-track {\n background-color: transparent;\n}\n\n.tamasha-popup::-webkit-scrollbar-thumb {\n background-color: #666666;\n border-radius: 20px;\n border: 6px solid transparent;\n background-clip: content-box;\n}\n\n.tamasha-popup::-webkit-scrollbar-thumb:hover {\n background-color: #909090; /* #a8bbbf;*/\n}","created":"20210101193022396","modified":"20210131184304342","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/slidelist":{"title":"$:/plugins/kookma/tamasha/styles/slidelist","text":".tamasha-popup{\n\tbackground-color: #323232;\n\tfont-size:1em;\n\tbox-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19);\n}\n\n.tamasha-popup .tc-btn-invisible{\n\tcolor:#b9b9b9;\n}\n\n.tamasha-popup button:focus{\n\toutline:none;\n}\n\n/* change number color*/\n.tamasha-popup li::marker { \n\tcolor:#b9b9b9;\n}\n\n/* slide in view: current slide in the slideList */\n.tamasha-popup .currentSlide .tc-btn-invisible,\n.tamasha-popup .currentSlide::marker {\n\tcolor:#fff;\n\tfont-size:0.9em;\n}\n\n","created":"20210101161416909","modified":"20210131180440752","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/styles/slidenumber":{"title":"$:/plugins/kookma/tamasha/styles/slidenumber","created":"20210101212605633","modified":"20210129122518439","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".tamasha-number-circle {\n\tborder: 0.1em solid #666;\n\tfont-size: 1.2em;\n\tfont-weight:300;\n\tbackground: <<colour background>>;\n\tcolor: #666;\n\topacity:0.9;\n}"},"$:/plugins/kookma/tamasha/styles/uisetting":{"title":"$:/plugins/kookma/tamasha/styles/uisetting","created":"20210202180320935","modified":"20210202180601520","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".noslidenumber .tamasha-slide-number{display:none}\n.noprogressbar .tamasha-progress{display:none}\n.nonavbutton .tamasha-viewer-nav {display:none}"},"$:/plugins/kookma/tamasha/templates/nolink":{"title":"$:/plugins/kookma/tamasha/templates/nolink","created":"20210131183020336","modified":"20210131183212076","tags":"$:/tags/Tamasha/Template","type":"text/vnd.tiddlywiki","text":"\\define tv-wikilinks() no\n<h2 class=\"title\"><$transclude tiddler=<<currentSlide>> field=title /></h2>\n<$transclude tiddler=<<currentSlide>> mode=block/>"},"$:/plugins/kookma/tamasha/templates/simple":{"title":"$:/plugins/kookma/tamasha/templates/simple","created":"20201231073430523","modified":"20210131183003513","tags":"$:/tags/Tamasha/Template","type":"text/vnd.tiddlywiki","text":"<$transclude tiddler=<<currentSlide>> mode=block/>"},"$:/plugins/kookma/tamasha/templates/vanilla":{"title":"$:/plugins/kookma/tamasha/templates/vanilla","created":"20210126130000247","modified":"20210131182956741","tags":"$:/tags/Tamasha/Template","type":"text/vnd.tiddlywiki","text":"<h2 class=\"title\"><$link to=<<currentSlide>> /></h2>\n<$transclude tiddler=<<currentSlide>> mode=block/>"},"$:/plugins/kookma/tamasha/themes/composite":{"title":"$:/plugins/kookma/tamasha/themes/composite","text":"vanda: vanda\nmitra: mitra\nkimia: kimia\nroya: vanda roya\nhoma: vanda homa\nleila: mitra leila\nirana: vanda irana","type":"application/x-tiddler-dictionary","created":"20210124104008856","modified":"20210131181446453","tags":"$:/tags/Tamasha/Theme"},"$:/plugins/kookma/tamasha/themes/homa":{"title":"$:/plugins/kookma/tamasha/themes/homa","text":".homa .tamasha-presentation-frame, \n.homa .tamasha-overlay {\n\tcolor:#ffffff;\n/*\tbackground-color:#A52A2A;*/\n\tbackground-image: linear-gradient(to left, #4d154f, #3b0f2f, #230c18, #000000);\n}\n.homa .tamasha-presentation-frame a:link {\n\tcolor: yellow;\n}\n.homa .tamasha-presentation-frame a:visited {\n\tcolor: #00ff00;\n}\n.homa .tamasha-slide-content pre {\n\tbackground-color: #230c18;\n}\n/* ---------- tables ---------- */\n.homa .tamasha-slide-content table th, \n.homa .tamasha-slide-content table thead td {\n\tbackground-color: #4d154f;\n}\n.homa .tamasha-slide-content table tfoot td{\n\tbackground-color: #4d154f;\n}","created":"20210124104512255","modified":"20210131181305897","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/irana":{"title":"$:/plugins/kookma/tamasha/themes/irana","text":".irana .tamasha-presentation-frame, \n.irana .tamasha-overlay {\ncolor:#efefef;\nbackground-color: #ee5522;\nbackground-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2000 1500'%3E%3Cdefs%3E%3CradialGradient id='a' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%23FB3'/%3E%3Cstop offset='1' stop-color='%23ee5522'/%3E%3C/radialGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='0' y1='750' x2='1550' y2='750'%3E%3Cstop offset='0' stop-color='%23f7882b'/%3E%3Cstop offset='1' stop-color='%23ee5522'/%3E%3C/linearGradient%3E%3Cpath id='s' fill='url(%23b)' d='M1549.2 51.6c-5.4 99.1-20.2 197.6-44.2 293.6c-24.1 96-57.4 189.4-99.3 278.6c-41.9 89.2-92.4 174.1-150.3 253.3c-58 79.2-123.4 152.6-195.1 219c-71.7 66.4-149.6 125.8-232.2 177.2c-82.7 51.4-170.1 94.7-260.7 129.1c-90.6 34.4-184.4 60-279.5 76.3C192.6 1495 96.1 1502 0 1500c96.1-2.1 191.8-13.3 285.4-33.6c93.6-20.2 185-49.5 272.5-87.2c87.6-37.7 171.3-83.8 249.6-137.3c78.4-53.5 151.5-114.5 217.9-181.7c66.5-67.2 126.4-140.7 178.6-218.9c52.3-78.3 96.9-161.4 133-247.9c36.1-86.5 63.8-176.2 82.6-267.6c18.8-91.4 28.6-184.4 29.6-277.4c0.3-27.6 23.2-48.7 50.8-48.4s49.5 21.8 49.2 49.5c0 0.7 0 1.3-0.1 2L1549.2 51.6z'/%3E%3Cg id='g'%3E%3Cuse href='%23s' transform='scale(0.12) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.2) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.25) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(0.3) rotate(-20)'/%3E%3Cuse href='%23s' transform='scale(0.4) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(0.5) rotate(20)'/%3E%3Cuse href='%23s' transform='scale(0.6) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.7) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.835) rotate(-40)'/%3E%3Cuse href='%23s' transform='scale(0.9) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(1.05) rotate(25)'/%3E%3Cuse href='%23s' transform='scale(1.2) rotate(8)'/%3E%3Cuse href='%23s' transform='scale(1.333) rotate(-60)'/%3E%3Cuse href='%23s' transform='scale(1.45) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(1.6) rotate(10)'/%3E%3C/g%3E%3C/defs%3E%3Cg transform='rotate(0 0 0)'%3E%3Cg transform='rotate(0 0 0)'%3E%3Ccircle fill='url(%23a)' r='3000'/%3E%3Cg opacity='0.5'%3E%3Ccircle fill='url(%23a)' r='2000'/%3E%3Ccircle fill='url(%23a)' r='1800'/%3E%3Ccircle fill='url(%23a)' r='1700'/%3E%3Ccircle fill='url(%23a)' r='1651'/%3E%3Ccircle fill='url(%23a)' r='1450'/%3E%3Ccircle fill='url(%23a)' r='1250'/%3E%3Ccircle fill='url(%23a)' r='1175'/%3E%3Ccircle fill='url(%23a)' r='900'/%3E%3Ccircle fill='url(%23a)' r='750'/%3E%3Ccircle fill='url(%23a)' r='500'/%3E%3Ccircle fill='url(%23a)' r='380'/%3E%3Ccircle fill='url(%23a)' r='250'/%3E%3C/g%3E%3Cg transform='rotate(0 0 0)'%3E%3Cuse href='%23g' transform='rotate(10)'/%3E%3Cuse href='%23g' transform='rotate(120)'/%3E%3Cuse href='%23g' transform='rotate(240)'/%3E%3C/g%3E%3Ccircle fill-opacity='0.1' fill='url(%23a)' r='3000'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");\nbackground-attachment: fixed;\nbackground-size: cover;\n/*https://www.svgbackgrounds.com*/\n}\n\n.irana .tamasha-slide-content pre {\n background-color: #2e2e2e;\n}\n/* ---------- tables ---------- */\n.irana .tamasha-slide-content table th, \n.irana .tamasha-slide-content table thead td {\n background-color: #ee5522;\n}\n.irana .tamasha-slide-content table tfoot td {\n\tbackground-color: #ef5d23;\n}\n\n.irana .tamasha-presentation-frame a:link {\n\tcolor:#efefef;\n}","created":"20210124105817944","modified":"20210201062332534","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/kimia":{"title":"$:/plugins/kookma/tamasha/themes/kimia","text":"/* hide ui elements */\n.kimia .tamasha-slide-number,\n.kimia .tamasha-viewer-nav {\n\tdisplay:none;\n}\n\n/*\n.kimia .tamasha-progress {\n\tdisplay:none;\n}\n*/\n\n.kimia .tamasha-slide-content {\t\n}\n\n\n.kimia .tamasha-slide-content .title{ /* used with vanilla template*/\n font-weight:300;\n}\n","created":"20210124154218942","modified":"20210202173934083","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/leila":{"title":"$:/plugins/kookma/tamasha/themes/leila","text":".leila .tamasha-presentation-frame, \n.leila .tamasha-overlay {\ncolor:#ffffff;\n/*background-color:#A52A2A;*/\nbackground: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);\n}\n\n.leila .tamasha-presentation-frame a:link {\n color: yellow;\n}\n\n.leila .tamasha-presentation-frame a:visited {\n color: #00ff00;\n}\n\n.leila .tamasha-slide-content pre {\n background-color: #182848;\n}\n\n/* ---------- tables ---------- */\n.leila .tamasha-slide-content table th, \n.leila .tamasha-slide-content table thead td {\n background-color: #4b6cb7;\n}","created":"20210124104852479","modified":"20210131181305924","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/mitra":{"title":"$:/plugins/kookma/tamasha/themes/mitra","text":".mitra .tamasha-slide-content {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-align:center;\n}\n\n.mitra .tamasha-slide-content{\n\tfont-weight:500;\n}\n\n.mitra .tamasha-slide-content .title{ /* used with vanilla template*/\n font-size:1.5em;\n line-height:1.5em;\n font-weight:500;\n}\n\n.mitra .tamasha-slide-content ol,\n.mitra .tamasha-slide-content ul{\n\ttext-align:left;\n}\n/* ---------- code ---------- */\n.mitra .tamasha-slide-content code,\n.mitra .tamasha-slide-content pre {\n\tfont-size:0.9em;\n\tline-height:1.2em;\n\ttext-align:left;\n}\n\n/* ---------- tables ---------- */\n.mitra .tamasha-slide-content table td,\n.mitra .tamasha-slide-content table th {\n\tfont-size:0.8em;\n\tfont-weight:400;\n}\n\n.mitra .tamasha-slide-content table caption {\n\tcaption-side:top;\n\tfont-size:1em;\n\tmargin-bottom:0.2rem;\n}\n","created":"20210118164232308","modified":"20210202171514557","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/roya":{"title":"$:/plugins/kookma/tamasha/themes/roya","text":".roya .tamasha-presentation-frame, \n.roya .tamasha-overlay {\ncolor:#000;\nbackground-color: #ffaa00;\nbackground-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1600 800'%3E%3Cg %3E%3Cpath fill='%23ffb100' d='M486 705.8c-109.3-21.8-223.4-32.2-335.3-19.4C99.5 692.1 49 703 0 719.8V800h843.8c-115.9-33.2-230.8-68.1-347.6-92.2C492.8 707.1 489.4 706.5 486 705.8z'/%3E%3Cpath fill='%23ffb800' d='M1600 0H0v719.8c49-16.8 99.5-27.8 150.7-33.5c111.9-12.7 226-2.4 335.3 19.4c3.4 0.7 6.8 1.4 10.2 2c116.8 24 231.7 59 347.6 92.2H1600V0z'/%3E%3Cpath fill='%23ffbf00' d='M478.4 581c3.2 0.8 6.4 1.7 9.5 2.5c196.2 52.5 388.7 133.5 593.5 176.6c174.2 36.6 349.5 29.2 518.6-10.2V0H0v574.9c52.3-17.6 106.5-27.7 161.1-30.9C268.4 537.4 375.7 554.2 478.4 581z'/%3E%3Cpath fill='%23ffc500' d='M0 0v429.4c55.6-18.4 113.5-27.3 171.4-27.7c102.8-0.8 203.2 22.7 299.3 54.5c3 1 5.9 2 8.9 3c183.6 62 365.7 146.1 562.4 192.1c186.7 43.7 376.3 34.4 557.9-12.6V0H0z'/%3E%3Cpath fill='%23ffcc00' d='M181.8 259.4c98.2 6 191.9 35.2 281.3 72.1c2.8 1.1 5.5 2.3 8.3 3.4c171 71.6 342.7 158.5 531.3 207.7c198.8 51.8 403.4 40.8 597.3-14.8V0H0v283.2C59 263.6 120.6 255.7 181.8 259.4z'/%3E%3Cpath fill='%23ffd624' d='M1600 0H0v136.3c62.3-20.9 127.7-27.5 192.2-19.2c93.6 12.1 180.5 47.7 263.3 89.6c2.6 1.3 5.1 2.6 7.7 3.9c158.4 81.1 319.7 170.9 500.3 223.2c210.5 61 430.8 49 636.6-16.6V0z'/%3E%3Cpath fill='%23ffe038' d='M454.9 86.3C600.7 177 751.6 269.3 924.1 325c208.6 67.4 431.3 60.8 637.9-5.3c12.8-4.1 25.4-8.4 38.1-12.9V0H288.1c56 21.3 108.7 50.6 159.7 82C450.2 83.4 452.5 84.9 454.9 86.3z'/%3E%3Cpath fill='%23ffeb49' d='M1600 0H498c118.1 85.8 243.5 164.5 386.8 216.2c191.8 69.2 400 74.7 595 21.1c40.8-11.2 81.1-25.2 120.3-41.7V0z'/%3E%3Cpath fill='%23fff558' d='M1397.5 154.8c47.2-10.6 93.6-25.3 138.6-43.8c21.7-8.9 43-18.8 63.9-29.5V0H643.4c62.9 41.7 129.7 78.2 202.1 107.4C1020.4 178.1 1214.2 196.1 1397.5 154.8z'/%3E%3Cpath fill='%23ffff66' d='M1315.3 72.4c75.3-12.6 148.9-37.1 216.8-72.4h-723C966.8 71 1144.7 101 1315.3 72.4z'/%3E%3C/g%3E%3C/svg%3E\");\nbackground-attachment: fixed;\nbackground-size: cover;\n/*https://www.svgbackgrounds.com*/\n}","created":"20210124102959224","modified":"20210131181305948","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/themes/vanda":{"title":"$:/plugins/kookma/tamasha/themes/vanda","text":"/* ---------- code ---------- */\n.vanda .tamasha-slide-content code,\n.vanda .tamasha-slide-content pre {\n\tfont-size:0.9em;\n\tline-height:1.2em;\n\ttext-align:left;\n}\n\n/* ---------- tables ---------- */\n.vanda .tamasha-slide-content table td,\n.vanda .tamasha-slide-content table th {\n\tfont-size:0.8em;\n\tfont-weight:400;\n}\n\n.vanda .tamasha-slide-content table caption {\n\tcaption-side:top;\n\tfont-size:1em;\n\tmargin-bottom:0.2rem;\n}\n","created":"20210120160001447","modified":"20210202171418172","tags":"$:/tags/Stylesheet","type":"text/css"},"$:/plugins/kookma/tamasha/ui/buttons":{"title":"$:/plugins/kookma/tamasha/ui/buttons","created":"20201231162035877","modified":"20210129122518531","type":"text/vnd.tiddlywiki","text":"\\define btn-toggle-presentation-mode()\n<$button class=\"tc-btn-invisible tamasha-nav-button\" actions=<<toggle-presentation-mode>> > {{$:/core/images/full-screen-button}} </$button>\n\\end\n\\define btn-toggle-author-mode()\n<$button class=\"tc-btn-invisible tamasha-nav-button\" actions=<<toggle-author-mode>> >{{$:/core/images/close-button}}</$button>\n\\end\n\n<div class=\"tamasha-viewer-nav\">\n<$button class=\"tc-btn-invisible tamasha-nav-button\" actions=<<previousSlide>> >{{$:/core/images/left-arrow}}\n</$button>\n<$button class=\"tc-btn-invisible tamasha-nav-button\" actions=<<nextSlide>> >{{$:/core/images/right-arrow}}\n</$button>\n<div class=\"tamasha-toolbar-separator\"> </div>\n<$button class=\"tc-btn-invisible tamasha-nav-button\" \n actions=\"\"\"<$action-listops $tiddler=<<stateListboxTid>> $field=\"text\" $subfilter=\"+[toggle[slideList]]\" />\"\"\" >\n\t {{$:/core/images/down-arrow}}\n</$button>\n<div class=\"tamasha-toolbar-separator\"> </div>\n<$list filter=\"[<statePresentTid>getindex[mode]match[presentation-mode]]\" \n variable=ignore emptyMessage=\"\"\"<<btn-toggle-presentation-mode>>\"\"\" \t>\n <<btn-toggle-author-mode>>\n</$list>\n</div>"},"$:/plugins/kookma/tamasha/ui/content":{"title":"$:/plugins/kookma/tamasha/ui/content","created":"20201231053912984","modified":"20210129122518539","type":"text/vnd.tiddlywiki","text":"<div class=\"tamasha-slide-content\">\n<<navigator>>\n</div>\n"},"$:/plugins/kookma/tamasha/ui/footer":{"title":"$:/plugins/kookma/tamasha/ui/footer","created":"20210115074727216","modified":"20210129122518546","tags":"","type":"text/vnd.tiddlywiki","text":"<div class=\"tamasha-slide-footer\">\n<span><<slideFooter>></span>\n</div>"},"$:/plugins/kookma/tamasha/ui/progressbar":{"title":"$:/plugins/kookma/tamasha/ui/progressbar","created":"20210112195456179","modified":"20210129165936287","tags":"","type":"text/vnd.tiddlywiki","text":"\\define calculate-progress()\n<span class=\"bar\"\n style={{{ [tag<mainTag>allbefore{$(stateNavigatorTid)$!!text}count[]add[1]divide<SlidesCount>fixed[2]addprefix[transform:scaleX(]addsuffix[);]] }}} >\n</span>\n\\end\n\n<div class=\"tamasha-progress\">\n\t<<calculate-progress>>\n</div>\n"},"$:/plugins/kookma/tamasha/ui/slide":{"title":"$:/plugins/kookma/tamasha/ui/slide","created":"20210114052937118","modified":"20210131180949356","tags":"","type":"text/vnd.tiddlywiki","text":"<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/content\" mode=block/>\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/footer\" mode=block/>\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/buttons\" mode=block/>\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/slidelist\" mode=block/>\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/slidenumber\" mode=block/>\n<$transclude tiddler=\"$:/plugins/kookma/tamasha/ui/progressbar\" mode=block/>"},"$:/plugins/kookma/tamasha/ui/slidelist":{"title":"$:/plugins/kookma/tamasha/ui/slidelist","created":"20201231205342137","modified":"20210131180949432","tags":"$:/tags/Macro/Tamasha","type":"text/vnd.tiddlywiki","text":"\\define stateListboxTid() $:/state/tamasha/listbox/$(currentTiddler)$/$(myState)$\n\n\\define gotoSlide() \n<$action-setfield $tiddler=<<stateNavigatorTid>> text=<<selectedTid>> />\n<$action-listops $tiddler=<<stateListboxTid>> $field=\"text\" $subfilter=\"+[toggle[slideList]]\" />\n<$action-sendmessage $message=\"tm-focus-selector\" $param=<<presentation-frame-focus-selector>> />\n\\end\n\n\n<$list filter=\"[<stateListboxTid>get[text]match[slideList]]\" variable=\"null\">\n<div class=\"tamasha-popup\">\n<ol>\n<$list filter=\"[tag<mainTag>]\" variable=\"selectedTid\">\n<li class={{{[<stateNavigatorTid>get[text]match<selectedTid>then[currentSlide]]}}} >\n<$button class=\"tc-btn-invisible\" actions=<<gotoSlide>> >\n<$view tiddler=<<selectedTid>> field=\"title\"/>\n</$button>\n</li>\n</$list>\n</ol>\n</div>\n</$list>\n"},"$:/plugins/kookma/tamasha/ui/slidenumber":{"title":"$:/plugins/kookma/tamasha/ui/slidenumber","created":"20210102082138734","modified":"20210129122518568","type":"text/vnd.tiddlywiki","text":"\\define calc-slideNumber()\n<$vars currentTid={{{[<stateNavigatorTid>get[text]] ~[tag<mainTag>first[]]}}}>\n<$text text={{{ [tag<mainTag>allbefore:include<currentTid>count[]pad[2]] }}} />\n</$vars>\n\\end\n<div class=\"tamasha-slide-number\">\n<div class=\"tamasha-number-circle\"><<calc-slideNumber>></div>\n</div>"}}}
{
"tiddlers": {
"$:/plugins/telmiger/details/details.css": {
"text": "/* details and summary */\n\ndetails {\n transition: height 1s ease;\n padding: 0 0.5em 0 0.66em;\n margin-top: 0.66em;\n margin-bottom: 0.66em;\n}\n\ndetails + details {\n margin-top: -0.46em;\n}\n\ndetails[open] {\n padding-bottom: 1em;\n}\n\ndetails:not([open]) { \n cursor: pointer;\n}\n\ndetails > summary {\n display: list-item;\n margin: 0 -0.5em 0 -0.66em;\n padding: 0.2em 0.5em 0.2em 0.66em;\n padding-left: 1.76em; /* adjust for indentation */\n text-indent: -1.1em;\n cursor: pointer;\n}\n\ndetails[open] > summary {\n margin-bottom: 1em;\n}\n\ndetails[open] > *:first-child:not(summary) {\n margin-top: 1em;\n}\n",
"title": "$:/plugins/telmiger/details/details.css",
"tags": "$:/tags/Stylesheet",
"modifier": "Thomas Elmiger",
"modified": "20180929131615369",
"creator": "Thomas Elmiger",
"created": "20170122140815442"
},
"$:/plugins/telmiger/details/details.js": {
"text": "/*\\\ntitle: $:/plugins/telmiger/details/details.js\ntype: application/javascript\nmodule-type: widget\n\nDetails widget v 0.8\n\nWill output an HTML 5 <details> section including a <summary>\n\n```\n\t<details>\n\t\t<summary>This sums it up</summary> \n\t\tAll the details follow here.\n\t</details>\n```\n\n|Parameter |Description |h\n|summary |Optional text to display as summary. Wins over field (see below). |\n|open |Optional initial state, set to \"open\" to show details on load. Defaults to \"\". |\n|state |An optional TextReference containing the state. Wins over open. |\n|field |Optionally, the summary is taken from the field with this name in a given tiddler. Defaults to \"title\". |\n|tiddler |Optional title of a tiddler to watch, connected to field. Defaults to current tiddler. |\n|class |Optional CSS classes to be assigned to the details tag. |\n\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DetailsWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDetailsWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDetailsWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute attributes\n\tthis.computeAttributes();\n\t// Execute logic\n\tthis.execute();\n\t// Create elements\n\tthis.detailsDomNode = this.document.createElement(\"details\");\n\tif(this.detailsClass !== \"\") {\n\t\t// this.detailsClass += \" \";\n\t\t// this.detailsClass += \"tc-details\";\n\t\tthis.detailsDomNode.setAttribute(\"class\",this.detailsClass);\n\t}\n\tif(this.detailsOpen == \"open\") {\n\t\tthis.detailsDomNode.setAttribute(\"open\",\"open\");\n\t}\n\tif(this.detailsSummary !== \"\") {\n\t\tthis.summaryDomNode = this.document.createElement(\"summary\");\n\t\t// this.summaryDomNode.setAttribute(\"class\",\"tc-summary\");\n\t\tthis.detailsDomNode.appendChild(this.summaryDomNode);\n\t\tthis.summaryDomNode.appendChild(this.document.createTextNode(this.detailsSummary));\n\t}\n// register an event listener\n/* Maybe this can be reactivated later, see below.\n\tif(this.detailsStateTitle) {\n\t\t$tw.utils.addEventListeners(this.detailsDomNode,[\n\t\t\t{name: \"toggle\", handlerObject: this, handlerMethod: \"handleToggleEvent\"},\n\t\t]);\n\t}\n*/\n// As iOS mobile browsers lack support of toggle events on details \n// we emulate the toggle event using click\n\tif(this.detailsStateTitle && this.summaryDomNode) {\n\t\t$tw.utils.addEventListeners(this.summaryDomNode,[\n\t\t\t{name: \"click\", handlerObject: this, handlerMethod: \"handleToggleEvent\"},\n\t\t]);\n\t} else {\n\t\tif(this.detailsStateTitle) {\n\t\t\t$tw.utils.addEventListeners(this.detailsDomNode,[\n\t\t\t\t{name: \"click\", handlerObject: this, handlerMethod: \"handleToggleEvent\"},\n\t\t\t]);\n\t\t}\n\t}\n\t// Insert the details into the DOM and render any children\n\tthis.parentDomNode.insertBefore(this.detailsDomNode,nextSibling);\n\tthis.renderChildren(this.detailsDomNode,null);\n\tthis.domNodes.push(this.detailsDomNode);\n};\n\n/*\nRetrieve the value of the summary\n*/\nDetailsWidget.prototype.getSummary = function() {\n\tvar summary = \"\";\n\tif(this.summaryTitle === \"Tiddler not found\" && this.summaryField === \"\") {\n\t// nothing defined: leave empty \n\t\tsummary = \"\";\n\t} else {\n\t\t// tiddler defined? use defined field or title\n\t\tif(this.myTiddler) {\n\t\t\tif(this.summaryField === \"title\" || this.summaryField === \"\") {\n\t\t\t\tsummary = this.summaryTitle;\n\t\t\t} else {\n\t\t\t\tif(this.summaryField === \"text\") {\n \t\t// getTiddlerText() triggers lazy loading of skinny tiddlers\n\t\t\t\t\tsummary = this.wiki.getTiddlerText(this.summaryTitle);\n\t\t\t\t} else {\n\t\t\t\t\tsummary = this.myTiddler.fields[this.summaryField];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif(this.summaryField !== \"\" && this.summaryField !== \"text\") {\n\t\t\t\t// try defined field in current tiddler\n\t\t\t\tvar tiddler = this.wiki.getTiddler(this.getVariable(\"currentTiddler\"));\n\t\t\t\tsummary = tiddler.fields[this.summaryField];\n\t\t\t} else {\n\t\t\t\tsummary = \"\";\n\t\t\t}\n\t\t}\n\t}\n return summary;\n};\n\n/*\nRetrieve the value of the state text reference\n*/\nDetailsWidget.prototype.getStateFromReference = function() {\n var state = this.detailsStateTitle ? this.wiki.getTextReference(this.detailsStateTitle,\"\",this.getVariable(\"currentTiddler\")) : \"\";\n return state;\n};\n\n/*\nCheck all open signals, state fields/tiddlers get priority\n*/\nDetailsWidget.prototype.getOpenState = function() {\n\tvar result = \"\";\n\tif((this.detailsOpenDefault !== \"\" && this.detailsOpenDefault !== \"no\") \n\t || this.detailsState === \"open\") {\n\t\tresult = \"open\";\n\t } \n\tif(this.detailsStateTitle !==\"\" && this.detailsState !== \"open\") {\n\t\tresult = \"\";\n\t}\n\treturn result;\n};\n\n/*\nUpdate the state text reference after click event\n*/\nDetailsWidget.prototype.updateState = function(openState) {\n\tvar fieldValue = \"false\";\n\tvar currentTiddler = this.getVariable(\"currentTiddler\");\n // get the title for the (existing/new) tiddler\n\tvar tr = $tw.utils.parseTextReference(this.detailsStateTitle);\n\tvar tidTitle = tr.title || currentTiddler;\n // is it an existing state tiddler?\n\tvar isStateTiddler = (tr.title === this.detailsStateTitle);\n\tvar hasStateTiddler = this.wiki.tiddlerExists(tr.title);\n\tvar currentStateTiddler = (tr.title === currentTiddler);\n\tif(isStateTiddler || hasStateTiddler || (currentStateTiddler && tr.field !== \"text\")) { \n\t\t// Set the state field (but never overwrite the current tiddler’s text field\n\t\tthis.wiki.setText(tidTitle,tr.field,tr.index,openState);\n\t} else {\n\t\tif(!hasStateTiddler && tidTitle !== currentTiddler) {\n\t\t\tthis.createTiddler(tidTitle);\n\t\t\tthis.wiki.setText(tidTitle,tr.field,tr.index,openState);\n\t\t} else {\n\t\t\tconsole.log (\"Something went wrong in updateState\");\n\t\t}\n\t}\n};\n\n/*\nCreate a tiddler with a title only\n*/\nDetailsWidget.prototype.createTiddler = function(tidTitle) {\n\tthis.wiki.addTiddler(new $tw.Tiddler(\n\t\tthis.wiki.getCreationFields(),\n\t\tthis.wiki.getModificationFields(),\n\t\t{\n\t\t\ttitle: tidTitle,\n\t\t\ttags: []\n\t\t}\n\t));\n};\n\n/*\nSet openState according to click\n*/\nDetailsWidget.prototype.handleToggleEvent = function(event) {\n\t// check if an open attribute is present\n\tvar newState = this.detailsDomNode.open ? \"\" : \"open\";\n\t// update only, if the node has a new state\n\tif(newState !== this.detailsState) {\n\t\tthis.updateState(newState);\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nDetailsWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes \n\tvar tryTiddler = this.getAttribute(\"tiddler\");\n\tthis.myTiddler = this.wiki.getTiddler(tryTiddler);\n\tthis.summaryTitle = this.myTiddler ? tryTiddler : \"Tiddler not found\";\n\tthis.summaryField = this.getAttribute(\"field\",\"\");\n\tthis.detailsSummary = this.getAttribute(\"summary\") || this.getSummary();\n\tthis.detailsStateTitle = this.getAttribute(\"state\",\"\");\n\tthis.detailsState = this.getStateFromReference();\n\tthis.detailsOpenDefault = this.getAttribute(\"open\",\"\");\n\tthis.detailsOpen = this.getOpenState();\n\tthis.detailsClass = this.getAttribute(\"class\",\"\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nDetailsWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.summary || changedAttributes.state || changedAttributes.open || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false;\n\t\tvar testState = this.getStateFromReference();\n\t\tif(testState !== this.detailsState) {\n\t\t\t// state change\n\t\t\tthis.refreshSelf();\n\t\t\trefreshed = true;\n\t\t} \n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\nexports.details = DetailsWidget;\n\n})();",
"type": "application/javascript",
"title": "$:/plugins/telmiger/details/details.js",
"tags": "Plugins",
"module-type": "widget",
"modifier": "Thomas Elmiger",
"modified": "20180929212032187",
"creator": "Thomas Elmiger",
"created": "20170124173619910"
},
"$:/plugins/telmiger/details/icon": {
"created": "20170205205314072",
"text": "<svg class=\"tc-image-button telmiger-icon\" viewBox=\"0 0 128 128\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\" viewBox=\"0 0 128 128\" role=\"img\" aria-labelledby=\"title\"><title id=\"title\">T</title><path class=\"circle\" d=\"M64 2C30 2 2 29.753 2 64c0 34.235 27.753 62 62 62s62-27.752 62-62C126 29.753 98.221 2 64 2z\"/><path class=\"t\" d=\"M100.41 63.254c-2.886 1.92-7.544 2.883-13.979 2.883h-8.008c-4.246 0-7.331.845-9.254 2.536-1.922 1.69-3.449 5.086-4.576 10.19 0 0-.181 1.481-.503 1.481s-.369-.877-.518-1.586a37.897 37.897 0 0 0-.721-2.754c-.631-2.137-1.262-3.753-1.894-4.847-.764-1.359-1.727-2.452-2.889-3.28-1.162-.83-2.49-1.326-3.985-1.492l-2.092-.248H41.73c-6.144 0-10.711-.962-13.7-2.884-4.976-3.159-7.649-9.129-8.02-17.91-.03-.706.003-1.351.132-2.171h.585c.399 3.975 3.679 7.048 6.086 9.219 2.408 2.172 6.269 3.258 11.581 3.258h9.313c5.347 0 9.257 1.226 11.731 3.68 2.231 2.213 3.701 5.68 4.406 10.4.076.511.03.736.178.736.149 0 .11-.256.17-.783.713-6.122 3.085-10.219 7.117-12.294 2.487-1.292 6.434-1.906 11.841-1.839l6.368.1c4.311.066 7.942-.788 10.893-2.56 2.953-1.773 6.447-5.079 6.844-9.917h.595c.183.478.16 1.576.127 2.333-.371 8.752-2.894 14.668-7.567 17.749z\"/></svg>\n<style>\n.telmiger-icon .circle { fill: #e2001a }\n.telmiger-icon .t { fill: #fff }\n</style>",
"title": "$:/plugins/telmiger/details/icon",
"tags": "",
"modified": "20171219183752113"
},
"$:/plugins/telmiger/details/license": {
"text": "!! Plugin license\n!!!The MIT License (MIT)\n\n```\nCopyright © 2017/2018 Thomas Elmiger – thomas-elmiger.ch\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```",
"title": "$:/plugins/telmiger/details/license",
"tags": "",
"modified": "20170205214435064",
"created": "20170205213335455"
},
"$:/plugins/telmiger/details/readme": {
"created": "20170205212323032",
"text": "! ~DetailsWidget\n\n{{$:/plugins/telmiger/details/about}}\n\nDocumentation can be found at http://tid.li/tw5/plugins.html#DetailsWidget\n",
"title": "$:/plugins/telmiger/details/readme",
"tags": "",
"modified": "20200603211110057"
},
"$:/plugins/telmiger/details/colours.css": {
"text": "/* details and summary colours */\n\ndetails {\n background-color: <<colour tiddler-info-tab-background>>;\n color: <<colour foreground>>;\n}\n\ndetails summary {\n background-color: <<colour dropdown-tab-background>>;\n}\n\ndetails.notification summary {\n background-color: <<colour notification-background>>;\n /* TW leaves color undefined/uses foreground */\n}\n\ndetails.warning summary {\n background-color: #ffbbaf;\n color: #000;\n}\n\ndetails.success summary {\n background-color: #88edc5;\n color: #000;\n}\n",
"title": "$:/plugins/telmiger/details/colours.css",
"tags": "$:/tags/Stylesheet",
"modifier": "Thomas Elmiger",
"modified": "20180926204140772",
"creator": "Thomas Elmiger",
"created": "20180925155320737"
},
"$:/plugins/telmiger/DetailsWidget/support": {
"created": "20200603204816640",
"text": "{{$:/plugins/telmiger/support}}",
"title": "$:/plugins/telmiger/DetailsWidget/support",
"tags": "",
"modified": "20200603204849180"
},
"$:/plugins/telmiger/support": {
"created": "20200604213259310",
"text": "!! Support the Author\n\n''Hi!'' I’m Thomas, the author of [[tid.li/tw5/plugins.html|https://tid.li/tw5/plugins.html]]. Feedback is always welcome, as well as funding for maintenance, support and new projects :)\n\n---\n\n!!! One Time Support\n\nIf using my plugins just makes you happy, consider a one time payment via ~PayPal to reward the effort:\n\nhttps://www.paypal.me/telmiger\n\n---\n\n!!! Permanent Support\n\nIf my tools make you more productive or save you time in your job or your everyday life, you can support me as a Patron: \n\nhttps://www.patreon.com/telmiger\n\n---\n\n!!! Thank You\n\nSubstantial parts of my availabe time go to the deveopment of useful plugins for [[TiddlyWiki|https://tiddlywiki.com/]]. – Many others do the same and I would like to thank them all, especially [[Jeremy Ruston|https://tiddlywiki.com/#JeremyRuston]] and all the active members of the community!\n\n//Hereby I promise to share future revenues (if any) with other developers who’s works I use or who inspired me.//\n\nIf you like my work, I would be very happy to hear from you.\n\n''Thank you very much for your support!''<br>\n//Thomas//\n\nhttps://thomas-elmiger.ch",
"title": "$:/plugins/telmiger/support",
"tags": "",
"modifier": "Thomas Elmiger",
"modified": "20200604213305050",
"creator": "Thomas Elmiger"
},
"$:/plugins/telmiger/details/about": {
"created": "20200603211101398",
"modified": "20200603211101398",
"title": "$:/plugins/telmiger/details/about",
"text": "Create HTML 5 `<details>` elements including a `<summary>` using this widget.\n\n<$details summary=\"The details element – W3C definition\">\n\n<<<\nThe [[details|http://w3c.github.io/html/interactive-elements.html#elementdef-details]] element represents a disclosure widget from which the user can obtain additional information or controls.\n<<< W3C\n\n</$details>\n\n<$details summary=\"Code example\" open=\"no\">\n\n```\n<$details summary=\"This should be open\" open=\"yes\">\n\nContent will be immediately visible if open is set to \"yes\".\n\n</$details>\n```\n\n</$details>",
"tags": ""
}
}
}
{"tiddlers":{"$:/plugins/tiddlywiki/bibtex/deserializer.js":{"title":"$:/plugins/tiddlywiki/bibtex/deserializer.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/bibtex/deserializer.js\ntype: application/javascript\nmodule-type: tiddlerdeserializer\n\nBibTeX file deserializer\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar bibtexParse = require(\"$:/plugins/tiddlywiki/bibtex/bibtexParse.js\");\n\n/*\nParse an BibTeX file into tiddlers\n*/\nexports[\"application/x-bibtex\"] = function(text,fields) {\n\tvar data,\n\t\tresults = [];\n\t// Parse the text\n\ttry {\n\t\tdata = bibtexParse.toJSON(text)\n\t} catch(ex) {\n\t\tdata = ex.toString();\n\t}\n\tif(typeof data === \"string\") {\n\t\treturn [{\n\t\t\ttitle: \"BibTeX import error\",\n\t\t\ttext: data\n\t\t}];\n\t}\n\t// Convert each entry\n\t$tw.utils.each(data,function(entry) {\n\t\tvar fields = {\n\t\t\ttitle: entry.citationKey,\n\t\t\t\"bibtex-entry-type\": entry.entryType\n\t\t};\n\t\t$tw.utils.each(entry.entryTags,function(value,name) {\n\t\t\tfields[\"bibtex-\" + name.toLowerCase()] = value;\n\t\t});\n\t\tresults.push(fields);\n\t});\n\t// Return the output tiddlers\n\treturn results;\n};\n\n})();\n","type":"application/javascript","module-type":"tiddlerdeserializer"},"$:/plugins/tiddlywiki/bibtex/readme":{"title":"$:/plugins/tiddlywiki/bibtex/readme","text":"The BibTeX plugin provides a deserializer that can convert bibliographic entries in `.bib` files into individual tiddlers.\n\nYou can use it in the browser by dragging and dropping a `.bib` file into the TiddlyWiki window. Under Node.js, use the `--load` command to load a `.bib` file.\n\nThe conversion is as follows:\n\n* `title` comes from citationKey\n* `bibtex-entry-type` comes from entryType\n* all `entryTags` are assigned to fields with the prefix `bibtex-`\n\nThe BibTeX plugin is based on the library [[bibtexParseJs by Henrik Muehe and Mikola Lysenko|https://github.com/ORCID/bibtexParseJs]].\n"},"$:/plugins/tiddlywiki/bibtex/bibtexParse.js":{"text":"/* start bibtexParse 0.0.24 */\n\n//Original work by Henrik Muehe (c) 2010\n//\n//CommonJS port by Mikola Lysenko 2013\n//\n//Choice of compact (default) or pretty output from toBibtex:\n//\t\tNick Bailey, 2017.\n//\n//Port to Browser lib by ORCID / RCPETERS\n//\n//Issues:\n//no comment handling within strings\n//no string concatenation\n//no variable values yet\n//Grammar implemented here:\n//bibtex -> (string | preamble | comment | entry)*;\n//string -> '@STRING' '{' key_equals_value '}';\n//preamble -> '@PREAMBLE' '{' value '}';\n//comment -> '@COMMENT' '{' value '}';\n//entry -> '@' key '{' key ',' key_value_list '}';\n//key_value_list -> key_equals_value (',' key_equals_value)*;\n//key_equals_value -> key '=' value;\n//value -> value_quotes | value_braces | key;\n//value_quotes -> '\"' .*? '\"'; // not quite\n//value_braces -> '{' .*? '\"'; // not quite\n(function(exports) {\n\n function BibtexParser() {\n\n this.months = [\"jan\", \"feb\", \"mar\", \"apr\", \"may\", \"jun\", \"jul\", \"aug\", \"sep\", \"oct\", \"nov\", \"dec\"];\n this.notKey = [',','{','}',' ','='];\n this.pos = 0;\n this.input = \"\";\n this.entries = new Array();\n\n this.currentEntry = \"\";\n\n this.setInput = function(t) {\n this.input = t;\n };\n\n this.getEntries = function() {\n return this.entries;\n };\n\n this.isWhitespace = function(s) {\n return (s == ' ' || s == '\\r' || s == '\\t' || s == '\\n');\n };\n\n this.match = function(s, canCommentOut) {\n if (canCommentOut == undefined || canCommentOut == null)\n canCommentOut = true;\n this.skipWhitespace(canCommentOut);\n if (this.input.substring(this.pos, this.pos + s.length) == s) {\n this.pos += s.length;\n } else {\n throw TypeError(\"Token mismatch: match\", \"expected \" + s + \", found \"\n + this.input.substring(this.pos));\n };\n this.skipWhitespace(canCommentOut);\n };\n\n this.tryMatch = function(s, canCommentOut) {\n if (canCommentOut == undefined || canCommentOut == null)\n canCommentOut = true;\n this.skipWhitespace(canCommentOut);\n if (this.input.substring(this.pos, this.pos + s.length) == s) {\n return true;\n } else {\n return false;\n };\n this.skipWhitespace(canCommentOut);\n };\n\n /* when search for a match all text can be ignored, not just white space */\n this.matchAt = function() {\n while (this.input.length > this.pos && this.input[this.pos] != '@') {\n this.pos++;\n };\n\n if (this.input[this.pos] == '@') {\n return true;\n };\n return false;\n };\n\n this.skipWhitespace = function(canCommentOut) {\n while (this.isWhitespace(this.input[this.pos])) {\n this.pos++;\n };\n if (this.input[this.pos] == \"%\" && canCommentOut == true) {\n while (this.input[this.pos] != \"\\n\") {\n this.pos++;\n };\n this.skipWhitespace(canCommentOut);\n };\n };\n\n this.value_braces = function() {\n var bracecount = 0;\n this.match(\"{\", false);\n var start = this.pos;\n var escaped = false;\n while (true) {\n if (!escaped) {\n if (this.input[this.pos] == '}') {\n if (bracecount > 0) {\n bracecount--;\n } else {\n var end = this.pos;\n this.match(\"}\", false);\n return this.input.substring(start, end);\n };\n } else if (this.input[this.pos] == '{') {\n bracecount++;\n } else if (this.pos >= this.input.length - 1) {\n throw TypeError(\"Unterminated value: value_braces\");\n };\n };\n if (this.input[this.pos] == '\\\\' && escaped == false)\n escaped = true;\n else\n escaped = false;\n this.pos++;\n };\n };\n\n this.value_comment = function() {\n var str = '';\n var brcktCnt = 0;\n while (!(this.tryMatch(\"}\", false) && brcktCnt == 0)) {\n str = str + this.input[this.pos];\n if (this.input[this.pos] == '{')\n brcktCnt++;\n if (this.input[this.pos] == '}')\n brcktCnt--;\n if (this.pos >= this.input.length - 1) {\n throw TypeError(\"Unterminated value: value_comment\", + this.input.substring(start));\n };\n this.pos++;\n };\n return str;\n };\n\n this.value_quotes = function() {\n this.match('\"', false);\n var start = this.pos;\n var escaped = false;\n while (true) {\n if (!escaped) {\n if (this.input[this.pos] == '\"') {\n var end = this.pos;\n this.match('\"', false);\n return this.input.substring(start, end);\n } else if (this.pos >= this.input.length - 1) {\n throw TypeError(\"Unterminated value: value_quotes\", this.input.substring(start));\n };\n }\n if (this.input[this.pos] == '\\\\' && escaped == false)\n escaped = true;\n else\n escaped = false;\n this.pos++;\n };\n };\n\n this.single_value = function() {\n var start = this.pos;\n if (this.tryMatch(\"{\")) {\n return this.value_braces();\n } else if (this.tryMatch('\"')) {\n return this.value_quotes();\n } else {\n var k = this.key();\n if (k.match(\"^[0-9]+$\"))\n return k;\n else if (this.months.indexOf(k.toLowerCase()) >= 0)\n return k.toLowerCase();\n else\n throw \"Value expected: single_value\" + this.input.substring(start) + ' for key: ' + k;\n\n };\n };\n\n this.value = function() {\n var values = [];\n values.push(this.single_value());\n while (this.tryMatch(\"#\")) {\n this.match(\"#\");\n values.push(this.single_value());\n };\n return values.join(\"\");\n };\n\n this.key = function(optional) {\n var start = this.pos;\n while (true) {\n if (this.pos >= this.input.length) {\n throw TypeError(\"Runaway key: key\");\n };\n // а-яА-Я is Cyrillic\n //console.log(this.input[this.pos]);\n if (this.notKey.indexOf(this.input[this.pos]) >= 0) {\n if (optional && this.input[this.pos] != ',') {\n this.pos = start;\n return null;\n };\n return this.input.substring(start, this.pos);\n } else {\n this.pos++;\n\n };\n };\n };\n\n this.key_equals_value = function() {\n var key = this.key();\n if (this.tryMatch(\"=\")) {\n this.match(\"=\");\n var val = this.value();\n key = key.trim()\n return [ key, val ];\n } else {\n throw TypeError(\"Value expected, equals sign missing: key_equals_value\",\n this.input.substring(this.pos));\n };\n };\n\n this.key_value_list = function() {\n var kv = this.key_equals_value();\n this.currentEntry['entryTags'] = {};\n this.currentEntry['entryTags'][kv[0]] = kv[1];\n while (this.tryMatch(\",\")) {\n this.match(\",\");\n // fixes problems with commas at the end of a list\n if (this.tryMatch(\"}\")) {\n break;\n }\n ;\n kv = this.key_equals_value();\n this.currentEntry['entryTags'][kv[0]] = kv[1];\n };\n };\n\n this.entry_body = function(d) {\n this.currentEntry = {};\n this.currentEntry['citationKey'] = this.key(true);\n this.currentEntry['entryType'] = d.substring(1);\n if (this.currentEntry['citationKey'] != null) {\n this.match(\",\");\n }\n this.key_value_list();\n this.entries.push(this.currentEntry);\n };\n\n this.directive = function() {\n this.match(\"@\");\n return \"@\" + this.key();\n };\n\n this.preamble = function() {\n this.currentEntry = {};\n this.currentEntry['entryType'] = 'PREAMBLE';\n this.currentEntry['entry'] = this.value_comment();\n this.entries.push(this.currentEntry);\n };\n\n this.comment = function() {\n this.currentEntry = {};\n this.currentEntry['entryType'] = 'COMMENT';\n this.currentEntry['entry'] = this.value_comment();\n this.entries.push(this.currentEntry);\n };\n\n this.entry = function(d) {\n this.entry_body(d);\n };\n\n this.alernativeCitationKey = function () {\n this.entries.forEach(function (entry) {\n if (!entry.citationKey && entry.entryTags) {\n entry.citationKey = '';\n if (entry.entryTags.author) {\n entry.citationKey += entry.entryTags.author.split(',')[0] += ', ';\n }\n entry.citationKey += entry.entryTags.year;\n }\n });\n }\n\n this.bibtex = function() {\n while (this.matchAt()) {\n var d = this.directive();\n this.match(\"{\");\n if (d.toUpperCase() == \"@STRING\") {\n this.string();\n } else if (d.toUpperCase() == \"@PREAMBLE\") {\n this.preamble();\n } else if (d.toUpperCase() == \"@COMMENT\") {\n this.comment();\n } else {\n this.entry(d);\n }\n this.match(\"}\");\n };\n\n this.alernativeCitationKey();\n };\n };\n\n exports.toJSON = function(bibtex) {\n var b = new BibtexParser();\n b.setInput(bibtex);\n b.bibtex();\n return b.entries;\n };\n\n /* added during hackathon don't hate on me */\n /* Increased the amount of white-space to make entries\n * more attractive to humans. Pass compact as false\n * to enable */\n exports.toBibtex = function(json, compact) {\n if (compact === undefined) compact = true;\n var out = '';\n \n var entrysep = ',';\n var indent = '';\n if (!compact) {\n\t\t entrysep = ',\\n';\n\t\t indent = ' '; \n }\n for ( var i in json) {\n out += \"@\" + json[i].entryType;\n out += '{';\n if (json[i].citationKey)\n out += json[i].citationKey + entrysep;\n if (json[i].entry)\n out += json[i].entry ;\n if (json[i].entryTags) {\n var tags = indent;\n for (var jdx in json[i].entryTags) {\n if (tags.trim().length != 0)\n tags += entrysep + indent;\n tags += jdx + (compact ? '={' : ' = {') + \n json[i].entryTags[jdx] + '}';\n }\n out += tags;\n }\n out += compact ? '}\\n' : '\\n}\\n\\n';\n }\n return out;\n\n };\n\n})(typeof exports === 'undefined' ? this['bibtexParse'] = {} : exports);\n\n/* end bibtexParse */\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/bibtex/bibtexParse.js","module-type":"library"},"$:/plugins/tiddlywiki/bibtex/license":{"text":"\nThe MIT License (MIT)\nCopyright (c) 2013 ORCID, Inc.\n\nCopyright (c) 2010 Henrik Muehe\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","type":"text/plain","title":"$:/plugins/tiddlywiki/bibtex/license"}}}
{"tiddlers":{"$:/plugins/tiddlywiki/jszip/docs":{"title":"$:/plugins/tiddlywiki/jszip/docs","text":"The following messages are provided to allow programmatic manipulation of ZIP files stored within tiddlers:\n\n!! Create ZIP file\n\n```\n<$action-sendmessage $message=\"tm-zip-create\" $param=\"MyZipTiddler\"/>\n```\n\n* ''$param'': title of tiddler to contain ZIP file\n\n!! Add/replace text file within ZIP file\n\n```\n<$action-sendmessage $message=\"tm-zip-add-text-file\" $param=\"MyZipTiddler\" filename=\"my/newfilename.txt\" text=\"The content\"/>\n```\n\n* ''$param'': title of tiddler containing ZIP file\n* ''filename'': filename of file to be added\n* ''text'': text content of file to be added\n\n!! Render tiddler to ZIP file\n\n```\n<$action-sendmessage $message=\"tm-zip-render-file\" $param=\"MyZipTiddler\" filename=\"my/newfilename.txt\" tiddler=\"HelloThere\" template=\"The content\" mode=\"block\" output=\"text/plain\"/>\n```\n\n* ''$param'': title of tiddler containing ZIP file\n* ''filename'': filename of output file\n* ''tiddler'': optional title of currentTiddler for rendering template\n* ''template'': title of template tiddler to be rendered\n* ''mode'': optional parsing mode \"block\" (default) or \"inline\"\n* ''output'': output format: \"text/plain\" (default) for the text content or \"text/html\" for the full HTML content, including tags\n\n!! Download a ZIP file\n\n```\n<$action-sendmessage $message=\"tm-zip-download\" $param=\"MyZipTiddler\" filename=\"myzipfile.zip\"/>\n```\n\n* ''$param'': title of tiddler containing ZIP file\n* ''filename'': filename to be suggested to browser for downloaded file\n"},"$:/plugins/tiddlywiki/jszip/examples":{"title":"$:/plugins/tiddlywiki/jszip/examples","text":"\\define actions-render-static-site()\n<$action-sendmessage $message=\"tm-zip-create\" $param=\"$:/temp/_ZipTiddler\"/>\n<$set name=\"tv-filter-export-link\" value=\"[slugify[]addsuffix[.html]]\">\n<$list filter=\"[all[tiddlers]!is[system]limit[25]]\">\n<$action-sendmessage $message=\"tm-zip-render-file\" $param=\"$:/temp/_ZipTiddler\" filename={{{ [<currentTiddler>slugify[]addsuffix[.html]] }}} tiddler=<<currentTiddler>> template=\"$:/core/templates/static.tiddler.html\"/>\n</$list>\n</$set>\n<$action-sendmessage $message=\"tm-zip-render-file\" $param=\"$:/temp/_ZipTiddler\" filename=\"static.css\" template=\"$:/core/templates/static.template.css\"/>\n<$action-sendmessage $message=\"tm-zip-download\" $param=\"$:/temp/_ZipTiddler\" filename=\"myzip.zip\"/>\n\\end\n\n! Rendering a Static Site to a Zip File\n\nThe actions below create a ZIP file containing a static HTML rendering of the first 100 non-system tiddlers:\n\n<pre>\n<$text text=<<actions-render-static-site>>/>\n</pre>\n\n<$button actions=<<actions-render-static-site>>>\nRender site\n</$button>\n\n<$list filter=\"[!is[system]duplicateslugs[]limit[1]]\" emptyMessage=\"''(There are no duplicate slugs)''\">\n''The following tiddlers have duplicate slugs:''\n\n<ul>\n<$list filter=\"[all[tiddlers]!is[system]limit[25]duplicateslugs[]]\">\n<li><$link><$text text=<<currentTiddler>>/></$link></li>\n</$list>\n</ul>\n</$list>\n\nTemporary zip file: $:/temp/_ZipTiddler\n"},"$:/plugins/tiddlywiki/jszip/jszip.js":{"text":"/*!\n\nJSZip - A Javascript class for generating and reading zip files\n<http://stuartk.com/jszip>\n\n(c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>\nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n!function(a){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=a();else if(\"function\"==typeof define&&define.amd)define([],a);else{var b;b=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this,b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i=\"function\"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error(\"Cannot find module '\"+g+\"'\");throw j.code=\"MODULE_NOT_FOUND\",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f=\"function\"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){\"use strict\";function d(a){if(a){this.data=a,this.length=this.data.length,this.index=0,this.zero=0;for(var b=0;b<this.data.length;b++)a[b]=255&a[b]}}var e=a(\"./dataReader\");d.prototype=new e,d.prototype.byteAt=function(a){return this.data[this.zero+a]},d.prototype.lastIndexOfSignature=function(a){for(var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.length-4;f>=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f-this.zero;return-1},d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return[];var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{\"./dataReader\":6}],2:[function(a,b,c){\"use strict\";var d=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";c.encode=function(a,b){for(var c,e,f,g,h,i,j,k=\"\",l=0;l<a.length;)c=a.charCodeAt(l++),e=a.charCodeAt(l++),f=a.charCodeAt(l++),g=c>>2,h=(3&c)<<4|e>>4,i=(15&e)<<2|f>>6,j=63&f,isNaN(e)?i=j=64:isNaN(f)&&(j=64),k=k+d.charAt(g)+d.charAt(h)+d.charAt(i)+d.charAt(j);return k},c.decode=function(a,b){var c,e,f,g,h,i,j,k=\"\",l=0;for(a=a.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");l<a.length;)g=d.indexOf(a.charAt(l++)),h=d.indexOf(a.charAt(l++)),i=d.indexOf(a.charAt(l++)),j=d.indexOf(a.charAt(l++)),c=g<<2|h>>4,e=(15&h)<<4|i>>2,f=(3&i)<<6|j,k+=String.fromCharCode(c),64!=i&&(k+=String.fromCharCode(e)),64!=j&&(k+=String.fromCharCode(f));return k}},{}],3:[function(a,b,c){\"use strict\";function d(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}d.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},b.exports=d},{}],4:[function(a,b,c){\"use strict\";c.STORE={magic:\"\\0\\0\",compress:function(a,b){return a},uncompress:function(a){return a},compressInputType:null,uncompressInputType:null},c.DEFLATE=a(\"./flate\")},{\"./flate\":9}],5:[function(a,b,c){\"use strict\";var d=a(\"./utils\"),e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];b.exports=function(a,b){if(\"undefined\"==typeof a||!a.length)return 0;var c=\"string\"!==d.getTypeOf(a);\"undefined\"==typeof b&&(b=0);var f=0,g=0,h=0;b^=-1;for(var i=0,j=a.length;i<j;i++)h=c?a[i]:a.charCodeAt(i),g=255&(b^h),f=e[g],b=b>>>8^f;return b^-1}},{\"./utils\":22}],6:[function(a,b,c){\"use strict\";function d(a){this.data=null,this.length=0,this.index=0,this.zero=0}var e=a(\"./utils\");d.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error(\"End of data reached (data length = \"+this.length+\", asked index = \"+a+\"). Corrupted zip ?\")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(a){},readInt:function(a){var b,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return e.transformTo(\"string\",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=d},{\"./utils\":22}],7:[function(a,b,c){\"use strict\";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!1,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],8:[function(a,b,c){\"use strict\";var d=a(\"./utils\");c.string2binary=function(a){return d.string2binary(a)},c.string2Uint8Array=function(a){return d.transformTo(\"uint8array\",a)},c.uint8Array2String=function(a){return d.transformTo(\"string\",a)},c.string2Blob=function(a){var b=d.transformTo(\"arraybuffer\",a);return d.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){return d.arrayBuffer2Blob(a)},c.transformTo=function(a,b){return d.transformTo(a,b)},c.getTypeOf=function(a){return d.getTypeOf(a)},c.checkSupport=function(a){return d.checkSupport(a)},c.MAX_VALUE_16BITS=d.MAX_VALUE_16BITS,c.MAX_VALUE_32BITS=d.MAX_VALUE_32BITS,c.pretty=function(a){return d.pretty(a)},c.findCompression=function(a){return d.findCompression(a)},c.isRegExp=function(a){return d.isRegExp(a)}},{\"./utils\":22}],9:[function(a,b,c){\"use strict\";var d=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,e=a(\"pako\");c.uncompressInputType=d?\"uint8array\":\"array\",c.compressInputType=d?\"uint8array\":\"array\",c.magic=\"\\b\\0\",c.compress=function(a,b){return e.deflateRaw(a,{level:b.level||-1})},c.uncompress=function(a){return e.inflateRaw(a)}},{pako:25}],10:[function(a,b,c){\"use strict\";function d(a,b){return this instanceof d?(this.files={},this.comment=null,this.root=\"\",a&&this.load(a,b),void(this.clone=function(){var a=new d;for(var b in this)\"function\"!=typeof this[b]&&(a[b]=this[b]);return a})):new d(a,b)}var e=a(\"./base64\");d.prototype=a(\"./object\"),d.prototype.load=a(\"./load\"),d.support=a(\"./support\"),d.defaults=a(\"./defaults\"),d.utils=a(\"./deprecatedPublicUtils\"),d.base64={encode:function(a){return e.encode(a)},decode:function(a){return e.decode(a)}},d.compressions=a(\"./compressions\"),b.exports=d},{\"./base64\":2,\"./compressions\":4,\"./defaults\":7,\"./deprecatedPublicUtils\":8,\"./load\":11,\"./object\":14,\"./support\":18}],11:[function(a,b,c){\"use strict\";var d=a(\"./base64\"),e=a(\"./utf8\"),f=a(\"./utils\"),g=a(\"./zipEntries\");b.exports=function(a,b){var c,h,i,j;for(b=f.extend(b||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:e.utf8decode}),b.base64&&(a=d.decode(a)),h=new g(a,b),c=h.files,i=0;i<c.length;i++)j=c[i],this.file(j.fileNameStr,j.decompressed,{binary:!0,optimizedBinaryString:!0,date:j.date,dir:j.dir,comment:j.fileCommentStr.length?j.fileCommentStr:null,unixPermissions:j.unixPermissions,dosPermissions:j.dosPermissions,createFolders:b.createFolders});return h.zipComment.length&&(this.comment=h.zipComment),this}},{\"./base64\":2,\"./utf8\":21,\"./utils\":22,\"./zipEntries\":23}],12:[function(a,b,c){(function(a){\"use strict\";b.exports=function(b,c){return new a(b,c)},b.exports.test=function(b){return a.isBuffer(b)}}).call(this,\"undefined\"!=typeof Buffer?Buffer:void 0)},{}],13:[function(a,b,c){\"use strict\";function d(a){this.data=a,this.length=this.data.length,this.index=0,this.zero=0}var e=a(\"./uint8ArrayReader\");d.prototype=new e,d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{\"./uint8ArrayReader\":19}],14:[function(a,b,c){\"use strict\";var d=a(\"./support\"),e=a(\"./utils\"),f=a(\"./crc32\"),g=a(\"./signature\"),h=a(\"./defaults\"),i=a(\"./base64\"),j=a(\"./compressions\"),k=a(\"./compressedObject\"),l=a(\"./nodeBuffer\"),m=a(\"./utf8\"),n=a(\"./stringWriter\"),o=a(\"./uint8ArrayWriter\"),p=function(a){if(a._data instanceof k&&(a._data=a._data.getContent(),a.options.binary=!0,a.options.base64=!1,\"uint8array\"===e.getTypeOf(a._data))){var b=a._data;a._data=new Uint8Array(b.length),0!==b.length&&a._data.set(b,0)}return a._data},q=function(a){var b=p(a),c=e.getTypeOf(b);return\"string\"===c?!a.options.binary&&d.nodebuffer?l(b,\"utf-8\"):a.asBinary():b},r=function(a){var b=p(this);return null===b||\"undefined\"==typeof b?\"\":(this.options.base64&&(b=i.decode(b)),b=a&&this.options.binary?D.utf8decode(b):e.transformTo(\"string\",b),a||this.options.binary||(b=e.transformTo(\"string\",D.utf8encode(b))),b)},s=function(a,b,c){this.name=a,this.dir=c.dir,this.date=c.date,this.comment=c.comment,this.unixPermissions=c.unixPermissions,this.dosPermissions=c.dosPermissions,this._data=b,this.options=c,this._initialMetadata={dir:c.dir,date:c.date}};s.prototype={asText:function(){return r.call(this,!0)},asBinary:function(){return r.call(this,!1)},asNodeBuffer:function(){var a=q(this);return e.transformTo(\"nodebuffer\",a)},asUint8Array:function(){var a=q(this);return e.transformTo(\"uint8array\",a)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var t=function(a,b){var c,d=\"\";for(c=0;c<b;c++)d+=String.fromCharCode(255&a),a>>>=8;return d},u=function(a){return a=a||{},a.base64!==!0||null!==a.binary&&void 0!==a.binary||(a.binary=!0),a=e.extend(a,h),a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),a},v=function(a,b,c){var d,f=e.getTypeOf(b);if(c=u(c),\"string\"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(a=x(a)),c.createFolders&&(d=w(a))&&y.call(this,d,!0),c.dir||null===b||\"undefined\"==typeof b)c.base64=!1,c.binary=!1,b=null,f=null;else if(\"string\"===f)c.binary&&!c.base64&&c.optimizedBinaryString!==!0&&(b=e.string2binary(b));else{if(c.base64=!1,c.binary=!0,!(f||b instanceof k))throw new Error(\"The data of '\"+a+\"' is in an unsupported format !\");\"arraybuffer\"===f&&(b=e.transformTo(\"uint8array\",b))}var g=new s(a,b,c);return this.files[a]=g,g},w=function(a){\"/\"==a.slice(-1)&&(a=a.substring(0,a.length-1));var b=a.lastIndexOf(\"/\");return b>0?a.substring(0,b):\"\"},x=function(a){return\"/\"!=a.slice(-1)&&(a+=\"/\"),a},y=function(a,b){return b=\"undefined\"!=typeof b&&b,a=x(a),this.files[a]||v.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},z=function(a,b,c){var d,g=new k;return a._data instanceof k?(g.uncompressedSize=a._data.uncompressedSize,g.crc32=a._data.crc32,0===g.uncompressedSize||a.dir?(b=j.STORE,g.compressedContent=\"\",g.crc32=0):a._data.compressionMethod===b.magic?g.compressedContent=a._data.getCompressedContent():(d=a._data.getContent(),g.compressedContent=b.compress(e.transformTo(b.compressInputType,d),c))):(d=q(a),d&&0!==d.length&&!a.dir||(b=j.STORE,d=\"\"),g.uncompressedSize=d.length,g.crc32=f(d),g.compressedContent=b.compress(e.transformTo(b.compressInputType,d),c)),g.compressedSize=g.compressedContent.length,g.compressionMethod=b.magic,g},A=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},B=function(a,b){return 63&(a||0)},C=function(a,b,c,d,h,i){var j,k,l,n,o=(c.compressedContent,i!==m.utf8encode),p=e.transformTo(\"string\",i(b.name)),q=e.transformTo(\"string\",m.utf8encode(b.name)),r=b.comment||\"\",s=e.transformTo(\"string\",i(r)),u=e.transformTo(\"string\",m.utf8encode(r)),v=q.length!==b.name.length,w=u.length!==r.length,x=b.options,y=\"\",z=\"\",C=\"\";l=b._initialMetadata.dir!==b.dir?b.dir:x.dir,n=b._initialMetadata.date!==b.date?b.date:x.date;var D=0,E=0;l&&(D|=16),\"UNIX\"===h?(E=798,D|=A(b.unixPermissions,l)):(E=20,D|=B(b.dosPermissions,l)),j=n.getHours(),j<<=6,j|=n.getMinutes(),j<<=5,j|=n.getSeconds()/2,k=n.getFullYear()-1980,k<<=4,k|=n.getMonth()+1,k<<=5,k|=n.getDate(),v&&(z=t(1,1)+t(f(p),4)+q,y+=\"up\"+t(z.length,2)+z),w&&(C=t(1,1)+t(this.crc32(s),4)+u,y+=\"uc\"+t(C.length,2)+C);var F=\"\";F+=\"\\n\\0\",F+=o||!v&&!w?\"\\0\\0\":\"\\0\\b\",F+=c.compressionMethod,F+=t(j,2),F+=t(k,2),F+=t(c.crc32,4),F+=t(c.compressedSize,4),F+=t(c.uncompressedSize,4),F+=t(p.length,2),F+=t(y.length,2);var G=g.LOCAL_FILE_HEADER+F+p+y,H=g.CENTRAL_FILE_HEADER+t(E,2)+F+t(s.length,2)+\"\\0\\0\\0\\0\"+t(D,4)+t(d,4)+p+y+s;return{fileRecord:G,dirRecord:H,compressedObject:c}},D={load:function(a,b){throw new Error(\"Load method is not defined. Is the file jszip-load.js included ?\")},filter:function(a){var b,c,d,f,g=[];for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],f=new s(d.name,d._data,e.extend(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,f)&&g.push(f));return g},file:function(a,b,c){if(1===arguments.length){if(e.isRegExp(a)){var d=a;return this.filter(function(a,b){return!b.dir&&d.test(a)})}return this.filter(function(b,c){return!c.dir&&b===a})[0]||null}return a=this.root+a,v.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(e.isRegExp(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=y.call(this,b),d=this.clone();return d.root=c.name,d},remove:function(a){a=this.root+a;var b=this.files[a];if(b||(\"/\"!=a.slice(-1)&&(a+=\"/\"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d<c.length;d++)delete this.files[c[d].name];return this},generate:function(a){a=e.extend(a||{},{base64:!0,compression:\"STORE\",compressionOptions:null,type:\"base64\",platform:\"DOS\",comment:null,mimeType:\"application/zip\",encodeFileName:m.utf8encode}),e.checkSupport(a.type),\"darwin\"!==a.platform&&\"freebsd\"!==a.platform&&\"linux\"!==a.platform&&\"sunos\"!==a.platform||(a.platform=\"UNIX\"),\"win32\"===a.platform&&(a.platform=\"DOS\");var b,c,d=[],f=0,h=0,k=e.transformTo(\"string\",a.encodeFileName(a.comment||this.comment||\"\"));for(var l in this.files)if(this.files.hasOwnProperty(l)){var p=this.files[l],q=p.options.compression||a.compression.toUpperCase(),r=j[q];if(!r)throw new Error(q+\" is not a valid compression method !\");var s=p.options.compressionOptions||a.compressionOptions||{},u=z.call(this,p,r,s),v=C.call(this,l,p,u,f,a.platform,a.encodeFileName);f+=v.fileRecord.length+u.compressedSize,h+=v.dirRecord.length,d.push(v)}var w=\"\";w=g.CENTRAL_DIRECTORY_END+\"\\0\\0\\0\\0\"+t(d.length,2)+t(d.length,2)+t(h,4)+t(f,4)+t(k.length,2)+k;var x=a.type.toLowerCase();for(b=\"uint8array\"===x||\"arraybuffer\"===x||\"blob\"===x||\"nodebuffer\"===x?new o(f+h+w.length):new n(f+h+w.length),c=0;c<d.length;c++)b.append(d[c].fileRecord),b.append(d[c].compressedObject.compressedContent);for(c=0;c<d.length;c++)b.append(d[c].dirRecord);b.append(w);var y=b.finalize();switch(a.type.toLowerCase()){case\"uint8array\":case\"arraybuffer\":case\"nodebuffer\":return e.transformTo(a.type.toLowerCase(),y);case\"blob\":return e.arrayBuffer2Blob(e.transformTo(\"arraybuffer\",y),a.mimeType);case\"base64\":return a.base64?i.encode(y):y;default:return y}},crc32:function(a,b){return f(a,b)},utf8encode:function(a){return e.transformTo(\"string\",m.utf8encode(a))},utf8decode:function(a){return m.utf8decode(a)}};b.exports=D},{\"./base64\":2,\"./compressedObject\":3,\"./compressions\":4,\"./crc32\":5,\"./defaults\":7,\"./nodeBuffer\":12,\"./signature\":15,\"./stringWriter\":17,\"./support\":18,\"./uint8ArrayWriter\":20,\"./utf8\":21,\"./utils\":22}],15:[function(a,b,c){\"use strict\";c.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",c.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",c.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",c.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",c.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],16:[function(a,b,c){\"use strict\";function d(a,b){this.data=a,b||(this.data=f.string2binary(this.data)),this.length=this.data.length,this.index=0,this.zero=0}var e=a(\"./dataReader\"),f=a(\"./utils\");d.prototype=new e,d.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},d.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{\"./dataReader\":6,\"./utils\":22}],17:[function(a,b,c){\"use strict\";var d=a(\"./utils\"),e=function(){this.data=[]};e.prototype={append:function(a){a=d.transformTo(\"string\",a),this.data.push(a)},finalize:function(){return this.data.join(\"\")}},b.exports=e},{\"./utils\":22}],18:[function(a,b,c){(function(a){\"use strict\";if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array,c.nodebuffer=\"undefined\"!=typeof a,c.uint8array=\"undefined\"!=typeof Uint8Array,\"undefined\"==typeof ArrayBuffer)c.blob=!1;else{var b=new ArrayBuffer(0);try{c.blob=0===new Blob([b],{type:\"application/zip\"}).size}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,f=new e;f.append(b),c.blob=0===f.getBlob(\"application/zip\").size}catch(d){c.blob=!1}}}}).call(this,\"undefined\"!=typeof Buffer?Buffer:void 0)},{}],19:[function(a,b,c){\"use strict\";function d(a){a&&(this.data=a,this.length=this.data.length,this.index=0,this.zero=0)}var e=a(\"./arrayReader\");d.prototype=new e,d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{\"./arrayReader\":1}],20:[function(a,b,c){\"use strict\";var d=a(\"./utils\"),e=function(a){this.data=new Uint8Array(a),this.index=0};e.prototype={append:function(a){0!==a.length&&(a=d.transformTo(\"uint8array\",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){return this.data}},b.exports=e},{\"./utils\":22}],21:[function(a,b,c){\"use strict\";for(var d=a(\"./utils\"),e=a(\"./support\"),f=a(\"./nodeBuffer\"),g=new Array(256),h=0;h<256;h++)g[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;g[254]=g[254]=1;var i=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;f<h;f++)c=a.charCodeAt(f),55296===(64512&c)&&f+1<h&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=c<128?1:c<2048?2:c<65536?3:4;for(b=e.uint8array?new Uint8Array(i):new Array(i),g=0,f=0;g<i;f++)c=a.charCodeAt(f),55296===(64512&c)&&f+1<h&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),c<128?b[g++]=c:c<2048?(b[g++]=192|c>>>6,b[g++]=128|63&c):c<65536?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},j=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+g[a[c]]>b?c:b},k=function(a){var b,c,e,f,h=a.length,i=new Array(2*h);for(c=0,b=0;b<h;)if(e=a[b++],e<128)i[c++]=e;else if(f=g[e],f>4)i[c++]=65533,b+=f-1;else{for(e&=2===f?31:3===f?15:7;f>1&&b<h;)e=e<<6|63&a[b++],f--;f>1?i[c++]=65533:e<65536?i[c++]=e:(e-=65536,i[c++]=55296|e>>10&1023,i[c++]=56320|1023&e)}return i.length!==c&&(i.subarray?i=i.subarray(0,c):i.length=c),d.applyFromCharCode(i)};c.utf8encode=function(a){return e.nodebuffer?f(a,\"utf-8\"):i(a)},c.utf8decode=function(a){if(e.nodebuffer)return d.transformTo(\"nodebuffer\",a).toString(\"utf-8\");a=d.transformTo(e.uint8array?\"uint8array\":\"array\",a);for(var b=[],c=0,f=a.length,g=65536;c<f;){var h=j(a,Math.min(c+g,f));e.uint8array?b.push(k(a.subarray(c,h))):b.push(k(a.slice(c,h))),c=h}return b.join(\"\")}},{\"./nodeBuffer\":12,\"./support\":18,\"./utils\":22}],22:[function(a,b,c){\"use strict\";function d(a){return a}function e(a,b){for(var c=0;c<a.length;++c)b[c]=255&a.charCodeAt(c);return b}function f(a){var b=65536,d=[],e=a.length,f=c.getTypeOf(a),g=0,h=!0;try{switch(f){case\"uint8array\":String.fromCharCode.apply(null,new Uint8Array(0));break;case\"nodebuffer\":String.fromCharCode.apply(null,j(0))}}catch(i){h=!1}if(!h){for(var k=\"\",l=0;l<a.length;l++)k+=String.fromCharCode(a[l]);return k}for(;g<e&&b>1;)try{\"array\"===f||\"nodebuffer\"===f?d.push(String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e)))):d.push(String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}return d.join(\"\")}function g(a,b){for(var c=0;c<a.length;c++)b[c]=a[c];return b}var h=a(\"./support\"),i=a(\"./compressions\"),j=a(\"./nodeBuffer\");c.string2binary=function(a){for(var b=\"\",c=0;c<a.length;c++)b+=String.fromCharCode(255&a.charCodeAt(c));return b},c.arrayBuffer2Blob=function(a,b){c.checkSupport(\"blob\"),b=b||\"application/zip\";try{return new Blob([a],{type:b})}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,f=new e;return f.append(a),f.getBlob(b)}catch(d){throw new Error(\"Bug : can't construct the Blob.\")}}},c.applyFromCharCode=f;var k={};k.string={string:d,array:function(a){return e(a,new Array(a.length))},arraybuffer:function(a){return k.string.uint8array(a).buffer},uint8array:function(a){return e(a,new Uint8Array(a.length))},nodebuffer:function(a){return e(a,j(a.length))}},k.array={string:f,array:d,arraybuffer:function(a){return new Uint8Array(a).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(a)}},k.arraybuffer={string:function(a){return f(new Uint8Array(a))},array:function(a){return g(new Uint8Array(a),new Array(a.byteLength))},arraybuffer:d,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(new Uint8Array(a))}},k.uint8array={string:f,array:function(a){return g(a,new Array(a.length))},arraybuffer:function(a){return a.buffer},uint8array:d,nodebuffer:function(a){return j(a)}},k.nodebuffer={string:f,array:function(a){return g(a,new Array(a.length))},arraybuffer:function(a){return k.nodebuffer.uint8array(a).buffer},uint8array:function(a){return g(a,new Uint8Array(a.length))},nodebuffer:d},c.transformTo=function(a,b){if(b||(b=\"\"),!a)return b;c.checkSupport(a);var d=c.getTypeOf(b),e=k[d][a](b);return e},c.getTypeOf=function(a){return\"string\"==typeof a?\"string\":\"[object Array]\"===Object.prototype.toString.call(a)?\"array\":h.nodebuffer&&j.test(a)?\"nodebuffer\":h.uint8array&&a instanceof Uint8Array?\"uint8array\":h.arraybuffer&&a instanceof ArrayBuffer?\"arraybuffer\":void 0},c.checkSupport=function(a){var b=h[a.toLowerCase()];if(!b)throw new Error(a+\" is not supported by this browser\")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(a){var b,c,d=\"\";for(c=0;c<(a||\"\").length;c++)b=a.charCodeAt(c),d+=\"\\\\x\"+(b<16?\"0\":\"\")+b.toString(16).toUpperCase();return d},c.findCompression=function(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b].magic===a)return i[b];return null},c.isRegExp=function(a){return\"[object RegExp]\"===Object.prototype.toString.call(a)},c.extend=function(){var a,b,c={};for(a=0;a<arguments.length;a++)for(b in arguments[a])arguments[a].hasOwnProperty(b)&&\"undefined\"==typeof c[b]&&(c[b]=arguments[a][b]);return c}},{\"./compressions\":4,\"./nodeBuffer\":12,\"./support\":18}],23:[function(a,b,c){\"use strict\";function d(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}var e=a(\"./stringReader\"),f=a(\"./nodeBufferReader\"),g=a(\"./uint8ArrayReader\"),h=a(\"./arrayReader\"),i=a(\"./utils\"),j=a(\"./signature\"),k=a(\"./zipEntry\"),l=a(\"./support\");a(\"./object\");d.prototype={checkSignature:function(a){var b=this.reader.readString(4);if(b!==a)throw new Error(\"Corrupted zip or bug : unexpected signature (\"+i.pretty(b)+\", expected \"+i.pretty(a)+\")\")},isSignature:function(a,b){var c=this.reader.index;this.reader.setIndex(a);var d=this.reader.readString(4),e=d===b;return this.reader.setIndex(c),e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var a=this.reader.readData(this.zipCommentLength),b=l.uint8array?\"uint8array\":\"array\",c=i.transformTo(b,a);this.zipComment=this.loadOptions.decodeFileName(c)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var a,b,c,d=this.zip64EndOfCentralSize-44,e=0;e<d;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error(\"Multi-volumes zip are not supported\")},readLocalFiles:function(){var a,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(j.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var a;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===j.CENTRAL_FILE_HEADER;)a=new k({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error(\"Corrupted zip or bug: expected \"+this.centralDirRecords+\" records in central dir, got \"+this.files.length)},readEndOfCentral:function(){var a=this.reader.lastIndexOfSignature(j.CENTRAL_DIRECTORY_END);if(a<0){var b=!this.isSignature(0,j.LOCAL_FILE_HEADER);throw b?new Error(\"Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html\"):new Error(\"Corrupted zip : can't find end of central directory\")}this.reader.setIndex(a);var c=a;if(this.checkSignature(j.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR),a<0)throw new Error(\"Corrupted zip : can't find the ZIP64 end of central directory locator\");if(this.reader.setIndex(a),this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,j.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error(\"Corrupted zip : can't find the ZIP64 end of central directory\");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var e=c-d;if(e>0)this.isSignature(c,j.CENTRAL_FILE_HEADER)||(this.reader.zero=e);else if(e<0)throw new Error(\"Corrupted zip: missing \"+Math.abs(e)+\" bytes.\")},prepareReader:function(a){var b=i.getTypeOf(a);if(i.checkSupport(b),\"string\"!==b||l.uint8array)if(\"nodebuffer\"===b)this.reader=new f(a);else if(l.uint8array)this.reader=new g(i.transformTo(\"uint8array\",a));else{if(!l.array)throw new Error(\"Unexpected error: unsupported type '\"+b+\"'\");this.reader=new h(i.transformTo(\"array\",a))}else this.reader=new e(a,this.loadOptions.optimizedBinaryString)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=d},{\"./arrayReader\":1,\"./nodeBufferReader\":13,\"./object\":14,\"./signature\":15,\"./stringReader\":16,\"./support\":18,\"./uint8ArrayReader\":19,\"./utils\":22,\"./zipEntry\":24}],24:[function(a,b,c){\"use strict\";function d(a,b){this.options=a,this.loadOptions=b}var e=a(\"./stringReader\"),f=a(\"./utils\"),g=a(\"./compressedObject\"),h=a(\"./object\"),i=a(\"./support\"),j=0,k=3;d.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(a,b,c){return function(){var d=a.index;a.setIndex(b);var e=a.readData(c);return a.setIndex(d),e}},prepareContent:function(a,b,c,d,e){return function(){var a=f.transformTo(d.uncompressInputType,this.getCompressedContent()),b=d.uncompress(a);if(b.length!==e)throw new Error(\"Bug : uncompressed data size mismatch\");return b}},readLocalPart:function(a){var b,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(c),this.compressedSize==-1||this.uncompressedSize==-1)throw new Error(\"Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)\");if(b=f.findCompression(this.compressionMethod),null===b)throw new Error(\"Corrupted zip : compression \"+f.pretty(this.compressionMethod)+\" unknown (inner file : \"+f.transformTo(\"string\",this.fileName)+\")\");if(this.decompressed=new g,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(a,a.index,this.compressedSize,b),this.decompressed.getContent=this.prepareContent(a,a.index,this.compressedSize,b,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=f.transformTo(\"string\",this.decompressed.getContent()),h.crc32(this.decompressed)!==this.crc32))throw new Error(\"Corrupted zip : CRC32 mismatch\");\n},readCentralPart:function(a){if(this.versionMadeBy=a.readInt(2),this.versionNeeded=a.readInt(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4),this.fileNameLength=a.readInt(2),this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error(\"Encrypted zip are not supported\");this.fileName=a.readData(this.fileNameLength),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a===j&&(this.dosPermissions=63&this.externalFileAttributes),a===k&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(a){if(this.extraFields[1]){var b=new e(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index<e+this.extraFieldsLength;)b=a.readInt(2),c=a.readInt(2),d=a.readString(c),this.extraFields[b]={id:b,length:c,value:d}},handleUTF8:function(){var a=i.uint8array?\"uint8array\":\"array\";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();if(null!==b)this.fileNameStr=b;else{var c=f.transformTo(a,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(c)}var d=this.findExtraFieldUnicodeComment();if(null!==d)this.fileCommentStr=d;else{var e=f.transformTo(a,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(e)}}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var b=new e(a.value);return 1!==b.readInt(1)?null:h.crc32(this.fileName)!==b.readInt(4)?null:h.utf8decode(b.readString(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var b=new e(a.value);return 1!==b.readInt(1)?null:h.crc32(this.fileComment)!==b.readInt(4)?null:h.utf8decode(b.readString(a.length-5))}return null}},b.exports=d},{\"./compressedObject\":3,\"./object\":14,\"./stringReader\":16,\"./support\":18,\"./utils\":22}],25:[function(a,b,c){\"use strict\";var d=a(\"./lib/utils/common\").assign,e=a(\"./lib/deflate\"),f=a(\"./lib/inflate\"),g=a(\"./lib/zlib/constants\"),h={};d(h,e,f,g),b.exports=h},{\"./lib/deflate\":26,\"./lib/inflate\":27,\"./lib/utils/common\":28,\"./lib/zlib/constants\":31}],26:[function(a,b,c){\"use strict\";function d(a){if(!(this instanceof d))return new d(a);this.options=i.assign({level:s,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:t,to:\"\"},a||{});var b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=h.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw new Error(k[c]);if(b.header&&h.deflateSetHeader(this.strm,b.header),b.dictionary){var e;if(e=\"string\"==typeof b.dictionary?j.string2buf(b.dictionary):\"[object ArrayBuffer]\"===m.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=h.deflateSetDictionary(this.strm,e),c!==p)throw new Error(k[c]);this._dict_set=!0}}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}function g(a,b){return b=b||{},b.gzip=!0,e(a,b)}var h=a(\"./zlib/deflate\"),i=a(\"./utils/common\"),j=a(\"./utils/strings\"),k=a(\"./zlib/messages\"),l=a(\"./zlib/zstream\"),m=Object.prototype.toString,n=0,o=4,p=0,q=1,r=2,s=-1,t=0,u=8;d.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?o:n,\"string\"==typeof a?e.input=j.string2buf(a):\"[object ArrayBuffer]\"===m.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new i.Buf8(f),e.next_out=0,e.avail_out=f),c=h.deflate(e,d),c!==q&&c!==p)return this.onEnd(c),this.ended=!0,!1;0!==e.avail_out&&(0!==e.avail_in||d!==o&&d!==r)||(\"string\"===this.options.to?this.onData(j.buf2binstring(i.shrinkBuf(e.output,e.next_out))):this.onData(i.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==q);return d===o?(c=h.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):d!==r||(this.onEnd(p),e.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===p&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=d,c.deflate=e,c.deflateRaw=f,c.gzip=g},{\"./utils/common\":28,\"./utils/strings\":29,\"./zlib/deflate\":33,\"./zlib/messages\":38,\"./zlib/zstream\":40}],27:[function(a,b,c){\"use strict\";function d(a){if(!(this instanceof d))return new d(a);this.options=h.assign({chunkSize:16384,windowBits:0,to:\"\"},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=g.inflateInit2(this.strm,b.windowBits);if(c!==j.Z_OK)throw new Error(k[c]);this.header=new m,g.inflateGetHeader(this.strm,this.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}var g=a(\"./zlib/inflate\"),h=a(\"./utils/common\"),i=a(\"./utils/strings\"),j=a(\"./zlib/constants\"),k=a(\"./zlib/messages\"),l=a(\"./zlib/zstream\"),m=a(\"./zlib/gzheader\"),n=Object.prototype.toString;d.prototype.push=function(a,b){var c,d,e,f,k,l,m=this.strm,o=this.options.chunkSize,p=this.options.dictionary,q=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?j.Z_FINISH:j.Z_NO_FLUSH,\"string\"==typeof a?m.input=i.binstring2buf(a):\"[object ArrayBuffer]\"===n.call(a)?m.input=new Uint8Array(a):m.input=a,m.next_in=0,m.avail_in=m.input.length;do{if(0===m.avail_out&&(m.output=new h.Buf8(o),m.next_out=0,m.avail_out=o),c=g.inflate(m,j.Z_NO_FLUSH),c===j.Z_NEED_DICT&&p&&(l=\"string\"==typeof p?i.string2buf(p):\"[object ArrayBuffer]\"===n.call(p)?new Uint8Array(p):p,c=g.inflateSetDictionary(this.strm,l)),c===j.Z_BUF_ERROR&&q===!0&&(c=j.Z_OK,q=!1),c!==j.Z_STREAM_END&&c!==j.Z_OK)return this.onEnd(c),this.ended=!0,!1;m.next_out&&(0!==m.avail_out&&c!==j.Z_STREAM_END&&(0!==m.avail_in||d!==j.Z_FINISH&&d!==j.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(e=i.utf8border(m.output,m.next_out),f=m.next_out-e,k=i.buf2string(m.output,e),m.next_out=f,m.avail_out=o-f,f&&h.arraySet(m.output,m.output,e,f,0),this.onData(k)):this.onData(h.shrinkBuf(m.output,m.next_out)))),0===m.avail_in&&0===m.avail_out&&(q=!0)}while((m.avail_in>0||0===m.avail_out)&&c!==j.Z_STREAM_END);return c===j.Z_STREAM_END&&(d=j.Z_FINISH),d===j.Z_FINISH?(c=g.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===j.Z_OK):d!==j.Z_SYNC_FLUSH||(this.onEnd(j.Z_OK),m.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===j.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=d,c.inflate=e,c.inflateRaw=f,c.ungzip=e},{\"./utils/common\":28,\"./utils/strings\":29,\"./zlib/constants\":31,\"./zlib/gzheader\":34,\"./zlib/inflate\":36,\"./zlib/messages\":38,\"./zlib/zstream\":40}],28:[function(a,b,c){\"use strict\";var d=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if(\"object\"!=typeof c)throw new TypeError(c+\"must be non-object\");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;f<d;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;b<c;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;b<c;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;f<d;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],29:[function(a,b,c){\"use strict\";function d(a,b){if(b<65537&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c=\"\",d=0;d<b;d++)c+=String.fromCharCode(a[d]);return c}var e=a(\"./common\"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;j<256;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;f<h;f++)c=a.charCodeAt(f),55296===(64512&c)&&f+1<h&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=c<128?1:c<2048?2:c<65536?3:4;for(b=new e.Buf8(i),g=0,f=0;g<i;f++)c=a.charCodeAt(f),55296===(64512&c)&&f+1<h&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),c<128?b[g++]=c:c<2048?(b[g++]=192|c>>>6,b[g++]=128|63&c):c<65536?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;c<d;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;c<h;)if(f=a[c++],f<128)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&c<h;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:f<65536?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+i[a[c]]>b?c:b}},{\"./common\":28}],30:[function(a,b,c){\"use strict\";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=d},{}],31:[function(a,b,c){\"use strict\";b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],32:[function(a,b,c){\"use strict\";function d(){for(var a,b=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a^=-1;for(var h=d;h<g;h++)a=a>>>8^e[255&(a^b[h])];return a^-1}var f=d();b.exports=e},{}],33:[function(a,b,c){\"use strict\";function d(a,b){return a.msg=I[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(E.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){F._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,E.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=G(a.adler,b,e,c):2===a.state.wrap&&(a.adler=H(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-la?a.strstart-(a.w_size-la):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ka,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&f<m);if(d=ka-(m-f),f=m-ka,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-la)){E.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ja)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+ja-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<ja)););}while(a.lookahead<la&&0!==a.strm.avail_in)}function n(a,b){var c=65535;for(c>a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===J)return ua;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return ua;if(a.strstart-a.block_start>=a.w_size-la&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?ua:ua}function o(a,b){for(var c,d;;){if(a.lookahead<la){if(m(a),a.lookahead<la&&b===J)return ua;if(0===a.lookahead)break}if(c=0,a.lookahead>=ja&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ja-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==c&&a.strstart-c<=a.w_size-la&&(a.match_length=l(a,c)),a.match_length>=ja)if(d=F._tr_tally(a,a.strstart-a.match_start,a.match_length-ja),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ja){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ja-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=a.strstart<ja-1?a.strstart:ja-1,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function p(a,b){for(var c,d,e;;){if(a.lookahead<la){if(m(a),a.lookahead<la&&b===J)return ua;if(0===a.lookahead)break}if(c=0,a.lookahead>=ja&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ja-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=ja-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-la&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===U||a.match_length===ja&&a.strstart-a.match_start>4096)&&(a.match_length=ja-1)),a.prev_length>=ja&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ja,d=F._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ja),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ja-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=ja-1,a.strstart++,d&&(h(a,!1),0===a.strm.avail_out))return ua}else if(a.match_available){if(d=F._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return ua}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(d=F._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<ja-1?a.strstart:ja-1,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function q(a,b){for(var c,d,e,f,g=a.window;;){if(a.lookahead<=ka){if(m(a),a.lookahead<=ka&&b===J)return ua;if(0===a.lookahead)break}if(a.match_length=0,a.lookahead>=ja&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ka;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&e<f);a.match_length=ka-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ja?(c=F._tr_tally(a,1,a.match_length-ja),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===J)return ua;break}if(a.match_length=0,c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function s(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e}function t(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=D[a.level].max_lazy,a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ja-1,a.match_available=0,a.ins_h=0}function u(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new E.Buf16(2*ha),this.dyn_dtree=new E.Buf16(2*(2*fa+1)),this.bl_tree=new E.Buf16(2*(2*ga+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E.Buf16(ia+1),this.heap=new E.Buf16(2*ea+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E.Buf16(2*ea+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=Z,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?na:sa,a.adler=2===b.wrap?0:1,b.last_flush=J,F._tr_init(b),O):d(a,Q)}function w(a){var b=v(a);return b===O&&t(a.state),b}function x(a,b){return a&&a.state?2!==a.state.wrap?Q:(a.state.gzhead=b,O):Q}function y(a,b,c,e,f,g){if(!a)return Q;var h=1;if(b===T&&(b=6),e<0?(h=0,e=-e):e>15&&(h=2,e-=16),f<1||f>_||c!==$||e<8||e>15||b<0||b>9||g<0||g>X)return d(a,Q);8===e&&(e=9);var i=new u;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=f+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+ja-1)/ja),i.window=new E.Buf8(2*i.w_size),i.head=new E.Buf16(i.hash_size),i.prev=new E.Buf16(i.w_size),i.lit_bufsize=1<<f+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new E.Buf8(i.pending_buf_size),i.d_buf=1*i.lit_bufsize,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,w(a)}function z(a,b){return y(a,b,$,aa,ba,Y)}function A(a,b){var c,h,k,l;if(!a||!a.state||b>N||b<0)return a?d(a,Q):Q;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===ta&&b!==M)return d(a,0===a.avail_out?S:Q);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===na)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=H(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=oa):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,ya),h.status=sa);else{var m=$+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=V||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=ma),m+=31-m%31,h.status=sa,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===oa)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=pa)}else h.status=pa;if(h.status===pa)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=qa)}else h.status=qa;if(h.status===qa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=ra)}else h.status=ra;if(h.status===ra&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=sa)):h.status=sa),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,O}else if(0===a.avail_in&&e(b)<=e(c)&&b!==M)return d(a,S);if(h.status===ta&&0!==a.avail_in)return d(a,S);if(0!==a.avail_in||0!==h.lookahead||b!==J&&h.status!==ta){var o=h.strategy===V?r(h,b):h.strategy===W?q(h,b):D[h.level].func(h,b);if(o!==wa&&o!==xa||(h.status=ta),o===ua||o===wa)return 0===a.avail_out&&(h.last_flush=-1),O;if(o===va&&(b===K?F._tr_align(h):b!==N&&(F._tr_stored_block(h,0,0,!1),b===L&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,O}return b!==M?O:h.wrap<=0?P:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?O:P)}function B(a){var b;return a&&a.state?(b=a.state.status,b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra&&b!==sa&&b!==ta?d(a,Q):(a.state=null,b===sa?d(a,R):O)):Q}function C(a,b){var c,d,e,g,h,i,j,k,l=b.length;if(!a||!a.state)return Q;if(c=a.state,g=c.wrap,2===g||1===g&&c.status!==na||c.lookahead)return Q;for(1===g&&(a.adler=G(a.adler,b,l,0)),c.wrap=0,l>=c.w_size&&(0===g&&(f(c.head),c.strstart=0,c.block_start=0,c.insert=0),k=new E.Buf8(c.w_size),E.arraySet(k,b,l-c.w_size,c.w_size,0),b=k,l=c.w_size),h=a.avail_in,i=a.next_in,j=a.input,a.avail_in=l,a.next_in=0,a.input=b,m(c);c.lookahead>=ja;){d=c.strstart,e=c.lookahead-(ja-1);do c.ins_h=(c.ins_h<<c.hash_shift^c.window[d+ja-1])&c.hash_mask,c.prev[d&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=d,d++;while(--e);c.strstart=d,c.lookahead=ja-1,m(c)}return c.strstart+=c.lookahead,c.block_start=c.strstart,c.insert=c.lookahead,c.lookahead=0,c.match_length=c.prev_length=ja-1,c.match_available=0,a.next_in=i,a.input=j,a.avail_in=h,c.wrap=g,O}var D,E=a(\"../utils/common\"),F=a(\"./trees\"),G=a(\"./adler32\"),H=a(\"./crc32\"),I=a(\"./messages\"),J=0,K=1,L=3,M=4,N=5,O=0,P=1,Q=-2,R=-3,S=-5,T=-1,U=1,V=2,W=3,X=4,Y=0,Z=2,$=8,_=9,aa=15,ba=8,ca=29,da=256,ea=da+1+ca,fa=30,ga=19,ha=2*ea+1,ia=15,ja=3,ka=258,la=ka+ja+1,ma=32,na=42,oa=69,pa=73,qa=91,ra=103,sa=113,ta=666,ua=1,va=2,wa=3,xa=4,ya=3;D=[new s(0,0,0,0,n),new s(4,4,8,4,o),new s(4,5,16,8,o),new s(4,6,32,32,o),new s(4,4,16,16,p),new s(8,16,32,32,p),new s(8,16,128,128,p),new s(8,32,128,256,p),new s(32,128,258,1024,p),new s(32,258,258,4096,p)],c.deflateInit=z,c.deflateInit2=y,c.deflateReset=w,c.deflateResetKeep=v,c.deflateSetHeader=x,c.deflate=A,c.deflateEnd=B,c.deflateSetDictionary=C,c.deflateInfo=\"pako deflate (from Nodeca project)\"},{\"../utils/common\":28,\"./adler32\":30,\"./crc32\":32,\"./messages\":38,\"./trees\":39}],34:[function(a,b,c){\"use strict\";function d(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}b.exports=d},{}],35:[function(a,b,c){\"use strict\";var d=30,e=12;b.exports=function(a,b){var c,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;c=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=c.dmax,l=c.wsize,m=c.whave,n=c.wnext,o=c.window,p=c.hold,q=c.bits,r=c.lencode,s=c.distcode,t=(1<<c.lenbits)-1,u=(1<<c.distbits)-1;a:do{q<15&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=r[p&t];b:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<<w)-1)];continue b}if(32&w){c.mode=e;break a}a.msg=\"invalid literal/length code\",c.mode=d;break a}x=65535&v,w&=15,w&&(q<w&&(p+=B[f++]<<q,q+=8),x+=p&(1<<w)-1,p>>>=w,q-=w),q<15&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=s[p&u];c:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<<w)-1)];continue c}a.msg=\"invalid distance code\",c.mode=d;break a}if(y=65535&v,w&=15,q<w&&(p+=B[f++]<<q,q+=8,q<w&&(p+=B[f++]<<q,q+=8)),y+=p&(1<<w)-1,y>k){a.msg=\"invalid distance too far back\",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg=\"invalid distance too far back\",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,w<x){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(n<w){if(z+=l+n-w,w-=n,w<x){x-=w;do C[h++]=o[z++];while(--w);if(z=0,n<x){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,w<x){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(f<g&&h<j);x=q>>3,f-=x,q-=x<<3,p&=(1<<q)-1,a.next_in=f,a.next_out=h,a.avail_in=f<g?5+(g-f):5-(f-g),a.avail_out=h<j?257+(j-h):257-(h-j),c.hold=p,c.bits=q}},{}],36:[function(a,b,c){\"use strict\";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg=\"\",b.wrap&&(a.adler=1&b.wrap),b.mode=L,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new s.Buf32(pa),b.distcode=b.distdyn=new s.Buf32(qa),b.sane=1,b.back=-1,D):G}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):G}function h(a,b){var c,d;return a&&a.state?(d=a.state,b<0?(c=0,b=-b):(c=(b>>4)+1,b<48&&(b&=15)),b&&(b<8||b>15)?G:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):G}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==D&&(a.state=null),c):G}function j(a){return i(a,sa)}function k(a){if(ta){var b;for(q=new s.Buf32(512),r=new s.Buf32(32),b=0;b<144;)a.lens[b++]=8;for(;b<256;)a.lens[b++]=9;for(;b<280;)a.lens[b++]=7;for(;b<288;)a.lens[b++]=8;for(w(y,a.lens,0,288,q,0,a.work,{bits:9}),b=0;b<32;)a.lens[b++]=5;w(z,a.lens,0,32,r,0,a.work,{bits:5}),ta=!1}a.lencode=q,a.lenbits=9,a.distcode=r,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<<f.wbits,f.wnext=0,f.whave=0,f.window=new s.Buf8(f.wsize)),d>=f.wsize?(s.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),s.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(s.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave<f.wsize&&(f.whave+=e))),0}function m(a,b){var c,e,f,g,h,i,j,m,n,o,p,q,r,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa=0,Ba=new s.Buf8(4),Ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return G;c=a.state,c.mode===W&&(c.mode=X),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,o=i,p=j,xa=D;a:for(;;)switch(c.mode){case L:if(0===c.wrap){c.mode=X;break}for(;n<16;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(2&c.wrap&&35615===m){c.check=0,Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0),m=0,n=0,c.mode=M;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg=\"incorrect header check\",c.mode=ma;break}if((15&m)!==K){a.msg=\"unknown compression method\",c.mode=ma;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg=\"invalid window size\",c.mode=ma;break}c.dmax=1<<wa,a.adler=c.check=1,c.mode=512&m?U:W,m=0,n=0;break;case M:for(;n<16;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.flags=m,(255&c.flags)!==K){a.msg=\"unknown compression method\",c.mode=ma;break}if(57344&c.flags){a.msg=\"unknown header flags set\",c.mode=ma;break}c.head&&(c.head.text=m>>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=N;case N:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.time=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=u(c.check,Ba,4,0)),m=0,n=0,c.mode=O;case O:for(;n<16;){if(0===i)break a;i--,m+=e[g++]<<n,\nn+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=P;case P:if(1024&c.flags){for(;n<16;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length=m,c.head&&(c.head.extra_len=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=Q;case Q:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),s.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=u(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=R;case R:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&q<i);if(512&c.flags&&(c.check=u(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=S;case S:if(4096&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.comment+=String.fromCharCode(wa));while(wa&&q<i);if(512&c.flags&&(c.check=u(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.comment=null);c.mode=T;case T:if(512&c.flags){for(;n<16;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(65535&c.check)){a.msg=\"header crc mismatch\",c.mode=ma;break}m=0,n=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=W;break;case U:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}a.adler=c.check=d(m),m=0,n=0,c.mode=V;case V:if(0===c.havedict)return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,F;a.adler=c.check=1,c.mode=W;case W:if(b===B||b===C)break a;case X:if(c.last){m>>>=7&n,n-=7&n,c.mode=ja;break}for(;n<3;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}switch(c.last=1&m,m>>>=1,n-=1,3&m){case 0:c.mode=Y;break;case 1:if(k(c),c.mode=ca,b===C){m>>>=2,n-=2;break a}break;case 2:c.mode=_;break;case 3:a.msg=\"invalid block type\",c.mode=ma}m>>>=2,n-=2;break;case Y:for(m>>>=7&n,n-=7&n;n<32;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if((65535&m)!==(m>>>16^65535)){a.msg=\"invalid stored block lengths\",c.mode=ma;break}if(c.length=65535&m,m=0,n=0,c.mode=Z,b===C)break a;case Z:c.mode=$;case $:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;s.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=W;break;case _:for(;n<14;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.nlen=(31&m)+257,m>>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg=\"too many length or distance symbols\",c.mode=ma;break}c.have=0,c.mode=aa;case aa:for(;c.have<c.ncode;){for(;n<3;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.lens[Ca[c.have++]]=7&m,m>>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=w(x,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg=\"invalid code lengths set\",c.mode=ma;break}c.have=0,c.mode=ba;case ba:for(;c.have<c.nlen+c.ndist;){for(;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(sa<16)m>>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;n<za;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m>>>=qa,n-=qa,0===c.have){a.msg=\"invalid bit length repeat\",c.mode=ma;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;n<za;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;n<za;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg=\"invalid bit length repeat\",c.mode=ma;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===ma)break;if(0===c.lens[256]){a.msg=\"invalid code -- missing end-of-block\",c.mode=ma;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=w(y,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg=\"invalid literal/lengths set\",c.mode=ma;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=w(z,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg=\"invalid distances set\",c.mode=ma;break}if(c.mode=ca,b===C)break a;case ca:c.mode=da;case da:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,v(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===W&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(ra&&0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.lencode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ia;break}if(32&ra){c.back=-1,c.mode=W;break}if(64&ra){a.msg=\"invalid literal/length code\",c.mode=ma;break}c.extra=15&ra,c.mode=ea;case ea:if(c.extra){for(za=c.extra;n<za;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=fa;case fa:for(;Aa=c.distcode[m&(1<<c.distbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.distcode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg=\"invalid distance code\",c.mode=ma;break}c.offset=sa,c.extra=15&ra,c.mode=ga;case ga:if(c.extra){for(za=c.extra;n<za;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg=\"invalid distance too far back\",c.mode=ma;break}c.mode=ha;case ha:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg=\"invalid distance too far back\",c.mode=ma;break}q>c.wnext?(q-=c.wnext,r=c.wsize-q):r=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,r=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[r++];while(--q);0===c.length&&(c.mode=da);break;case ia:if(0===j)break a;f[h++]=c.length,j--,c.mode=da;break;case ja:if(c.wrap){for(;n<32;){if(0===i)break a;i--,m|=e[g++]<<n,n+=8}if(p-=j,a.total_out+=p,c.total+=p,p&&(a.adler=c.check=c.flags?u(c.check,f,p,h-p):t(c.check,f,p,h-p)),p=j,(c.flags?m:d(m))!==c.check){a.msg=\"incorrect data check\",c.mode=ma;break}m=0,n=0}c.mode=ka;case ka:if(c.wrap&&c.flags){for(;n<32;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(4294967295&c.total)){a.msg=\"incorrect length check\",c.mode=ma;break}m=0,n=0}c.mode=la;case la:xa=E;break a;case ma:xa=H;break a;case na:return I;case oa:default:return G}return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,(c.wsize||p!==a.avail_out&&c.mode<ma&&(c.mode<ja||b!==A))&&l(a,a.output,a.next_out,p-a.avail_out)?(c.mode=na,I):(o-=a.avail_in,p-=a.avail_out,a.total_in+=o,a.total_out+=p,c.total+=p,c.wrap&&p&&(a.adler=c.check=c.flags?u(c.check,f,p,a.next_out-p):t(c.check,f,p,a.next_out-p)),a.data_type=c.bits+(c.last?64:0)+(c.mode===W?128:0)+(c.mode===ca||c.mode===Z?256:0),(0===o&&0===p||b===A)&&xa===D&&(xa=J),xa)}function n(a){if(!a||!a.state)return G;var b=a.state;return b.window&&(b.window=null),a.state=null,D}function o(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?G:(c.head=b,b.done=!1,D)):G}function p(a,b){var c,d,e,f=b.length;return a&&a.state?(c=a.state,0!==c.wrap&&c.mode!==V?G:c.mode===V&&(d=1,d=t(d,b,f,0),d!==c.check)?H:(e=l(a,b,f,f))?(c.mode=na,I):(c.havedict=1,D)):G}var q,r,s=a(\"../utils/common\"),t=a(\"./adler32\"),u=a(\"./crc32\"),v=a(\"./inffast\"),w=a(\"./inftrees\"),x=0,y=1,z=2,A=4,B=5,C=6,D=0,E=1,F=2,G=-2,H=-3,I=-4,J=-5,K=8,L=1,M=2,N=3,O=4,P=5,Q=6,R=7,S=8,T=9,U=10,V=11,W=12,X=13,Y=14,Z=15,$=16,_=17,aa=18,ba=19,ca=20,da=21,ea=22,fa=23,ga=24,ha=25,ia=26,ja=27,ka=28,la=29,ma=30,na=31,oa=32,pa=852,qa=592,ra=15,sa=ra,ta=!0;c.inflateReset=g,c.inflateReset2=h,c.inflateResetKeep=f,c.inflateInit=j,c.inflateInit2=i,c.inflate=m,c.inflateEnd=n,c.inflateGetHeader=o,c.inflateSetDictionary=p,c.inflateInfo=\"pako inflate (from Nodeca project)\"},{\"../utils/common\":28,\"./adler32\":30,\"./crc32\":32,\"./inffast\":35,\"./inftrees\":37}],37:[function(a,b,c){\"use strict\";var d=a(\"../utils/common\"),e=15,f=852,g=592,h=0,i=1,j=2,k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];b.exports=function(a,b,c,o,p,q,r,s){var t,u,v,w,x,y,z,A,B,C=s.bits,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=null,O=0,P=new d.Buf16(e+1),Q=new d.Buf16(e+1),R=null,S=0;for(D=0;D<=e;D++)P[D]=0;for(E=0;E<o;E++)P[b[c+E]]++;for(H=C,G=e;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;F<G&&0===P[F];F++);for(H<F&&(H=F),K=1,D=1;D<=e;D++)if(K<<=1,K-=P[D],K<0)return-1;if(K>0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;D<e;D++)Q[D+1]=Q[D]+P[D];for(E=0;E<o;E++)0!==b[c+E]&&(r[Q[b[c+E]]++]=E);if(a===h?(N=R=r,y=19):a===i?(N=k,O-=257,R=l,S-=257,y=256):(N=m,R=n,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<<H,w=L-1,a===i&&L>f||a===j&&L>g)return 1;for(var T=0;;){T++,z=D-J,r[E]<y?(A=0,B=r[E]):r[E]>y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<<D-J,u=1<<I,F=u;do u-=t,p[x+(M>>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<<D-1;M&t;)t>>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<<I;I+J<G&&(K-=P[I+J],!(K<=0));)I++,K<<=1;if(L+=1<<I,a===i&&L>f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{\"../utils/common\":28}],38:[function(a,b,c){\"use strict\";b.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},{}],39:[function(a,b,c){\"use strict\";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length}function f(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b}function g(a){return a<256?ia[a]:ia[256+(a>>>7)]}function h(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function i(a,b,c){a.bi_valid>X-c?(a.bi_buf|=b<<a.bi_valid&65535,h(a,a.bi_buf),a.bi_buf=b>>X-a.bi_valid,a.bi_valid+=c-X):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function j(a,b,c){i(a,c[2*b],c[2*b+1])}function k(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(--b>0);return c>>>1}function l(a){16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function m(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;f<=W;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;c<V;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function n(a,b,c){var d,e,f=new Array(W+1),g=0;for(d=1;d<=W;d++)f[d]=g=g+c[d-1]<<1;for(e=0;e<=b;e++){var h=a[2*e+1];0!==h&&(a[2*e]=k(f[h]++,h))}}function o(){var a,b,c,d,f,g=new Array(W+1);for(c=0,d=0;d<Q-1;d++)for(ka[d]=c,a=0;a<1<<ba[d];a++)ja[c++]=d;for(ja[c-1]=d,f=0,d=0;d<16;d++)for(la[d]=f,a=0;a<1<<ca[d];a++)ia[f++]=d;for(f>>=7;d<T;d++)for(la[d]=f<<7,a=0;a<1<<ca[d]-7;a++)ia[256+f++]=d;for(b=0;b<=W;b++)g[b]=0;for(a=0;a<=143;)ga[2*a+1]=8,a++,g[8]++;for(;a<=255;)ga[2*a+1]=9,a++,g[9]++;for(;a<=279;)ga[2*a+1]=7,a++,g[7]++;for(;a<=287;)ga[2*a+1]=8,a++,g[8]++;for(n(ga,S+1,g),a=0;a<T;a++)ha[2*a+1]=5,ha[2*a]=k(a,5);ma=new e(ga,ba,R+1,S,W),na=new e(ha,ca,0,T,W),oa=new e(new Array(0),da,0,U,Y)}function p(a){var b;for(b=0;b<S;b++)a.dyn_ltree[2*b]=0;for(b=0;b<T;b++)a.dyn_dtree[2*b]=0;for(b=0;b<U;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*Z]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function q(a){a.bi_valid>8?h(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function r(a,b,c,d){q(a),d&&(h(a,c),h(a,~c)),G.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function s(a,b,c,d){var e=2*b,f=2*c;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function t(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&s(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!s(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function u(a,b,c){var d,e,f,h,k=0;if(0!==a.last_lit)do d=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],e=a.pending_buf[a.l_buf+k],k++,0===d?j(a,e,b):(f=ja[e],j(a,f+R+1,b),h=ba[f],0!==h&&(e-=ka[f],i(a,e,h)),d--,f=g(d),j(a,f,c),h=ca[f],0!==h&&(d-=la[f],i(a,d,h)));while(k<a.last_lit);j(a,Z,b)}function v(a,b){var c,d,e,f=b.dyn_tree,g=b.stat_desc.static_tree,h=b.stat_desc.has_stree,i=b.stat_desc.elems,j=-1;for(a.heap_len=0,a.heap_max=V,c=0;c<i;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=j<2?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)t(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],t(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,t(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],m(a,b),n(f,j,a.bl_count)}function w(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;d<=c;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(h<j?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*$]++):h<=10?a.bl_tree[2*_]++:a.bl_tree[2*aa]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function x(a,b,c){var d,e,f=-1,g=b[1],h=0,k=7,l=4;for(0===g&&(k=138,l=3),d=0;d<=c;d++)if(e=g,g=b[2*(d+1)+1],!(++h<k&&e===g)){if(h<l){do j(a,e,a.bl_tree);while(0!==--h)}else 0!==e?(e!==f&&(j(a,e,a.bl_tree),h--),j(a,$,a.bl_tree),i(a,h-3,2)):h<=10?(j(a,_,a.bl_tree),i(a,h-3,3)):(j(a,aa,a.bl_tree),i(a,h-11,7));h=0,f=e,0===g?(k=138,l=3):e===g?(k=6,l=3):(k=7,l=4)}}function y(a){var b;for(w(a,a.dyn_ltree,a.l_desc.max_code),w(a,a.dyn_dtree,a.d_desc.max_code),v(a,a.bl_desc),b=U-1;b>=3&&0===a.bl_tree[2*ea[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function z(a,b,c,d){var e;for(i(a,b-257,5),i(a,c-1,5),i(a,d-4,4),e=0;e<d;e++)i(a,a.bl_tree[2*ea[e]+1],3);x(a,a.dyn_ltree,b-1),x(a,a.dyn_dtree,c-1)}function A(a){var b,c=4093624447;for(b=0;b<=31;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return I;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return J;for(b=32;b<R;b++)if(0!==a.dyn_ltree[2*b])return J;return I}function B(a){pa||(o(),pa=!0),a.l_desc=new f(a.dyn_ltree,ma),a.d_desc=new f(a.dyn_dtree,na),a.bl_desc=new f(a.bl_tree,oa),a.bi_buf=0,a.bi_valid=0,p(a)}function C(a,b,c,d){i(a,(L<<1)+(d?1:0),3),r(a,b,c,!0)}function D(a){i(a,M<<1,3),j(a,Z,ga),l(a)}function E(a,b,c,d){var e,f,g=0;a.level>0?(a.strm.data_type===K&&(a.strm.data_type=A(a)),v(a,a.l_desc),v(a,a.d_desc),g=y(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,f<=e&&(e=f)):e=f=c+5,c+4<=e&&b!==-1?C(a,b,c,d):a.strategy===H||f===e?(i(a,(M<<1)+(d?1:0),3),u(a,ga,ha)):(i(a,(N<<1)+(d?1:0),3),z(a,a.l_desc.max_code+1,a.d_desc.max_code+1,g+1),u(a,a.dyn_ltree,a.dyn_dtree)),p(a),d&&q(a)}function F(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ja[c]+R+1)]++,a.dyn_dtree[2*g(b)]++),a.last_lit===a.lit_bufsize-1}var G=a(\"../utils/common\"),H=4,I=0,J=1,K=2,L=0,M=1,N=2,O=3,P=258,Q=29,R=256,S=R+1+Q,T=30,U=19,V=2*S+1,W=15,X=16,Y=7,Z=256,$=16,_=17,aa=18,ba=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ca=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],da=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=512,ga=new Array(2*(S+2));d(ga);var ha=new Array(2*T);d(ha);var ia=new Array(fa);d(ia);var ja=new Array(P-O+1);d(ja);var ka=new Array(Q);d(ka);var la=new Array(T);d(la);var ma,na,oa,pa=!1;c._tr_init=B,c._tr_stored_block=C,c._tr_flush_block=E,c._tr_tally=F,c._tr_align=D},{\"../utils/common\":28}],40:[function(a,b,c){\"use strict\";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}]},{},[10])(10)});","type":"application/javascript","title":"$:/plugins/tiddlywiki/jszip/jszip.js","module-type":"library"},"$:/plugins/tiddlywiki/jszip/license":{"text":"JSZip is dual licensed. You may use it under the MIT license *or* the GPLv3\nlicense.\n\nThe MIT License\n===============\n\nCopyright (c) 2009-2014 Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\nGPL version 3\n=============\n\n GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n","type":"text/plain","title":"$:/plugins/tiddlywiki/jszip/license"},"$:/plugins/tiddlywiki/jszip/readme":{"title":"$:/plugins/tiddlywiki/jszip/readme","text":"This plugin provides primitives for working with Zip files. It also makes the [[JSZip|https://stuk.github.io/jszip/]] library available for use by other plugins.\n"},"$:/plugins/tiddlywiki/jszip/startup.js":{"title":"$:/plugins/tiddlywiki/jszip/startup.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/jszip/startup.js\ntype: application/javascript\nmodule-type: startup\n\nSetup the root widget event handlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar JSZip = require(\"$:/plugins/tiddlywiki/jszip/jszip.js\");\n\n// Export name and synchronous status\nexports.name = \"jszip\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n// Install the root widget event handlers\nexports.startup = function() {\n\t$tw.rootWidget.addEventListener(\"tm-zip-create\",function(event) {\n\t\tif(event.param) {\n\t\t\tvar zip = new JSZip();\n\t\t\tsaveZipTiddler(event.param,zip);\n\t\t}\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-zip-add-text-file\",function(event) {\n\t\tvar paramObject = event.paramObject || {};\n\t\tif(event.param && paramObject.filename && paramObject.text) {\n\t\t\tvar zip = loadZipTiddler(event.param);\n\t\t\tzip.file(paramObject.filename,paramObject.text);\n\t\t\tsaveZipTiddler(event.param,zip);\n\t\t}\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-zip-render-file\",function(event) {\n\t\tvar paramObject = event.paramObject || {};\n\t\tif(event.param && paramObject.filename && paramObject.template) {\n\t\t\tvar zip = loadZipTiddler(event.param),\n\t\t\t\toutputType = paramObject.output || \"text/plain\",\n\t\t\t\ttemplateTitle = paramObject.template,\n\t\t\t\ttext = $tw.wiki.renderTiddler(outputType,templateTitle,{\n\t\t\t\t\tparseAsInline: paramObject.mode === \"inline\",\n\t\t\t\t\tparentWidget: event.widget,\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tcurrentTiddler: paramObject.tiddler\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tzip.file(paramObject.filename,text);\n\t\t\tsaveZipTiddler(event.param,zip);\n\t\t}\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-zip-download\",function(event) {\n\t\tvar paramObject = event.paramObject || {};\n\t\tif(event.param) {\n\t\t\tdownloadZipFile(event.param,paramObject.filename || \"file.zip\");\n\t\t}\n\t});\n};\n\nfunction loadZipTiddler(title) {\n\treturn $tw.wiki.getGlobalCache(\"jszip\",function() {\n\t\tvar zip = new JSZip(),\n\t\t\ttiddler = $tw.wiki.getTiddler(title);\n\t\tif(tiddler && tiddler.fields.type === \"application/zip\") {\n\t\t\ttry {\n\t\t\t\tzip.load(tiddler.fields.text,{\n\t\t\t\t\tbase64: true\n\t\t\t\t});\n\t\t\t} catch(e) {\n\t\t\t\tconsole.log(\"JSZip error: \" + e)\n\t\t\t}\n\t\t}\n\t\treturn zip;\t\t\n\t});\n}\n\nfunction saveZipTiddler(title,zip) {\n\tvar data = zip.generate({\n\t\t\ttype: \"base64\"\n\t\t});\n\t$tw.wiki.addTiddler({\n\t\ttitle: title,\n\t\ttype: \"application/zip\",\n\t\ttext: data\n\t});\n}\n\nfunction downloadZipFile(title,filename) {\n\tvar tiddler = $tw.wiki.getTiddler(title);\n\tif(tiddler && tiddler.fields.text && tiddler.fields.type === \"application/zip\") {\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\",\"data:application/zip;base64,\" + encodeURIComponent(tiddler.fields.text));\n\t\tlink.setAttribute(\"download\",filename);\n\t\tdocument.body.appendChild(link);\n\t\tlink.click();\n\t\tdocument.body.removeChild(link);\n\t}\n}\n\n})();\n","type":"application/javascript","module-type":"startup"}}}
{"tiddlers":{"$:/config/DefaultColourMappings/menubar-foreground":{"title":"$:/config/DefaultColourMappings/menubar-foreground","text":"#fff"},"$:/config/DefaultColourMappings/menubar-background":{"title":"$:/config/DefaultColourMappings/menubar-background","text":"#5778d8"},"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/pagecontrols":{"title":"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/pagecontrols","text":"hide"},"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/server":{"title":"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/server","text":"hide"},"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/sidebar":{"title":"$:/config/plugins/menubar/MenuItems/Visibility/$:/plugins/tiddlywiki/menubar/items/sidebar","text":"hide"},"$:/config/plugins/menubar/TableOfContents/Tag":{"title":"$:/config/plugins/menubar/TableOfContents/Tag","text":"TableOfContents"},"$:/config/plugins/menubar/breakpoint":{"title":"$:/config/plugins/menubar/breakpoint","text":"620px"},"$:/plugins/tiddlywiki/menubar/config":{"title":"$:/plugins/tiddlywiki/menubar/config","tags":"$:/tags/ControlPanel/Toolbars","caption":"Menu Bar","text":"\\define config-base() $:/config/plugins/menubar/MenuItems/Visibility/\n\n! Menu Bar Configuration\n\n!! Menu Items\n\nSelect which menu items will be shown. You can also drag items to reorder them.\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$macrocall $name=\"list-tagged-draggable\" tag=\"$:/tags/MenuBar\" itemTemplate=\"$:/core/ui/ControlPanel/Toolbars/ItemTemplate\"/>\n\n</$set>\n\n</$set>\n\n!! Breakpoint Position\n\nThe breakpoint position between narrow and wide screens. Should include CSS units (eg. `400px`).\n\n<$edit-text tiddler=\"$:/config/plugins/menubar/breakpoint\" default=\"\" tag=\"input\"/>\n\n!! Contents Tag\n\nThe tag for the ~TableOfContents used in the Contents dropdown\n\n<$edit-text tiddler=\"$:/config/plugins/menubar/TableOfContents/Tag\" default=\"\" tag=\"input\"/>\n\n!! Menu Bar Colours\n\nTo change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette\n"},"$:/plugins/tiddlywiki/menubar/items/contents":{"title":"$:/plugins/tiddlywiki/menubar/items/contents","caption":"Contents","description":"Table of Contents","is-dropdown":"yes","tags":"$:/tags/MenuBar","text":"<div class=\"tc-table-of-contents\">\n\n<$macrocall $name=\"toc-selective-expandable\" tag={{$:/config/plugins/menubar/TableOfContents/Tag}}/>\n\n</div>\n"},"$:/plugins/tiddlywiki/menubar/items/hamburger":{"title":"$:/plugins/tiddlywiki/menubar/items/hamburger","tags":"$:/tags/MenuBar","caption":"Hamburger","description":"Show the full menu bar on a narrow screen","custom-menu-content":"{{$:/plugins/tiddlywiki/menubar/items/hamburger}}","show-when":"narrow","text":"<$list filter=\"[[$:/state/popup/menubar/hamburger]get[text]else[no]match[no]]\">\n<$button set=\"$:/state/popup/menubar/hamburger\" setTo=\"yes\">\n{{$:/core/images/menu-button}}\n</$button>\n</$list>\n<$list filter=\"[[$:/state/popup/menubar/hamburger]get[text]else[no]match[yes]]\">\n<$button set=\"$:/state/popup/menubar/hamburger\" setTo=\"no\">\n{{$:/core/images/close-button}}\n</$button>\n</$list>\n"},"$:/plugins/tiddlywiki/menubar/items/pagecontrols":{"title":"$:/plugins/tiddlywiki/menubar/items/pagecontrols","tags":"$:/tags/MenuBar","description":"Page controls from the sidebar","caption":"Page controls","custom-menu-content":"<$transclude tiddler=\"$:/plugins/tiddlywiki/menubar/items/pagecontrols\" mode=\"inline\"/>","text":"\\whitespace trim\n\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n<$set name=\"hidden\" value=<<config-title>>>\n<$list filter=\"[<hidden>!text[hide]]\" storyview=\"pop\" variable=\"ignore\">\n<$set name=\"tv-config-toolbar-class\" filter=\"[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]\">\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n</$set>\n</$list>\n</$set>\n</$list>\n"},"$:/plugins/tiddlywiki/menubar/items/search":{"title":"$:/plugins/tiddlywiki/menubar/items/search","custom-menu-content":"{{$:/plugins/tiddlywiki/menubar/items/search}}","description":"Search","caption":"Search","tags":"$:/tags/MenuBar","text":"\\define cancel-search-actions()\n<$set name=\"userInput\" value={{{ [<__storeTitle__>get[text]] }}}>\n<$list filter=\"[<__tiddler__>get[text]!match<userInput>]\" emptyMessage=\"\"\"<$action-deletetiddler $filter=\"[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]\"/>\"\"\">\n<$action-setfield $tiddler=<<__tiddler__>> text=<<userInput>>/><$action-setfield $tiddler=<<__refreshTitle__>> text=\"yes\"/>\n</$list>\n</$set>\n\\end\n\n\\define input-accept-actions() <$list filter=\"[{$:/config/Search/NavigateOnEnter/enable}match[yes]]\" emptyMessage=\"\"\"<$list filter=\"[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]\"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>\"\"\"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>\n\n\\define input-accept-variant-actions() <$list filter=\"[{$:/config/Search/NavigateOnEnter/enable}match[yes]]\" emptyMessage=\"\"\"<$list filter=\"[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]\"><$list filter=\"[<__tiddler__>get[text]minlength[1]]\"><$action-sendmessage $message=\"tm-edit-tiddler\" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>\"\"\"><$list filter=\"[<__tiddler__>get[text]minlength[1]]\"><$action-sendmessage $message=\"tm-edit-tiddler\" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>\n\n\\define set-next-input-tab(beforeafter:\"after\") <$macrocall $name=\"change-input-tab\" stateTitle=\"$:/state/tab/search-results/sidebar\" tag=\"$:/tags/SearchResults\" beforeafter=\"$beforeafter$\" defaultState={{$:/config/SearchResults/Default}} actions=\"\"\"<$action-setfield $tiddler=\"$:/state/search/currentTab\" text=<<nextTab>>/>\"\"\"/>\n\n\\whitespace trim\n<$vars searchTiddler=\"$:/temp/menubarsearch/input\" searchListState=<<qualify \"$:/state/search-list/selected-item\">>>\n<span style=\"margin: 0 0.5em;\">\n<$keyboard key=\"((input-tab-right))\" actions=<<set-next-input-tab>>>\n<$keyboard key=\"((input-tab-left))\" actions=<<set-next-input-tab \"before\">>>\n<$macrocall $name=\"keyboard-driven-input\" tiddler=\"$:/temp/menubarsearch\" storeTitle=<<searchTiddler>> selectionStateTitle=<<searchListState>> \n\t\trefreshTitle=\"$:/temp/menubarsearch/refresh\" tag=\"input\" type=\"search\" focusPopup=\"$:/state/popup/menubar-search-dropdown\" \n\t\tclass=\"tc-popup-handle tc-menu-show-when-wide\" placeholder=\"Search...\" default=\"\" cancelPopups=\"yes\" \n\t\tinputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> inputCancelActions=<<cancel-search-actions>> \n\t\tfilterMinLength={{$:/config/Search/MinLength}} configTiddlerFilter=\"[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]\" />\n</$keyboard>\n</$keyboard>\n</span>\n<$reveal tag=\"div\" class=\"tc-block-dropdown-wrapper\" state=\"$:/state/popup/menubar-search-dropdown\" type=\"nomatch\" text=\"\" default=\"\">\n\n<div class=\"tc-block-dropdown tc-search-drop-down\">\n\n<$list filter=\"[<searchTiddler>get[text]minlength[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">Type your search terms</div>\"\"\" variable=\"ignore\">\n\n<$list filter=\"[<searchTiddler>get[text]minlength{$:/config/Search/MinLength}limit[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">{{$:/language/Search/Search/TooShort}}</div>\"\"\" variable=\"listItem\">\n\n<$vars configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} userInput={{{ [<searchTiddler>get[text]] }}}>\n\n{{$:/core/ui/SearchResults}}\n\n</$vars>\n\n</$list>\n\n</$list>\n\n</div>\n\n</$reveal>\n\n</$vars>\n"},"$:/plugins/tiddlywiki/menubar/items/server":{"title":"$:/plugins/tiddlywiki/menubar/items/server","tags":"$:/tags/MenuBar","description":"Server options","caption":"Server","custom-menu-content":"<$transclude tiddler=\"$:/plugins/tiddlywiki/menubar/items/server\" mode=\"inline\"/>","text":"<$list filter=\"[[$:/status/IsLoggedIn]get[text]else[no]match[yes]]\" variable=\"ignore\">\n<$transclude tiddler=\"$:/core/ui/Buttons/save-wiki\" mode=\"inline\"/>\n</$list>\n<$list filter=\"[[$:/status/IsLoggedIn]get[text]else[no]match[no]]\" variable=\"ignore\">\n<$button message=\"tm-login\">\nLogin\n</$button>\n</$list>\n"},"$:/plugins/tiddlywiki/menubar/items/sidebar":{"title":"$:/plugins/tiddlywiki/menubar/items/sidebar","caption":"Sidebar","description":"Sidebar","is-dropdown":"yes","tags":"$:/tags/MenuBar","text":"<$scrollable fallthrough=\"none\" class=\"tc-popup-keep tc-menubar-dropdown-sidebar\">\n\n<$transclude tiddler=\"$:/core/ui/SideBarSegments/tabs\" mode=\"inline\"/>\n\n</$scrollable>\n"},"$:/plugins/tiddlywiki/menubar/items/topleftbar":{"title":"$:/plugins/tiddlywiki/menubar/items/topleftbar","tags":"$:/tags/MenuBar","description":"Items from $:/tags/TopLeftBar","caption":"Legacy Top Left Bar","custom-menu-content":"<$transclude tiddler=\"$:/plugins/tiddlywiki/menubar/items/topleftbar\" mode=\"inline\"/>","text":"<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]\" variable=\"listItem\" storyview=\"pop\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>"},"$:/plugins/tiddlywiki/menubar/items/toprightbar":{"title":"$:/plugins/tiddlywiki/menubar/items/toprightbar","tags":"$:/tags/MenuBar","description":"Items from $:/tags/TopRightBar","caption":"Legacy Top Right Bar","custom-menu-content":"<$transclude tiddler=\"$:/plugins/tiddlywiki/menubar/items/toprightbar\" mode=\"inline\"/>","custom-menu-styles-wide":"float: right;","text":"<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopRightBar]!has[draft.of]reverse[]]\" variable=\"listItem\" storyview=\"pop\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>"},"$:/plugins/tiddlywiki/menubar/menu":{"title":"$:/plugins/tiddlywiki/menubar/menu","tags":"$:/tags/PageTemplate","text":"\\define menubar-inner(size)\n<ul class=\"tc-menubar-list\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/MenuBar]!has[draft.of]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/toprightbar]]\">\n<$list filter=\"[<currentTiddler>addprefix[$:/config/plugins/menubar/MenuItems/Visibility/]get[text]] ~show +[match[show]]\" variable=\"ignore\">\n<$list filter=\"[[$size$]match[wide]] ~[<currentTiddler>get[show-when]match[$size$]] ~[{$:/state/popup/menubar/hamburger}match[yes]]\" variable=\"ignore\">\n<li style={{!!custom-menu-styles-$size$}} class={{{ [<currentTiddler>get[show-when]addprefix[tc-menubar-]] tc-menubar-item +[join[ ]] }}}>\n<$list filter=\"[<currentTiddler>!is-dropdown[yes]]\" variable=\"listItem\" emptyMessage=\"\"\"\n\t<!-- Dropdown -->\n\t<$set name=\"dropdown-state\" value=<<qualify \"$:/state/popup/topmenu/dropdown/\">>>\n\t<$set name=\"dropdown-state\" value={{{ [<dropdown-state>addsuffix<currentTiddler>] }}}>\n\t<$button popup=<<dropdown-state>> selectedClass=\"tc-selected\">\n\t<$set name=\"tv-wikilinks\" value=\"no\">\n\t<$transclude field=\"caption\" mode=\"inline\"/>\n\t<$text text=\" \"/>\n\t<span class=\"tc-menubar-dropdown-arrow\">\n\t<$transclude tiddler=\"$:/core/images/down-arrow\" mode=\"inline\"/>\n\t</span>\n\t</$set>\n\t</$button>\n\t</$set>\n\t</$set>\n\"\"\">\n<$list filter=\"[<currentTiddler>has[custom-menu-content]]\" variable=\"listItem\" emptyMessage=\"\"\"\n\t<!-- Link -->\n\t<$link to={{!!target}}>\n\t<$set name=\"tv-wikilinks\" value=\"no\">\n\t<$transclude field=\"caption\" mode=\"inline\"/>\n\t</$set>\n\t</$link>\n\"\"\">\n<!-- Custom content -->\n<$transclude field=\"custom-menu-content\" mode=\"inline\"/>\n</$list>\n</$list>\n</li>\n</$list>\n</$list>\n</$list>\n</ul>\n\\end\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/MenuBar]!has[draft.of]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/toprightbar]] +[limit[1]]\" variable=\"listItem\">\n<nav class=\"tc-menubar tc-adjust-top-of-scroll\">\n<div class=\"tc-menubar-narrow\">\n<<menubar-inner narrow>>\n</div>\n<div class=\"tc-menubar-wide\">\n<<menubar-inner wide>>\n</div>\n<div style=\"clear:both;\"/>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/MenuBar]!has[draft.of]is-dropdown[yes]]\">\n<$list filter=\"[<currentTiddler>addprefix[$:/config/plugins/menubar/MenuItems/Visibility/]get[text]] ~show +[match[show]]\" variable=\"ignore\">\n<$set name=\"dropdown-state\" value=<<qualify \"$:/state/popup/topmenu/dropdown/\">>>\n<$set name=\"dropdown-state\" value={{{ [<dropdown-state>addsuffix<currentTiddler>] }}}>\n<$reveal type=\"popup\" state=<<dropdown-state>> position={{{ [<currentTiddler>get[dropdown-position]else[below]] }}} class={{{ [<currentTiddler>get[class]] }}} tag=\"div\">\n<div class=\"tc-drop-down\">\n<$transclude/>\n</div>\n</$reveal>\n</$set>\n</$set>\n</$list>\n</$list>\n</nav>\n</$list>\n"},"$:/core/ui/PageTemplate/topleftbar":{"title":"$:/core/ui/PageTemplate/topleftbar","text":"<!-- The menubar plugin overrides this tiddler to remove the core top left menu. The menu items that it would include are instead included in the menubar -->"},"$:/core/ui/PageTemplate/toprightbar":{"title":"$:/core/ui/PageTemplate/toprightbar","text":"<!-- The menubar plugin overrides this tiddler to remove the core top right menu. The menu items that it would include are instead included in the menubar -->"},"$:/plugins/tiddlywiki/menubar/readme":{"title":"$:/plugins/tiddlywiki/menubar/readme","text":"!! Introduction\n\nThis plugin provides a menu bar with the following features:\n\n* Menu items take the form of simple text links, dropdowns, or entirely custom content\n* Menu items can be individually enabled via the control panel\n* Responds to reduced screen width by abbreviating the menu items to a \"hamburger\" dropdown\n\n!! Menu Item Tiddlers\n\nMenu items are tagged <<tag $:/tags/MenuBar>>. The following fields are used by this plugin:\n\n|!Field Name |!Purpose |\n|title |Each menu item must have a unique title (not shown to the user) |\n|description |Description for use in listings |\n|tags |Must contain `$:/tags/MenuBar` |\n|caption |The text that is displayed for the menu item. Avoid links, using `~` to suppress CamelCase links if required |\n|target |For simple link menu items specifies a tiddler title as the target of the link |\n|is-dropdown |Set to `yes` to indicate a dropdown menu item |\n|dropdown-position |Optional position for the dropdown (can be ''left'', ''above'', ''aboveleft'', ''aboveright'', ''right'', ''belowleft'', ''belowright'' or ''below'') |\n|text |For dropdown menu items, specifies the body of the dropdown |\n|custom-menu-content |Optional wikitext to be displayed in place of the caption |\n|custom-menu-styles-wide |Optional string of styles to be applied to menu item when the menubar is wide |\n|custom-menu-styles-narrow |Optional string of styles to be applied to menu item when the menubar is narrow |\n\nCustom menu items should make sure that the clickable link or button is an immediate child, and not wrapped in another element.\n\nNote that menu items can be pushed to the right of the menu bar setting the ''custom-menu-styles'' field to `float: right;`.\n"},"$:/plugins/tiddlywiki/menubar/styles":{"title":"$:/plugins/tiddlywiki/menubar/styles","tags":"[[$:/tags/Stylesheet]]","text":"\\define breakpoint-plus-one()\n<$text text={{{ [{$:/config/plugins/menubar/breakpoint}removesuffix[px]add[1]addsuffix[px]] ~[{$:/config/plugins/menubar/breakpoint}] }}} />\n\\end\n\n\\define sidebarbreakpoint-minus-one()\n<$text text={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] }}} />\n\\end\n\n\\define set-sidebar-scrollable-top-if-hamburger()\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/MenuBar]] -[all[tiddlers+shadows]prefix[$:/config/plugins/menubar/MenuItems/Visibility/]regexp:text[hide]removeprefix[$:/config/plugins/menubar/MenuItems/Visibility/]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[$:/plugins/tiddlywiki/menubar/items/toprightbar]] -$:/plugins/tiddlywiki/menubar/items/hamburger +[limit[1]]\">\n\n\t.tc-sidebar-scrollable {\n\t\tmargin-top: 2em;\n\t}\n\n</$list>\n\\end\n\n\\define set-sidebar-scrollable-top()\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/MenuBar]] -[all[tiddlers+shadows]prefix[$:/config/plugins/menubar/MenuItems/Visibility/]regexp:text[hide]removeprefix[$:/config/plugins/menubar/MenuItems/Visibility/]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[$:/plugins/tiddlywiki/menubar/items/toprightbar]] +[limit[1]]\">\n\n\t.tc-sidebar-scrollable {\n\t\tmargin-top: 2em;\n\t}\n\n</$list>\n<$reveal state=\"$:/state/popup/menubar/hamburger\" type=\"match\" text=\"yes\">\n\n\t<$set name=\"itemCount\" value={{{ [all[tiddlers+shadows]tag[$:/tags/MenuBar]] -[all[tiddlers+shadows]prefix[$:/config/plugins/menubar/MenuItems/Visibility/]regexp:text[hide]removeprefix[$:/config/plugins/menubar/MenuItems/Visibility/]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/toprightbar]] +[count[]] }}}>\n\n\t\t.tc-sidebar-scrollable {\n\t\t\tmargin-top: calc(<<itemCount>> * 2em);\n\t\t}\n\n\t</$set>\n\n</$reveal>\n\\end\n\n\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\n\nnav.tc-menubar {\n\tposition: fixed;\n\tz-index: 850;\n\tdisplay: inline-block;\n\ttop: 0;\n\tright: 0;\n\tleft: 0;\n}\n\nnav.tc-menubar ul.tc-menubar-list {\n\tposition: relative;\n\tlist-style-type: none;\n\tmargin: 0;\n\tpadding: 0 0 0 42px;\n\tbackground: <<colour background>>;\n\tbackground: <<colour menubar-background>>;\n\t<<box-shadow \"1px 1px 5px rgba(0, 0, 0, 0.3)\">>\n}\n\n@media (max-width: <<sidebarbreakpoint-minus-one>>) {\n\n\thtml nav.tc-menubar ul.tc-menubar-list {\n\t\tpadding: 0 0 0 8px;\n\t}\n\n}\n\nnav.tc-menubar li.tc-menubar-item {\n\tdisplay: inline-block;\n\tmargin: 0;\n\tpadding: 0;\n}\n\nnav.tc-menubar .tc-menubar-narrow li.tc-menubar-item {\n\tdisplay: block;\n}\n\nnav.tc-menubar li.tc-menubar-item > a,\nnav.tc-menubar li.tc-menubar-item > button {\n\tdisplay: inline-block;\n/*\ttext-transform: uppercase; */\n\tline-height: 1;\n\tfont-weight: 700;\n\tcolor: <<colour foreground>>;\n\tcolor: <<colour menubar-foreground>>;\n\tfill: <<colour foreground>>;\n\tfill: <<colour menubar-foreground>>;\n\ttext-decoration: none;\n\tpadding: 0.5em;\n\tmargin: 0;\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tborder-radius: 0;\n\ttext-decoration: none;\n}\n\nnav.tc-menubar li.tc-menubar-item > a.tc-selected,\nnav.tc-menubar li.tc-menubar-item > button.tc-selected {\n\tbackground: <<colour foreground>>;\n\tbackground: <<colour menubar-foreground>>;\n\tcolor: <<colour background>>;\n\tcolor: <<colour menubar-background>>;\n\tfill: <<colour background>>;\n\tfill: <<colour menubar-background>>;\n}\n\nnav.tc-menubar li.tc-menubar-item svg {\n\ttransition: none;\n\twidth: 1em;\n\theight: 1em;\n\tfill: <<colour foreground>>;\n\tfill: <<colour menubar-foreground>>;\n}\n\nnav.tc-menubar li.tc-menubar-item .tc-menubar-dropdown-arrow svg {\n\twidth: 0.5em;\n\theight: 0.5em;\n}\n\nnav.tc-menubar li.tc-menubar-item > a.tc-selected svg,\nnav.tc-menubar li.tc-menubar-item > button.tc-selected svg {\n\tfill: <<colour background>>;\n\tfill: <<colour menubar-background>>;\n}\n\nnav.tc-menubar li.tc-menubar-item > a:hover,\nnav.tc-menubar li.tc-menubar-item > button:hover svg,\nnav.tc-menubar li.tc-menubar-item > button:hover {\n\tbackground: <<colour foreground>>;\n\tbackground: <<colour menubar-foreground>>;\n\tcolor: <<colour background>>;\n\tcolor: <<colour menubar-background>>;\n\tfill: <<colour background>>;\n\tfill: <<colour menubar-background>>;\n\tborder-radius: 0;\n\ttext-decoration: none;\n}\n\nnav.tc-menubar li.tc-menubar-item > a:active,\nnav.tc-menubar li.tc-menubar-item > button:active svg,\nnav.tc-menubar li.tc-menubar-item > button:active {\n\tbackground: <<colour foreground>>;\n\tbackground: <<colour menubar-foreground>>;\n\tcolor: <<colour background>>;\n\tcolor: <<colour menubar-background>>;\n\tfill: <<colour background>>;\n\tfill: <<colour menubar-background>>;\n\tborder-radius: 0;\n\ttext-decoration: none;\n}\n\nnav.tc-menubar .tc-drop-down,\nnav.tc-menubar .tc-block-dropdown {\n\tmax-width: 70vw;\n\tmax-height: 70vh;\n\toverflow: auto;\n}\n\nnav.tc-menubar .tc-drop-down a {\n\ttext-decoration: none;\n}\n\nnav.tc-menubar .tc-drop-down .tc-table-of-contents button {\n\tdisplay: inline-block;\n\twidth: auto;\n}\n\nnav.tc-menubar .tc-drop-down ol {\n\tmargin: 0;\n}\n\nnav.tc-menubar .tc-drop-down .tc-menubar-dropdown-sidebar a,\nnav.tc-menubar .tc-drop-down .tc-menubar-dropdown-sidebar button {\n\tdisplay: inline;\n\twidth: auto;\n}\n\nnav.tc-menubar .tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button {\n\tdisplay: block;\n\twidth: 100%;\n}\n\n@media (max-width: {{$:/config/plugins/menubar/breakpoint}}) {\n\n\t.tc-menubar-wide {\n\t\tdisplay: none;\n\t}\n\n}\n\n@media (min-width: <<breakpoint-plus-one>>) {\n\n\tnav.tc-menubar li.tc-menubar-item.tc-menubar-narrow,\n\t.tc-menubar-narrow {\n\t\tdisplay: none;\n\t}\n\n}\n\n@media (max-width: <<sidebarbreakpoint-minus-one>>) {\n\n\t<<set-sidebar-scrollable-top-if-hamburger>>\n\n}\n\n@media (max-width: {{$:/config/plugins/menubar/breakpoint}}) {\n\n\t<<set-sidebar-scrollable-top>>\n\n}\n@media print {\n\n\tnav.tc-menubar {\n\t\tdisplay: none;\n\t}\n\n}\n"},"$:/tags/MenuBar":{"title":"$:/tags/MenuBar","list":"$:/plugins/tiddlywiki/menubar/items/hamburger $:/plugins/tiddlywiki/menubar/items/topleftbar $:/plugins/tiddlywiki/menubar/items/contents $:/plugins/tiddlywiki/menubar/items/search $:/plugins/tiddlywiki/menubar/items/pagecontrols $:/plugins/tiddlywiki/menubar/items/server $:/plugins/tiddlywiki/menubar/items/toprightbar"}}}
{"tiddlers":{"$:/plugins/tiddlywiki/xlsx-utils/controls":{"title":"$:/plugins/tiddlywiki/xlsx-utils/controls","caption":"XLSX Utilities","tags":"$:/tags/ControlPanel","text":"\\define help-button(state)\n<$button popup=\"\"\"$:/state/expand-help/$state$\"\"\" class=\"tc-btn-invisible tc-popup-keep\">\n{{$:/core/images/help}}\n</$button>\n\\end\n\n\\define help-content(type,state)\n<$reveal tag=\"span\" state=\"\"\"$:/state/expand-help/$state$\"\"\" type=\"popup\" position=\"below\">\n<div class=\"tc-drop-down tc-popup-keep\" style=\"padding: 0.5em; max-width: 30em; white-space: normal;\">\n<$transclude tiddler=\"\"\"$:/plugins/tiddlywiki/xlsx-utils/docs/$type$\"\"\" mode=\"block\"/>\n</div>\n</$reveal>\n\\end\n\n\\define renameProxyTitle()\n$:/state/plugins/tiddlywiki/xlsx-utils/rename-$(currentTiddler)$\n\\end\n\n\\define rename-current-tiddler()\n<$edit-text tag=\"input\" tiddler=<<renameProxyTitle>> placeholder=\"Rename\" default=<<currentTiddler>> size=\"50\"/>\n<$reveal type=\"nomatch\" state=\"\"\"$(renameProxyTitle)$\"\"\" text=<<currentTiddler>> default=<<currentTiddler>> tag=\"span\">\n<$button>\n<$action-deletetiddler $tiddler=<<renameProxyTitle>>/>\ncancel\n</$button>\n<$button>\n<$action-sendmessage $message=\"tm-rename-tiddler\" from=<<currentTiddler>> to={{$(renameProxyTitle)$}}/>\n<$action-deletetiddler $tiddler=<<renameProxyTitle>>/>\nrename\n</$button>\n<$set name=\"proxy-title\" value={{$(renameProxyTitle)$}}>\n<$list filter=\"\"\"[<proxy-title>is[tiddler]]\"\"\">\nWarning: tiddler already exists\n</$list>\n</$set>\n</$reveal>\n\\end\n\n\\define expand-collapse-button(state)\n<$reveal state=\"\"\"$:/state/expand/$state$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"span\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"\"\"$:/state/expand/$state$\"\"\" $value=\"no\"/>\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n<$reveal state=\"\"\"$:/state/expand/$state$\"\"\" type=\"nomatch\" text=\"yes\" default=\"no\" tag=\"span\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"\"\"$:/state/expand/$state$\"\"\" $value=\"yes\"/>\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n\\end\n\n\\define expand-collapse-content(state,content,class)\n<$reveal state=\"\"\"$:/state/expand/$state$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"div\" class=\"\"\"$class$\"\"\" animate=\"yes\" retain=\"yes\">\n$content$\n</$reveal>\n\\end\n\n\\define up-down-buttons(parent,child)\n<$list filter=\"[list<$parent$>butfirst[]field:title<$child$>limit[1]]\" variable=\"listItem\">\n<$button class=\"tc-btn-invisible\">\n<$action-listops $tiddler=<<$parent$>> $subfilter=\"+[move:-1<$child$>]\"/>\n{{$:/core/images/chevron-up}}\n</$button>\n</$list>\n<$list filter=\"[list<$parent$>butlast[]field:title<$child$>limit[1]]\" variable=\"listItem\">\n<$button class=\"tc-btn-invisible\">\n<$action-listops $tiddler=<<$parent$>> $subfilter=\"+[move:1<$child$>]\"/>\n{{$:/core/images/chevron-down}}\n</$button>\n</$list>\n\\end\n\n\\define edit-button(state)\n<$reveal state=\"\"\"$:/state/edit/$state$\"\"\" type=\"nomatch\" text=\"yes\" default=\"no\" tag=\"span\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"\"\"$:/state/edit/$state$\"\"\" $value=\"yes\"/>\n<$action-setfield $tiddler=\"\"\"$:/state/expand/$state$\"\"\" $value=\"yes\"/>\n{{$:/core/images/edit-button}}\n</$button>\n</$reveal>\n<$reveal state=\"\"\"$:/state/edit/$state$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"span\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"\"\"$:/state/edit/$state$\"\"\" $value=\"no\"/>\n{{$:/core/images/done-button}} Finish editing\n</$button>\n</$reveal>\n\\end\n\n\\define delete-item-button(filter,parent,title,prompt)\n<$button class=\"tc-btn-invisible\">\n<$action-deletetiddler $filter=\"\"\"$filter$\"\"\"/>\n<$action-listops $tiddler=\"\"\"$parent$\"\"\" $subfilter=\"-[[$title$]]\"/>\n{{$:/core/images/delete-button}}$prompt$\n</$button>\n\\end\n\n\\define edit-field()\n<$select tiddler=<<field>> field=\"import-field-list-op\" default=\"none\">\n<option value=\"none\">Set field</option>\n<option value=\"append\">Append to list field</option>\n</$select>\n<$edit-text tiddler=<<field>> field=\"import-field-name\" size=\"10\" tag=\"input\" placeholder=\"field name\"default=\"\"/>\n<$reveal state=\"\"\"$(field)$!!import-field-list-op\"\"\" type=\"match\" text=\"none\" default=\"none\" tag=\"span\">\nto\n</$reveal>\n<$reveal state=\"\"\"$(field)$!!import-field-list-op\"\"\" type=\"match\" text=\"append\" default=\"none\" tag=\"span\">\nthe\n</$reveal>\n<$select tiddler=<<field>> field=\"import-field-type\" default=\"string\">\n<option value=\"date\">date</option>\n<option value=\"string\">string</option>\n</$select>\n<$select tiddler=<<field>> field=\"import-field-source\" default=\"column\">\n<option value=\"column\">from column</option>\n<option value=\"constant\">constant</option>\n</$select>\n<$reveal state=\"\"\"$(field)$!!import-field-source\"\"\" type=\"match\" text=\"column\" default=\"column\" tag=\"span\">\n<$edit-text tiddler=<<field>> field=\"import-field-column\" tag=\"input\" placeholder=\"column\" default=\"\"/>\nprefixed\n<$edit-text tiddler=<<field>> field=\"import-field-prefix\" tag=\"input\" placeholder=\"prefix\" default=\"\"/>,\nsuffixed\n<$edit-text tiddler=<<field>> field=\"import-field-suffix\" tag=\"input\" placeholder=\"suffix\" default=\"\"/>\n</$reveal>\n<$reveal state=\"\"\"$(field)$!!import-field-source\"\"\" type=\"match\" text=\"constant\" default=\"column\" tag=\"span\">\n<$edit-text tiddler=<<field>> field=\"import-field-value\" tag=\"input\" placeholder=\"constant\" default=\"\"/>\n</$reveal>\n<$checkbox tiddler=<<field>> field=\"import-field-skip-tiddler-if-blank\" checked=\"yes\" unchecked=\"no\" default=\"no\">\nSkip this tiddler when field blank\n<br/>\nTitle:\n<$tiddler tiddler=<<field>>>\n<<rename-current-tiddler>>\n</$tiddler>\n\\end\n\n\\define view-field()\n<$link to=<<field>>>\n<$list filter=\"[<field>!has[import-field-list-op]]\" variable=\"listItem\">\nSet field ''<$view tiddler=<<field>> field=\"import-field-name\"/>'' to\n</$list>\n<$list filter=\"[<field>get[import-field-list-op]prefix[append]]\" variable=\"listItem\">\nAppend to list field ''<$view tiddler=<<field>> field=\"import-field-name\"/>''\n</$list>\n<$list filter=\"[<field>has[import-field-prefix]]\" variable=\"listItem\">\n''<code><$view tiddler=<<field>> field=\"import-field-prefix\"/></code>'' +\n</$list>\n<$list filter=\"[<field>get[import-field-type]prefix[date]]\" variable=\"listItem\">\ndate\n</$list>\n<$list filter=\"[<field>get[import-field-source]prefix[column]]\" variable=\"listItem\">\nvalue from column ''<$view tiddler=<<field>> field=\"import-field-column\"/>''\n</$list>\n<$list filter=\"[<field>get[import-field-source]prefix[constant]]\" variable=\"listItem\">\nconstant ''<code><$view tiddler=<<field>> field=\"import-field-value\"/></code>''\n</$list>\n<$list filter=\"[<field>has[import-field-suffix]]\" variable=\"listItem\">\n+ ''<code><$view tiddler=<<field>> field=\"import-field-suffix\"/></code>''\n</$list>\n</$link>\n\\end\n\n\\define list-fields()\n<ul class=\"tc-import-spec-row-list\">\n<$list filter=\"[list<row>]\" variable=\"field\" emptyMessage=\"<div>(No field import specifiers)</div>\">\n<li class=\"tc-import-spec-field-wrapper\">\n<$reveal state=\"\"\"$:/state/edit/$(row)$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"span\">\n<<edit-field>>\n<<up-down-buttons parent:\"row\" child:\"field\">>\n<$macrocall $name=\"delete-item-button\" filter=\"[<field>]\" parent=<<row>> title=<<field>>/>\n</$reveal>\n<$reveal state=\"\"\"$:/state/edit/$(row)$\"\"\" type=\"nomatch\" text=\"yes\" default=\"no\" tag=\"span\">\n<<view-field>>\n</$reveal>\n</li>\n</$list>\n</ul>\n\\end\n\n\\define view-row-content()\n<$reveal state=\"\"\"$:/state/edit/$(row)$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"ul\" class=\"tc-import-spec-row-controls\" animate=\"yes\" retain=\"yes\">\n<li>\n<$macrocall $name=\"delete-item-button\" filter=\"[<row>] [<row>getlist[]]\" parent=<<sheet>> title=<<row>> prompt=\" Delete this row\"/>\n</li>\n<li>\nTitle:\n<$tiddler tiddler=<<row>>>\n<<rename-current-tiddler>>\n</$tiddler>\n</li>\n<li>\nRow type:\n<$select tiddler=<<row>> field=\"import-row-type\" default=\"by-field\">\n<option value=\"by-field\">By field</option>\n<option value=\"by-column\">By column</option>\n</$select>\n</li>\n<li>\n<$button class=\"tc-btn-invisible\">\n<$action-createtiddler $basetitle=\"$:/_ExcelImporter/ImportSpecifiers/Field\" $savetitle=\"$:/temp/newtiddler\" import-spec-role=\"field\" import-field-name=\"fieldname\" import-field-type=\"string\" import-field-source=\"column\" import-field-column=\"Column Name\" />\n<$action-listops $tiddler=<<row>> $subfilter=\"[{$:/temp/newtiddler}] +[putfirst[]]\"/>\n{{$:/core/images/new-button}} Add new field\n</$button>\n</li>\n</$reveal>\n<<list-fields>>\n\\end\n\n\\define view-row()\n<div class=\"tc-import-spec-row-wrapper\">\n<h5>\n<$macrocall $name=\"expand-collapse-button\" state=<<row>>/>\nEach row: <$list filter=\"[list<row>import-field-name[title]]\" variable=\"field\" emptyMessage=\"\n<$link to=<<field>>>(title field not set)</$link>\"><<view-field>></$list>\n<$macrocall $name=\"edit-button\" state=<<row>>/>\n<<up-down-buttons parent:\"sheet\" child:\"row\">>\n<$macrocall $name=\"help-button\" state=<<row>>/>\n</h5>\n<$macrocall $name=\"help-content\" type=\"row\" state=<<row>>/>\n<$macrocall $name=\"expand-collapse-content\" state=<<row>> content=<<view-row-content>> class=\"tc-import-spec-row\"/>\n</div>\n\\end\n\n\\define list-rows()\n<div class=\"tc-import-spec-sheet-list\">\n<$list filter=\"[list<sheet>]\" variable=\"row\" emptyMessage=\"<div>(No row import specifiers)</div>\">\n<<view-row>>\n</$list>\n\\end\n\n\\define view-sheet-content()\n<$reveal state=\"\"\"$:/state/edit/$(sheet)$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"ul\" class=\"tc-import-spec-sheet-controls\" animate=\"yes\" retain=\"yes\">\n<li>\n<$macrocall $name=\"delete-item-button\" filter=\"[<sheet>] [<sheet>getlist[]] [<sheet>getlist[]getlist[]]\" parent=<<workbook>> title=<<sheet>> prompt=\" Delete this sheet\"/>\n</li>\n<li>\nTitle:\n<$tiddler tiddler=<<sheet>>>\n<<rename-current-tiddler>>\n</$tiddler>\n</li>\n<li>\nImport sheet name:\n<$edit-text tiddler=<<sheet>> field=\"import-sheet-name\" size=\"50\"/>\n</li>\n<li>\n<$button class=\"tc-btn-invisible\">\n<$action-createtiddler $basetitle=\"$:/_ExcelImporter/ImportSpecifiers/Row\" $savetitle=\"$:/temp/newtiddler\" import-spec-role=\"row\"/>\n<$action-listops $tiddler=<<sheet>> $subfilter=\"[{$:/temp/newtiddler}] +[putfirst[]]\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/edit/]] }}} $value=\"yes\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/expand/]] }}} $value=\"yes\"/>\n{{$:/core/images/new-button}} Add new row\n</$button>\n</li>\n</$reveal>\n<<list-rows>>\n\\end\n\n\\define view-sheet()\n<div class=\"tc-import-spec-sheet-wrapper\">\n<h4>\n<$macrocall $name=\"expand-collapse-button\" state=<<sheet>>/>\nSheet: <$link to=<<sheet>>><$view tiddler=<<sheet>> field=\"import-sheet-name\"/></$link>\n<$macrocall $name=\"edit-button\" state=<<sheet>>/>\n<<up-down-buttons parent:\"workbook\" child:\"sheet\">>\n<$macrocall $name=\"help-button\" state=<<sheet>>/>\n</h4>\n<$macrocall $name=\"help-content\" type=\"sheet\" state=<<sheet>>/>\n<$macrocall $name=\"expand-collapse-content\" state=<<sheet>> content=<<view-sheet-content>> class=\"tc-import-spec-sheet\"/>\n</div>\n\\end\n\n\\define list-sheets()\n<div class=\"tc-import-spec-workbook-list\">\n<$list filter=\"[list<workbook>]\" variable=\"sheet\" emptyMessage=\"<div>(No sheet import specifiers)</div>\">\n<<view-sheet>>\n</$list>\n</div>\n\\end\n\n\\define view-workbook-content()\n<$reveal state=\"\"\"$:/state/edit/$(workbook)$\"\"\" type=\"match\" text=\"yes\" default=\"no\" tag=\"ul\" class=\"tc-import-spec-workbook-controls\" animate=\"yes\" retain=\"yes\">\n<li>\n<$macrocall $name=\"delete-item-button\" filter=\"[<workbook>] [<workbook>getlist[]] [<workbook>getlist[]getlist[]] [<workbook>getlist[]getlist[]getlist[]]\" prompt=\" Delete this workbook\"/>\n</li>\n<li>\nTitle:\n<$tiddler tiddler=<<workbook>>>\n<<rename-current-tiddler>>\n</$tiddler>\n</li>\n<li>\nCaption:\n<$edit-text tiddler=<<workbook>> field=\"caption\" size=\"50\"/>\n</li>\n<li>\n<$button class=\"tc-btn-invisible\">\n<$action-createtiddler $basetitle=\"$:/_ExcelImporter/ImportSpecifiers/Sheet\" $savetitle=\"$:/temp/newtiddler\" import-spec-role=\"sheet\" import-sheet-name=\"Sheet name\"/>\n<$action-listops $tiddler=<<workbook>> $subfilter=\"[{$:/temp/newtiddler}] +[putfirst[]]\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/edit/]] }}} $value=\"yes\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/expand/]] }}} $value=\"yes\"/>\n{{$:/core/images/new-button}} Add new sheet\n</$button>\n</li>\n</$reveal>\n<<list-sheets>>\n\\end\n\n\\define view-workbook()\n<div class=\"tc-import-spec-workbook-wrapper\">\n<h3>\n<$macrocall $name=\"expand-collapse-button\" state=<<workbook>>/>\nWorkbook: <$link to=<<workbook>>><$view tiddler=<<workbook>> field=\"caption\"/></$link>\n<$macrocall $name=\"edit-button\" state=<<workbook>>/>\n<$macrocall $name=\"help-button\" state=<<workbook>>/>\n</h3>\n<$macrocall $name=\"help-content\" type=\"workbook\" state=<<workbook>>/>\n<$macrocall $name=\"expand-collapse-content\" state=<<workbook>> content=<<view-workbook-content>> class=\"tc-import-spec-workbook\"/>\n</div>\n\\end\n\n\\define list-workbooks()\n<ul class=\"tc-import-spec-editor-controls\">\n<li>\n<$button class=\"tc-btn-invisible\">\n<$action-createtiddler $basetitle=\"$:/_ExcelImporter/ImportSpecifiers/Workbook\" $savetitle=\"$:/temp/newtiddler\" import-spec-role=\"workbook\" caption=\"New workbook\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/edit/]] }}} $value=\"yes\"/>\n<$action-setfield $tiddler={{{ [{$:/temp/newtiddler}addprefix[$:/state/expand/]] }}} $value=\"yes\"/>\n{{$:/core/images/new-button}} Add new workbook\n</$button>\n</li>\n</ul>\n<div class=\"tc-import-spec-editor-list\">\n<$list filter=\"[all[shadows+tiddlers]import-spec-role[workbook]sort[caption]]\" variable=\"workbook\">\n<<view-workbook>>\n</$list>\n</div>\n\\end\n\n<h1>\nControls for XLSX Spreadsheet Utilities\n</h1>\n\n<div class=\"tc-import-spec-selector\">\n<h2>\nCurrent Import Specification\n</h2>\n<$list filter=\"[all[shadows+tiddlers]import-spec-role[workbook]limit[1]]\" emptyMessage=\"\"\"\nThere are no import specifications available. Use the controls below to create one\n\"\"\">\nThis is the import specification that will be used for the next import of an `.XLSX` file\n<$select tiddler=\"$:/config/plugins/tiddlywiki/xlsx-utils/default-import-spec\">\n<$list filter=\"[all[shadows+tiddlers]import-spec-role[workbook]sort[caption]]\">\n<option value=<<currentTiddler>>><$text text={{!!caption}}/></option>\n</$list>\n</$select>\n</$list>\n</div>\n\n<div class=\"tc-import-spec-editor-wrapper\">\n<h2>\n Import Specifications\n<$macrocall $name=\"help-button\" state=\"\"/>\n</h2>\n<$macrocall $name=\"help-content\" type=\"editor\" state=\"\"/>\n<div class=\"tc-import-spec-editor\">\n<<list-workbooks>>\n</div>\n</div>\n"},"$:/plugins/tiddlywiki/xlsx-utils/deserializer.js":{"title":"$:/plugins/tiddlywiki/xlsx-utils/deserializer.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/xlsx-utils/deserializer.js\ntype: application/javascript\nmodule-type: tiddlerdeserializer\n\nXLSX file deserializer\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nParse an XLSX file into tiddlers\n*/\nexports[\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"] = function(text,fields) {\n\t// Collect output tiddlers in an array\n\tvar results = [],\n\t\tXLSXImporter = require(\"$:/plugins/tiddlywiki/xlsx-utils/importer.js\").XLSXImporter,\n\t\timporter = new XLSXImporter({\n\t\t\ttext: text,\n\t\t\twiki: $tw.wiki\n\t\t});\n\t// Return the output tiddlers\n\treturn importer.getResults();\n};\n\n})();\n","type":"application/javascript","module-type":"tiddlerdeserializer"},"$:/plugins/tiddlywiki/xlsx-utils/docs/editor":{"title":"$:/plugins/tiddlywiki/xlsx-utils/docs/editor","text":"!!! Import Specifications\n\nImport specifications govern how spreadsheets are converted into individual tiddlers.\n\nEach \"workbook\" describes how spreadsheets of a particular format should be converted.\n"},"$:/plugins/tiddlywiki/xlsx-utils/docs/row":{"title":"$:/plugins/tiddlywiki/xlsx-utils/docs/row","text":"!!! Row Import Specifications\n\nEach row import specification describes how one tiddler should be extracted from each row of the current sheet.\n\nNote that using multiple row import specifications within a sheet enables multiple tiddlers to be created from each row of the sheet.\n\nRows contain a list of field import specifications that describe how each field of the tiddler should be created.\n\n!!! Field Import Specifications\n\nField import specifications describe the value given to a particular field of a tiddler.\n\nThey follow a rich syntax for describing how each field of the tiddler is created. For example:\n\n* Set field `title` to string from column `Organization`\n* Set field `role` to string constant `organization`\n* Append to list field `list` the string from column `Country` prefixed with `Map:`\n\n"},"$:/plugins/tiddlywiki/xlsx-utils/docs/sheet":{"title":"$:/plugins/tiddlywiki/xlsx-utils/docs/sheet","text":"!!! Sheet Import Specifications\n\nEach sheet import specification describes how a named sheet within a workbook should be converted into individual tiddlers.\n\nSheets contain a list of row import specifications that describe how individual rows of the sheet should be handled.\n\nEach sheet has the name of the sheet that it handles.\n\nNote that the first row of each sheet is interpreted as the title of each column.\n"},"$:/plugins/tiddlywiki/xlsx-utils/docs/workbook":{"title":"$:/plugins/tiddlywiki/xlsx-utils/docs/workbook","text":"!!! Workbook Import Specifications\n\nEach workbook import specification describes how spreadsheets of a particular format should be converted into individual tiddlers.\n\nCreate a new workbook for each type of spreadsheet that you will be working with.\n\nWorkbooks contain a list of sheet import specifications that describe how individual sheets of the workbook should be handled.\n\nEach workbook has a caption that you can use to describe its purpose.\n"},"$:/plugins/tiddlywiki/xlsx-utils/xlsx.js":{"text":"var old_exports = exports,JSZip = require(\"$:/plugins/tiddlywiki/jszip/jszip.js\");exports = {};if($tw.browser){module.exports=undefined;};/* xlsx.js (C) 2013-2015 SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*jshint -W041 */\n/*jshint funcscope:true, eqnull:true */\nvar XLSX = {};\n(function make_xlsx(XLSX){\nXLSX.version = '0.8.0';\nvar current_codepage = 1200, current_cptable;\nif(typeof module !== \"undefined\" && typeof require !== 'undefined') {\n\tif(typeof cptable === 'undefined') cptable = require('./dist/cpexcel');\n\tcurrent_cptable = cptable[current_codepage];\n}\nfunction reset_cp() { set_cp(1200); }\nvar set_cp = function(cp) { current_codepage = cp; };\n\nfunction char_codes(data) { var o = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }\nvar debom_xml = function(data) { return data; };\n\nvar _getchar = function _gc1(x) { return String.fromCharCode(x); };\nif(typeof cptable !== 'undefined') {\n\tset_cp = function(cp) { current_codepage = cp; current_cptable = cptable[cp]; };\n\tdebom_xml = function(data) {\n\t\tif(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return cptable.utils.decode(1200, char_codes(data.substr(2))); }\n\t\treturn data;\n\t};\n\t_getchar = function _gc2(x) {\n\t\tif(current_codepage === 1200) return String.fromCharCode(x);\n\t\treturn cptable.utils.decode(current_codepage, [x&255,x>>8])[0];\n\t};\n}\nvar Base64 = (function make_b64(){\n\tvar map = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\treturn {\n\t\tencode: function(input, utf8) {\n\t\t\tvar o = \"\";\n\t\t\tvar c1, c2, c3, e1, e2, e3, e4;\n\t\t\tfor(var i = 0; i < input.length; ) {\n\t\t\t\tc1 = input.charCodeAt(i++);\n\t\t\t\tc2 = input.charCodeAt(i++);\n\t\t\t\tc3 = input.charCodeAt(i++);\n\t\t\t\te1 = c1 >> 2;\n\t\t\t\te2 = (c1 & 3) << 4 | c2 >> 4;\n\t\t\t\te3 = (c2 & 15) << 2 | c3 >> 6;\n\t\t\t\te4 = c3 & 63;\n\t\t\t\tif (isNaN(c2)) { e3 = e4 = 64; }\n\t\t\t\telse if (isNaN(c3)) { e4 = 64; }\n\t\t\t\to += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);\n\t\t\t}\n\t\t\treturn o;\n\t\t},\n\t\tdecode: function b64_decode(input, utf8) {\n\t\t\tvar o = \"\";\n\t\t\tvar c1, c2, c3;\n\t\t\tvar e1, e2, e3, e4;\n\t\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\t\tfor(var i = 0; i < input.length;) {\n\t\t\t\te1 = map.indexOf(input.charAt(i++));\n\t\t\t\te2 = map.indexOf(input.charAt(i++));\n\t\t\t\te3 = map.indexOf(input.charAt(i++));\n\t\t\t\te4 = map.indexOf(input.charAt(i++));\n\t\t\t\tc1 = e1 << 2 | e2 >> 4;\n\t\t\t\tc2 = (e2 & 15) << 4 | e3 >> 2;\n\t\t\t\tc3 = (e3 & 3) << 6 | e4;\n\t\t\t\to += String.fromCharCode(c1);\n\t\t\t\tif (e3 != 64) { o += String.fromCharCode(c2); }\n\t\t\t\tif (e4 != 64) { o += String.fromCharCode(c3); }\n\t\t\t}\n\t\t\treturn o;\n\t\t}\n\t};\n})();\nvar has_buf = (typeof Buffer !== 'undefined');\n\nfunction new_raw_buf(len) {\n\t/* jshint -W056 */\n\treturn new (has_buf ? Buffer : Array)(len);\n\t/* jshint +W056 */\n}\n\nfunction s2a(s) {\n\tif(has_buf) return new Buffer(s, \"binary\");\n\treturn s.split(\"\").map(function(x){ return x.charCodeAt(0) & 0xff; });\n}\n\nvar bconcat = function(bufs) { return [].concat.apply([], bufs); };\n\nvar chr0 = /\\u0000/g, chr1 = /[\\u0001-\\u0006]/;\n/* ssf.js (C) 2013-2014 SheetJS -- http://sheetjs.com */\n/*jshint -W041 */\nvar SSF = {};\nvar make_ssf = function make_ssf(SSF){\nSSF.version = '0.8.1';\nfunction _strrev(x) { var o = \"\", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }\nfunction fill(c,l) { var o = \"\"; while(o.length < l) o+=c; return o; }\nfunction pad0(v,d){var t=\"\"+v; return t.length>=d?t:fill('0',d-t.length)+t;}\nfunction pad_(v,d){var t=\"\"+v;return t.length>=d?t:fill(' ',d-t.length)+t;}\nfunction rpad_(v,d){var t=\"\"+v; return t.length>=d?t:t+fill(' ',d-t.length);}\nfunction pad0r1(v,d){var t=\"\"+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;}\nfunction pad0r2(v,d){var t=\"\"+v; return t.length>=d?t:fill('0',d-t.length)+t;}\nvar p2_32 = Math.pow(2,32);\nfunction pad0r(v,d){if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); }\nfunction isgeneral(s, i) { return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; }\n/* Options */\nvar opts_fmt = [\n\t[\"date1904\", 0],\n\t[\"output\", \"\"],\n\t[\"WTF\", false]\n];\nfunction fixopts(o){\n\tfor(var y = 0; y != opts_fmt.length; ++y) if(o[opts_fmt[y][0]]===undefined) o[opts_fmt[y][0]]=opts_fmt[y][1];\n}\nSSF.opts = opts_fmt;\nvar table_fmt = {\n\t0: 'General',\n\t1: '0',\n\t2: '0.00',\n\t3: '#,##0',\n\t4: '#,##0.00',\n\t9: '0%',\n\t10: '0.00%',\n\t11: '0.00E+00',\n\t12: '# ?/?',\n\t13: '# ??/??',\n\t14: 'm/d/yy',\n\t15: 'd-mmm-yy',\n\t16: 'd-mmm',\n\t17: 'mmm-yy',\n\t18: 'h:mm AM/PM',\n\t19: 'h:mm:ss AM/PM',\n\t20: 'h:mm',\n\t21: 'h:mm:ss',\n\t22: 'm/d/yy h:mm',\n\t37: '#,##0 ;(#,##0)',\n\t38: '#,##0 ;[Red](#,##0)',\n\t39: '#,##0.00;(#,##0.00)',\n\t40: '#,##0.00;[Red](#,##0.00)',\n\t45: 'mm:ss',\n\t46: '[h]:mm:ss',\n\t47: 'mmss.0',\n\t48: '##0.0E+0',\n\t49: '@',\n\t56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"',\n\t65535: 'General'\n};\nvar days = [\n\t['Sun', 'Sunday'],\n\t['Mon', 'Monday'],\n\t['Tue', 'Tuesday'],\n\t['Wed', 'Wednesday'],\n\t['Thu', 'Thursday'],\n\t['Fri', 'Friday'],\n\t['Sat', 'Saturday']\n];\nvar months = [\n\t['J', 'Jan', 'January'],\n\t['F', 'Feb', 'February'],\n\t['M', 'Mar', 'March'],\n\t['A', 'Apr', 'April'],\n\t['M', 'May', 'May'],\n\t['J', 'Jun', 'June'],\n\t['J', 'Jul', 'July'],\n\t['A', 'Aug', 'August'],\n\t['S', 'Sep', 'September'],\n\t['O', 'Oct', 'October'],\n\t['N', 'Nov', 'November'],\n\t['D', 'Dec', 'December']\n];\nfunction frac(x, D, mixed) {\n\tvar sgn = x < 0 ? -1 : 1;\n\tvar B = x * sgn;\n\tvar P_2 = 0, P_1 = 1, P = 0;\n\tvar Q_2 = 1, Q_1 = 0, Q = 0;\n\tvar A = Math.floor(B);\n\twhile(Q_1 < D) {\n\t\tA = Math.floor(B);\n\t\tP = A * P_1 + P_2;\n\t\tQ = A * Q_1 + Q_2;\n\t\tif((B - A) < 0.0000000005) break;\n\t\tB = 1 / (B - A);\n\t\tP_2 = P_1; P_1 = P;\n\t\tQ_2 = Q_1; Q_1 = Q;\n\t}\n\tif(Q > D) { Q = Q_1; P = P_1; }\n\tif(Q > D) { Q = Q_2; P = P_2; }\n\tif(!mixed) return [0, sgn * P, Q];\n\tif(Q===0) throw \"Unexpected state: \"+P+\" \"+P_1+\" \"+P_2+\" \"+Q+\" \"+Q_1+\" \"+Q_2;\n\tvar q = Math.floor(sgn * P/Q);\n\treturn [q, sgn*P - q*Q, Q];\n}\nfunction general_fmt_int(v, opts) { return \"\"+v; }\nSSF._general_int = general_fmt_int;\nvar general_fmt_num = (function make_general_fmt_num() {\nvar gnr1 = /\\.(\\d*[1-9])0+$/, gnr2 = /\\.0*$/, gnr4 = /\\.(\\d*[1-9])0+/, gnr5 = /\\.0*[Ee]/, gnr6 = /(E[+-])(\\d)$/;\nfunction gfn2(v) {\n\tvar w = (v<0?12:11);\n\tvar o = gfn5(v.toFixed(12)); if(o.length <= w) return o;\n\to = v.toPrecision(10); if(o.length <= w) return o;\n\treturn v.toExponential(5);\n}\nfunction gfn3(v) {\n\tvar o = v.toFixed(11).replace(gnr1,\".$1\");\n\tif(o.length > (v<0?12:11)) o = v.toPrecision(6);\n\treturn o;\n}\nfunction gfn4(o) {\n\tfor(var i = 0; i != o.length; ++i) if((o.charCodeAt(i) | 0x20) === 101) return o.replace(gnr4,\".$1\").replace(gnr5,\"E\").replace(\"e\",\"E\").replace(gnr6,\"$10$2\");\n\treturn o;\n}\nfunction gfn5(o) {\n\t//for(var i = 0; i != o.length; ++i) if(o.charCodeAt(i) === 46) return o.replace(gnr2,\"\").replace(gnr1,\".$1\");\n\t//return o;\n\treturn o.indexOf(\".\") > -1 ? o.replace(gnr2,\"\").replace(gnr1,\".$1\") : o;\n}\nreturn function general_fmt_num(v, opts) {\n\tvar V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o;\n\tif(V >= -4 && V <= -1) o = v.toPrecision(10+V);\n\telse if(Math.abs(V) <= 9) o = gfn2(v);\n\telse if(V === 10) o = v.toFixed(10).substr(0,12);\n\telse o = gfn3(v);\n\treturn gfn5(gfn4(o));\n};})();\nSSF._general_num = general_fmt_num;\nfunction general_fmt(v, opts) {\n\tswitch(typeof v) {\n\t\tcase 'string': return v;\n\t\tcase 'boolean': return v ? \"TRUE\" : \"FALSE\";\n\t\tcase 'number': return (v|0) === v ? general_fmt_int(v, opts) : general_fmt_num(v, opts);\n\t}\n\tthrow new Error(\"unsupported value in General format: \" + v);\n}\nSSF._general = general_fmt;\nfunction fix_hijri(date, o) { return 0; }\nfunction parse_date_code(v,opts,b2) {\n\tif(v > 2958465 || v < 0) return null;\n\tvar date = (v|0), time = Math.floor(86400 * (v - date)), dow=0;\n\tvar dout=[];\n\tvar out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};\n\tif(Math.abs(out.u) < 1e-6) out.u = 0;\n\tfixopts(opts != null ? opts : (opts=[]));\n\tif(opts.date1904) date += 1462;\n\tif(out.u > 0.999) {\n\t\tout.u = 0;\n\t\tif(++time == 86400) { time = 0; ++date; }\n\t}\n\tif(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}\n\telse if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}\n\telse {\n\t\tif(date > 60) --date;\n\t\t/* 1 = Jan 1 1900 */\n\t\tvar d = new Date(1900,0,1);\n\t\td.setDate(d.getDate() + date - 1);\n\t\tdout = [d.getFullYear(), d.getMonth()+1,d.getDate()];\n\t\tdow = d.getDay();\n\t\tif(date < 60) dow = (dow + 6) % 7;\n\t\tif(b2) dow = fix_hijri(d, dout);\n\t}\n\tout.y = dout[0]; out.m = dout[1]; out.d = dout[2];\n\tout.S = time % 60; time = Math.floor(time / 60);\n\tout.M = time % 60; time = Math.floor(time / 60);\n\tout.H = time;\n\tout.q = dow;\n\treturn out;\n}\nSSF.parse_date_code = parse_date_code;\n/*jshint -W086 */\nfunction write_date(type, fmt, val, ss0) {\n\tvar o=\"\", ss=0, tt=0, y = val.y, out, outl = 0;\n\tswitch(type) {\n\t\tcase 98: /* 'b' buddhist year */\n\t\t\ty = val.y + 543;\n\t\t\t/* falls through */\n\t\tcase 121: /* 'y' year */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = y % 100; outl = 2; break;\n\t\t\tdefault: out = y % 10000; outl = 4; break;\n\t\t} break;\n\t\tcase 109: /* 'm' month */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.m; outl = fmt.length; break;\n\t\t\tcase 3: return months[val.m-1][1];\n\t\t\tcase 5: return months[val.m-1][0];\n\t\t\tdefault: return months[val.m-1][2];\n\t\t} break;\n\t\tcase 100: /* 'd' day */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.d; outl = fmt.length; break;\n\t\t\tcase 3: return days[val.q][0];\n\t\t\tdefault: return days[val.q][1];\n\t\t} break;\n\t\tcase 104: /* 'h' 12-hour */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad hour format: ' + fmt;\n\t\t} break;\n\t\tcase 72: /* 'H' 24-hour */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.H; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad hour format: ' + fmt;\n\t\t} break;\n\t\tcase 77: /* 'M' minutes */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.M; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad minute format: ' + fmt;\n\t\t} break;\n\t\tcase 115: /* 's' seconds */\n\t\tif(val.u === 0) switch(fmt) {\n\t\t\tcase 's': case 'ss': return pad0(val.S, fmt.length);\n\t\t\tcase '.0': case '.00': case '.000':\n\t\t}\n\t\tswitch(fmt) {\n\t\t\tcase 's': case 'ss': case '.0': case '.00': case '.000':\n\t\t\t\tif(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100;\n\t\t\t\telse tt = ss0 === 1 ? 10 : 1;\n\t\t\t\tss = Math.round((tt)*(val.S + val.u));\n\t\t\t\tif(ss >= 60*tt) ss = 0;\n\t\t\t\tif(fmt === 's') return ss === 0 ? \"0\" : \"\"+ss/tt;\n\t\t\t\to = pad0(ss,2 + ss0);\n\t\t\t\tif(fmt === 'ss') return o.substr(0,2);\n\t\t\t\treturn \".\" + o.substr(2,fmt.length-1);\n\t\t\tdefault: throw 'bad second format: ' + fmt;\n\t\t}\n\t\tcase 90: /* 'Z' absolute time */\n\t\tswitch(fmt) {\n\t\t\tcase '[h]': case '[hh]': out = val.D*24+val.H; break;\n\t\t\tcase '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break;\n\t\t\tcase '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+Math.round(val.S+val.u); break;\n\t\t\tdefault: throw 'bad abstime format: ' + fmt;\n\t\t} outl = fmt.length === 3 ? 1 : 2; break;\n\t\tcase 101: /* 'e' era */\n\t\t\tout = y; outl = 1;\n\t}\n\tif(outl > 0) return pad0(out, outl); else return \"\";\n}\n/*jshint +W086 */\nfunction commaify(s) {\n\tif(s.length <= 3) return s;\n\tvar j = (s.length % 3), o = s.substr(0,j);\n\tfor(; j!=s.length; j+=3) o+=(o.length > 0 ? \",\" : \"\") + s.substr(j,3);\n\treturn o;\n}\nvar write_num = (function make_write_num(){\nvar pct1 = /%/g;\nfunction write_num_pct(type, fmt, val){\n\tvar sfmt = fmt.replace(pct1,\"\"), mul = fmt.length - sfmt.length;\n\treturn write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill(\"%\",mul);\n}\nfunction write_num_cm(type, fmt, val){\n\tvar idx = fmt.length - 1;\n\twhile(fmt.charCodeAt(idx-1) === 44) --idx;\n\treturn write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));\n}\nfunction write_num_exp(fmt, val){\n\tvar o;\n\tvar idx = fmt.indexOf(\"E\") - fmt.indexOf(\".\") - 1;\n\tif(fmt.match(/^#+0.0E\\+0$/)) {\n\t\tvar period = fmt.indexOf(\".\"); if(period === -1) period=fmt.indexOf('E');\n\t\tvar ee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E)%period;\n\t\tif(ee < 0) ee += period;\n\t\to = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);\n\t\tif(o.indexOf(\"e\") === -1) {\n\t\t\tvar fakee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E);\n\t\t\tif(o.indexOf(\".\") === -1) o = o[0] + \".\" + o.substr(1) + \"E+\" + (fakee - o.length+ee);\n\t\t\telse o += \"E+\" + (fakee - ee);\n\t\t\twhile(o.substr(0,2) === \"0.\") {\n\t\t\t\to = o[0] + o.substr(2,period) + \".\" + o.substr(2+period);\n\t\t\t\to = o.replace(/^0+([1-9])/,\"$1\").replace(/^0+\\./,\"0.\");\n\t\t\t}\n\t\t\to = o.replace(/\\+-/,\"-\");\n\t\t}\n\t\to = o.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + \".\" + $3.substr(ee) + \"E\"; });\n\t} else o = val.toExponential(idx);\n\tif(fmt.match(/E\\+00$/) && o.match(/e[+-]\\d$/)) o = o.substr(0,o.length-1) + \"0\" + o[o.length-1];\n\tif(fmt.match(/E\\-/) && o.match(/e\\+/)) o = o.replace(/e\\+/,\"e\");\n\treturn o.replace(\"e\",\"E\");\n}\nvar frac1 = /# (\\?+)( ?)\\/( ?)(\\d+)/;\nfunction write_num_f1(r, aval, sign) {\n\tvar den = parseInt(r[4]), rr = Math.round(aval * den), base = Math.floor(rr/den);\n\tvar myn = (rr - base*den), myd = den;\n\treturn sign + (base === 0 ? \"\" : \"\"+base) + \" \" + (myn === 0 ? fill(\" \", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + \"/\" + r[3] + pad0(myd,r[4].length));\n}\nfunction write_num_f2(r, aval, sign) {\n\treturn sign + (aval === 0 ? \"\" : \"\"+aval) + fill(\" \", r[1].length + 2 + r[4].length);\n}\nvar dec1 = /^#*0*\\.(0+)/;\nvar closeparen = /\\).*[0#]/;\nvar phone = /\\(###\\) ###\\\\?-####/;\nfunction hashq(str) {\n\tvar o = \"\", cc;\n\tfor(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) {\n\t\tcase 35: break;\n\t\tcase 63: o+= \" \"; break;\n\t\tcase 48: o+= \"0\"; break;\n\t\tdefault: o+= String.fromCharCode(cc);\n\t}\n\treturn o;\n}\nfunction rnd(val, d) { var dd = Math.pow(10,d); return \"\"+(Math.round(val * dd)/dd); }\nfunction dec(val, d) { return Math.round((val-Math.floor(val))*Math.pow(10,d)); }\nfunction flr(val) { if(val < 2147483647 && val > -2147483648) return \"\"+(val >= 0 ? (val|0) : (val-1|0)); return \"\"+Math.floor(val); }\nfunction write_num_flt(type, fmt, val) {\n\tif(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {\n\t\tvar ffmt = fmt.replace(/\\( */,\"\").replace(/ \\)/,\"\").replace(/\\)/,\"\");\n\t\tif(val >= 0) return write_num_flt('n', ffmt, val);\n\t\treturn '(' + write_num_flt('n', ffmt, -val) + ')';\n\t}\n\tif(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);\n\tif(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val);\n\tif(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val);\n\tif(fmt.charCodeAt(0) === 36) return \"$\"+write_num_flt(type,fmt.substr(fmt[1]==' '?2:1),val);\n\tvar o, oo;\n\tvar r, ri, ff, aval = Math.abs(val), sign = val < 0 ? \"-\" : \"\";\n\tif(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length);\n\tif(fmt.match(/^[#?]+$/)) {\n\t\to = pad0r(val,0); if(o === \"0\") o = \"\";\n\t\treturn o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n\tif((r = fmt.match(frac1)) !== null) return write_num_f1(r, aval, sign);\n\tif(fmt.match(/^#+0+$/) !== null) return sign + pad0r(aval,fmt.length - fmt.indexOf(\"0\"));\n\tif((r = fmt.match(dec1)) !== null) {\n\t\to = rnd(val, r[1].length).replace(/^([^\\.]+)$/,\"$1.\"+r[1]).replace(/\\.$/,\".\"+r[1]).replace(/\\.(\\d*)$/,function($$, $1) { return \".\" + $1 + fill(\"0\", r[1].length-$1.length); });\n\t\treturn fmt.indexOf(\"0.\") !== -1 ? o : o.replace(/^0\\./,\".\");\n\t}\n\tfmt = fmt.replace(/^#+([0.])/, \"$1\");\n\tif((r = fmt.match(/^(0*)\\.(#*)$/)) !== null) {\n\t\treturn sign + rnd(aval, r[2].length).replace(/\\.(\\d*[1-9])0*$/,\".$1\").replace(/^(-?\\d*)$/,\"$1.\").replace(/^0\\./,r[1].length?\"0.\":\".\");\n\t}\n\tif((r = fmt.match(/^#,##0(\\.?)$/)) !== null) return sign + commaify(pad0r(aval,0));\n\tif((r = fmt.match(/^#,##0\\.([#0]*0)$/)) !== null) {\n\t\treturn val < 0 ? \"-\" + write_num_flt(type, fmt, -val) : commaify(\"\"+(Math.floor(val))) + \".\" + pad0(dec(val, r[1].length),r[1].length);\n\t}\n\tif((r = fmt.match(/^#,#*,#0/)) !== null) return write_num_flt(type,fmt.replace(/^#,#*,/,\"\"),val);\n\tif((r = fmt.match(/^([0#]+)(\\\\?-([0#]+))+$/)) !== null) {\n\t\to = _strrev(write_num_flt(type, fmt.replace(/[\\\\-]/g,\"\"), val));\n\t\tri = 0;\n\t\treturn _strrev(_strrev(fmt.replace(/\\\\/g,\"\")).replace(/[0#]/g,function(x){return ri<o.length?o[ri++]:x==='0'?'0':\"\";}));\n\t}\n\tif(fmt.match(phone) !== null) {\n\t\to = write_num_flt(type, \"##########\", val);\n\t\treturn \"(\" + o.substr(0,3) + \") \" + o.substr(3, 3) + \"-\" + o.substr(6);\n\t}\n\tvar oa = \"\";\n\tif((r = fmt.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/)) !== null) {\n\t\tri = Math.min(r[4].length,7);\n\t\tff = frac(aval, Math.pow(10,ri)-1, false);\n\t\to = \"\" + sign;\n\t\toa = write_num(\"n\", r[1], ff[1]);\n\t\tif(oa[oa.length-1] == \" \") oa = oa.substr(0,oa.length-1) + \"0\";\n\t\to += oa + r[2] + \"/\" + r[3];\n\t\toa = rpad_(ff[2],ri);\n\t\tif(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;\n\t\to += oa;\n\t\treturn o;\n\t}\n\tif((r = fmt.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/)) !== null) {\n\t\tri = Math.min(Math.max(r[1].length, r[4].length),7);\n\t\tff = frac(aval, Math.pow(10,ri)-1, true);\n\t\treturn sign + (ff[0]||(ff[1] ? \"\" : \"0\")) + \" \" + (ff[1] ? pad_(ff[1],ri) + r[2] + \"/\" + r[3] + rpad_(ff[2],ri): fill(\" \", 2*ri+1 + r[2].length + r[3].length));\n\t}\n\tif((r = fmt.match(/^[#0?]+$/)) !== null) {\n\t\to = pad0r(val, 0);\n\t\tif(fmt.length <= o.length) return o;\n\t\treturn hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n if((r = fmt.match(/^([#0?]+)\\.([#0]+)$/)) !== null) {\n\t\to = \"\" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,\"$1\");\n\t\tri = o.indexOf(\".\");\n\t\tvar lres = fmt.indexOf(\".\") - ri, rres = fmt.length - o.length - lres;\n\t\treturn hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));\n\t}\n\tif((r = fmt.match(/^00,000\\.([#0]*0)$/)) !== null) {\n\t\tri = dec(val, r[1].length);\n\t\treturn val < 0 ? \"-\" + write_num_flt(type, fmt, -val) : commaify(flr(val)).replace(/^\\d,\\d{3}$/,\"0$&\").replace(/^\\d*$/,function($$) { return \"00,\" + ($$.length < 3 ? pad0(0,3-$$.length) : \"\") + $$; }) + \".\" + pad0(ri,r[1].length);\n\t}\n\tswitch(fmt) {\n\t\tcase \"#,###\": var x = commaify(pad0r(aval,0)); return x !== \"0\" ? sign + x : \"\";\n\t\tdefault:\n\t}\n\tthrow new Error(\"unsupported format |\" + fmt + \"|\");\n}\nfunction write_num_cm2(type, fmt, val){\n\tvar idx = fmt.length - 1;\n\twhile(fmt.charCodeAt(idx-1) === 44) --idx;\n\treturn write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));\n}\nfunction write_num_pct2(type, fmt, val){\n\tvar sfmt = fmt.replace(pct1,\"\"), mul = fmt.length - sfmt.length;\n\treturn write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill(\"%\",mul);\n}\nfunction write_num_exp2(fmt, val){\n\tvar o;\n\tvar idx = fmt.indexOf(\"E\") - fmt.indexOf(\".\") - 1;\n\tif(fmt.match(/^#+0.0E\\+0$/)) {\n\t\tvar period = fmt.indexOf(\".\"); if(period === -1) period=fmt.indexOf('E');\n\t\tvar ee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E)%period;\n\t\tif(ee < 0) ee += period;\n\t\to = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);\n\t\tif(!o.match(/[Ee]/)) {\n\t\t\tvar fakee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E);\n\t\t\tif(o.indexOf(\".\") === -1) o = o[0] + \".\" + o.substr(1) + \"E+\" + (fakee - o.length+ee);\n\t\t\telse o += \"E+\" + (fakee - ee);\n\t\t\to = o.replace(/\\+-/,\"-\");\n\t\t}\n\t\to = o.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + \".\" + $3.substr(ee) + \"E\"; });\n\t} else o = val.toExponential(idx);\n\tif(fmt.match(/E\\+00$/) && o.match(/e[+-]\\d$/)) o = o.substr(0,o.length-1) + \"0\" + o[o.length-1];\n\tif(fmt.match(/E\\-/) && o.match(/e\\+/)) o = o.replace(/e\\+/,\"e\");\n\treturn o.replace(\"e\",\"E\");\n}\nfunction write_num_int(type, fmt, val) {\n\tif(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {\n\t\tvar ffmt = fmt.replace(/\\( */,\"\").replace(/ \\)/,\"\").replace(/\\)/,\"\");\n\t\tif(val >= 0) return write_num_int('n', ffmt, val);\n\t\treturn '(' + write_num_int('n', ffmt, -val) + ')';\n\t}\n\tif(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);\n\tif(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val);\n\tif(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val);\n\tif(fmt.charCodeAt(0) === 36) return \"$\"+write_num_int(type,fmt.substr(fmt[1]==' '?2:1),val);\n\tvar o;\n\tvar r, ri, ff, aval = Math.abs(val), sign = val < 0 ? \"-\" : \"\";\n\tif(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length);\n\tif(fmt.match(/^[#?]+$/)) {\n\t\to = (\"\"+val); if(val === 0) o = \"\";\n\t\treturn o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n\tif((r = fmt.match(frac1)) !== null) return write_num_f2(r, aval, sign);\n\tif(fmt.match(/^#+0+$/) !== null) return sign + pad0(aval,fmt.length - fmt.indexOf(\"0\"));\n\tif((r = fmt.match(dec1)) !== null) {\n\t\to = (\"\"+val).replace(/^([^\\.]+)$/,\"$1.\"+r[1]).replace(/\\.$/,\".\"+r[1]).replace(/\\.(\\d*)$/,function($$, $1) { return \".\" + $1 + fill(\"0\", r[1].length-$1.length); });\n\t\treturn fmt.indexOf(\"0.\") !== -1 ? o : o.replace(/^0\\./,\".\");\n\t}\n\tfmt = fmt.replace(/^#+([0.])/, \"$1\");\n\tif((r = fmt.match(/^(0*)\\.(#*)$/)) !== null) {\n\t\treturn sign + (\"\"+aval).replace(/\\.(\\d*[1-9])0*$/,\".$1\").replace(/^(-?\\d*)$/,\"$1.\").replace(/^0\\./,r[1].length?\"0.\":\".\");\n\t}\n\tif((r = fmt.match(/^#,##0(\\.?)$/)) !== null) return sign + commaify((\"\"+aval));\n\tif((r = fmt.match(/^#,##0\\.([#0]*0)$/)) !== null) {\n\t\treturn val < 0 ? \"-\" + write_num_int(type, fmt, -val) : commaify((\"\"+val)) + \".\" + fill('0',r[1].length);\n\t}\n\tif((r = fmt.match(/^#,#*,#0/)) !== null) return write_num_int(type,fmt.replace(/^#,#*,/,\"\"),val);\n\tif((r = fmt.match(/^([0#]+)(\\\\?-([0#]+))+$/)) !== null) {\n\t\to = _strrev(write_num_int(type, fmt.replace(/[\\\\-]/g,\"\"), val));\n\t\tri = 0;\n\t\treturn _strrev(_strrev(fmt.replace(/\\\\/g,\"\")).replace(/[0#]/g,function(x){return ri<o.length?o[ri++]:x==='0'?'0':\"\";}));\n\t}\n\tif(fmt.match(phone) !== null) {\n\t\to = write_num_int(type, \"##########\", val);\n\t\treturn \"(\" + o.substr(0,3) + \") \" + o.substr(3, 3) + \"-\" + o.substr(6);\n\t}\n\tvar oa = \"\";\n\tif((r = fmt.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/)) !== null) {\n\t\tri = Math.min(r[4].length,7);\n\t\tff = frac(aval, Math.pow(10,ri)-1, false);\n\t\to = \"\" + sign;\n\t\toa = write_num(\"n\", r[1], ff[1]);\n\t\tif(oa[oa.length-1] == \" \") oa = oa.substr(0,oa.length-1) + \"0\";\n\t\to += oa + r[2] + \"/\" + r[3];\n\t\toa = rpad_(ff[2],ri);\n\t\tif(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;\n\t\to += oa;\n\t\treturn o;\n\t}\n\tif((r = fmt.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/)) !== null) {\n\t\tri = Math.min(Math.max(r[1].length, r[4].length),7);\n\t\tff = frac(aval, Math.pow(10,ri)-1, true);\n\t\treturn sign + (ff[0]||(ff[1] ? \"\" : \"0\")) + \" \" + (ff[1] ? pad_(ff[1],ri) + r[2] + \"/\" + r[3] + rpad_(ff[2],ri): fill(\" \", 2*ri+1 + r[2].length + r[3].length));\n\t}\n\tif((r = fmt.match(/^[#0?]+$/)) !== null) {\n\t\to = \"\" + val;\n\t\tif(fmt.length <= o.length) return o;\n\t\treturn hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n\tif((r = fmt.match(/^([#0]+)\\.([#0]+)$/)) !== null) {\n\t\to = \"\" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,\"$1\");\n\t\tri = o.indexOf(\".\");\n\t\tvar lres = fmt.indexOf(\".\") - ri, rres = fmt.length - o.length - lres;\n\t\treturn hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));\n\t}\n\tif((r = fmt.match(/^00,000\\.([#0]*0)$/)) !== null) {\n\t\treturn val < 0 ? \"-\" + write_num_int(type, fmt, -val) : commaify(\"\"+val).replace(/^\\d,\\d{3}$/,\"0$&\").replace(/^\\d*$/,function($$) { return \"00,\" + ($$.length < 3 ? pad0(0,3-$$.length) : \"\") + $$; }) + \".\" + pad0(0,r[1].length);\n\t}\n\tswitch(fmt) {\n\t\tcase \"#,###\": var x = commaify(\"\"+aval); return x !== \"0\" ? sign + x : \"\";\n\t\tdefault:\n\t}\n\tthrow new Error(\"unsupported format |\" + fmt + \"|\");\n}\nreturn function write_num(type, fmt, val) {\n\treturn (val|0) === val ? write_num_int(type, fmt, val) : write_num_flt(type, fmt, val);\n};})();\nfunction split_fmt(fmt) {\n\tvar out = [];\n\tvar in_str = false, cc;\n\tfor(var i = 0, j = 0; i < fmt.length; ++i) switch((cc=fmt.charCodeAt(i))) {\n\t\tcase 34: /* '\"' */\n\t\t\tin_str = !in_str; break;\n\t\tcase 95: case 42: case 92: /* '_' '*' '\\\\' */\n\t\t\t++i; break;\n\t\tcase 59: /* ';' */\n\t\t\tout[out.length] = fmt.substr(j,i-j);\n\t\t\tj = i+1;\n\t}\n\tout[out.length] = fmt.substr(j);\n\tif(in_str === true) throw new Error(\"Format |\" + fmt + \"| unterminated string \");\n\treturn out;\n}\nSSF._split = split_fmt;\nvar abstime = /\\[[HhMmSs]*\\]/;\nfunction eval_fmt(fmt, v, opts, flen) {\n\tvar out = [], o = \"\", i = 0, c = \"\", lst='t', q, dt, j, cc;\n\tvar hr='H';\n\t/* Tokenize */\n\twhile(i < fmt.length) {\n\t\tswitch((c = fmt[i])) {\n\t\t\tcase 'G': /* General */\n\t\t\t\tif(!isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt);\n\t\t\t\tout[out.length] = {t:'G', v:'General'}; i+=7; break;\n\t\t\tcase '\"': /* Literal text */\n\t\t\t\tfor(o=\"\";(cc=fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) o += String.fromCharCode(cc);\n\t\t\t\tout[out.length] = {t:'t', v:o}; ++i; break;\n\t\t\tcase '\\\\': var w = fmt[++i], t = (w === \"(\" || w === \")\") ? w : 't';\n\t\t\t\tout[out.length] = {t:t, v:w}; ++i; break;\n\t\t\tcase '_': out[out.length] = {t:'t', v:\" \"}; i+=2; break;\n\t\t\tcase '@': /* Text Placeholder */\n\t\t\t\tout[out.length] = {t:'T', v:v}; ++i; break;\n\t\t\tcase 'B': case 'b':\n\t\t\t\tif(fmt[i+1] === \"1\" || fmt[i+1] === \"2\") {\n if(dt==null) { dt=parse_date_code(v, opts, fmt[i+1] === \"2\"); if(dt==null) return \"\"; }\n\t\t\t\t\tout[out.length] = {t:'X', v:fmt.substr(i,2)}; lst = c; i+=2; break;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':\n\t\t\t\tc = c.toLowerCase();\n\t\t\t\t/* falls through */\n\t\t\tcase 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g':\n\t\t\t\tif(v < 0) return \"\";\n\t\t\t\tif(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return \"\"; }\n\t\t\t\to = c; while(++i<fmt.length && fmt[i].toLowerCase() === c) o+=c;\n\t\t\t\tif(c === 'm' && lst.toLowerCase() === 'h') c = 'M'; /* m = minute */\n\t\t\t\tif(c === 'h') c = hr;\n\t\t\t\tout[out.length] = {t:c, v:o}; lst = c; break;\n\t\t\tcase 'A':\n\t\t\t\tq={t:c, v:\"A\"};\n\t\t\t\tif(dt==null) dt=parse_date_code(v, opts);\n if(fmt.substr(i, 3) === \"A/P\") { if(dt!=null) q.v = dt.H >= 12 ? \"P\" : \"A\"; q.t = 'T'; hr='h';i+=3;}\n else if(fmt.substr(i,5) === \"AM/PM\") { if(dt!=null) q.v = dt.H >= 12 ? \"PM\" : \"AM\"; q.t = 'T'; i+=5; hr='h'; }\n\t\t\t\telse { q.t = \"t\"; ++i; }\n\t\t\t\tif(dt==null && q.t === 'T') return \"\";\n\t\t\t\tout[out.length] = q; lst = c; break;\n\t\t\tcase '[':\n\t\t\t\to = c;\n\t\t\t\twhile(fmt[i++] !== ']' && i < fmt.length) o += fmt[i];\n\t\t\t\tif(o.substr(-1) !== ']') throw 'unterminated \"[\" block: |' + o + '|';\n\t\t\t\tif(o.match(abstime)) {\n\t\t\t\t\tif(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return \"\"; }\n\t\t\t\t\tout[out.length] = {t:'Z', v:o.toLowerCase()};\n\t\t\t\t} else { o=\"\"; }\n\t\t\t\tbreak;\n\t\t\t/* Numbers */\n\t\t\tcase '.':\n\t\t\t\tif(dt != null) {\n\t\t\t\t\to = c; while((c=fmt[++i]) === \"0\") o += c;\n\t\t\t\t\tout[out.length] = {t:'s', v:o}; break;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase '0': case '#':\n\t\t\t\to = c; while(\"0#?.,E+-%\".indexOf(c=fmt[++i]) > -1 || c=='\\\\' && fmt[i+1] == \"-\" && \"0#\".indexOf(fmt[i+2])>-1) o += c;\n\t\t\t\tout[out.length] = {t:'n', v:o}; break;\n\t\t\tcase '?':\n\t\t\t\to = c; while(fmt[++i] === c) o+=c;\n\t\t\t\tq={t:c, v:o}; out[out.length] = q; lst = c; break;\n\t\t\tcase '*': ++i; if(fmt[i] == ' ' || fmt[i] == '*') ++i; break; // **\n\t\t\tcase '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break;\n\t\t\tcase '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':\n\t\t\t\to = c; while(\"0123456789\".indexOf(fmt[++i]) > -1) o+=fmt[i];\n\t\t\t\tout[out.length] = {t:'D', v:o}; break;\n\t\t\tcase ' ': out[out.length] = {t:c, v:c}; ++i; break;\n\t\t\tdefault:\n\t\t\t\tif(\",$-+/():!^&'~{}<>=€acfijklopqrtuvwxz\".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt);\n\t\t\t\tout[out.length] = {t:'t', v:c}; ++i; break;\n\t\t}\n\t}\n\tvar bt = 0, ss0 = 0, ssm;\n\tfor(i=out.length-1, lst='t'; i >= 0; --i) {\n\t\tswitch(out[i].t) {\n\t\t\tcase 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break;\n\t\t\tcase 's':\n\t\t\t\tif((ssm=out[i].v.match(/\\.0+$/))) ss0=Math.max(ss0,ssm[0].length-1);\n\t\t\t\tif(bt < 3) bt = 3;\n\t\t\t/* falls through */\n\t\t\tcase 'd': case 'y': case 'M': case 'e': lst=out[i].t; break;\n\t\t\tcase 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break;\n\t\t\tcase 'X': if(out[i].v === \"B2\");\n\t\t\t\tbreak;\n\t\t\tcase 'Z':\n\t\t\t\tif(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1;\n\t\t\t\tif(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2;\n\t\t\t\tif(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3;\n\t\t}\n\t}\n\tswitch(bt) {\n\t\tcase 0: break;\n\t\tcase 1:\n\t\t\tif(dt.u >= 0.5) { dt.u = 0; ++dt.S; }\n\t\t\tif(dt.S >= 60) { dt.S = 0; ++dt.M; }\n\t\t\tif(dt.M >= 60) { dt.M = 0; ++dt.H; }\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tif(dt.u >= 0.5) { dt.u = 0; ++dt.S; }\n\t\t\tif(dt.S >= 60) { dt.S = 0; ++dt.M; }\n\t\t\tbreak;\n\t}\n\t/* replace fields */\n\tvar nstr = \"\", jj;\n\tfor(i=0; i < out.length; ++i) {\n\t\tswitch(out[i].t) {\n\t\t\tcase 't': case 'T': case ' ': case 'D': break;\n\t\t\tcase 'X': out[i] = undefined; break;\n\t\t\tcase 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z':\n\t\t\t\tout[i].v = write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);\n\t\t\t\tout[i].t = 't'; break;\n\t\t\tcase 'n': case '(': case '?':\n\t\t\t\tjj = i+1;\n\t\t\t\twhile(out[jj] != null && (\n\t\t\t\t\t(c=out[jj].t) === \"?\" || c === \"D\" ||\n\t\t\t\t\t(c === \" \" || c === \"t\") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === \"t\" && out[jj+1].v === '/') ||\n\t\t\t\t\tout[i].t === '(' && (c === ' ' || c === 'n' || c === ')') ||\n\t\t\t\t\tc === 't' && (out[jj].v === '/' || '$€'.indexOf(out[jj].v) > -1 || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?')\n\t\t\t\t)) {\n\t\t\t\t\tout[i].v += out[jj].v;\n\t\t\t\t\tout[jj] = undefined; ++jj;\n\t\t\t\t}\n\t\t\t\tnstr += out[i].v;\n\t\t\t\ti = jj-1; break;\n\t\t\tcase 'G': out[i].t = 't'; out[i].v = general_fmt(v,opts); break;\n\t\t}\n\t}\n\tvar vv = \"\", myv, ostr;\n\tif(nstr.length > 0) {\n\t\tmyv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v); /* '-' */\n\t\tostr = write_num(nstr.charCodeAt(0) === 40 ? '(' : 'n', nstr, myv); /* '(' */\n\t\tjj=ostr.length-1;\n\t\tvar decpt = out.length;\n\t\tfor(i=0; i < out.length; ++i) if(out[i] != null && out[i].v.indexOf(\".\") > -1) { decpt = i; break; }\n\t\tvar lasti=out.length;\n\t\tif(decpt === out.length && ostr.indexOf(\"E\") === -1) {\n\t\t\tfor(i=out.length-1; i>= 0;--i) {\n\t\t\t\tif(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;\n\t\t\t\tif(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); }\n\t\t\t\telse if(jj < 0) out[i].v = \"\";\n\t\t\t\telse { out[i].v = ostr.substr(0, jj+1); jj = -1; }\n\t\t\t\tout[i].t = 't';\n\t\t\t\tlasti = i;\n\t\t\t}\n\t\t\tif(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;\n\t\t}\n\t\telse if(decpt !== out.length && ostr.indexOf(\"E\") === -1) {\n\t\t\tjj = ostr.indexOf(\".\")-1;\n\t\t\tfor(i=decpt; i>= 0; --i) {\n\t\t\t\tif(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;\n\t\t\t\tj=out[i].v.indexOf(\".\")>-1&&i===decpt?out[i].v.indexOf(\".\")-1:out[i].v.length-1;\n\t\t\t\tvv = out[i].v.substr(j+1);\n\t\t\t\tfor(; j>=0; --j) {\n\t\t\t\t\tif(jj>=0 && (out[i].v[j] === \"0\" || out[i].v[j] === \"#\")) vv = ostr[jj--] + vv;\n\t\t\t\t}\n\t\t\t\tout[i].v = vv;\n\t\t\t\tout[i].t = 't';\n\t\t\t\tlasti = i;\n\t\t\t}\n\t\t\tif(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;\n\t\t\tjj = ostr.indexOf(\".\")+1;\n\t\t\tfor(i=decpt; i<out.length; ++i) {\n\t\t\t\tif(out[i] == null || 'n?('.indexOf(out[i].t) === -1 && i !== decpt ) continue;\n\t\t\t\tj=out[i].v.indexOf(\".\")>-1&&i===decpt?out[i].v.indexOf(\".\")+1:0;\n\t\t\t\tvv = out[i].v.substr(0,j);\n\t\t\t\tfor(; j<out[i].v.length; ++j) {\n\t\t\t\t\tif(jj<ostr.length) vv += ostr[jj++];\n\t\t\t\t}\n\t\t\t\tout[i].v = vv;\n\t\t\t\tout[i].t = 't';\n\t\t\t\tlasti = i;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=0; i<out.length; ++i) if(out[i] != null && 'n(?'.indexOf(out[i].t)>-1) {\n\t\tmyv = (flen >1 && v < 0 && i>0 && out[i-1].v === \"-\" ? -v:v);\n\t\tout[i].v = write_num(out[i].t, out[i].v, myv);\n\t\tout[i].t = 't';\n\t}\n\tvar retval = \"\";\n\tfor(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v;\n\treturn retval;\n}\nSSF._eval = eval_fmt;\nvar cfregex = /\\[[=<>]/;\nvar cfregex2 = /\\[([=<>]*)(-?\\d+\\.?\\d*)\\]/;\nfunction chkcond(v, rr) {\n\tif(rr == null) return false;\n\tvar thresh = parseFloat(rr[2]);\n\tswitch(rr[1]) {\n\t\tcase \"=\": if(v == thresh) return true; break;\n\t\tcase \">\": if(v > thresh) return true; break;\n\t\tcase \"<\": if(v < thresh) return true; break;\n\t\tcase \"<>\": if(v != thresh) return true; break;\n\t\tcase \">=\": if(v >= thresh) return true; break;\n\t\tcase \"<=\": if(v <= thresh) return true; break;\n\t}\n\treturn false;\n}\nfunction choose_fmt(f, v) {\n\tvar fmt = split_fmt(f);\n\tvar l = fmt.length, lat = fmt[l-1].indexOf(\"@\");\n\tif(l<4 && lat>-1) --l;\n\tif(fmt.length > 4) throw \"cannot find right format for |\" + fmt + \"|\";\n\tif(typeof v !== \"number\") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:\"@\"];\n\tswitch(fmt.length) {\n\t\tcase 1: fmt = lat>-1 ? [\"General\", \"General\", \"General\", fmt[0]] : [fmt[0], fmt[0], fmt[0], \"@\"]; break;\n\t\tcase 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], \"@\"]; break;\n\t\tcase 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], \"@\"]; break;\n\t\tcase 4: break;\n\t}\n\tvar ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2];\n\tif(fmt[0].indexOf(\"[\") === -1 && fmt[1].indexOf(\"[\") === -1) return [l, ff];\n\tif(fmt[0].match(cfregex) != null || fmt[1].match(cfregex) != null) {\n\t\tvar m1 = fmt[0].match(cfregex2);\n\t\tvar m2 = fmt[1].match(cfregex2);\n\t\treturn chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]];\n\t}\n\treturn [l, ff];\n}\nfunction format(fmt,v,o) {\n\tfixopts(o != null ? o : (o=[]));\n\tvar sfmt = \"\";\n\tswitch(typeof fmt) {\n\t\tcase \"string\": sfmt = fmt; break;\n\t\tcase \"number\": sfmt = (o.table != null ? o.table : table_fmt)[fmt]; break;\n\t}\n\tif(isgeneral(sfmt,0)) return general_fmt(v, o);\n\tvar f = choose_fmt(sfmt, v);\n\tif(isgeneral(f[1])) return general_fmt(v, o);\n\tif(v === true) v = \"TRUE\"; else if(v === false) v = \"FALSE\";\n\telse if(v === \"\" || v == null) return \"\";\n\treturn eval_fmt(f[1], v, o, f[0]);\n}\nSSF._table = table_fmt;\nSSF.load = function load_entry(fmt, idx) { table_fmt[idx] = fmt; };\nSSF.format = format;\nSSF.get_table = function get_table() { return table_fmt; };\nSSF.load_table = function load_table(tbl) { for(var i=0; i!=0x0188; ++i) if(tbl[i] !== undefined) SSF.load(tbl[i], i); };\n};\nmake_ssf(SSF);\n/* map from xlml named formats to SSF TODO: localize */\nvar XLMLFormatMap = {\n\t\"General Number\": \"General\",\n\t\"General Date\": SSF._table[22],\n\t\"Long Date\": \"dddd, mmmm dd, yyyy\",\n\t\"Medium Date\": SSF._table[15],\n\t\"Short Date\": SSF._table[14],\n\t\"Long Time\": SSF._table[19],\n\t\"Medium Time\": SSF._table[18],\n\t\"Short Time\": SSF._table[20],\n\t\"Currency\": '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\t\"Fixed\": SSF._table[2],\n\t\"Standard\": SSF._table[4],\n\t\"Percent\": SSF._table[10],\n\t\"Scientific\": SSF._table[11],\n\t\"Yes/No\": '\"Yes\";\"Yes\";\"No\";@',\n\t\"True/False\": '\"True\";\"True\";\"False\";@',\n\t\"On/Off\": '\"Yes\";\"Yes\";\"No\";@'\n};\n\nvar DO_NOT_EXPORT_CFB = true;\n/* cfb.js (C) 2013-2014 SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*jshint eqnull:true */\n\n/* [MS-CFB] v20130118 */\nvar CFB = (function _CFB(){\nvar exports = {};\nexports.version = '0.10.2';\nfunction parse(file) {\nvar mver = 3; // major version\nvar ssz = 512; // sector size\nvar nmfs = 0; // number of mini FAT sectors\nvar ndfs = 0; // number of DIFAT sectors\nvar dir_start = 0; // first directory sector location\nvar minifat_start = 0; // first mini FAT sector location\nvar difat_start = 0; // first mini FAT sector location\n\nvar fat_addrs = []; // locations of FAT sectors\n\n/* [MS-CFB] 2.2 Compound File Header */\nvar blob = file.slice(0,512);\nprep_blob(blob, 0);\n\n/* major version */\nvar mv = check_get_mver(blob);\nmver = mv[0];\nswitch(mver) {\n\tcase 3: ssz = 512; break; case 4: ssz = 4096; break;\n\tdefault: throw \"Major Version: Expected 3 or 4 saw \" + mver;\n}\n\n/* reprocess header */\nif(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }\n/* Save header for final object */\nvar header = file.slice(0,ssz);\n\ncheck_shifts(blob, mver);\n\n// Number of Directory Sectors\nvar nds = blob.read_shift(4, 'i');\nif(mver === 3 && nds !== 0) throw '# Directory Sectors: Expected 0 saw ' + nds;\n\n// Number of FAT Sectors\n//var nfs = blob.read_shift(4, 'i');\nblob.l += 4;\n\n// First Directory Sector Location\ndir_start = blob.read_shift(4, 'i');\n\n// Transaction Signature\nblob.l += 4;\n\n// Mini Stream Cutoff Size\nblob.chk('00100000', 'Mini Stream Cutoff Size: ');\n\n// First Mini FAT Sector Location\nminifat_start = blob.read_shift(4, 'i');\n\n// Number of Mini FAT Sectors\nnmfs = blob.read_shift(4, 'i');\n\n// First DIFAT sector location\ndifat_start = blob.read_shift(4, 'i');\n\n// Number of DIFAT Sectors\nndfs = blob.read_shift(4, 'i');\n\n// Grab FAT Sector Locations\nfor(var q, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */\n\tq = blob.read_shift(4, 'i');\n\tif(q<0) break;\n\tfat_addrs[j] = q;\n}\n\n/** Break the file up into sectors */\nvar sectors = sectorify(file, ssz);\n\nsleuth_fat(difat_start, ndfs, sectors, ssz, fat_addrs);\n\n/** Chains */\nvar sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);\n\nsector_list[dir_start].name = \"!Directory\";\nif(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = \"!MiniFAT\";\nsector_list[fat_addrs[0]].name = \"!FAT\";\nsector_list.fat_addrs = fat_addrs;\nsector_list.ssz = ssz;\n\n/* [MS-CFB] 2.6.1 Compound File Directory Entry */\nvar files = {}, Paths = [], FileIndex = [], FullPaths = [], FullPathDir = {};\nread_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex);\n\nbuild_full_paths(FileIndex, FullPathDir, FullPaths, Paths);\n\nvar root_name = Paths.shift();\nPaths.root = root_name;\n\n/* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */\nvar find_path = make_find_path(FullPaths, Paths, FileIndex, files, root_name);\n\nreturn {\n\traw: {header: header, sectors: sectors},\n\tFileIndex: FileIndex,\n\tFullPaths: FullPaths,\n\tFullPathDir: FullPathDir,\n\tfind: find_path\n};\n} // parse\n\n/* [MS-CFB] 2.2 Compound File Header -- read up to major version */\nfunction check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}\nfunction check_shifts(blob, mver) {\n\tvar shift = 0x09;\n\n\t// Byte Order\n\tblob.chk('feff', 'Byte Order: ');\n\n\t// Sector Shift\n\tswitch((shift = blob.read_shift(2))) {\n\t\tcase 0x09: if(mver !== 3) throw 'MajorVersion/SectorShift Mismatch'; break;\n\t\tcase 0x0c: if(mver !== 4) throw 'MajorVersion/SectorShift Mismatch'; break;\n\t\tdefault: throw 'Sector Shift: Expected 9 or 12 saw ' + shift;\n\t}\n\n\t// Mini Sector Shift\n\tblob.chk('0600', 'Mini Sector Shift: ');\n\n\t// Reserved\n\tblob.chk('000000000000', 'Reserved: ');\n}\n\n/** Break the file up into sectors */\nfunction sectorify(file, ssz) {\n\tvar nsectors = Math.ceil(file.length/ssz)-1;\n\tvar sectors = new Array(nsectors);\n\tfor(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);\n\tsectors[nsectors-1] = file.slice(nsectors*ssz);\n\treturn sectors;\n}\n\n/* [MS-CFB] 2.6.4 Red-Black Tree */\nfunction build_full_paths(FI, FPD, FP, Paths) {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad = new Array(pl), q = new Array(pl);\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1) { dad[L] = dad[i]; q.push(L); }\n\t\tif(R !== -1) { dad[R] = dad[i]; q.push(R); }\n\t}\n\tfor(i=1; i !== pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = dad[i];\n\t\tif(j === 0) FP[i] = FP[0] + \"/\" + FP[i];\n\t\telse while(j !== 0) {\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t\tj = dad[j];\n\t\t}\n\t\tdad[i] = 0;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t\tFPD[FP[i]] = FI[i];\n\t}\n}\n\n/* [MS-CFB] 2.6.4 */\nfunction make_find_path(FullPaths, Paths, FileIndex, files, root_name) {\n\tvar UCFullPaths = new Array(FullPaths.length);\n\tvar UCPaths = new Array(Paths.length), i;\n\tfor(i = 0; i < FullPaths.length; ++i) UCFullPaths[i] = FullPaths[i].toUpperCase().replace(chr0,'').replace(chr1,'!');\n\tfor(i = 0; i < Paths.length; ++i) UCPaths[i] = Paths[i].toUpperCase().replace(chr0,'').replace(chr1,'!');\n\treturn function find_path(path) {\n\t\tvar k;\n\t\tif(path.charCodeAt(0) === 47 /* \"/\" */) { k=true; path = root_name + path; }\n\t\telse k = path.indexOf(\"/\") !== -1;\n\t\tvar UCPath = path.toUpperCase().replace(chr0,'').replace(chr1,'!');\n\t\tvar w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);\n\t\tif(w === -1) return null;\n\t\treturn k === true ? FileIndex[w] : files[Paths[w]];\n\t};\n}\n\n/** Chase down the rest of the DIFAT chain to build a comprehensive list\n DIFAT chains by storing the next sector number as the last 32 bytes */\nfunction sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}\n\n/** Follow the linked list of sectors for a given starting point */\nfunction get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}\n\n/** Chase down the sector linked lists */\nfunction make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}\n\n/* [MS-CFB] 2.6.1 Compound File Directory Entry */\nfunction read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = {\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t};\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}\n\nfunction read_date(blob, offset) {\n\treturn new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);\n}\n\nvar fs;\nfunction readFileSync(filename, options) {\n\tif(fs === undefined) fs = require('fs');\n\treturn parse(fs.readFileSync(filename), options);\n}\n\nfunction readSync(blob, options) {\n\tswitch(options !== undefined && options.type !== undefined ? options.type : \"base64\") {\n\t\tcase \"file\": return readFileSync(blob, options);\n\t\tcase \"base64\": return parse(s2a(Base64.decode(blob)), options);\n\t\tcase \"binary\": return parse(s2a(blob), options);\n\t}\n\treturn parse(blob);\n}\n\n/** CFB Constants */\nvar MSSZ = 64; /* Mini Sector Size = 1<<6 */\n//var MSCSZ = 4096; /* Mini Stream Cutoff Size */\n/* 2.1 Compound File Sector Numbers and Types */\nvar ENDOFCHAIN = -2;\n/* 2.2 Compound File Header */\nvar HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';\nvar HEADER_CLSID = '00000000000000000000000000000000';\nvar consts = {\n\t/* 2.1 Compund File Sector Numbers and Types */\n\tMAXREGSECT: -6,\n\tDIFSECT: -4,\n\tFATSECT: -3,\n\tENDOFCHAIN: ENDOFCHAIN,\n\tFREESECT: -1,\n\t/* 2.2 Compound File Header */\n\tHEADER_SIGNATURE: HEADER_SIGNATURE,\n\tHEADER_MINOR_VERSION: '3e00',\n\tMAXREGSID: -6,\n\tNOSTREAM: -1,\n\tHEADER_CLSID: HEADER_CLSID,\n\t/* 2.6.1 Compound File Directory Entry */\n\tEntryTypes: ['unknown','storage','stream','lockbytes','property','root']\n};\n\nexports.read = readSync;\nexports.parse = parse;\nexports.utils = {\n\tReadShift: ReadShift,\n\tCheckField: CheckField,\n\tprep_blob: prep_blob,\n\tbconcat: bconcat,\n\tconsts: consts\n};\n\nreturn exports;\n})();\n\nif(typeof require !== 'undefined' && typeof module !== 'undefined' && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }\nfunction isval(x) { return x !== undefined && x !== null; }\n\nfunction keys(o) { return Object.keys(o); }\n\nfunction evert_key(obj, key) {\n\tvar o = [], K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) o[obj[K[i]][key]] = K[i];\n\treturn o;\n}\n\nfunction evert(obj) {\n\tvar o = [], K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i];\n\treturn o;\n}\n\nfunction evert_num(obj) {\n\tvar o = [], K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10);\n\treturn o;\n}\n\nfunction evert_arr(obj) {\n\tvar o = [], K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) {\n\t\tif(o[obj[K[i]]] == null) o[obj[K[i]]] = [];\n\t\to[obj[K[i]]].push(K[i]);\n\t}\n\treturn o;\n}\n\n/* TODO: date1904 logic */\nfunction datenum(v, date1904) {\n\tif(date1904) v+=1462;\n\tvar epoch = Date.parse(v);\n\treturn (epoch + 2209161600000) / (24 * 60 * 60 * 1000);\n}\n\nfunction cc2str(arr) {\n\tvar o = \"\";\n\tfor(var i = 0; i != arr.length; ++i) o += String.fromCharCode(arr[i]);\n\treturn o;\n}\n\nfunction getdata(data) {\n\tif(!data) return null;\n\tif(data.name.substr(-4) === \".bin\") {\n\t\tif(data.data) return char_codes(data.data);\n\t\tif(data.asNodeBuffer && has_buf) return data.asNodeBuffer();\n\t\tif(data._data && data._data.getContent) return Array.prototype.slice.call(data._data.getContent());\n\t} else {\n\t\tif(data.data) return data.name.substr(-4) !== \".bin\" ? debom_xml(data.data) : char_codes(data.data);\n\t\tif(data.asNodeBuffer && has_buf) return debom_xml(data.asNodeBuffer().toString('binary'));\n\t\tif(data.asBinary) return debom_xml(data.asBinary());\n\t\tif(data._data && data._data.getContent) return debom_xml(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));\n\t}\n\treturn null;\n}\n\nfunction safegetzipfile(zip, file) {\n\tvar f = file; if(zip.files[f]) return zip.files[f];\n\tf = file.toLowerCase(); if(zip.files[f]) return zip.files[f];\n\tf = f.replace(/\\//g,'\\\\'); if(zip.files[f]) return zip.files[f];\n\treturn null;\n}\n\nfunction getzipfile(zip, file) {\n\tvar o = safegetzipfile(zip, file);\n\tif(o == null) throw new Error(\"Cannot find file \" + file + \" in zip\");\n\treturn o;\n}\n\nfunction getzipdata(zip, file, safe) {\n\tif(!safe) return getdata(getzipfile(zip, file));\n\tif(!file) return null;\n\ttry { return getzipdata(zip, file); } catch(e) { return null; }\n}\n\nvar _fs, jszip;\nif(typeof JSZip !== 'undefined') jszip = JSZip;\nif (typeof exports !== 'undefined') {\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tif(has_buf && typeof jszip === 'undefined') jszip = require('js'+'zip');\n\t\tif(typeof jszip === 'undefined') jszip = require('./js'+'zip').JSZip;\n\t\t_fs = require('f'+'s');\n\t}\n}\nvar attregexg=/([\\w:]+)=((?:\")([^\"]*)(?:\")|(?:')([^']*)(?:'))/g;\nvar tagregex=/<[^>]*>/g;\nvar nsregex=/<\\w*:/, nsregex2 = /<(\\/?)\\w+:/;\nfunction parsexmltag(tag, skip_root) {\n\tvar z = [];\n\tvar eq = 0, c = 0;\n\tfor(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;\n\tif(!skip_root) z[0] = tag.substr(0, eq);\n\tif(eq === tag.length) return z;\n\tvar m = tag.match(attregexg), j=0, w=\"\", v=\"\", i=0, q=\"\", cc=\"\";\n\tif(m) for(i = 0; i != m.length; ++i) {\n\t\tcc = m[i];\n\t\tfor(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;\n\t\tq = cc.substr(0,c); v = cc.substring(c+2, cc.length-1);\n\t\tfor(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break;\n\t\tif(j===q.length) z[q] = v;\n\t\telse z[(j===5 && q.substr(0,5)===\"xmlns\"?\"xmlns\":\"\")+q.substr(j+1)] = v;\n\t}\n\treturn z;\n}\nfunction strip_ns(x) { return x.replace(nsregex2, \"<$1\"); }\n\nvar encodings = {\n\t'"': '\"',\n\t''': \"'\",\n\t'>': '>',\n\t'<': '<',\n\t'&': '&'\n};\nvar rencoding = evert(encodings);\nvar rencstr = \"&<>'\\\"\".split(\"\");\n\n// TODO: CP remap (need to read file version to determine OS)\nvar unescapexml = (function() {\n\tvar encregex = /&[a-z]*;/g, coderegex = /_x([\\da-fA-F]+)_/g;\n\treturn function unescapexml(text){\n\t\tvar s = text + '';\n\t\treturn s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});\n\t};\n})();\n\nvar decregex=/[&<>'\"]/g, charegex = /[\\u0000-\\u0008\\u000b-\\u001f]/g;\nfunction escapexml(text){\n\tvar s = text + '';\n\treturn s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return \"_x\" + (\"000\"+s.charCodeAt(0).toString(16)).substr(-4) + \"_\";});\n}\n\n/* TODO: handle codepages */\nvar xlml_fixstr = (function() {\n\tvar entregex = /&#(\\d+);/g;\n\tfunction entrepl($$,$1) { return String.fromCharCode(parseInt($1,10)); }\n\treturn function xlml_fixstr(str) { return str.replace(entregex,entrepl); };\n})();\n\nfunction parsexmlbool(value, tag) {\n\tswitch(value) {\n\t\tcase '1': case 'true': case 'TRUE': return true;\n\t\t/* case '0': case 'false': case 'FALSE':*/\n\t\tdefault: return false;\n\t}\n}\n\nvar utf8read = function utf8reada(orig) {\n\tvar out = \"\", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;\n\twhile (i < orig.length) {\n\t\tc = orig.charCodeAt(i++);\n\t\tif (c < 128) { out += String.fromCharCode(c); continue; }\n\t\td = orig.charCodeAt(i++);\n\t\tif (c>191 && c<224) { out += String.fromCharCode(((c & 31) << 6) | (d & 63)); continue; }\n\t\te = orig.charCodeAt(i++);\n\t\tif (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }\n\t\tf = orig.charCodeAt(i++);\n\t\tw = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;\n\t\tout += String.fromCharCode(0xD800 + ((w>>>10)&1023));\n\t\tout += String.fromCharCode(0xDC00 + (w&1023));\n\t}\n\treturn out;\n};\n\n\nif(has_buf) {\n\tvar utf8readb = function utf8readb(data) {\n\t\tvar out = new Buffer(2*data.length), w, i, j = 1, k = 0, ww=0, c;\n\t\tfor(i = 0; i < data.length; i+=j) {\n\t\t\tj = 1;\n\t\t\tif((c=data.charCodeAt(i)) < 128) w = c;\n\t\t\telse if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; }\n\t\t\telse if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; }\n\t\t\telse { j = 4;\n\t\t\t\tw = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63);\n\t\t\t\tw -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023);\n\t\t\t}\n\t\t\tif(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; }\n\t\t\tout[k++] = w%256; out[k++] = w>>>8;\n\t\t}\n\t\tout.length = k;\n\t\treturn out.toString('ucs2');\n\t};\n\tvar corpus = \"foo bar baz\\u00e2\\u0098\\u0083\\u00f0\\u009f\\u008d\\u00a3\";\n\tif(utf8read(corpus) == utf8readb(corpus)) utf8read = utf8readb;\n\tvar utf8readc = function utf8readc(data) { return Buffer(data, 'binary').toString('utf8'); };\n\tif(utf8read(corpus) == utf8readc(corpus)) utf8read = utf8readc;\n}\n\n// matches <foo>...</foo> extracts content\nvar matchtag = (function() {\n\tvar mtcache = {};\n\treturn function matchtag(f,g) {\n\t\tvar t = f+\"|\"+g;\n\t\tif(mtcache[t] !== undefined) return mtcache[t];\n\t\treturn (mtcache[t] = new RegExp('<(?:\\\\w+:)?'+f+'(?: xml:space=\"preserve\")?(?:[^>]*)>([^\\u2603]*)</(?:\\\\w+:)?'+f+'>',(g||\"\")));\n\t};\n})();\n\nvar vtregex = (function(){ var vt_cache = {};\n\treturn function vt_regex(bt) {\n\t\tif(vt_cache[bt] !== undefined) return vt_cache[bt];\n\t\treturn (vt_cache[bt] = new RegExp(\"<vt:\" + bt + \">(.*?)</vt:\" + bt + \">\", 'g') );\n};})();\nvar vtvregex = /<\\/?vt:variant>/g, vtmregex = /<vt:([^>]*)>(.*)</;\nfunction parseVector(data) {\n\tvar h = parsexmltag(data);\n\n\tvar matches = data.match(vtregex(h.baseType))||[];\n\tif(matches.length != h.size) throw \"unexpected vector length \" + matches.length + \" != \" + h.size;\n\tvar res = [];\n\tmatches.forEach(function(x) {\n\t\tvar v = x.replace(vtvregex,\"\").match(vtmregex);\n\t\tres.push({v:v[2], t:v[1]});\n\t});\n\treturn res;\n}\n\nvar wtregex = /(^\\s|\\s$|\\n)/;\nfunction writetag(f,g) {return '<' + f + (g.match(wtregex)?' xml:space=\"preserve\"' : \"\") + '>' + g + '</' + f + '>';}\n\nfunction wxt_helper(h) { return keys(h).map(function(k) { return \" \" + k + '=\"' + h[k] + '\"';}).join(\"\"); }\nfunction writextag(f,g,h) { return '<' + f + (isval(h) ? wxt_helper(h) : \"\") + (isval(g) ? (g.match(wtregex)?' xml:space=\"preserve\"' : \"\") + '>' + g + '</' + f : \"/\") + '>';}\n\nfunction write_w3cdtf(d, t) { try { return d.toISOString().replace(/\\.\\d*/,\"\"); } catch(e) { if(t) throw e; } }\n\nfunction write_vt(s) {\n\tswitch(typeof s) {\n\t\tcase 'string': return writextag('vt:lpwstr', s);\n\t\tcase 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', String(s));\n\t\tcase 'boolean': return writextag('vt:bool',s?'true':'false');\n\t}\n\tif(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s));\n\tthrow new Error(\"Unable to serialize \" + s);\n}\n\nvar XML_HEADER = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\r\\n';\nvar XMLNS = {\n\t'dc': 'http://purl.org/dc/elements/1.1/',\n\t'dcterms': 'http://purl.org/dc/terms/',\n\t'dcmitype': 'http://purl.org/dc/dcmitype/',\n\t'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main',\n\t'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n\t'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties',\n\t'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n\t'xsi': 'http://www.w3.org/2001/XMLSchema-instance',\n\t'xsd': 'http://www.w3.org/2001/XMLSchema'\n};\n\nXMLNS.main = [\n\t'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n\t'http://purl.oclc.org/ooxml/spreadsheetml/main',\n\t'http://schemas.microsoft.com/office/excel/2006/main',\n\t'http://schemas.microsoft.com/office/excel/2006/2'\n];\n\nfunction readIEEE754(buf, idx, isLE, nl, ml) {\n\tif(isLE === undefined) isLE = true;\n\tif(!nl) nl = 8;\n\tif(!ml && nl === 8) ml = 52;\n\tvar e, m, el = nl * 8 - ml - 1, eMax = (1 << el) - 1, eBias = eMax >> 1;\n\tvar bits = -7, d = isLE ? -1 : 1, i = isLE ? (nl - 1) : 0, s = buf[idx + i];\n\n\ti += d;\n\te = s & ((1 << (-bits)) - 1); s >>>= (-bits); bits += el;\n\tfor (; bits > 0; e = e * 256 + buf[idx + i], i += d, bits -= 8);\n\tm = e & ((1 << (-bits)) - 1); e >>>= (-bits); bits += ml;\n\tfor (; bits > 0; m = m * 256 + buf[idx + i], i += d, bits -= 8);\n\tif (e === eMax) return m ? NaN : ((s ? -1 : 1) * Infinity);\n\telse if (e === 0) e = 1 - eBias;\n\telse { m = m + Math.pow(2, ml); e = e - eBias; }\n\treturn (s ? -1 : 1) * m * Math.pow(2, e - ml);\n}\n\nvar __toBuffer, ___toBuffer;\n__toBuffer = ___toBuffer = function toBuffer_(bufs) { var x = []; for(var i = 0; i < bufs[0].length; ++i) { x.push.apply(x, bufs[0][i]); } return x; };\nvar __utf16le, ___utf16le;\n__utf16le = ___utf16le = function utf16le_(b,s,e) { var ss=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join(\"\"); };\nvar __hexlify, ___hexlify;\n__hexlify = ___hexlify = function hexlify_(b,s,l) { return b.slice(s,(s+l)).map(function(x){return (x<16?\"0\":\"\") + x.toString(16);}).join(\"\"); };\nvar __utf8, ___utf8;\n__utf8 = ___utf8 = function(b,s,e) { var ss=[]; for(var i=s; i<e; i++) ss.push(String.fromCharCode(__readUInt8(b,i))); return ss.join(\"\"); };\nvar __lpstr, ___lpstr;\n__lpstr = ___lpstr = function lpstr_(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : \"\";};\nvar __lpwstr, ___lpwstr;\n__lpwstr = ___lpwstr = function lpwstr_(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : \"\";};\nvar __double, ___double;\n__double = ___double = function(b, idx) { return readIEEE754(b, idx);};\n\nvar is_buf = function is_buf_a(a) { return Array.isArray(a); };\nif(has_buf) {\n\t__utf16le = function utf16le_b(b,s,e) { if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e); return b.toString('utf16le',s,e); };\n\t__hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };\n\t__lpstr = function lpstr_b(b,i) { if(!Buffer.isBuffer(b)) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : \"\";};\n\t__lpwstr = function lpwstr_b(b,i) { if(!Buffer.isBuffer(b)) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);};\n\t__utf8 = function utf8_b(s,e) { return this.toString('utf8',s,e); };\n\t__toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0]) : ___toBuffer(bufs);};\n\tbconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : [].concat.apply([], bufs); };\n\t__double = function double_(b,i) { if(Buffer.isBuffer(b)) return b.readDoubleLE(i); return ___double(b,i); };\n\tis_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a); };\n}\n\n/* from js-xls */\nif(typeof cptable !== 'undefined') {\n\t__utf16le = function(b,s,e) { return cptable.utils.decode(1200, b.slice(s,e)); };\n\t__utf8 = function(b,s,e) { return cptable.utils.decode(65001, b.slice(s,e)); };\n\t__lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : \"\";};\n\t__lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : \"\";};\n}\n\nvar __readUInt8 = function(b, idx) { return b[idx]; };\nvar __readUInt16LE = function(b, idx) { return b[idx+1]*(1<<8)+b[idx]; };\nvar __readInt16LE = function(b, idx) { var u = b[idx+1]*(1<<8)+b[idx]; return (u < 0x8000) ? u : (0xffff - u + 1) * -1; };\nvar __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };\nvar __readInt32LE = function(b, idx) { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; };\n\nvar ___unhexlify = function(s) { return s.match(/../g).map(function(x) { return parseInt(x,16);}); };\nvar __unhexlify = typeof Buffer !== \"undefined\" ? function(s) { return Buffer.isBuffer(s) ? new Buffer(s, 'hex') : ___unhexlify(s); } : ___unhexlify;\n\nfunction ReadShift(size, t) {\n\tvar o=\"\", oI, oR, oo=[], w, vv, i, loc;\n\tswitch(t) {\n\t\tcase 'dbcs':\n\t\t\tloc = this.l;\n\t\t\tif(has_buf && Buffer.isBuffer(this)) o = this.slice(this.l, this.l+2*size).toString(\"utf16le\");\n\t\t\telse for(i = 0; i != size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; }\n\t\t\tsize *= 2;\n\t\t\tbreak;\n\n\t\tcase 'utf8': o = __utf8(this, this.l, this.l + size); break;\n\t\tcase 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break;\n\n\t\t/* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */\n\t\tcase 'lpstr': o = __lpstr(this, this.l); size = 5 + o.length; break;\n\t\t/* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */\n\t\tcase 'lpwstr': o = __lpwstr(this, this.l); size = 5 + o.length; if(o[o.length-1] == '\\u0000') size += 2; break;\n\n\t\tcase 'cstr': size = 0; o = \"\";\n\t\t\twhile((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w));\n\t\t\to = oo.join(\"\"); break;\n\t\tcase 'wstr': size = 0; o = \"\";\n\t\t\twhile((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;}\n\t\t\tsize+=2; o = oo.join(\"\"); break;\n\n\t\t/* sbcs and dbcs support continue records in the SST way TODO codepages */\n\t\tcase 'dbcs-cont': o = \"\"; loc = this.l;\n\t\t\tfor(i = 0; i != size; ++i) {\n\t\t\t\tif(this.lens && this.lens.indexOf(loc) !== -1) {\n\t\t\t\t\tw = __readUInt8(this, loc);\n\t\t\t\t\tthis.l = loc + 1;\n\t\t\t\t\tvv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');\n\t\t\t\t\treturn oo.join(\"\") + vv;\n\t\t\t\t}\n\t\t\t\too.push(_getchar(__readUInt16LE(this, loc)));\n\t\t\t\tloc+=2;\n\t\t\t} o = oo.join(\"\"); size *= 2; break;\n\n\t\tcase 'sbcs-cont': o = \"\"; loc = this.l;\n\t\t\tfor(i = 0; i != size; ++i) {\n\t\t\t\tif(this.lens && this.lens.indexOf(loc) !== -1) {\n\t\t\t\t\tw = __readUInt8(this, loc);\n\t\t\t\t\tthis.l = loc + 1;\n\t\t\t\t\tvv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');\n\t\t\t\t\treturn oo.join(\"\") + vv;\n\t\t\t\t}\n\t\t\t\too.push(_getchar(__readUInt8(this, loc)));\n\t\t\t\tloc+=1;\n\t\t\t} o = oo.join(\"\"); break;\n\n\t\tdefault:\n\tswitch(size) {\n\t\tcase 1: oI = __readUInt8(this, this.l); this.l++; return oI;\n\t\tcase 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI;\n\t\tcase 4:\n\t\t\tif(t === 'i' || (this[this.l+3] & 0x80)===0) { oI = __readInt32LE(this, this.l); this.l += 4; return oI; }\n\t\t\telse { oR = __readUInt32LE(this, this.l); this.l += 4; return oR; } break;\n\t\tcase 8: if(t === 'f') { oR = __double(this, this.l); this.l += 8; return oR; }\n\t\t/* falls through */\n\t\tcase 16: o = __hexlify(this, this.l, size); break;\n\t}}\n\tthis.l+=size; return o;\n}\n\nfunction WriteShift(t, val, f) {\n\tvar size, i;\n\tif(f === 'dbcs') {\n\t\tfor(i = 0; i != val.length; ++i) this.writeUInt16LE(val.charCodeAt(i), this.l + 2 * i);\n\t\tsize = 2 * val.length;\n\t} else switch(t) {\n\t\tcase 1: size = 1; this[this.l] = val&255; break;\n\t\tcase 3: size = 3; this[this.l+2] = val & 255; val >>>= 8; this[this.l+1] = val&255; val >>>= 8; this[this.l] = val&255; break;\n\t\tcase 4: size = 4; this.writeUInt32LE(val, this.l); break;\n\t\tcase 8: size = 8; if(f === 'f') { this.writeDoubleLE(val, this.l); break; }\n\t\t/* falls through */\n\t\tcase 16: break;\n\t\tcase -4: size = 4; this.writeInt32LE(val, this.l); break;\n\t}\n\tthis.l += size; return this;\n}\n\nfunction CheckField(hexstr, fld) {\n\tvar m = __hexlify(this,this.l,hexstr.length>>1);\n\tif(m !== hexstr) throw fld + 'Expected ' + hexstr + ' saw ' + m;\n\tthis.l += hexstr.length>>1;\n}\n\nfunction prep_blob(blob, pos) {\n\tblob.l = pos;\n\tblob.read_shift = ReadShift;\n\tblob.chk = CheckField;\n\tblob.write_shift = WriteShift;\n}\n\nfunction parsenoop(blob, length) { blob.l += length; }\n\nfunction writenoop(blob, length) { blob.l += length; }\n\nfunction new_buf(sz) {\n\tvar o = new_raw_buf(sz);\n\tprep_blob(o, 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.1.4 Record */\nfunction recordhopper(data, cb, opts) {\n\tvar tmpbyte, cntbyte, length;\n\tprep_blob(data, data.l || 0);\n\twhile(data.l < data.length) {\n\t\tvar RT = data.read_shift(1);\n\t\tif(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);\n\t\tvar R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF];\n\t\ttmpbyte = data.read_shift(1);\n\t\tlength = tmpbyte & 0x7F;\n\t\tfor(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);\n\t\tvar d = R.f(data, length, opts);\n\t\tif(cb(d, R, RT)) return;\n\t}\n}\n\n/* control buffer usage for fixed-length buffers */\nfunction buf_array() {\n\tvar bufs = [], blksz = 2048;\n\tvar newblk = function ba_newblk(sz) {\n\t\tvar o = new_buf(sz);\n\t\tprep_blob(o, 0);\n\t\treturn o;\n\t};\n\n\tvar curbuf = newblk(blksz);\n\n\tvar endbuf = function ba_endbuf() {\n\t\tcurbuf.length = curbuf.l;\n\t\tif(curbuf.length > 0) bufs.push(curbuf);\n\t\tcurbuf = null;\n\t};\n\n\tvar next = function ba_next(sz) {\n\t\tif(sz < curbuf.length - curbuf.l) return curbuf;\n\t\tendbuf();\n\t\treturn (curbuf = newblk(Math.max(sz+1, blksz)));\n\t};\n\n\tvar end = function ba_end() {\n\t\tendbuf();\n\t\treturn __toBuffer([bufs]);\n\t};\n\n\tvar push = function ba_push(buf) { endbuf(); curbuf = buf; next(blksz); };\n\n\treturn { next:next, push:push, end:end, _bufs:bufs };\n}\n\nfunction write_record(ba, type, payload, length) {\n\tvar t = evert_RE[type], l;\n\tif(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0;\n\tl = 1 + (t >= 0x80 ? 1 : 0) + 1 + length;\n\tif(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l;\n\tvar o = ba.next(l);\n\tif(t <= 0x7F) o.write_shift(1, t);\n\telse {\n\t\to.write_shift(1, (t & 0x7F) + 0x80);\n\t\to.write_shift(1, (t >> 7));\n\t}\n\tfor(var i = 0; i != 4; ++i) {\n\t\tif(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; }\n\t\telse { o.write_shift(1, length); break; }\n\t}\n\tif(length > 0 && is_buf(payload)) ba.push(payload);\n}\n/* XLS ranges enforced */\nfunction shift_cell_xls(cell, tgt) {\n\tif(tgt.s) {\n\t\tif(cell.cRel) cell.c += tgt.s.c;\n\t\tif(cell.rRel) cell.r += tgt.s.r;\n\t} else {\n\t\tcell.c += tgt.c;\n\t\tcell.r += tgt.r;\n\t}\n\tcell.cRel = cell.rRel = 0;\n\twhile(cell.c >= 0x100) cell.c -= 0x100;\n\twhile(cell.r >= 0x10000) cell.r -= 0x10000;\n\treturn cell;\n}\n\nfunction shift_range_xls(cell, range) {\n\tcell.s = shift_cell_xls(cell.s, range.s);\n\tcell.e = shift_cell_xls(cell.e, range.s);\n\treturn cell;\n}\n\nvar OFFCRYPTO = {};\nvar make_offcrypto = function(O, _crypto) {\n\tvar crypto;\n\tif(typeof _crypto !== 'undefined') crypto = _crypto;\n\telse if(typeof require !== 'undefined') {\n\t\ttry { crypto = require('cry'+'pto'); }\n\t\tcatch(e) { crypto = null; }\n\t}\n\n\tO.rc4 = function(key, data) {\n\t\tvar S = new Array(256);\n\t\tvar c = 0, i = 0, j = 0, t = 0;\n\t\tfor(i = 0; i != 256; ++i) S[i] = i;\n\t\tfor(i = 0; i != 256; ++i) {\n\t\t\tj = (j + S[i] + (key[i%key.length]).charCodeAt(0))&255;\n\t\t\tt = S[i]; S[i] = S[j]; S[j] = t;\n\t\t}\n\t\ti = j = 0; out = Buffer(data.length);\n\t\tfor(c = 0; c != data.length; ++c) {\n\t\t\ti = (i + 1)&255;\n\t\t\tj = (j + S[i])%256;\n\t\t\tt = S[i]; S[i] = S[j]; S[j] = t;\n\t\t\tout[c] = (data[c] ^ S[(S[i]+S[j])&255]);\n\t\t}\n\t\treturn out;\n\t};\n\n\tif(crypto) {\n\t\tO.md5 = function(hex) { return crypto.createHash('md5').update(hex).digest('hex'); };\n\t} else {\n\t\tO.md5 = function(hex) { throw \"unimplemented\"; };\n\t}\n};\nmake_offcrypto(OFFCRYPTO, typeof crypto !== \"undefined\" ? crypto : undefined);\n\n\n/* [MS-XLSB] 2.5.143 */\nfunction parse_StrRun(data, length) {\n\treturn { ich: data.read_shift(2), ifnt: data.read_shift(2) };\n}\n\n/* [MS-XLSB] 2.1.7.121 */\nfunction parse_RichStr(data, length) {\n\tvar start = data.l;\n\tvar flags = data.read_shift(1);\n\tvar str = parse_XLWideString(data);\n\tvar rgsStrRun = [];\n\tvar z = { t: str, h: str };\n\tif((flags & 1) !== 0) { /* fRichStr */\n\t\t/* TODO: formatted string */\n\t\tvar dwSizeStrRun = data.read_shift(4);\n\t\tfor(var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));\n\t\tz.r = rgsStrRun;\n\t}\n\telse z.r = \"<t>\" + escapexml(str) + \"</t>\";\n\tif((flags & 2) !== 0) { /* fExtStr */\n\t\t/* TODO: phonetic string */\n\t}\n\tdata.l = start + length;\n\treturn z;\n}\nfunction write_RichStr(str, o) {\n\t/* TODO: formatted string */\n\tif(o == null) o = new_buf(5+2*str.t.length);\n\to.write_shift(1,0);\n\twrite_XLWideString(str.t, o);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.9 */\nfunction parse_XLSBCell(data) {\n\tvar col = data.read_shift(4);\n\tvar iStyleRef = data.read_shift(2);\n\tiStyleRef += data.read_shift(1) <<16;\n\tvar fPhShow = data.read_shift(1);\n\treturn { c:col, iStyleRef: iStyleRef };\n}\nfunction write_XLSBCell(cell, o) {\n\tif(o == null) o = new_buf(8);\n\to.write_shift(-4, cell.c);\n\to.write_shift(3, cell.iStyleRef === undefined ? cell.iStyleRef : cell.s);\n\to.write_shift(1, 0); /* fPhShow */\n\treturn o;\n}\n\n\n/* [MS-XLSB] 2.5.21 */\nfunction parse_XLSBCodeName (data, length) { return parse_XLWideString(data, length); }\n\n/* [MS-XLSB] 2.5.166 */\nfunction parse_XLNullableWideString(data) {\n\tvar cchCharacters = data.read_shift(4);\n\treturn cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? \"\" : data.read_shift(cchCharacters, 'dbcs');\n}\nfunction write_XLNullableWideString(data, o) {\n\tif(!o) o = new_buf(127);\n\to.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);\n\tif(data.length > 0) o.write_shift(0, data, 'dbcs');\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.168 */\nfunction parse_XLWideString(data) {\n\tvar cchCharacters = data.read_shift(4);\n\treturn cchCharacters === 0 ? \"\" : data.read_shift(cchCharacters, 'dbcs');\n}\nfunction write_XLWideString(data, o) {\n\tif(o == null) o = new_buf(4+2*data.length);\n\to.write_shift(4, data.length);\n\tif(data.length > 0) o.write_shift(0, data, 'dbcs');\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.114 */\nvar parse_RelID = parse_XLNullableWideString;\nvar write_RelID = write_XLNullableWideString;\n\n\n/* [MS-XLSB] 2.5.122 */\n/* [MS-XLS] 2.5.217 */\nfunction parse_RkNumber(data) {\n\tvar b = data.slice(data.l, data.l+4);\n\tvar fX100 = b[0] & 1, fInt = b[0] & 2;\n\tdata.l+=4;\n\tb[0] &= 0xFC; // b[0] &= ~3;\n\tvar RK = fInt === 0 ? __double([0,0,0,0,b[0],b[1],b[2],b[3]],0) : __readInt32LE(b,0)>>2;\n\treturn fX100 ? RK/100 : RK;\n}\n\n/* [MS-XLSB] 2.5.153 */\nfunction parse_UncheckedRfX(data) {\n\tvar cell = {s: {}, e: {}};\n\tcell.s.r = data.read_shift(4);\n\tcell.e.r = data.read_shift(4);\n\tcell.s.c = data.read_shift(4);\n\tcell.e.c = data.read_shift(4);\n\treturn cell;\n}\n\nfunction write_UncheckedRfX(r, o) {\n\tif(!o) o = new_buf(16);\n\to.write_shift(4, r.s.r);\n\to.write_shift(4, r.e.r);\n\to.write_shift(4, r.s.c);\n\to.write_shift(4, r.e.c);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.171 */\n/* [MS-XLS] 2.5.342 */\nfunction parse_Xnum(data, length) { return data.read_shift(8, 'f'); }\nfunction write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, 'f', data); }\n\n/* [MS-XLSB] 2.5.198.2 */\nvar BErr = {\n\t0x00: \"#NULL!\",\n\t0x07: \"#DIV/0!\",\n\t0x0F: \"#VALUE!\",\n\t0x17: \"#REF!\",\n\t0x1D: \"#NAME?\",\n\t0x24: \"#NUM!\",\n\t0x2A: \"#N/A\",\n\t0x2B: \"#GETTING_DATA\",\n\t0xFF: \"#WTF?\"\n};\nvar RBErr = evert_num(BErr);\n\n/* [MS-XLSB] 2.4.321 BrtColor */\nfunction parse_BrtColor(data, length) {\n\tvar out = {};\n\tvar d = data.read_shift(1);\n\tout.fValidRGB = d & 1;\n\tout.xColorType = d >>> 1;\n\tout.index = data.read_shift(1);\n\tout.nTintAndShade = data.read_shift(2, 'i');\n\tout.bRed = data.read_shift(1);\n\tout.bGreen = data.read_shift(1);\n\tout.bBlue = data.read_shift(1);\n\tout.bAlpha = data.read_shift(1);\n}\n\n/* [MS-XLSB] 2.5.52 */\nfunction parse_FontFlags(data, length) {\n\tvar d = data.read_shift(1);\n\tdata.l++;\n\tvar out = {\n\t\tfItalic: d & 0x2,\n\t\tfStrikeout: d & 0x8,\n\t\tfOutline: d & 0x10,\n\t\tfShadow: d & 0x20,\n\t\tfCondense: d & 0x40,\n\t\tfExtend: d & 0x80\n\t};\n\treturn out;\n}\n/* [MS-OLEPS] 2.2 PropertyType */\n{\n\tvar VT_EMPTY = 0x0000;\n\tvar VT_NULL = 0x0001;\n\tvar VT_I2 = 0x0002;\n\tvar VT_I4 = 0x0003;\n\tvar VT_R4 = 0x0004;\n\tvar VT_R8 = 0x0005;\n\tvar VT_CY = 0x0006;\n\tvar VT_DATE = 0x0007;\n\tvar VT_BSTR = 0x0008;\n\tvar VT_ERROR = 0x000A;\n\tvar VT_BOOL = 0x000B;\n\tvar VT_VARIANT = 0x000C;\n\tvar VT_DECIMAL = 0x000E;\n\tvar VT_I1 = 0x0010;\n\tvar VT_UI1 = 0x0011;\n\tvar VT_UI2 = 0x0012;\n\tvar VT_UI4 = 0x0013;\n\tvar VT_I8 = 0x0014;\n\tvar VT_UI8 = 0x0015;\n\tvar VT_INT = 0x0016;\n\tvar VT_UINT = 0x0017;\n\tvar VT_LPSTR = 0x001E;\n\tvar VT_LPWSTR = 0x001F;\n\tvar VT_FILETIME = 0x0040;\n\tvar VT_BLOB = 0x0041;\n\tvar VT_STREAM = 0x0042;\n\tvar VT_STORAGE = 0x0043;\n\tvar VT_STREAMED_Object = 0x0044;\n\tvar VT_STORED_Object = 0x0045;\n\tvar VT_BLOB_Object = 0x0046;\n\tvar VT_CF = 0x0047;\n\tvar VT_CLSID = 0x0048;\n\tvar VT_VERSIONED_STREAM = 0x0049;\n\tvar VT_VECTOR = 0x1000;\n\tvar VT_ARRAY = 0x2000;\n\n\tvar VT_STRING = 0x0050; // 2.3.3.1.11 VtString\n\tvar VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString\n\tvar VT_CUSTOM = [VT_STRING, VT_USTR];\n}\n\n/* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */\nvar DocSummaryPIDDSI = {\n\t0x01: { n: 'CodePage', t: VT_I2 },\n\t0x02: { n: 'Category', t: VT_STRING },\n\t0x03: { n: 'PresentationFormat', t: VT_STRING },\n\t0x04: { n: 'ByteCount', t: VT_I4 },\n\t0x05: { n: 'LineCount', t: VT_I4 },\n\t0x06: { n: 'ParagraphCount', t: VT_I4 },\n\t0x07: { n: 'SlideCount', t: VT_I4 },\n\t0x08: { n: 'NoteCount', t: VT_I4 },\n\t0x09: { n: 'HiddenCount', t: VT_I4 },\n\t0x0a: { n: 'MultimediaClipCount', t: VT_I4 },\n\t0x0b: { n: 'Scale', t: VT_BOOL },\n\t0x0c: { n: 'HeadingPair', t: VT_VECTOR | VT_VARIANT },\n\t0x0d: { n: 'DocParts', t: VT_VECTOR | VT_LPSTR },\n\t0x0e: { n: 'Manager', t: VT_STRING },\n\t0x0f: { n: 'Company', t: VT_STRING },\n\t0x10: { n: 'LinksDirty', t: VT_BOOL },\n\t0x11: { n: 'CharacterCount', t: VT_I4 },\n\t0x13: { n: 'SharedDoc', t: VT_BOOL },\n\t0x16: { n: 'HLinksChanged', t: VT_BOOL },\n\t0x17: { n: 'AppVersion', t: VT_I4, p: 'version' },\n\t0x1A: { n: 'ContentType', t: VT_STRING },\n\t0x1B: { n: 'ContentStatus', t: VT_STRING },\n\t0x1C: { n: 'Language', t: VT_STRING },\n\t0x1D: { n: 'Version', t: VT_STRING },\n\t0xFF: {}\n};\n\n/* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */\nvar SummaryPIDSI = {\n\t0x01: { n: 'CodePage', t: VT_I2 },\n\t0x02: { n: 'Title', t: VT_STRING },\n\t0x03: { n: 'Subject', t: VT_STRING },\n\t0x04: { n: 'Author', t: VT_STRING },\n\t0x05: { n: 'Keywords', t: VT_STRING },\n\t0x06: { n: 'Comments', t: VT_STRING },\n\t0x07: { n: 'Template', t: VT_STRING },\n\t0x08: { n: 'LastAuthor', t: VT_STRING },\n\t0x09: { n: 'RevNumber', t: VT_STRING },\n\t0x0A: { n: 'EditTime', t: VT_FILETIME },\n\t0x0B: { n: 'LastPrinted', t: VT_FILETIME },\n\t0x0C: { n: 'CreatedDate', t: VT_FILETIME },\n\t0x0D: { n: 'ModifiedDate', t: VT_FILETIME },\n\t0x0E: { n: 'PageCount', t: VT_I4 },\n\t0x0F: { n: 'WordCount', t: VT_I4 },\n\t0x10: { n: 'CharCount', t: VT_I4 },\n\t0x11: { n: 'Thumbnail', t: VT_CF },\n\t0x12: { n: 'ApplicationName', t: VT_LPSTR },\n\t0x13: { n: 'DocumentSecurity', t: VT_I4 },\n\t0xFF: {}\n};\n\n/* [MS-OLEPS] 2.18 */\nvar SpecialProperties = {\n\t0x80000000: { n: 'Locale', t: VT_UI4 },\n\t0x80000003: { n: 'Behavior', t: VT_UI4 },\n\t0x72627262: {}\n};\n\n(function() {\n\tfor(var y in SpecialProperties) if(SpecialProperties.hasOwnProperty(y))\n\tDocSummaryPIDDSI[y] = SummaryPIDSI[y] = SpecialProperties[y];\n})();\n\n/* [MS-XLS] 2.4.63 Country/Region codes */\nvar CountryEnum = {\n\t0x0001: \"US\", // United States\n\t0x0002: \"CA\", // Canada\n\t0x0003: \"\", // Latin America (except Brazil)\n\t0x0007: \"RU\", // Russia\n\t0x0014: \"EG\", // Egypt\n\t0x001E: \"GR\", // Greece\n\t0x001F: \"NL\", // Netherlands\n\t0x0020: \"BE\", // Belgium\n\t0x0021: \"FR\", // France\n\t0x0022: \"ES\", // Spain\n\t0x0024: \"HU\", // Hungary\n\t0x0027: \"IT\", // Italy\n\t0x0029: \"CH\", // Switzerland\n\t0x002B: \"AT\", // Austria\n\t0x002C: \"GB\", // United Kingdom\n\t0x002D: \"DK\", // Denmark\n\t0x002E: \"SE\", // Sweden\n\t0x002F: \"NO\", // Norway\n\t0x0030: \"PL\", // Poland\n\t0x0031: \"DE\", // Germany\n\t0x0034: \"MX\", // Mexico\n\t0x0037: \"BR\", // Brazil\n\t0x003d: \"AU\", // Australia\n\t0x0040: \"NZ\", // New Zealand\n\t0x0042: \"TH\", // Thailand\n\t0x0051: \"JP\", // Japan\n\t0x0052: \"KR\", // Korea\n\t0x0054: \"VN\", // Viet Nam\n\t0x0056: \"CN\", // China\n\t0x005A: \"TR\", // Turkey\n\t0x0069: \"JS\", // Ramastan\n\t0x00D5: \"DZ\", // Algeria\n\t0x00D8: \"MA\", // Morocco\n\t0x00DA: \"LY\", // Libya\n\t0x015F: \"PT\", // Portugal\n\t0x0162: \"IS\", // Iceland\n\t0x0166: \"FI\", // Finland\n\t0x01A4: \"CZ\", // Czech Republic\n\t0x0376: \"TW\", // Taiwan\n\t0x03C1: \"LB\", // Lebanon\n\t0x03C2: \"JO\", // Jordan\n\t0x03C3: \"SY\", // Syria\n\t0x03C4: \"IQ\", // Iraq\n\t0x03C5: \"KW\", // Kuwait\n\t0x03C6: \"SA\", // Saudi Arabia\n\t0x03CB: \"AE\", // United Arab Emirates\n\t0x03CC: \"IL\", // Israel\n\t0x03CE: \"QA\", // Qatar\n\t0x03D5: \"IR\", // Iran\n\t0xFFFF: \"US\" // United States\n};\n\n/* [MS-XLS] 2.5.127 */\nvar XLSFillPattern = [\n\tnull,\n\t'solid',\n\t'mediumGray',\n\t'darkGray',\n\t'lightGray',\n\t'darkHorizontal',\n\t'darkVertical',\n\t'darkDown',\n\t'darkUp',\n\t'darkGrid',\n\t'darkTrellis',\n\t'lightHorizontal',\n\t'lightVertical',\n\t'lightDown',\n\t'lightUp',\n\t'lightGrid',\n\t'lightTrellis',\n\t'gray125',\n\t'gray0625'\n];\n\nfunction rgbify(arr) { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); }\n\n/* [MS-XLS] 2.5.161 */\nvar XLSIcv = rgbify([\n\t/* Color Constants */\n\t0x000000,\n\t0xFFFFFF,\n\t0xFF0000,\n\t0x00FF00,\n\t0x0000FF,\n\t0xFFFF00,\n\t0xFF00FF,\n\t0x00FFFF,\n\n\t/* Defaults */\n\t0x000000,\n\t0xFFFFFF,\n\t0xFF0000,\n\t0x00FF00,\n\t0x0000FF,\n\t0xFFFF00,\n\t0xFF00FF,\n\t0x00FFFF,\n\n\t0x800000,\n\t0x008000,\n\t0x000080,\n\t0x808000,\n\t0x800080,\n\t0x008080,\n\t0xC0C0C0,\n\t0x808080,\n\t0x9999FF,\n\t0x993366,\n\t0xFFFFCC,\n\t0xCCFFFF,\n\t0x660066,\n\t0xFF8080,\n\t0x0066CC,\n\t0xCCCCFF,\n\n\t0x000080,\n\t0xFF00FF,\n\t0xFFFF00,\n\t0x00FFFF,\n\t0x800080,\n\t0x800000,\n\t0x008080,\n\t0x0000FF,\n\t0x00CCFF,\n\t0xCCFFFF,\n\t0xCCFFCC,\n\t0xFFFF99,\n\t0x99CCFF,\n\t0xFF99CC,\n\t0xCC99FF,\n\t0xFFCC99,\n\n\t0x3366FF,\n\t0x33CCCC,\n\t0x99CC00,\n\t0xFFCC00,\n\t0xFF9900,\n\t0xFF6600,\n\t0x666699,\n\t0x969696,\n\t0x003366,\n\t0x339966,\n\t0x003300,\n\t0x333300,\n\t0x993300,\n\t0x993366,\n\t0x333399,\n\t0x333333,\n\n\t/* Sheet */\n\t0xFFFFFF,\n\t0x000000\n]);\n\n/* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */\n/* 12.3 Part Summary <SpreadsheetML> */\n/* 14.2 Part Summary <DrawingML> */\n/* [MS-XLSX] 2.1 Part Enumerations */\n/* [MS-XLSB] 2.1.7 Part Enumeration */\nvar ct2type = {\n\t/* Workbook */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\": \"workbooks\",\n\n\t/* Worksheet */\n\t\"application/vnd.ms-excel.binIndexWs\": \"TODO\", /* Binary Index */\n\n\t/* Chartsheet */\n\t\"application/vnd.ms-excel.chartsheet\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\": \"TODO\",\n\n\t/* Dialogsheet */\n\t\"application/vnd.ms-excel.dialogsheet\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\": \"TODO\",\n\n\t/* Macrosheet */\n\t\"application/vnd.ms-excel.macrosheet\": \"TODO\",\n\t\"application/vnd.ms-excel.macrosheet+xml\": \"TODO\",\n\t\"application/vnd.ms-excel.intlmacrosheet\": \"TODO\",\n\t\"application/vnd.ms-excel.binIndexMs\": \"TODO\", /* Binary Index */\n\n\t/* File Properties */\n\t\"application/vnd.openxmlformats-package.core-properties+xml\": \"coreprops\",\n\t\"application/vnd.openxmlformats-officedocument.custom-properties+xml\": \"custprops\",\n\t\"application/vnd.openxmlformats-officedocument.extended-properties+xml\": \"extprops\",\n\n\t/* Custom Data Properties */\n\t\"application/vnd.openxmlformats-officedocument.customXmlProperties+xml\": \"TODO\",\n\n\t/* Comments */\n\t\"application/vnd.ms-excel.comments\": \"comments\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\": \"comments\",\n\n\t/* PivotTable */\n\t\"application/vnd.ms-excel.pivotTable\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml\": \"TODO\",\n\n\t/* Calculation Chain */\n\t\"application/vnd.ms-excel.calcChain\": \"calcchains\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml\": \"calcchains\",\n\n\t/* Printer Settings */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings\": \"TODO\",\n\n\t/* ActiveX */\n\t\"application/vnd.ms-office.activeX\": \"TODO\",\n\t\"application/vnd.ms-office.activeX+xml\": \"TODO\",\n\n\t/* Custom Toolbars */\n\t\"application/vnd.ms-excel.attachedToolbars\": \"TODO\",\n\n\t/* External Data Connections */\n\t\"application/vnd.ms-excel.connections\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\": \"TODO\",\n\n\t/* External Links */\n\t\"application/vnd.ms-excel.externalLink\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml\": \"TODO\",\n\n\t/* Metadata */\n\t\"application/vnd.ms-excel.sheetMetadata\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml\": \"TODO\",\n\n\t/* PivotCache */\n\t\"application/vnd.ms-excel.pivotCacheDefinition\": \"TODO\",\n\t\"application/vnd.ms-excel.pivotCacheRecords\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml\": \"TODO\",\n\n\t/* Query Table */\n\t\"application/vnd.ms-excel.queryTable\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml\": \"TODO\",\n\n\t/* Shared Workbook */\n\t\"application/vnd.ms-excel.userNames\": \"TODO\",\n\t\"application/vnd.ms-excel.revisionHeaders\": \"TODO\",\n\t\"application/vnd.ms-excel.revisionLog\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml\": \"TODO\",\n\n\t/* Single Cell Table */\n\t\"application/vnd.ms-excel.tableSingleCells\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml\": \"TODO\",\n\n\t/* Slicer */\n\t\"application/vnd.ms-excel.slicer\": \"TODO\",\n\t\"application/vnd.ms-excel.slicerCache\": \"TODO\",\n\t\"application/vnd.ms-excel.slicer+xml\": \"TODO\",\n\t\"application/vnd.ms-excel.slicerCache+xml\": \"TODO\",\n\n\t/* Sort Map */\n\t\"application/vnd.ms-excel.wsSortMap\": \"TODO\",\n\n\t/* Table */\n\t\"application/vnd.ms-excel.table\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\": \"TODO\",\n\n\t/* Themes */\n\t\"application/vnd.openxmlformats-officedocument.theme+xml\": \"themes\",\n\n\t/* Timeline */\n\t\"application/vnd.ms-excel.Timeline+xml\": \"TODO\", /* verify */\n\t\"application/vnd.ms-excel.TimelineCache+xml\": \"TODO\", /* verify */\n\n\t/* VBA */\n\t\"application/vnd.ms-office.vbaProject\": \"vba\",\n\t\"application/vnd.ms-office.vbaProjectSignature\": \"vba\",\n\n\t/* Volatile Dependencies */\n\t\"application/vnd.ms-office.volatileDependencies\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml\": \"TODO\",\n\n\t/* Control Properties */\n\t\"application/vnd.ms-excel.controlproperties+xml\": \"TODO\",\n\n\t/* Data Model */\n\t\"application/vnd.openxmlformats-officedocument.model+data\": \"TODO\",\n\n\t/* Survey */\n\t\"application/vnd.ms-excel.Survey+xml\": \"TODO\",\n\n\t/* Drawing */\n\t\"application/vnd.openxmlformats-officedocument.drawing+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml\": \"TODO\",\n\n\t/* VML */\n\t\"application/vnd.openxmlformats-officedocument.vmlDrawing\": \"TODO\",\n\n\t\"application/vnd.openxmlformats-package.relationships+xml\": \"rels\",\n\t\"application/vnd.openxmlformats-officedocument.oleObject\": \"TODO\",\n\n\t\"sheet\": \"js\"\n};\n\nvar CT_LIST = (function(){\n\tvar o = {\n\t\tworkbooks: {\n\t\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\",\n\t\t\txlsm: \"application/vnd.ms-excel.sheet.macroEnabled.main+xml\",\n\t\t\txlsb: \"application/vnd.ms-excel.sheet.binary.macroEnabled.main\",\n\t\t\txltx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\"\n\t\t},\n\t\tstrs: { /* Shared Strings */\n\t\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\",\n\t\t\txlsb: \"application/vnd.ms-excel.sharedStrings\"\n\t\t},\n\t\tsheets: {\n\t\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\",\n\t\t\txlsb: \"application/vnd.ms-excel.worksheet\"\n\t\t},\n\t\tstyles: {/* Styles */\n\t\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\",\n\t\t\txlsb: \"application/vnd.ms-excel.styles\"\n\t\t}\n\t};\n\tkeys(o).forEach(function(k) { if(!o[k].xlsm) o[k].xlsm = o[k].xlsx; });\n\tkeys(o).forEach(function(k){ keys(o[k]).forEach(function(v) { ct2type[o[k][v]] = k; }); });\n\treturn o;\n})();\n\nvar type2ct = evert_arr(ct2type);\n\nXMLNS.CT = 'http://schemas.openxmlformats.org/package/2006/content-types';\n\nfunction parse_ct(data, opts) {\n\tvar ctext = {};\n\tif(!data || !data.match) return data;\n\tvar ct = { workbooks: [], sheets: [], calcchains: [], themes: [], styles: [],\n\t\tcoreprops: [], extprops: [], custprops: [], strs:[], comments: [], vba: [],\n\t\tTODO:[], rels:[], xmlns: \"\" };\n\t(data.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0].replace(nsregex,\"<\")) {\n\t\t\tcase '<?xml': break;\n\t\t\tcase '<Types': ct.xmlns = y['xmlns' + (y[0].match(/<(\\w+):/)||[\"\",\"\"])[1] ]; break;\n\t\t\tcase '<Default': ctext[y.Extension] = y.ContentType; break;\n\t\t\tcase '<Override':\n\t\t\t\tif(ct[ct2type[y.ContentType]] !== undefined) ct[ct2type[y.ContentType]].push(y.PartName);\n\t\t\t\telse if(opts.WTF) console.error(y);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\tif(ct.xmlns !== XMLNS.CT) throw new Error(\"Unknown Namespace: \" + ct.xmlns);\n\tct.calcchain = ct.calcchains.length > 0 ? ct.calcchains[0] : \"\";\n\tct.sst = ct.strs.length > 0 ? ct.strs[0] : \"\";\n\tct.style = ct.styles.length > 0 ? ct.styles[0] : \"\";\n\tct.defaults = ctext;\n\tdelete ct.calcchains;\n\treturn ct;\n}\n\nvar CTYPE_XML_ROOT = writextag('Types', null, {\n\t'xmlns': XMLNS.CT,\n\t'xmlns:xsd': XMLNS.xsd,\n\t'xmlns:xsi': XMLNS.xsi\n});\n\nvar CTYPE_DEFAULTS = [\n\t['xml', 'application/xml'],\n\t['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'],\n\t['rels', type2ct.rels[0]]\n].map(function(x) {\n\treturn writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]});\n});\n\nfunction write_ct(ct, opts) {\n\tvar o = [], v;\n\to[o.length] = (XML_HEADER);\n\to[o.length] = (CTYPE_XML_ROOT);\n\to = o.concat(CTYPE_DEFAULTS);\n\tvar f1 = function(w) {\n\t\tif(ct[w] && ct[w].length > 0) {\n\t\t\tv = ct[w][0];\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': CT_LIST[w][opts.bookType || 'xlsx']\n\t\t\t}));\n\t\t}\n\t};\n\tvar f2 = function(w) {\n\t\tct[w].forEach(function(v) {\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': CT_LIST[w][opts.bookType || 'xlsx']\n\t\t\t}));\n\t\t});\n\t};\n\tvar f3 = function(t) {\n\t\t(ct[t]||[]).forEach(function(v) {\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': type2ct[t][0]\n\t\t\t}));\n\t\t});\n\t};\n\tf1('workbooks');\n\tf2('sheets');\n\tf3('themes');\n\t['strs', 'styles'].forEach(f1);\n\t['coreprops', 'extprops', 'custprops'].forEach(f3);\n\tif(o.length>2){ o[o.length] = ('</Types>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 9.3.2 OPC Relationships Markup */\nvar RELS = {\n\tWB: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n\tSHEET: \"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"\n};\n\nfunction parse_rels(data, currentFilePath) {\n\tif (!data) return data;\n\tif (currentFilePath.charAt(0) !== '/') {\n\t\tcurrentFilePath = '/'+currentFilePath;\n\t}\n\tvar rels = {};\n\tvar hash = {};\n\tvar resolveRelativePathIntoAbsolute = function (to) {\n\t\tvar toksFrom = currentFilePath.split('/');\n\t\ttoksFrom.pop(); // folder path\n\t\tvar toksTo = to.split('/');\n\t\tvar reversed = [];\n\t\twhile (toksTo.length !== 0) {\n\t\t\tvar tokTo = toksTo.shift();\n\t\t\tif (tokTo === '..') {\n\t\t\t\ttoksFrom.pop();\n\t\t\t} else if (tokTo !== '.') {\n\t\t\t\ttoksFrom.push(tokTo);\n\t\t\t}\n\t\t}\n\t\treturn toksFrom.join('/');\n\t};\n\n\tdata.match(tagregex).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\t/* 9.3.2.2 OPC_Relationships */\n\t\tif (y[0] === '<Relationship') {\n\t\t\tvar rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; rel.TargetMode = y.TargetMode;\n\t\t\tvar canonictarget = y.TargetMode === 'External' ? y.Target : resolveRelativePathIntoAbsolute(y.Target);\n\t\t\trels[canonictarget] = rel;\n\t\t\thash[y.Id] = rel;\n\t\t}\n\t});\n\trels[\"!id\"] = hash;\n\treturn rels;\n}\n\nXMLNS.RELS = 'http://schemas.openxmlformats.org/package/2006/relationships';\n\nvar RELS_ROOT = writextag('Relationships', null, {\n\t//'xmlns:ns0': XMLNS.RELS,\n\t'xmlns': XMLNS.RELS\n});\n\n/* TODO */\nfunction write_rels(rels) {\n\tvar o = [];\n\to[o.length] = (XML_HEADER);\n\to[o.length] = (RELS_ROOT);\n\tkeys(rels['!id']).forEach(function(rid) { var rel = rels['!id'][rid];\n\t\to[o.length] = (writextag('Relationship', null, rel));\n\t});\n\tif(o.length>2){ o[o.length] = ('</Relationships>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* ECMA-376 Part II 11.1 Core Properties Part */\n/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */\nvar CORE_PROPS = [\n\t[\"cp:category\", \"Category\"],\n\t[\"cp:contentStatus\", \"ContentStatus\"],\n\t[\"cp:keywords\", \"Keywords\"],\n\t[\"cp:lastModifiedBy\", \"LastAuthor\"],\n\t[\"cp:lastPrinted\", \"LastPrinted\"],\n\t[\"cp:revision\", \"RevNumber\"],\n\t[\"cp:version\", \"Version\"],\n\t[\"dc:creator\", \"Author\"],\n\t[\"dc:description\", \"Comments\"],\n\t[\"dc:identifier\", \"Identifier\"],\n\t[\"dc:language\", \"Language\"],\n\t[\"dc:subject\", \"Subject\"],\n\t[\"dc:title\", \"Title\"],\n\t[\"dcterms:created\", \"CreatedDate\", 'date'],\n\t[\"dcterms:modified\", \"ModifiedDate\", 'date']\n];\n\nXMLNS.CORE_PROPS = \"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\";\nRELS.CORE_PROPS = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';\n\nvar CORE_PROPS_REGEX = (function() {\n\tvar r = new Array(CORE_PROPS.length);\n\tfor(var i = 0; i < CORE_PROPS.length; ++i) {\n\t\tvar f = CORE_PROPS[i];\n\t\tvar g = \"(?:\"+ f[0].substr(0,f[0].indexOf(\":\")) +\":)\"+ f[0].substr(f[0].indexOf(\":\")+1);\n\t\tr[i] = new RegExp(\"<\" + g + \"[^>]*>(.*)<\\/\" + g + \">\");\n\t}\n\treturn r;\n})();\n\nfunction parse_core_props(data) {\n\tvar p = {};\n\n\tfor(var i = 0; i < CORE_PROPS.length; ++i) {\n\t\tvar f = CORE_PROPS[i], cur = data.match(CORE_PROPS_REGEX[i]);\n\t\tif(cur != null && cur.length > 0) p[f[1]] = cur[1];\n\t\tif(f[2] === 'date' && p[f[1]]) p[f[1]] = new Date(p[f[1]]);\n\t}\n\n\treturn p;\n}\n\nvar CORE_PROPS_XML_ROOT = writextag('cp:coreProperties', null, {\n\t//'xmlns': XMLNS.CORE_PROPS,\n\t'xmlns:cp': XMLNS.CORE_PROPS,\n\t'xmlns:dc': XMLNS.dc,\n\t'xmlns:dcterms': XMLNS.dcterms,\n\t'xmlns:dcmitype': XMLNS.dcmitype,\n\t'xmlns:xsi': XMLNS.xsi\n});\n\nfunction cp_doit(f, g, h, o, p) {\n\tif(p[f] != null || g == null || g === \"\") return;\n\tp[f] = g;\n\to[o.length] = (h ? writextag(f,g,h) : writetag(f,g));\n}\n\nfunction write_core_props(cp, opts) {\n\tvar o = [XML_HEADER, CORE_PROPS_XML_ROOT], p = {};\n\tif(!cp) return o.join(\"\");\n\n\n\tif(cp.CreatedDate != null) cp_doit(\"dcterms:created\", typeof cp.CreatedDate === \"string\" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {\"xsi:type\":\"dcterms:W3CDTF\"}, o, p);\n\tif(cp.ModifiedDate != null) cp_doit(\"dcterms:modified\", typeof cp.ModifiedDate === \"string\" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {\"xsi:type\":\"dcterms:W3CDTF\"}, o, p);\n\n\tfor(var i = 0; i != CORE_PROPS.length; ++i) { var f = CORE_PROPS[i]; cp_doit(f[0], cp[f[1]], null, o, p); }\n\tif(o.length>2){ o[o.length] = ('</cp:coreProperties>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 15.2.12.3 Extended File Properties Part */\n/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */\nvar EXT_PROPS = [\n\t[\"Application\", \"Application\", \"string\"],\n\t[\"AppVersion\", \"AppVersion\", \"string\"],\n\t[\"Company\", \"Company\", \"string\"],\n\t[\"DocSecurity\", \"DocSecurity\", \"string\"],\n\t[\"Manager\", \"Manager\", \"string\"],\n\t[\"HyperlinksChanged\", \"HyperlinksChanged\", \"bool\"],\n\t[\"SharedDoc\", \"SharedDoc\", \"bool\"],\n\t[\"LinksUpToDate\", \"LinksUpToDate\", \"bool\"],\n\t[\"ScaleCrop\", \"ScaleCrop\", \"bool\"],\n\t[\"HeadingPairs\", \"HeadingPairs\", \"raw\"],\n\t[\"TitlesOfParts\", \"TitlesOfParts\", \"raw\"]\n];\n\nXMLNS.EXT_PROPS = \"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\";\nRELS.EXT_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';\n\nfunction parse_ext_props(data, p) {\n\tvar q = {}; if(!p) p = {};\n\n\tEXT_PROPS.forEach(function(f) {\n\t\tswitch(f[2]) {\n\t\t\tcase \"string\": p[f[1]] = (data.match(matchtag(f[0]))||[])[1]; break;\n\t\t\tcase \"bool\": p[f[1]] = (data.match(matchtag(f[0]))||[])[1] === \"true\"; break;\n\t\t\tcase \"raw\":\n\t\t\t\tvar cur = data.match(new RegExp(\"<\" + f[0] + \"[^>]*>(.*)<\\/\" + f[0] + \">\"));\n\t\t\t\tif(cur && cur.length > 0) q[f[1]] = cur[1];\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(q.HeadingPairs && q.TitlesOfParts) {\n\t\tvar v = parseVector(q.HeadingPairs);\n\t\tvar j = 0, widx = 0;\n\t\tfor(var i = 0; i !== v.length; ++i) {\n\t\t\tswitch(v[i].v) {\n\t\t\t\tcase \"Worksheets\": widx = j; p.Worksheets = +(v[++i].v); break;\n\t\t\t\tcase \"Named Ranges\": ++i; break; // TODO: Handle Named Ranges\n\t\t\t}\n\t\t}\n\t\tvar parts = parseVector(q.TitlesOfParts).map(function(x) { return utf8read(x.v); });\n\t\tp.SheetNames = parts.slice(widx, widx + p.Worksheets);\n\t}\n\treturn p;\n}\n\nvar EXT_PROPS_XML_ROOT = writextag('Properties', null, {\n\t'xmlns': XMLNS.EXT_PROPS,\n\t'xmlns:vt': XMLNS.vt\n});\n\nfunction write_ext_props(cp, opts) {\n\tvar o = [], p = {}, W = writextag;\n\tif(!cp) cp = {};\n\tcp.Application = \"SheetJS\";\n\to[o.length] = (XML_HEADER);\n\to[o.length] = (EXT_PROPS_XML_ROOT);\n\n\tEXT_PROPS.forEach(function(f) {\n\t\tif(cp[f[1]] === undefined) return;\n\t\tvar v;\n\t\tswitch(f[2]) {\n\t\t\tcase 'string': v = cp[f[1]]; break;\n\t\t\tcase 'bool': v = cp[f[1]] ? 'true' : 'false'; break;\n\t\t}\n\t\tif(v !== undefined) o[o.length] = (W(f[0], v));\n\t});\n\n\t/* TODO: HeadingPairs, TitlesOfParts */\n\to[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', '<vt:lpstr>Worksheets</vt:lpstr>')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:\"variant\"})));\n\to[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return \"<vt:lpstr>\" + s + \"</vt:lpstr>\"; }).join(\"\"), {size: cp.Worksheets, baseType:\"lpstr\"})));\n\tif(o.length>2){ o[o.length] = ('</Properties>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 15.2.12.2 Custom File Properties Part */\nXMLNS.CUST_PROPS = \"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\";\nRELS.CUST_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties';\n\nvar custregex = /<[^>]+>[^<]*/g;\nfunction parse_cust_props(data, opts) {\n\tvar p = {}, name;\n\tvar m = data.match(custregex);\n\tif(m) for(var i = 0; i != m.length; ++i) {\n\t\tvar x = m[i], y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '<?xml': break;\n\t\t\tcase '<Properties':\n\t\t\t\tif(y.xmlns !== XMLNS.CUST_PROPS) throw \"unrecognized xmlns \" + y.xmlns;\n\t\t\t\tif(y.xmlnsvt && y.xmlnsvt !== XMLNS.vt) throw \"unrecognized vt \" + y.xmlnsvt;\n\t\t\t\tbreak;\n\t\t\tcase '<property': name = y.name; break;\n\t\t\tcase '</property>': name = null; break;\n\t\t\tdefault: if (x.indexOf('<vt:') === 0) {\n\t\t\t\tvar toks = x.split('>');\n\t\t\t\tvar type = toks[0].substring(4), text = toks[1];\n\t\t\t\t/* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase 'lpstr': case 'lpwstr': case 'bstr': case 'lpwstr':\n\t\t\t\t\t\tp[name] = unescapexml(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\tp[name] = parsexmlbool(text, '<vt:bool>');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint':\n\t\t\t\t\t\tp[name] = parseInt(text, 10);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'r4': case 'r8': case 'decimal':\n\t\t\t\t\t\tp[name] = parseFloat(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'filetime': case 'date':\n\t\t\t\t\t\tp[name] = new Date(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cy': case 'error':\n\t\t\t\t\t\tp[name] = unescapexml(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);\n\t\t\t\t}\n\t\t\t} else if(x.substr(0,2) === \"</\") {\n\t\t\t} else if(opts.WTF) throw new Error(x);\n\t\t}\n\t}\n\treturn p;\n}\n\nvar CUST_PROPS_XML_ROOT = writextag('Properties', null, {\n\t'xmlns': XMLNS.CUST_PROPS,\n\t'xmlns:vt': XMLNS.vt\n});\n\nfunction write_cust_props(cp, opts) {\n\tvar o = [XML_HEADER, CUST_PROPS_XML_ROOT];\n\tif(!cp) return o.join(\"\");\n\tvar pid = 1;\n\tkeys(cp).forEach(function custprop(k) { ++pid;\n\t\to[o.length] = (writextag('property', write_vt(cp[k]), {\n\t\t\t'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',\n\t\t\t'pid': pid,\n\t\t\t'name': k\n\t\t}));\n\t});\n\tif(o.length>2){ o[o.length] = '</Properties>'; o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\nfunction xlml_set_prop(Props, tag, val) {\n\t/* TODO: Normalize the properties */\n\tswitch(tag) {\n\t\tcase 'Description': tag = 'Comments'; break;\n\t}\n\tProps[tag] = val;\n}\n\n/* [MS-DTYP] 2.3.3 FILETIME */\n/* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */\n/* [MS-OLEPS] 2.8 FILETIME (Packet Version) */\nfunction parse_FILETIME(blob) {\n\tvar dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);\n\treturn new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\\.000/,\"\");\n}\n\n/* [MS-OSHARED] 2.3.3.1.4 Lpstr */\nfunction parse_lpstr(blob, type, pad) {\n\tvar str = blob.read_shift(0, 'lpstr');\n\tif(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;\n\treturn str;\n}\n\n/* [MS-OSHARED] 2.3.3.1.6 Lpwstr */\nfunction parse_lpwstr(blob, type, pad) {\n\tvar str = blob.read_shift(0, 'lpwstr');\n\tif(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;\n\treturn str;\n}\n\n\n/* [MS-OSHARED] 2.3.3.1.11 VtString */\n/* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */\nfunction parse_VtStringBase(blob, stringType, pad) {\n\tif(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob);\n\treturn parse_lpstr(blob, stringType, pad);\n}\n\nfunction parse_VtString(blob, t, pad) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); }\nfunction parse_VtUnalignedString(blob, t) { if(!t) throw new Error(\"dafuq?\"); return parse_VtStringBase(blob, t, 0); }\n\n/* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */\nfunction parse_VtVecUnalignedLpstrValue(blob) {\n\tvar length = blob.read_shift(4);\n\tvar ret = [];\n\tfor(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr');\n\treturn ret;\n}\n\n/* [MS-OSHARED] 2.3.3.1.10 VtVecUnalignedLpstr */\nfunction parse_VtVecUnalignedLpstr(blob) {\n\treturn parse_VtVecUnalignedLpstrValue(blob);\n}\n\n/* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */\nfunction parse_VtHeadingPair(blob) {\n\tvar headingString = parse_TypedPropertyValue(blob, VT_USTR);\n\tvar headerParts = parse_TypedPropertyValue(blob, VT_I4);\n\treturn [headingString, headerParts];\n}\n\n/* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */\nfunction parse_VtVecHeadingPairValue(blob) {\n\tvar cElements = blob.read_shift(4);\n\tvar out = [];\n\tfor(var i = 0; i != cElements / 2; ++i) out.push(parse_VtHeadingPair(blob));\n\treturn out;\n}\n\n/* [MS-OSHARED] 2.3.3.1.15 VtVecHeadingPair */\nfunction parse_VtVecHeadingPair(blob) {\n\t// NOTE: When invoked, wType & padding were already consumed\n\treturn parse_VtVecHeadingPairValue(blob);\n}\n\n/* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */\nfunction parse_dictionary(blob,CodePage) {\n\tvar cnt = blob.read_shift(4);\n\tvar dict = {};\n\tfor(var j = 0; j != cnt; ++j) {\n\t\tvar pid = blob.read_shift(4);\n\t\tvar len = blob.read_shift(4);\n\t\tdict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!');\n\t}\n\tif(blob.l & 3) blob.l = (blob.l>>2+1)<<2;\n\treturn dict;\n}\n\n/* [MS-OLEPS] 2.9 BLOB */\nfunction parse_BLOB(blob) {\n\tvar size = blob.read_shift(4);\n\tvar bytes = blob.slice(blob.l,blob.l+size);\n\tif(size & 3 > 0) blob.l += (4 - (size & 3)) & 3;\n\treturn bytes;\n}\n\n/* [MS-OLEPS] 2.11 ClipboardData */\nfunction parse_ClipboardData(blob) {\n\t// TODO\n\tvar o = {};\n\to.Size = blob.read_shift(4);\n\t//o.Format = blob.read_shift(4);\n\tblob.l += o.Size;\n\treturn o;\n}\n\n/* [MS-OLEPS] 2.14 Vector and Array Property Types */\nfunction parse_VtVector(blob, cb) {\n\t/* [MS-OLEPS] 2.14.2 VectorHeader */\n/*\tvar Length = blob.read_shift(4);\n\tvar o = [];\n\tfor(var i = 0; i != Length; ++i) {\n\t\to.push(cb(blob));\n\t}\n\treturn o;*/\n}\n\n/* [MS-OLEPS] 2.15 TypedPropertyValue */\nfunction parse_TypedPropertyValue(blob, type, _opts) {\n\tvar t = blob.read_shift(2), ret, opts = _opts||{};\n\tblob.l += 2;\n\tif(type !== VT_VARIANT)\n\tif(t !== type && VT_CUSTOM.indexOf(type)===-1) throw new Error('Expected type ' + type + ' saw ' + t);\n\tswitch(type === VT_VARIANT ? t : type) {\n\t\tcase 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;\n\t\tcase 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;\n\t\tcase 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;\n\t\tcase 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;\n\t\tcase 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,'');\n\t\tcase 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob);\n\t\tcase 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);\n\t\tcase 0x41 /*VT_BLOB*/: return parse_BLOB(blob);\n\t\tcase 0x47 /*VT_CF*/: return parse_ClipboardData(blob);\n\t\tcase 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw && 4).replace(chr0,'');\n\t\tcase 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t, 4).replace(chr0,'');\n\t\tcase 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPair(blob);\n\t\tcase 0x101E /*VT_LPSTR*/: return parse_VtVecUnalignedLpstr(blob);\n\t\tdefault: throw new Error(\"TypedPropertyValue unrecognized type \" + type + \" \" + t);\n\t}\n}\n/* [MS-OLEPS] 2.14.2 VectorHeader */\n/*function parse_VTVectorVariant(blob) {\n\tvar Length = blob.read_shift(4);\n\n\tif(Length & 1 !== 0) throw new Error(\"VectorHeader Length=\" + Length + \" must be even\");\n\tvar o = [];\n\tfor(var i = 0; i != Length; ++i) {\n\t\to.push(parse_TypedPropertyValue(blob, VT_VARIANT));\n\t}\n\treturn o;\n}*/\n\n/* [MS-OLEPS] 2.20 PropertySet */\nfunction parse_PropertySet(blob, PIDSI) {\n\tvar start_addr = blob.l;\n\tvar size = blob.read_shift(4);\n\tvar NumProps = blob.read_shift(4);\n\tvar Props = [], i = 0;\n\tvar CodePage = 0;\n\tvar Dictionary = -1, DictObj;\n\tfor(i = 0; i != NumProps; ++i) {\n\t\tvar PropID = blob.read_shift(4);\n\t\tvar Offset = blob.read_shift(4);\n\t\tProps[i] = [PropID, Offset + start_addr];\n\t}\n\tvar PropH = {};\n\tfor(i = 0; i != NumProps; ++i) {\n\t\tif(blob.l !== Props[i][1]) {\n\t\t\tvar fail = true;\n\t\t\tif(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) {\n\t\t\t\tcase 0x02 /*VT_I2*/: if(blob.l +2 === Props[i][1]) { blob.l+=2; fail = false; } break;\n\t\t\t\tcase 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;\n\t\t\t\tcase 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;\n\t\t\t}\n\t\t\tif(!PIDSI && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; }\n\t\t\tif(fail) throw new Error(\"Read Error: Expected address \" + Props[i][1] + ' at ' + blob.l + ' :' + i);\n\t\t}\n\t\tif(PIDSI) {\n\t\t\tvar piddsi = PIDSI[Props[i][0]];\n\t\t\tPropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true});\n\t\t\tif(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + \".\" + String(PropH[piddsi.n] & 0xFFFF);\n\t\t\tif(piddsi.n == \"CodePage\") switch(PropH[piddsi.n]) {\n\t\t\t\tcase 0: PropH[piddsi.n] = 1252;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 10000: // OSX Roman\n\t\t\t\tcase 1252: // Windows Latin\n\n\t\t\t\tcase 874: // SB Windows Thai\n\t\t\t\tcase 1250: // SB Windows Central Europe\n\t\t\t\tcase 1251: // SB Windows Cyrillic\n\t\t\t\tcase 1253: // SB Windows Greek\n\t\t\t\tcase 1254: // SB Windows Turkish\n\t\t\t\tcase 1255: // SB Windows Hebrew\n\t\t\t\tcase 1256: // SB Windows Arabic\n\t\t\t\tcase 1257: // SB Windows Baltic\n\t\t\t\tcase 1258: // SB Windows Vietnam\n\n\t\t\t\tcase 932: // DB Windows Japanese Shift-JIS\n\t\t\t\tcase 936: // DB Windows Simplified Chinese GBK\n\t\t\t\tcase 949: // DB Windows Korean\n\t\t\t\tcase 950: // DB Windows Traditional Chinese Big5\n\n\t\t\t\tcase 1200: // UTF16LE\n\t\t\t\tcase 1201: // UTF16BE\n\t\t\t\tcase 65000: case -536: // UTF-7\n\t\t\t\tcase 65001: case -535: // UTF-8\n\t\t\t\t\tset_cp(CodePage = PropH[piddsi.n]); break;\n\t\t\t\tdefault: throw new Error(\"Unsupported CodePage: \" + PropH[piddsi.n]);\n\t\t\t}\n\t\t} else {\n\t\t\tif(Props[i][0] === 0x1) {\n\t\t\t\tCodePage = PropH.CodePage = parse_TypedPropertyValue(blob, VT_I2);\n\t\t\t\tset_cp(CodePage);\n\t\t\t\tif(Dictionary !== -1) {\n\t\t\t\t\tvar oldpos = blob.l;\n\t\t\t\t\tblob.l = Props[Dictionary][1];\n\t\t\t\t\tDictObj = parse_dictionary(blob,CodePage);\n\t\t\t\t\tblob.l = oldpos;\n\t\t\t\t}\n\t\t\t} else if(Props[i][0] === 0) {\n\t\t\t\tif(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; }\n\t\t\t\tDictObj = parse_dictionary(blob,CodePage);\n\t\t\t} else {\n\t\t\t\tvar name = DictObj[Props[i][0]];\n\t\t\t\tvar val;\n\t\t\t\t/* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */\n\t\t\t\tswitch(blob[blob.l]) {\n\t\t\t\t\tcase 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break;\n\t\t\t\t\tcase 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]); break;\n\t\t\t\t\tcase 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]); break;\n\t\t\t\t\tcase 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break;\n\t\t\t\t\tcase 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break;\n\t\t\t\t\tcase 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break;\n\t\t\t\t\tcase 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break;\n\t\t\t\t\tcase 0x40 /*VT_FILETIME*/: blob.l += 4; val = new Date(parse_FILETIME(blob)); break;\n\t\t\t\t\tdefault: throw new Error(\"unparsed value: \" + blob[blob.l]);\n\t\t\t\t}\n\t\t\t\tPropH[name] = val;\n\t\t\t}\n\t\t}\n\t}\n\tblob.l = start_addr + size; /* step ahead to skip padding */\n\treturn PropH;\n}\n\n/* [MS-OLEPS] 2.21 PropertySetStream */\nfunction parse_PropertySetStream(file, PIDSI) {\n\tvar blob = file.content;\n\tprep_blob(blob, 0);\n\n\tvar NumSets, FMTID0, FMTID1, Offset0, Offset1;\n\tblob.chk('feff', 'Byte Order: ');\n\n\tvar vers = blob.read_shift(2); // TODO: check version\n\tvar SystemIdentifier = blob.read_shift(4);\n\tblob.chk(CFB.utils.consts.HEADER_CLSID, 'CLSID: ');\n\tNumSets = blob.read_shift(4);\n\tif(NumSets !== 1 && NumSets !== 2) throw \"Unrecognized #Sets: \" + NumSets;\n\tFMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4);\n\n\tif(NumSets === 1 && Offset0 !== blob.l) throw \"Length mismatch\";\n\telse if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); }\n\tvar PSet0 = parse_PropertySet(blob, PIDSI);\n\n\tvar rval = { SystemIdentifier: SystemIdentifier };\n\tfor(var y in PSet0) rval[y] = PSet0[y];\n\t//rval.blob = blob;\n\trval.FMTID = FMTID0;\n\t//rval.PSet0 = PSet0;\n\tif(NumSets === 1) return rval;\n\tif(blob.l !== Offset1) throw \"Length mismatch 2: \" + blob.l + \" !== \" + Offset1;\n\tvar PSet1;\n\ttry { PSet1 = parse_PropertySet(blob, null); } catch(e) { }\n\tfor(y in PSet1) rval[y] = PSet1[y];\n\trval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1\n\treturn rval;\n}\n\n\nfunction parsenoop2(blob, length) { blob.read_shift(length); return null; }\n\nfunction parslurp(blob, length, cb) {\n\tvar arr = [], target = blob.l + length;\n\twhile(blob.l < target) arr.push(cb(blob, target - blob.l));\n\tif(target !== blob.l) throw new Error(\"Slurp error\");\n\treturn arr;\n}\n\nfunction parslurp2(blob, length, cb) {\n\tvar arr = [], target = blob.l + length, len = blob.read_shift(2);\n\twhile(len-- !== 0) arr.push(cb(blob, target - blob.l));\n\tif(target !== blob.l) throw new Error(\"Slurp error\");\n\treturn arr;\n}\n\nfunction parsebool(blob, length) { return blob.read_shift(length) === 0x1; }\n\nfunction parseuint16(blob) { return blob.read_shift(2, 'u'); }\nfunction parseuint16a(blob, length) { return parslurp(blob,length,parseuint16);}\n\n/* --- 2.5 Structures --- */\n\n/* [MS-XLS] 2.5.14 Boolean */\nvar parse_Boolean = parsebool;\n\n/* [MS-XLS] 2.5.10 Bes (boolean or error) */\nfunction parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}\n\n/* [MS-XLS] 2.5.240 ShortXLUnicodeString */\nfunction parse_ShortXLUnicodeString(blob, length, opts) {\n\tvar cch = blob.read_shift(1);\n\tvar width = 1, encoding = 'sbcs-cont';\n\tvar cp = current_codepage;\n\tif(opts && opts.biff >= 8) current_codepage = 1200;\n\tif(opts === undefined || opts.biff !== 5) {\n\t\tvar fHighByte = blob.read_shift(1);\n\t\tif(fHighByte) { width = 2; encoding = 'dbcs-cont'; }\n\t}\n\tvar o = cch ? blob.read_shift(cch, encoding) : \"\";\n\tcurrent_codepage = cp;\n\treturn o;\n}\n\n/* 2.5.293 XLUnicodeRichExtendedString */\nfunction parse_XLUnicodeRichExtendedString(blob) {\n\tvar cp = current_codepage;\n\tcurrent_codepage = 1200;\n\tvar cch = blob.read_shift(2), flags = blob.read_shift(1);\n\tvar fHighByte = flags & 0x1, fExtSt = flags & 0x4, fRichSt = flags & 0x8;\n\tvar width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs\n\tvar cRun, cbExtRst;\n\tvar z = {};\n\tif(fRichSt) cRun = blob.read_shift(2);\n\tif(fExtSt) cbExtRst = blob.read_shift(4);\n\tvar encoding = (flags & 0x1) ? 'dbcs-cont' : 'sbcs-cont';\n\tvar msg = cch === 0 ? \"\" : blob.read_shift(cch, encoding);\n\tif(fRichSt) blob.l += 4 * cRun; //TODO: parse this\n\tif(fExtSt) blob.l += cbExtRst; //TODO: parse this\n\tz.t = msg;\n\tif(!fRichSt) { z.raw = \"<t>\" + z.t + \"</t>\"; z.r = z.t; }\n\tcurrent_codepage = cp;\n\treturn z;\n}\n\n/* 2.5.296 XLUnicodeStringNoCch */\nfunction parse_XLUnicodeStringNoCch(blob, cch, opts) {\n\tvar retval;\n\tvar fHighByte = blob.read_shift(1);\n\tif(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); }\n\telse { retval = blob.read_shift(cch, 'dbcs-cont'); }\n\treturn retval;\n}\n\n/* 2.5.294 XLUnicodeString */\nfunction parse_XLUnicodeString(blob, length, opts) {\n\tvar cch = blob.read_shift(opts !== undefined && opts.biff > 0 && opts.biff < 8 ? 1 : 2);\n\tif(cch === 0) { blob.l++; return \"\"; }\n\treturn parse_XLUnicodeStringNoCch(blob, cch, opts);\n}\n/* BIFF5 override */\nfunction parse_XLUnicodeString2(blob, length, opts) {\n\tif(opts.biff !== 5 && opts.biff !== 2) return parse_XLUnicodeString(blob, length, opts);\n\tvar cch = blob.read_shift(1);\n\tif(cch === 0) { blob.l++; return \"\"; }\n\treturn blob.read_shift(cch, 'sbcs-cont');\n}\n\n/* [MS-XLS] 2.5.61 ControlInfo */\nvar parse_ControlInfo = parsenoop;\n\n/* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */\nvar parse_URLMoniker = function(blob, length) {\n\tvar len = blob.read_shift(4), start = blob.l;\n\tvar extra = false;\n\tif(len > 24) {\n\t\t/* look ahead */\n\t\tblob.l += len - 24;\n\t\tif(blob.read_shift(16) === \"795881f43b1d7f48af2c825dc4852763\") extra = true;\n\t\tblob.l = start;\n\t}\n\tvar url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,\"\");\n\tif(extra) blob.l += 24;\n\treturn url;\n};\n\n/* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */\nvar parse_FileMoniker = function(blob, length) {\n\tvar cAnti = blob.read_shift(2);\n\tvar ansiLength = blob.read_shift(4);\n\tvar ansiPath = blob.read_shift(ansiLength, 'cstr');\n\tvar endServer = blob.read_shift(2);\n\tvar versionNumber = blob.read_shift(2);\n\tvar cbUnicodePathSize = blob.read_shift(4);\n\tif(cbUnicodePathSize === 0) return ansiPath.replace(/\\\\/g,\"/\");\n\tvar cbUnicodePathBytes = blob.read_shift(4);\n\tvar usKeyValue = blob.read_shift(2);\n\tvar unicodePath = blob.read_shift(cbUnicodePathBytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn unicodePath;\n};\n\n/* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */\nvar parse_HyperlinkMoniker = function(blob, length) {\n\tvar clsid = blob.read_shift(16); length -= 16;\n\tswitch(clsid) {\n\t\tcase \"e0c9ea79f9bace118c8200aa004ba90b\": return parse_URLMoniker(blob, length);\n\t\tcase \"0303000000000000c000000000000046\": return parse_FileMoniker(blob, length);\n\t\tdefault: throw \"unsupported moniker \" + clsid;\n\t}\n};\n\n/* [MS-OSHARED] 2.3.7.9 HyperlinkString */\nvar parse_HyperlinkString = function(blob, length) {\n\tvar len = blob.read_shift(4);\n\tvar o = blob.read_shift(len, 'utf16le').replace(chr0, \"\");\n\treturn o;\n};\n\n/* [MS-OSHARED] 2.3.7.1 Hyperlink Object TODO: unify params with XLSX */\nvar parse_Hyperlink = function(blob, length) {\n\tvar end = blob.l + length;\n\tvar sVer = blob.read_shift(4);\n\tif(sVer !== 2) throw new Error(\"Unrecognized streamVersion: \" + sVer);\n\tvar flags = blob.read_shift(2);\n\tblob.l += 2;\n\tvar displayName, targetFrameName, moniker, oleMoniker, location, guid, fileTime;\n\tif(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);\n\tif(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);\n\tif((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);\n\tif((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);\n\tif(flags & 0x0008) location = parse_HyperlinkString(blob, end - blob.l);\n\tif(flags & 0x0020) guid = blob.read_shift(16);\n\tif(flags & 0x0040) fileTime = parse_FILETIME(blob, 8);\n\tblob.l = end;\n\tvar target = (targetFrameName||moniker||oleMoniker);\n\tif(location) target+=\"#\"+location;\n\treturn {Target: target};\n};\n\n/* 2.5.178 LongRGBA */\nfunction parse_LongRGBA(blob, length) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; }\n\n/* 2.5.177 LongRGB */\nfunction parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; }\n\n\n/* --- MS-XLS --- */\n\n/* 2.5.19 */\nfunction parse_XLSCell(blob, length) {\n\tvar rw = blob.read_shift(2); // 0-indexed\n\tvar col = blob.read_shift(2);\n\tvar ixfe = blob.read_shift(2);\n\treturn {r:rw, c:col, ixfe:ixfe};\n}\n\n/* 2.5.134 */\nfunction parse_frtHeader(blob) {\n\tvar rt = blob.read_shift(2);\n\tvar flags = blob.read_shift(2); // TODO: parse these flags\n\tblob.l += 8;\n\treturn {type: rt, flags: flags};\n}\n\n\n\nfunction parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? \"\" : parse_XLUnicodeString2(blob, length, opts); }\n\n/* 2.5.158 */\nvar HIDEOBJENUM = ['SHOWALL', 'SHOWPLACEHOLDER', 'HIDEALL'];\nvar parse_HideObjEnum = parseuint16;\n\n/* 2.5.344 */\nfunction parse_XTI(blob, length) {\n\tvar iSupBook = blob.read_shift(2), itabFirst = blob.read_shift(2,'i'), itabLast = blob.read_shift(2,'i');\n\treturn [iSupBook, itabFirst, itabLast];\n}\n\n/* 2.5.218 */\nfunction parse_RkRec(blob, length) {\n\tvar ixfe = blob.read_shift(2);\n\tvar RK = parse_RkNumber(blob);\n\t//console.log(\"::\", ixfe, RK,\";;\");\n\treturn [ixfe, RK];\n}\n\n/* 2.5.1 */\nfunction parse_AddinUdf(blob, length) {\n\tblob.l += 4; length -= 4;\n\tvar l = blob.l + length;\n\tvar udfName = parse_ShortXLUnicodeString(blob, length);\n\tvar cb = blob.read_shift(2);\n\tl -= blob.l;\n\tif(cb !== l) throw \"Malformed AddinUdf: padding = \" + l + \" != \" + cb;\n\tblob.l += cb;\n\treturn udfName;\n}\n\n/* 2.5.209 TODO: Check sizes */\nfunction parse_Ref8U(blob, length) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(2);\n\tvar colLast = blob.read_shift(2);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}\n\n/* 2.5.211 */\nfunction parse_RefU(blob, length) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(1);\n\tvar colLast = blob.read_shift(1);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}\n\n/* 2.5.207 */\nvar parse_Ref = parse_RefU;\n\n/* 2.5.143 */\nfunction parse_FtCmo(blob, length) {\n\tblob.l += 4;\n\tvar ot = blob.read_shift(2);\n\tvar id = blob.read_shift(2);\n\tvar flags = blob.read_shift(2);\n\tblob.l+=12;\n\treturn [id, ot, flags];\n}\n\n/* 2.5.149 */\nfunction parse_FtNts(blob, length) {\n\tvar out = {};\n\tblob.l += 4;\n\tblob.l += 16; // GUID TODO\n\tout.fSharedNote = blob.read_shift(2);\n\tblob.l += 4;\n\treturn out;\n}\n\n/* 2.5.142 */\nfunction parse_FtCf(blob, length) {\n\tvar out = {};\n\tblob.l += 4;\n\tblob.cf = blob.read_shift(2);\n\treturn out;\n}\n\n/* 2.5.140 - 2.5.154 and friends */\nvar FtTab = {\n\t0x15: parse_FtCmo,\n\t0x13: parsenoop, /* FtLbsData */\n\t0x12: function(blob, length) { blob.l += 12; }, /* FtCblsData */\n\t0x11: function(blob, length) { blob.l += 8; }, /* FtRboData */\n\t0x10: parsenoop, /* FtEdoData */\n\t0x0F: parsenoop, /* FtGboData */\n\t0x0D: parse_FtNts, /* FtNts */\n\t0x0C: function(blob, length) { blob.l += 24; }, /* FtSbs */\n\t0x0B: function(blob, length) { blob.l += 10; }, /* FtRbo */\n\t0x0A: function(blob, length) { blob.l += 16; }, /* FtCbls */\n\t0x09: parsenoop, /* FtPictFmla */\n\t0x08: function(blob, length) { blob.l += 6; }, /* FtPioGrbit */\n\t0x07: parse_FtCf, /* FtCf */\n\t0x06: function(blob, length) { blob.l += 6; }, /* FtGmo */\n\t0x04: parsenoop, /* FtMacro */\n\t0x00: function(blob, length) { blob.l += 4; } /* FtEnding */\n};\nfunction parse_FtArray(blob, length, ot) {\n\tvar s = blob.l;\n\tvar fts = [];\n\twhile(blob.l < s + length) {\n\t\tvar ft = blob.read_shift(2);\n\t\tblob.l-=2;\n\t\ttry {\n\t\t\tfts.push(FtTab[ft](blob, s + length - blob.l));\n\t\t} catch(e) { blob.l = s + length; return fts; }\n\t}\n\tif(blob.l != s + length) blob.l = s + length; //throw \"bad Object Ft-sequence\";\n\treturn fts;\n}\n\n/* 2.5.129 */\nvar parse_FontIndex = parseuint16;\n\n/* --- 2.4 Records --- */\n\n/* 2.4.21 */\nfunction parse_BOF(blob, length) {\n\tvar o = {};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: throw \"Unexpected BIFF Ver \" + o.BIFFVer;\n\t}\n\tblob.read_shift(length);\n\treturn o;\n}\n\n\n/* 2.4.146 */\nfunction parse_InterfaceHdr(blob, length) {\n\tif(length === 0) return 0x04b0;\n\tvar q;\n\tif((q=blob.read_shift(2))!==0x04b0) throw 'InterfaceHdr codePage ' + q;\n\treturn 0x04b0;\n}\n\n\n/* 2.4.349 */\nfunction parse_WriteAccess(blob, length, opts) {\n\tif(opts.enc) { blob.l += length; return \"\"; }\n\tvar l = blob.l;\n\t// TODO: make sure XLUnicodeString doesnt overrun\n\tvar UserName = parse_XLUnicodeString(blob, 0, opts);\n\tblob.read_shift(length + l - blob.l);\n\treturn UserName;\n}\n\n/* 2.4.28 */\nfunction parse_BoundSheet8(blob, length, opts) {\n\tvar pos = blob.read_shift(4);\n\tvar hidden = blob.read_shift(1) >> 6;\n\tvar dt = blob.read_shift(1);\n\tswitch(dt) {\n\t\tcase 0: dt = 'Worksheet'; break;\n\t\tcase 1: dt = 'Macrosheet'; break;\n\t\tcase 2: dt = 'Chartsheet'; break;\n\t\tcase 6: dt = 'VBAModule'; break;\n\t}\n\tvar name = parse_ShortXLUnicodeString(blob, 0, opts);\n\tif(name.length === 0) name = \"Sheet1\";\n\treturn { pos:pos, hs:hidden, dt:dt, name:name };\n}\n\n/* 2.4.265 TODO */\nfunction parse_SST(blob, length) {\n\tvar cnt = blob.read_shift(4);\n\tvar ucnt = blob.read_shift(4);\n\tvar strs = [];\n\tfor(var i = 0; i != ucnt; ++i) {\n\t\tstrs.push(parse_XLUnicodeRichExtendedString(blob));\n\t}\n\tstrs.Count = cnt; strs.Unique = ucnt;\n\treturn strs;\n}\n\n/* 2.4.107 */\nfunction parse_ExtSST(blob, length) {\n\tvar extsst = {};\n\textsst.dsst = blob.read_shift(2);\n\tblob.l += length-2;\n\treturn extsst;\n}\n\n\n/* 2.4.221 TODO*/\nfunction parse_Row(blob, length) {\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2), Col = blob.read_shift(2), rht = blob.read_shift(2);\n\tblob.read_shift(4); // reserved(2), unused(2)\n\tvar flags = blob.read_shift(1); // various flags\n\tblob.read_shift(1); // reserved\n\tblob.read_shift(2); //ixfe, other flags\n\treturn {r:rw, c:col, cnt:Col-col};\n}\n\n\n/* 2.4.125 */\nfunction parse_ForceFullCalculation(blob, length) {\n\tvar header = parse_frtHeader(blob);\n\tif(header.type != 0x08A3) throw \"Invalid Future Record \" + header.type;\n\tvar fullcalc = blob.read_shift(4);\n\treturn fullcalc !== 0x0;\n}\n\n\nvar parse_CompressPictures = parsenoop2; /* 2.4.55 Not interesting */\n\n\n\n/* 2.4.215 rt */\nfunction parse_RecalcId(blob, length) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}\n\n/* 2.4.87 */\nfunction parse_DefaultRowHeight (blob, length) {\n\tvar f = blob.read_shift(2), miyRw;\n\tmiyRw = blob.read_shift(2); // flags & 0x02 -> hidden, else empty\n\tvar fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};\n\treturn [fl, miyRw];\n}\n\n/* 2.4.345 TODO */\nfunction parse_Window1(blob, length) {\n\tvar xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2);\n\tvar ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2);\n\treturn { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur,\n\t\tFirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio };\n}\n\n/* 2.4.122 TODO */\nfunction parse_Font(blob, length, opts) {\n\tblob.l += 14;\n\tvar name = parse_ShortXLUnicodeString(blob, 0, opts);\n\treturn name;\n}\n\n/* 2.4.149 */\nfunction parse_LabelSst(blob, length) {\n\tvar cell = parse_XLSCell(blob);\n\tcell.isst = blob.read_shift(4);\n\treturn cell;\n}\n\n/* 2.4.148 */\nfunction parse_Label(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 6);\n\tvar str = parse_XLUnicodeString(blob, length-6, opts);\n\tcell.val = str;\n\treturn cell;\n}\n\n/* 2.4.126 Number Formats */\nfunction parse_Format(blob, length, opts) {\n\tvar ifmt = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [ifmt, fmtstr];\n}\n\n/* 2.4.90 */\nfunction parse_Dimensions(blob, length) {\n\tvar w = length === 10 ? 2 : 4;\n\tvar r = blob.read_shift(w), R = blob.read_shift(w),\n\t c = blob.read_shift(2), C = blob.read_shift(2);\n\tblob.l += 2;\n\treturn {s: {r:r, c:c}, e: {r:R, c:C}};\n}\n\n/* 2.4.220 */\nfunction parse_RK(blob, length) {\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2);\n\tvar rkrec = parse_RkRec(blob);\n\treturn {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]};\n}\n\n/* 2.4.175 */\nfunction parse_MulRk(blob, length) {\n\tvar target = blob.l + length - 2;\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2);\n\tvar rkrecs = [];\n\twhile(blob.l < target) rkrecs.push(parse_RkRec(blob));\n\tif(blob.l !== target) throw \"MulRK read error\";\n\tvar lastcol = blob.read_shift(2);\n\tif(rkrecs.length != lastcol - col + 1) throw \"MulRK length mismatch\";\n\treturn {r:rw, c:col, C:lastcol, rkrec:rkrecs};\n}\n\n/* 2.5.20 2.5.249 TODO */\nfunction parse_CellStyleXF(blob, length, style) {\n\tvar o = {};\n\tvar a = blob.read_shift(4), b = blob.read_shift(4);\n\tvar c = blob.read_shift(4), d = blob.read_shift(2);\n\to.patternType = XLSFillPattern[c >> 26];\n\to.icvFore = d & 0x7F;\n\to.icvBack = (d >> 7) & 0x7F;\n\treturn o;\n}\nfunction parse_CellXF(blob, length) {return parse_CellStyleXF(blob,length,0);}\nfunction parse_StyleXF(blob, length) {return parse_CellStyleXF(blob,length,1);}\n\n/* 2.4.353 TODO: actually do this right */\nfunction parse_XF(blob, length) {\n\tvar o = {};\n\to.ifnt = blob.read_shift(2); o.ifmt = blob.read_shift(2); o.flags = blob.read_shift(2);\n\to.fStyle = (o.flags >> 2) & 0x01;\n\tlength -= 6;\n\to.data = parse_CellStyleXF(blob, length, o.fStyle);\n\treturn o;\n}\n\n/* 2.4.134 */\nfunction parse_Guts(blob, length) {\n\tblob.l += 4;\n\tvar out = [blob.read_shift(2), blob.read_shift(2)];\n\tif(out[0] !== 0) out[0]--;\n\tif(out[1] !== 0) out[1]--;\n\tif(out[0] > 7 || out[1] > 7) throw \"Bad Gutters: \" + out;\n\treturn out;\n}\n\n/* 2.4.24 */\nfunction parse_BoolErr(blob, length) {\n\tvar cell = parse_XLSCell(blob, 6);\n\tvar val = parse_Bes(blob, 2);\n\tcell.val = val;\n\tcell.t = (val === true || val === false) ? 'b' : 'e';\n\treturn cell;\n}\n\n/* 2.4.180 Number */\nfunction parse_Number(blob, length) {\n\tvar cell = parse_XLSCell(blob, 6);\n\tvar xnum = parse_Xnum(blob, 8);\n\tcell.val = xnum;\n\treturn cell;\n}\n\nvar parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136\n\n/* 2.4.271 */\nfunction parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}\n\n/* 2.4.105 TODO */\nfunction parse_ExternName(blob, length, opts) {\n\tvar flags = blob.read_shift(2);\n\tvar body;\n\tvar o = {\n\t\tfBuiltIn: flags & 0x01,\n\t\tfWantAdvise: (flags >>> 1) & 0x01,\n\t\tfWantPict: (flags >>> 2) & 0x01,\n\t\tfOle: (flags >>> 3) & 0x01,\n\t\tfOleLink: (flags >>> 4) & 0x01,\n\t\tcf: (flags >>> 5) & 0x3FF,\n\t\tfIcon: flags >>> 15 & 0x01\n\t};\n\tif(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2);\n\t//else throw new Error(\"unsupported SupBook cch: \" + opts.sbcch);\n\to.body = body || blob.read_shift(length-2);\n\treturn o;\n}\n\n/* 2.4.150 TODO */\nfunction parse_Lbl(blob, length, opts) {\n\tif(opts.biff < 8) return parse_Label(blob, length, opts);\n\tvar target = blob.l + length;\n\tvar flags = blob.read_shift(2);\n\tvar chKey = blob.read_shift(1);\n\tvar cch = blob.read_shift(1);\n\tvar cce = blob.read_shift(2);\n\tblob.l += 2;\n\tvar itab = blob.read_shift(2);\n\tblob.l += 4;\n\tvar name = parse_XLUnicodeStringNoCch(blob, cch, opts);\n\tvar rgce = parse_NameParsedFormula(blob, target - blob.l, opts, cce);\n\treturn {\n\t\tchKey: chKey,\n\t\tName: name,\n\t\trgce: rgce\n\t};\n}\n\n/* 2.4.106 TODO: verify supbook manipulation */\nfunction parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);\n\tvar o = parslurp2(blob,length,parse_XTI);\n\tvar oo = [];\n\tif(opts.sbcch === 0x0401) {\n\t\tfor(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);\n\t\treturn oo;\n\t}\n\telse return o;\n}\n\n/* 2.4.260 */\nfunction parse_ShrFmla(blob, length, opts) {\n\tvar ref = parse_RefU(blob, 6);\n\tblob.l++;\n\tvar cUse = blob.read_shift(1);\n\tlength -= 8;\n\treturn [parse_SharedParsedFormula(blob, length, opts), cUse];\n}\n\n/* 2.4.4 TODO */\nfunction parse_Array(blob, length, opts) {\n\tvar ref = parse_Ref(blob, 6);\n\tblob.l += 6; length -= 12; /* TODO: fAlwaysCalc */\n\treturn [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];\n}\n\n/* 2.4.173 */\nfunction parse_MTRSettings(blob, length) {\n\tvar fMTREnabled = blob.read_shift(4) !== 0x00;\n\tvar fUserSetThreadCount = blob.read_shift(4) !== 0x00;\n\tvar cUserThreadCount = blob.read_shift(4);\n\treturn [fMTREnabled, fUserSetThreadCount, cUserThreadCount];\n}\n\n/* 2.5.186 TODO: BIFF5 */\nfunction parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}\n\n/* 2.4.179 */\nfunction parse_Note(blob, length, opts) {\n\t/* TODO: Support revisions */\n\treturn parse_NoteSh(blob, length, opts);\n}\n\n/* 2.4.168 */\nfunction parse_MergeCells(blob, length) {\n\tvar merges = [];\n\tvar cmcs = blob.read_shift(2);\n\twhile (cmcs--) merges.push(parse_Ref8U(blob,length));\n\treturn merges;\n}\n\n/* 2.4.181 TODO: parse all the things! */\nfunction parse_Obj(blob, length) {\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}\n\n/* 2.4.329 TODO: parse properly */\nfunction parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo;\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\tvar cbRuns = blob.read_shift(2);\n\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tvar texts = \"\";\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw \"TxO: bad continue record\";\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow \"cchText: \" + cchText + \" != \" + texts.length;\n\t}\n\n\tblob.l = s + length;\n\t/* 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw \"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText;\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw \"TxO \" + (s + length) + \", at \" + blob.l;\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts||\"\" }; }\n}\n\n/* 2.4.140 */\nvar parse_HLink = function(blob, length) {\n\tvar ref = parse_Ref8U(blob, 8);\n\tblob.l += 16; /* CLSID */\n\tvar hlink = parse_Hyperlink(blob, length-24);\n\treturn [ref, hlink];\n};\n\n/* 2.4.141 */\nvar parse_HLinkTooltip = function(blob, length) {\n\tvar end = blob.l + length;\n\tblob.read_shift(2);\n\tvar ref = parse_Ref8U(blob, 8);\n\tvar wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont');\n\twzTooltip = wzTooltip.replace(chr0,\"\");\n\treturn [ref, wzTooltip];\n};\n\n/* 2.4.63 */\nfunction parse_Country(blob, length) {\n\tvar o = [], d;\n\td = blob.read_shift(2); o[0] = CountryEnum[d] || d;\n\td = blob.read_shift(2); o[1] = CountryEnum[d] || d;\n\treturn o;\n}\n\n/* 2.4.50 ClrtClient */\nfunction parse_ClrtClient(blob, length) {\n\tvar ccv = blob.read_shift(2);\n\tvar o = [];\n\twhile(ccv-->0) o.push(parse_LongRGB(blob, 8));\n\treturn o;\n}\n\n/* 2.4.188 */\nfunction parse_Palette(blob, length) {\n\tvar ccv = blob.read_shift(2);\n\tvar o = [];\n\twhile(ccv-->0) o.push(parse_LongRGB(blob, 8));\n\treturn o;\n}\n\n/* 2.4.354 */\nfunction parse_XFCRC(blob, length) {\n\tblob.l += 2;\n\tvar o = {cxfs:0, crc:0};\n\to.cxfs = blob.read_shift(2);\n\to.crc = blob.read_shift(4);\n\treturn o;\n}\n\n\nvar parse_Style = parsenoop;\nvar parse_StyleExt = parsenoop;\n\nvar parse_ColInfo = parsenoop;\n\nvar parse_Window2 = parsenoop;\n\n\nvar parse_Backup = parsebool; /* 2.4.14 */\nvar parse_Blank = parse_XLSCell; /* 2.4.20 Just the cell */\nvar parse_BottomMargin = parse_Xnum; /* 2.4.27 */\nvar parse_BuiltInFnGroupCount = parseuint16; /* 2.4.30 0x0E or 0x10 but excel 2011 generates 0x11? */\nvar parse_CalcCount = parseuint16; /* 2.4.31 #Iterations */\nvar parse_CalcDelta = parse_Xnum; /* 2.4.32 */\nvar parse_CalcIter = parsebool; /* 2.4.33 1=iterative calc */\nvar parse_CalcMode = parseuint16; /* 2.4.34 0=manual, 1=auto (def), 2=table */\nvar parse_CalcPrecision = parsebool; /* 2.4.35 */\nvar parse_CalcRefMode = parsenoop2; /* 2.4.36 */\nvar parse_CalcSaveRecalc = parsebool; /* 2.4.37 */\nvar parse_CodePage = parseuint16; /* 2.4.52 */\nvar parse_Compat12 = parsebool; /* 2.4.54 true = no compatibility check */\nvar parse_Date1904 = parsebool; /* 2.4.77 - 1=1904,0=1900 */\nvar parse_DefColWidth = parseuint16; /* 2.4.89 */\nvar parse_DSF = parsenoop2; /* 2.4.94 -- MUST be ignored */\nvar parse_EntExU2 = parsenoop2; /* 2.4.102 -- Explicitly says to ignore */\nvar parse_EOF = parsenoop2; /* 2.4.103 */\nvar parse_Excel9File = parsenoop2; /* 2.4.104 -- Optional and unused */\nvar parse_FeatHdr = parsenoop2; /* 2.4.112 */\nvar parse_FontX = parseuint16; /* 2.4.123 */\nvar parse_Footer = parse_XLHeaderFooter; /* 2.4.124 */\nvar parse_GridSet = parseuint16; /* 2.4.132, =1 */\nvar parse_HCenter = parsebool; /* 2.4.135 sheet centered horizontal on print */\nvar parse_Header = parse_XLHeaderFooter; /* 2.4.136 */\nvar parse_HideObj = parse_HideObjEnum; /* 2.4.139 */\nvar parse_InterfaceEnd = parsenoop2; /* 2.4.145 -- noop */\nvar parse_LeftMargin = parse_Xnum; /* 2.4.151 */\nvar parse_Mms = parsenoop2; /* 2.4.169 -- Explicitly says to ignore */\nvar parse_ObjProtect = parsebool; /* 2.4.183 -- must be 1 if present */\nvar parse_Password = parseuint16; /* 2.4.191 */\nvar parse_PrintGrid = parsebool; /* 2.4.202 */\nvar parse_PrintRowCol = parsebool; /* 2.4.203 */\nvar parse_PrintSize = parseuint16; /* 2.4.204 0:3 */\nvar parse_Prot4Rev = parsebool; /* 2.4.205 */\nvar parse_Prot4RevPass = parseuint16; /* 2.4.206 */\nvar parse_Protect = parsebool; /* 2.4.207 */\nvar parse_RefreshAll = parsebool; /* 2.4.217 -- must be 0 if not template */\nvar parse_RightMargin = parse_Xnum; /* 2.4.219 */\nvar parse_RRTabId = parseuint16a; /* 2.4.241 */\nvar parse_ScenarioProtect = parsebool; /* 2.4.245 */\nvar parse_Scl = parseuint16a; /* 2.4.247 num, den */\nvar parse_String = parse_XLUnicodeString; /* 2.4.268 */\nvar parse_SxBool = parsebool; /* 2.4.274 */\nvar parse_TopMargin = parse_Xnum; /* 2.4.328 */\nvar parse_UsesELFs = parsebool; /* 2.4.337 -- should be 0 */\nvar parse_VCenter = parsebool; /* 2.4.342 */\nvar parse_WinProtect = parsebool; /* 2.4.347 */\nvar parse_WriteProtect = parsenoop; /* 2.4.350 empty record */\n\n\n/* ---- */\nvar parse_VerticalPageBreaks = parsenoop;\nvar parse_HorizontalPageBreaks = parsenoop;\nvar parse_Selection = parsenoop;\nvar parse_Continue = parsenoop;\nvar parse_Pane = parsenoop;\nvar parse_Pls = parsenoop;\nvar parse_DCon = parsenoop;\nvar parse_DConRef = parsenoop;\nvar parse_DConName = parsenoop;\nvar parse_XCT = parsenoop;\nvar parse_CRN = parsenoop;\nvar parse_FileSharing = parsenoop;\nvar parse_Uncalced = parsenoop;\nvar parse_Template = parsenoop;\nvar parse_Intl = parsenoop;\nvar parse_WsBool = parsenoop;\nvar parse_Sort = parsenoop;\nvar parse_Sync = parsenoop;\nvar parse_LPr = parsenoop;\nvar parse_DxGCol = parsenoop;\nvar parse_FnGroupName = parsenoop;\nvar parse_FilterMode = parsenoop;\nvar parse_AutoFilterInfo = parsenoop;\nvar parse_AutoFilter = parsenoop;\nvar parse_Setup = parsenoop;\nvar parse_ScenMan = parsenoop;\nvar parse_SCENARIO = parsenoop;\nvar parse_SxView = parsenoop;\nvar parse_Sxvd = parsenoop;\nvar parse_SXVI = parsenoop;\nvar parse_SxIvd = parsenoop;\nvar parse_SXLI = parsenoop;\nvar parse_SXPI = parsenoop;\nvar parse_DocRoute = parsenoop;\nvar parse_RecipName = parsenoop;\nvar parse_MulBlank = parsenoop;\nvar parse_SXDI = parsenoop;\nvar parse_SXDB = parsenoop;\nvar parse_SXFDB = parsenoop;\nvar parse_SXDBB = parsenoop;\nvar parse_SXNum = parsenoop;\nvar parse_SxErr = parsenoop;\nvar parse_SXInt = parsenoop;\nvar parse_SXString = parsenoop;\nvar parse_SXDtr = parsenoop;\nvar parse_SxNil = parsenoop;\nvar parse_SXTbl = parsenoop;\nvar parse_SXTBRGIITM = parsenoop;\nvar parse_SxTbpg = parsenoop;\nvar parse_ObProj = parsenoop;\nvar parse_SXStreamID = parsenoop;\nvar parse_DBCell = parsenoop;\nvar parse_SXRng = parsenoop;\nvar parse_SxIsxoper = parsenoop;\nvar parse_BookBool = parsenoop;\nvar parse_DbOrParamQry = parsenoop;\nvar parse_OleObjectSize = parsenoop;\nvar parse_SXVS = parsenoop;\nvar parse_BkHim = parsenoop;\nvar parse_MsoDrawingGroup = parsenoop;\nvar parse_MsoDrawing = parsenoop;\nvar parse_MsoDrawingSelection = parsenoop;\nvar parse_PhoneticInfo = parsenoop;\nvar parse_SxRule = parsenoop;\nvar parse_SXEx = parsenoop;\nvar parse_SxFilt = parsenoop;\nvar parse_SxDXF = parsenoop;\nvar parse_SxItm = parsenoop;\nvar parse_SxName = parsenoop;\nvar parse_SxSelect = parsenoop;\nvar parse_SXPair = parsenoop;\nvar parse_SxFmla = parsenoop;\nvar parse_SxFormat = parsenoop;\nvar parse_SXVDEx = parsenoop;\nvar parse_SXFormula = parsenoop;\nvar parse_SXDBEx = parsenoop;\nvar parse_RRDInsDel = parsenoop;\nvar parse_RRDHead = parsenoop;\nvar parse_RRDChgCell = parsenoop;\nvar parse_RRDRenSheet = parsenoop;\nvar parse_RRSort = parsenoop;\nvar parse_RRDMove = parsenoop;\nvar parse_RRFormat = parsenoop;\nvar parse_RRAutoFmt = parsenoop;\nvar parse_RRInsertSh = parsenoop;\nvar parse_RRDMoveBegin = parsenoop;\nvar parse_RRDMoveEnd = parsenoop;\nvar parse_RRDInsDelBegin = parsenoop;\nvar parse_RRDInsDelEnd = parsenoop;\nvar parse_RRDConflict = parsenoop;\nvar parse_RRDDefName = parsenoop;\nvar parse_RRDRstEtxp = parsenoop;\nvar parse_LRng = parsenoop;\nvar parse_CUsr = parsenoop;\nvar parse_CbUsr = parsenoop;\nvar parse_UsrInfo = parsenoop;\nvar parse_UsrExcl = parsenoop;\nvar parse_FileLock = parsenoop;\nvar parse_RRDInfo = parsenoop;\nvar parse_BCUsrs = parsenoop;\nvar parse_UsrChk = parsenoop;\nvar parse_UserBView = parsenoop;\nvar parse_UserSViewBegin = parsenoop; // overloaded\nvar parse_UserSViewEnd = parsenoop;\nvar parse_RRDUserView = parsenoop;\nvar parse_Qsi = parsenoop;\nvar parse_CondFmt = parsenoop;\nvar parse_CF = parsenoop;\nvar parse_DVal = parsenoop;\nvar parse_DConBin = parsenoop;\nvar parse_Lel = parsenoop;\nvar parse_XLSCodeName = parse_XLUnicodeString;\nvar parse_SXFDBType = parsenoop;\nvar parse_ObNoMacros = parsenoop;\nvar parse_Dv = parsenoop;\nvar parse_Index = parsenoop;\nvar parse_Table = parsenoop;\nvar parse_BigName = parsenoop;\nvar parse_ContinueBigName = parsenoop;\nvar parse_WebPub = parsenoop;\nvar parse_QsiSXTag = parsenoop;\nvar parse_DBQueryExt = parsenoop;\nvar parse_ExtString = parsenoop;\nvar parse_TxtQry = parsenoop;\nvar parse_Qsir = parsenoop;\nvar parse_Qsif = parsenoop;\nvar parse_RRDTQSIF = parsenoop;\nvar parse_OleDbConn = parsenoop;\nvar parse_WOpt = parsenoop;\nvar parse_SXViewEx = parsenoop;\nvar parse_SXTH = parsenoop;\nvar parse_SXPIEx = parsenoop;\nvar parse_SXVDTEx = parsenoop;\nvar parse_SXViewEx9 = parsenoop;\nvar parse_ContinueFrt = parsenoop;\nvar parse_RealTimeData = parsenoop;\nvar parse_ChartFrtInfo = parsenoop;\nvar parse_FrtWrapper = parsenoop;\nvar parse_StartBlock = parsenoop;\nvar parse_EndBlock = parsenoop;\nvar parse_StartObject = parsenoop;\nvar parse_EndObject = parsenoop;\nvar parse_CatLab = parsenoop;\nvar parse_YMult = parsenoop;\nvar parse_SXViewLink = parsenoop;\nvar parse_PivotChartBits = parsenoop;\nvar parse_FrtFontList = parsenoop;\nvar parse_SheetExt = parsenoop;\nvar parse_BookExt = parsenoop;\nvar parse_SXAddl = parsenoop;\nvar parse_CrErr = parsenoop;\nvar parse_HFPicture = parsenoop;\nvar parse_Feat = parsenoop;\nvar parse_DataLabExt = parsenoop;\nvar parse_DataLabExtContents = parsenoop;\nvar parse_CellWatch = parsenoop;\nvar parse_FeatHdr11 = parsenoop;\nvar parse_Feature11 = parsenoop;\nvar parse_DropDownObjIds = parsenoop;\nvar parse_ContinueFrt11 = parsenoop;\nvar parse_DConn = parsenoop;\nvar parse_List12 = parsenoop;\nvar parse_Feature12 = parsenoop;\nvar parse_CondFmt12 = parsenoop;\nvar parse_CF12 = parsenoop;\nvar parse_CFEx = parsenoop;\nvar parse_AutoFilter12 = parsenoop;\nvar parse_ContinueFrt12 = parsenoop;\nvar parse_MDTInfo = parsenoop;\nvar parse_MDXStr = parsenoop;\nvar parse_MDXTuple = parsenoop;\nvar parse_MDXSet = parsenoop;\nvar parse_MDXProp = parsenoop;\nvar parse_MDXKPI = parsenoop;\nvar parse_MDB = parsenoop;\nvar parse_PLV = parsenoop;\nvar parse_DXF = parsenoop;\nvar parse_TableStyles = parsenoop;\nvar parse_TableStyle = parsenoop;\nvar parse_TableStyleElement = parsenoop;\nvar parse_NamePublish = parsenoop;\nvar parse_NameCmt = parsenoop;\nvar parse_SortData = parsenoop;\nvar parse_GUIDTypeLib = parsenoop;\nvar parse_FnGrp12 = parsenoop;\nvar parse_NameFnGrp12 = parsenoop;\nvar parse_HeaderFooter = parsenoop;\nvar parse_CrtLayout12 = parsenoop;\nvar parse_CrtMlFrt = parsenoop;\nvar parse_CrtMlFrtContinue = parsenoop;\nvar parse_ShapePropsStream = parsenoop;\nvar parse_TextPropsStream = parsenoop;\nvar parse_RichTextStream = parsenoop;\nvar parse_CrtLayout12A = parsenoop;\nvar parse_Units = parsenoop;\nvar parse_Chart = parsenoop;\nvar parse_Series = parsenoop;\nvar parse_DataFormat = parsenoop;\nvar parse_LineFormat = parsenoop;\nvar parse_MarkerFormat = parsenoop;\nvar parse_AreaFormat = parsenoop;\nvar parse_PieFormat = parsenoop;\nvar parse_AttachedLabel = parsenoop;\nvar parse_SeriesText = parsenoop;\nvar parse_ChartFormat = parsenoop;\nvar parse_Legend = parsenoop;\nvar parse_SeriesList = parsenoop;\nvar parse_Bar = parsenoop;\nvar parse_Line = parsenoop;\nvar parse_Pie = parsenoop;\nvar parse_Area = parsenoop;\nvar parse_Scatter = parsenoop;\nvar parse_CrtLine = parsenoop;\nvar parse_Axis = parsenoop;\nvar parse_Tick = parsenoop;\nvar parse_ValueRange = parsenoop;\nvar parse_CatSerRange = parsenoop;\nvar parse_AxisLine = parsenoop;\nvar parse_CrtLink = parsenoop;\nvar parse_DefaultText = parsenoop;\nvar parse_Text = parsenoop;\nvar parse_ObjectLink = parsenoop;\nvar parse_Frame = parsenoop;\nvar parse_Begin = parsenoop;\nvar parse_End = parsenoop;\nvar parse_PlotArea = parsenoop;\nvar parse_Chart3d = parsenoop;\nvar parse_PicF = parsenoop;\nvar parse_DropBar = parsenoop;\nvar parse_Radar = parsenoop;\nvar parse_Surf = parsenoop;\nvar parse_RadarArea = parsenoop;\nvar parse_AxisParent = parsenoop;\nvar parse_LegendException = parsenoop;\nvar parse_ShtProps = parsenoop;\nvar parse_SerToCrt = parsenoop;\nvar parse_AxesUsed = parsenoop;\nvar parse_SBaseRef = parsenoop;\nvar parse_SerParent = parsenoop;\nvar parse_SerAuxTrend = parsenoop;\nvar parse_IFmtRecord = parsenoop;\nvar parse_Pos = parsenoop;\nvar parse_AlRuns = parsenoop;\nvar parse_BRAI = parsenoop;\nvar parse_SerAuxErrBar = parsenoop;\nvar parse_SerFmt = parsenoop;\nvar parse_Chart3DBarShape = parsenoop;\nvar parse_Fbi = parsenoop;\nvar parse_BopPop = parsenoop;\nvar parse_AxcExt = parsenoop;\nvar parse_Dat = parsenoop;\nvar parse_PlotGrowth = parsenoop;\nvar parse_SIIndex = parsenoop;\nvar parse_GelFrame = parsenoop;\nvar parse_BopPopCustom = parsenoop;\nvar parse_Fbi2 = parsenoop;\n\n/* --- Specific to versions before BIFF8 --- */\nfunction parse_BIFF5String(blob) {\n\tvar len = blob.read_shift(1);\n\treturn blob.read_shift(len, 'sbcs-cont');\n}\n\n/* BIFF2_??? where ??? is the name from [XLS] */\nfunction parse_BIFF2STR(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 6);\n\t++blob.l;\n\tvar str = parse_XLUnicodeString2(blob, length-7, opts);\n\tcell.val = str;\n\treturn cell;\n}\n\nfunction parse_BIFF2NUM(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 6);\n\t++blob.l;\n\tvar num = parse_Xnum(blob, 8);\n\tcell.val = num;\n\treturn cell;\n}\n\n/* 18.4.1 charset to codepage mapping */\nvar CS2CP = {\n\t0: 1252, /* ANSI */\n\t1: 65001, /* DEFAULT */\n\t2: 65001, /* SYMBOL */\n\t77: 10000, /* MAC */\n\t128: 932, /* SHIFTJIS */\n\t129: 949, /* HANGUL */\n\t130: 1361, /* JOHAB */\n\t134: 936, /* GB2312 */\n\t136: 950, /* CHINESEBIG5 */\n\t161: 1253, /* GREEK */\n\t162: 1254, /* TURKISH */\n\t163: 1258, /* VIETNAMESE */\n\t177: 1255, /* HEBREW */\n\t178: 1256, /* ARABIC */\n\t186: 1257, /* BALTIC */\n\t204: 1251, /* RUSSIAN */\n\t222: 874, /* THAI */\n\t238: 1250, /* EASTEUROPE */\n\t255: 1252, /* OEM */\n\t69: 6969 /* MISC */\n};\n\n/* Parse a list of <r> tags */\nvar parse_rs = (function parse_rs_factory() {\n\tvar tregex = matchtag(\"t\"), rpregex = matchtag(\"rPr\"), rregex = /<r>/g, rend = /<\\/r>/, nlregex = /\\r\\n/g;\n\t/* 18.4.7 rPr CT_RPrElt */\n\tvar parse_rpr = function parse_rpr(rpr, intro, outro) {\n\t\tvar font = {}, cp = 65001;\n\t\tvar m = rpr.match(tagregex), i = 0;\n\t\tif(m) for(;i!=m.length; ++i) {\n\t\t\tvar y = parsexmltag(m[i]);\n\t\t\tswitch(y[0]) {\n\t\t\t\t/* 18.8.12 condense CT_BooleanProperty */\n\t\t\t\t/* ** not required . */\n\t\t\t\tcase '<condense': break;\n\t\t\t\t/* 18.8.17 extend CT_BooleanProperty */\n\t\t\t\t/* ** not required . */\n\t\t\t\tcase '<extend': break;\n\t\t\t\t/* 18.8.36 shadow CT_BooleanProperty */\n\t\t\t\t/* ** not required . */\n\t\t\t\tcase '<shadow':\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<shadow/>': break;\n\n\t\t\t\t/* 18.4.1 charset CT_IntProperty TODO */\n\t\t\t\tcase '<charset':\n\t\t\t\t\tif(y.val == '1') break;\n\t\t\t\t\tcp = CS2CP[parseInt(y.val, 10)];\n\t\t\t\t\tbreak;\n\n\t\t\t\t/* 18.4.2 outline CT_BooleanProperty TODO */\n\t\t\t\tcase '<outline':\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<outline/>': break;\n\n\t\t\t\t/* 18.4.5 rFont CT_FontName */\n\t\t\t\tcase '<rFont': font.name = y.val; break;\n\n\t\t\t\t/* 18.4.11 sz CT_FontSize */\n\t\t\t\tcase '<sz': font.sz = y.val; break;\n\n\t\t\t\t/* 18.4.10 strike CT_BooleanProperty */\n\t\t\t\tcase '<strike':\n\t\t\t\t\tif(!y.val) break;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<strike/>': font.strike = 1; break;\n\t\t\t\tcase '</strike>': break;\n\n\t\t\t\t/* 18.4.13 u CT_UnderlineProperty */\n\t\t\t\tcase '<u':\n\t\t\t\t\tif(!y.val) break;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<u/>': font.u = 1; break;\n\t\t\t\tcase '</u>': break;\n\n\t\t\t\t/* 18.8.2 b */\n\t\t\t\tcase '<b':\n\t\t\t\t\tif(!y.val) break;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<b/>': font.b = 1; break;\n\t\t\t\tcase '</b>': break;\n\n\t\t\t\t/* 18.8.26 i */\n\t\t\t\tcase '<i':\n\t\t\t\t\tif(!y.val) break;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase '<i/>': font.i = 1; break;\n\t\t\t\tcase '</i>': break;\n\n\t\t\t\t/* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */\n\t\t\t\tcase '<color':\n\t\t\t\t\tif(y.rgb) font.color = y.rgb.substr(2,6);\n\t\t\t\t\tbreak;\n\n\t\t\t\t/* 18.8.18 family ST_FontFamily */\n\t\t\t\tcase '<family': font.family = y.val; break;\n\n\t\t\t\t/* 18.4.14 vertAlign CT_VerticalAlignFontProperty TODO */\n\t\t\t\tcase '<vertAlign': break;\n\n\t\t\t\t/* 18.8.35 scheme CT_FontScheme TODO */\n\t\t\t\tcase '<scheme': break;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif(y[0].charCodeAt(1) !== 47) throw 'Unrecognized rich format ' + y[0];\n\t\t\t}\n\t\t}\n\t\t/* TODO: These should be generated styles, not inline */\n\t\tvar style = [];\n\t\tif(font.b) style.push(\"font-weight: bold;\");\n\t\tif(font.i) style.push(\"font-style: italic;\");\n\t\tintro.push('<span style=\"' + style.join(\"\") + '\">');\n\t\toutro.push(\"</span>\");\n\t\treturn cp;\n\t};\n\n\t/* 18.4.4 r CT_RElt */\n\tfunction parse_r(r) {\n\t\tvar terms = [[],\"\",[]];\n\t\t/* 18.4.12 t ST_Xstring */\n\t\tvar t = r.match(tregex), cp = 65001;\n\t\tif(!isval(t)) return \"\";\n\t\tterms[1] = t[1];\n\n\t\tvar rpr = r.match(rpregex);\n\t\tif(isval(rpr)) cp = parse_rpr(rpr[1], terms[0], terms[2]);\n\n\t\treturn terms[0].join(\"\") + terms[1].replace(nlregex,'<br/>') + terms[2].join(\"\");\n\t}\n\treturn function parse_rs(rs) {\n\t\treturn rs.replace(rregex,\"\").split(rend).map(parse_r).join(\"\");\n\t};\n})();\n\n/* 18.4.8 si CT_Rst */\nvar sitregex = /<t[^>]*>([^<]*)<\\/t>/g, sirregex = /<r>/;\nfunction parse_si(x, opts) {\n\tvar html = opts ? opts.cellHTML : true;\n\tvar z = {};\n\tif(!x) return null;\n\tvar y;\n\t/* 18.4.12 t ST_Xstring (Plaintext String) */\n\tif(x.charCodeAt(1) === 116) {\n\t\tz.t = utf8read(unescapexml(x.substr(x.indexOf(\">\")+1).split(/<\\/t>/)[0]));\n\t\tz.r = x;\n\t\tif(html) z.h = z.t;\n\t}\n\t/* 18.4.4 r CT_RElt (Rich Text Run) */\n\telse if((y = x.match(sirregex))) {\n\t\tz.r = x;\n\t\tz.t = utf8read(unescapexml(x.match(sitregex).join(\"\").replace(tagregex,\"\")));\n\t\tif(html) z.h = parse_rs(x);\n\t}\n\t/* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */\n\t/* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */\n\treturn z;\n}\n\n/* 18.4 Shared String Table */\nvar sstr0 = /<sst([^>]*)>([\\s\\S]*)<\\/sst>/;\nvar sstr1 = /<(?:si|sstItem)>/g;\nvar sstr2 = /<\\/(?:si|sstItem)>/;\nfunction parse_sst_xml(data, opts) {\n\tvar s = [], ss;\n\t/* 18.4.9 sst CT_Sst */\n\tvar sst = data.match(sstr0);\n\tif(isval(sst)) {\n\t\tss = sst[2].replace(sstr1,\"\").split(sstr2);\n\t\tfor(var i = 0; i != ss.length; ++i) {\n\t\t\tvar o = parse_si(ss[i], opts);\n\t\t\tif(o != null) s[s.length] = o;\n\t\t}\n\t\tsst = parsexmltag(sst[1]); s.Count = sst.count; s.Unique = sst.uniqueCount;\n\t}\n\treturn s;\n}\n\nRELS.SST = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\";\nvar straywsregex = /^\\s|\\s$|[\\t\\n\\r]/;\nfunction write_sst_xml(sst, opts) {\n\tif(!opts.bookSST) return \"\";\n\tvar o = [XML_HEADER];\n\to[o.length] = (writextag('sst', null, {\n\t\txmlns: XMLNS.main[0],\n\t\tcount: sst.Count,\n\t\tuniqueCount: sst.Unique\n\t}));\n\tfor(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue;\n\t\tvar s = sst[i];\n\t\tvar sitag = \"<si>\";\n\t\tif(s.r) sitag += s.r;\n\t\telse {\n\t\t\tsitag += \"<t\";\n\t\t\tif(s.t.match(straywsregex)) sitag += ' xml:space=\"preserve\"';\n\t\t\tsitag += \">\" + escapexml(s.t) + \"</t>\";\n\t\t}\n\t\tsitag += \"</si>\";\n\t\to[o.length] = (sitag);\n\t}\n\tif(o.length>2){ o[o.length] = ('</sst>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.219 BrtBeginSst */\nfunction parse_BrtBeginSst(data, length) {\n\treturn [data.read_shift(4), data.read_shift(4)];\n}\n\n/* [MS-XLSB] 2.1.7.45 Shared Strings */\nfunction parse_sst_bin(data, opts) {\n\tvar s = [];\n\tvar pass = false;\n\trecordhopper(data, function hopper_sst(val, R, RT) {\n\t\tswitch(R.n) {\n\t\t\tcase 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;\n\t\t\tcase 'BrtSSTItem': s.push(val); break;\n\t\t\tcase 'BrtEndSst': return true;\n\t\t\t/* TODO: produce a test case with a future record */\n\t\t\tcase 'BrtFRTBegin': pass = true; break;\n\t\t\tcase 'BrtFRTEnd': pass = false; break;\n\t\t\tdefault: if(!pass || opts.WTF) throw new Error(\"Unexpected record \" + RT + \" \" + R.n);\n\t\t}\n\t});\n\treturn s;\n}\n\nfunction write_BrtBeginSst(sst, o) {\n\tif(!o) o = new_buf(8);\n\to.write_shift(4, sst.Count);\n\to.write_shift(4, sst.Unique);\n\treturn o;\n}\n\nvar write_BrtSSTItem = write_RichStr;\n\nfunction write_sst_bin(sst, opts) {\n\tvar ba = buf_array();\n\twrite_record(ba, \"BrtBeginSst\", write_BrtBeginSst(sst));\n\tfor(var i = 0; i < sst.length; ++i) write_record(ba, \"BrtSSTItem\", write_BrtSSTItem(sst[i]));\n\twrite_record(ba, \"BrtEndSst\");\n\treturn ba.end();\n}\nfunction _JS2ANSI(str) { if(typeof cptable !== 'undefined') return cptable.utils.encode(1252, str); return str.split(\"\").map(function(x) { return x.charCodeAt(0); }); }\n\n/* [MS-OFFCRYPTO] 2.1.4 Version */\nfunction parse_Version(blob, length) {\n\tvar o = {};\n\to.Major = blob.read_shift(2);\n\to.Minor = blob.read_shift(2);\n\treturn o;\n}\n/* [MS-OFFCRYPTO] 2.3.2 Encryption Header */\nfunction parse_EncryptionHeader(blob, length) {\n\tvar o = {};\n\to.Flags = blob.read_shift(4);\n\n\t// Check if SizeExtra is 0x00000000\n\tvar tmp = blob.read_shift(4);\n\tif(tmp !== 0) throw 'Unrecognized SizeExtra: ' + tmp;\n\n\to.AlgID = blob.read_shift(4);\n\tswitch(o.AlgID) {\n\t\tcase 0: case 0x6801: case 0x660E: case 0x660F: case 0x6610: break;\n\t\tdefault: throw 'Unrecognized encryption algorithm: ' + o.AlgID;\n\t}\n\tparsenoop(blob, length-12);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */\nfunction parse_EncryptionVerifier(blob, length) {\n\treturn parsenoop(blob, length);\n}\n/* [MS-OFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header */\nfunction parse_RC4CryptoHeader(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Minor != 2) throw 'unrecognized minor version code: ' + vers.Minor;\n\tif(vers.Major > 4 || vers.Major < 2) throw 'unrecognized major version code: ' + vers.Major;\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}\n/* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */\nfunction parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */\nfunction crypto_CreatePasswordVerifier_Method1(Password) {\n\tvar Verifier = 0x0000, PasswordArray;\n\tvar PasswordDecoded = _JS2ANSI(Password);\n\tvar len = PasswordDecoded.length + 1, i, PasswordByte;\n\tvar Intermediate1, Intermediate2, Intermediate3;\n\tPasswordArray = new_raw_buf(len);\n\tPasswordArray[0] = PasswordDecoded.length;\n\tfor(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1];\n\tfor(i = len-1; i >= 0; --i) {\n\t\tPasswordByte = PasswordArray[i];\n\t\tIntermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1;\n\t\tIntermediate2 = (Verifier << 1) & 0x7FFF;\n\t\tIntermediate3 = Intermediate1 | Intermediate2;\n\t\tVerifier = Intermediate3 ^ PasswordByte;\n\t}\n\treturn Verifier ^ 0xCE4B;\n}\n\n/* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */\nvar crypto_CreateXorArray_Method1 = (function() {\n\tvar PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00];\n\tvar InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3];\n\tvar XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4];\n\tvar Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; };\n\tvar XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); };\n\tvar CreateXorKey_Method1 = function(Password) {\n\t\tvar XorKey = InitialCode[Password.length - 1];\n\t\tvar CurrentElement = 0x68;\n\t\tfor(var i = Password.length-1; i >= 0; --i) {\n\t\t\tvar Char = Password[i];\n\t\t\tfor(var j = 0; j != 7; ++j) {\n\t\t\t\tif(Char & 0x40) XorKey ^= XorMatrix[CurrentElement];\n\t\t\t\tChar *= 2; --CurrentElement;\n\t\t\t}\n\t\t}\n\t\treturn XorKey;\n\t};\n\treturn function(password) {\n\t\tvar Password = _JS2ANSI(password);\n\t\tvar XorKey = CreateXorKey_Method1(Password);\n\t\tvar Index = Password.length;\n\t\tvar ObfuscationArray = new_raw_buf(16);\n\t\tfor(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00;\n\t\tvar Temp, PasswordLastChar, PadIndex;\n\t\tif((Index & 1) === 1) {\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(PadArray[0], Temp);\n\t\t\t--Index;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tPasswordLastChar = Password[Password.length - 1];\n\t\t\tObfuscationArray[Index] = XorRor(PasswordLastChar, Temp);\n\t\t}\n\t\twhile(Index > 0) {\n\t\t\t--Index;\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t\t--Index;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t}\n\t\tIndex = 15;\n\t\tPadIndex = 15 - Password.length;\n\t\twhile(PadIndex > 0) {\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp);\n\t\t\t--Index;\n\t\t\t--PadIndex;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t\t--Index;\n\t\t\t--PadIndex;\n\t\t}\n\t\treturn ObfuscationArray;\n\t};\n})();\n\n/* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */\nvar crypto_DecryptData_Method1 = function(password, Data, XorArrayIndex, XorArray, O) {\n\t/* If XorArray is set, use it; if O is not set, make changes in-place */\n\tif(!O) O = Data;\n\tif(!XorArray) XorArray = crypto_CreateXorArray_Method1(password);\n\tvar Index, Value;\n\tfor(Index = 0; Index != Data.length; ++Index) {\n\t\tValue = Data[Index];\n\t\tValue ^= XorArray[XorArrayIndex];\n\t\tValue = ((Value>>5) | (Value<<3)) & 0xFF;\n\t\tO[Index] = Value;\n\t\t++XorArrayIndex;\n\t}\n\treturn [O, XorArrayIndex, XorArray];\n};\n\nvar crypto_MakeXorDecryptor = function(password) {\n\tvar XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password);\n\treturn function(Data) {\n\t\tvar O = crypto_DecryptData_Method1(null, Data, XorArrayIndex, XorArray);\n\t\tXorArrayIndex = O[1];\n\t\treturn O[0];\n\t};\n};\n\n/* 2.5.343 */\nfunction parse_XORObfuscation(blob, length, opts, out) {\n\tvar o = { key: parseuint16(blob), verificationBytes: parseuint16(blob) };\n\tif(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);\n\tout.valid = o.verificationBytes === o.verifier;\n\tif(out.valid) out.insitu_decrypt = crypto_MakeXorDecryptor(opts.password);\n\treturn o;\n}\n\n/* 2.4.117 */\nfunction parse_FilePassHeader(blob, length, oo) {\n\tvar o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2;\n\tif(o.Info === 1) o.Data = parse_RC4Header(blob, length);\n\telse o.Data = parse_RC4CryptoHeader(blob, length);\n\treturn o;\n}\nfunction parse_FilePass(blob, length, opts) {\n\tvar o = { Type: blob.read_shift(2) }; /* wEncryptionType */\n\tif(o.Type) parse_FilePassHeader(blob, length-2, o);\n\telse parse_XORObfuscation(blob, length-2, opts, o);\n\treturn o;\n}\n\n\nfunction hex2RGB(h) {\n\tvar o = h.substr(h[0]===\"#\"?1:0,6);\n\treturn [parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16)];\n}\nfunction rgb2Hex(rgb) {\n\tfor(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]);\n\treturn o.toString(16).toUpperCase().substr(1);\n}\n\nfunction rgb2HSL(rgb) {\n\tvar R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255;\n\tvar M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m;\n\tif(C === 0) return [0, 0, R];\n\n\tvar H6 = 0, S = 0, L2 = (M + m);\n\tS = C / (L2 > 1 ? 2 - L2 : L2);\n\tswitch(M){\n\t\tcase R: H6 = ((G - B) / C + 6)%6; break;\n\t\tcase G: H6 = ((B - R) / C + 2); break;\n\t\tcase B: H6 = ((R - G) / C + 4); break;\n\t}\n\treturn [H6 / 6, S, L2 / 2];\n}\n\nfunction hsl2RGB(hsl){\n\tvar H = hsl[0], S = hsl[1], L = hsl[2];\n\tvar C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2;\n\tvar rgb = [m,m,m], h6 = 6*H;\n\n\tvar X;\n\tif(S !== 0) switch(h6|0) {\n\t\tcase 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break;\n\t\tcase 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break;\n\t\tcase 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break;\n\t\tcase 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break;\n\t\tcase 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break;\n\t\tcase 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break;\n\t}\n\tfor(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255);\n\treturn rgb;\n}\n\n/* 18.8.3 bgColor tint algorithm */\nfunction rgb_tint(hex, tint) {\n\tif(tint === 0) return hex;\n\tvar hsl = rgb2HSL(hex2RGB(hex));\n\tif (tint < 0) hsl[2] = hsl[2] * (1 + tint);\n\telse hsl[2] = 1 - (1 - hsl[2]) * (1 - tint);\n\treturn rgb2Hex(hsl2RGB(hsl));\n}\n\n/* 18.3.1.13 width calculations */\nvar DEF_MDW = 7, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;\nfunction width2px(width) { return (( width + ((128/MDW)|0)/256 )* MDW )|0; }\nfunction px2char(px) { return (((px - 5)/MDW * 100 + 0.5)|0)/100; }\nfunction char2width(chr) { return (((chr * MDW + 5)/MDW*256)|0)/256; }\nfunction cycle_width(collw) { return char2width(px2char(width2px(collw))); }\nfunction find_mdw(collw, coll) {\n\tif(cycle_width(collw) != collw) {\n\t\tfor(MDW=DEF_MDW; MDW>MIN_MDW; --MDW) if(cycle_width(collw) === collw) break;\n\t\tif(MDW === MIN_MDW) for(MDW=DEF_MDW+1; MDW<MAX_MDW; ++MDW) if(cycle_width(collw) === collw) break;\n\t\tif(MDW === MAX_MDW) MDW = DEF_MDW;\n\t}\n}\n\n/* [MS-EXSPXML3] 2.4.54 ST_enmPattern */\nvar XLMLPatternTypeMap = {\n\t\"None\": \"none\",\n\t\"Solid\": \"solid\",\n\t\"Gray50\": \"mediumGray\",\n\t\"Gray75\": \"darkGray\",\n\t\"Gray25\": \"lightGray\",\n\t\"HorzStripe\": \"darkHorizontal\",\n\t\"VertStripe\": \"darkVertical\",\n\t\"ReverseDiagStripe\": \"darkDown\",\n\t\"DiagStripe\": \"darkUp\",\n\t\"DiagCross\": \"darkGrid\",\n\t\"ThickDiagCross\": \"darkTrellis\",\n\t\"ThinHorzStripe\": \"lightHorizontal\",\n\t\"ThinVertStripe\": \"lightVertical\",\n\t\"ThinReverseDiagStripe\": \"lightDown\",\n\t\"ThinHorzCross\": \"lightGrid\"\n};\n\nvar styles = {}; // shared styles\n\nvar themes = {}; // shared themes\n\n/* 18.8.21 fills CT_Fills */\nfunction parse_fills(t, opts) {\n\tstyles.Fills = [];\n\tvar fill = {};\n\tt[0].match(tagregex).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '<fills': case '<fills>': case '</fills>': break;\n\n\t\t\t/* 18.8.20 fill CT_Fill */\n\t\t\tcase '<fill>': break;\n\t\t\tcase '</fill>': styles.Fills.push(fill); fill = {}; break;\n\n\t\t\t/* 18.8.32 patternFill CT_PatternFill */\n\t\t\tcase '<patternFill':\n\t\t\t\tif(y.patternType) fill.patternType = y.patternType;\n\t\t\t\tbreak;\n\t\t\tcase '<patternFill/>': case '</patternFill>': break;\n\n\t\t\t/* 18.8.3 bgColor CT_Color */\n\t\t\tcase '<bgColor':\n\t\t\t\tif(!fill.bgColor) fill.bgColor = {};\n\t\t\t\tif(y.indexed) fill.bgColor.indexed = parseInt(y.indexed, 10);\n\t\t\t\tif(y.theme) fill.bgColor.theme = parseInt(y.theme, 10);\n\t\t\t\tif(y.tint) fill.bgColor.tint = parseFloat(y.tint);\n\t\t\t\t/* Excel uses ARGB strings */\n\t\t\t\tif(y.rgb) fill.bgColor.rgb = y.rgb.substring(y.rgb.length - 6);\n\t\t\t\tbreak;\n\t\t\tcase '<bgColor/>': case '</bgColor>': break;\n\n\t\t\t/* 18.8.19 fgColor CT_Color */\n\t\t\tcase '<fgColor':\n\t\t\t\tif(!fill.fgColor) fill.fgColor = {};\n\t\t\t\tif(y.theme) fill.fgColor.theme = parseInt(y.theme, 10);\n\t\t\t\tif(y.tint) fill.fgColor.tint = parseFloat(y.tint);\n\t\t\t\t/* Excel uses ARGB strings */\n\t\t\t\tif(y.rgb) fill.fgColor.rgb = y.rgb.substring(y.rgb.length - 6);\n\t\t\t\tbreak;\n\t\t\tcase '<fgColor/>': case '</fgColor>': break;\n\n\t\t\tdefault: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in fills';\n\t\t}\n\t});\n}\n\n/* 18.8.31 numFmts CT_NumFmts */\nfunction parse_numFmts(t, opts) {\n\tstyles.NumberFmt = [];\n\tvar k = keys(SSF._table);\n\tfor(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];\n\tvar m = t[0].match(tagregex);\n\tfor(i=0; i < m.length; ++i) {\n\t\tvar y = parsexmltag(m[i]);\n\t\tswitch(y[0]) {\n\t\t\tcase '<numFmts': case '</numFmts>': case '<numFmts/>': case '<numFmts>': break;\n\t\t\tcase '<numFmt': {\n\t\t\t\tvar f=unescapexml(utf8read(y.formatCode)), j=parseInt(y.numFmtId,10);\n\t\t\t\tstyles.NumberFmt[j] = f; if(j>0) SSF.load(f,j);\n\t\t\t} break;\n\t\t\tdefault: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in numFmts';\n\t\t}\n\t}\n}\n\nfunction write_numFmts(NF, opts) {\n\tvar o = [\"<numFmts>\"];\n\t[[5,8],[23,26],[41,44],[63,66],[164,392]].forEach(function(r) {\n\t\tfor(var i = r[0]; i <= r[1]; ++i) if(NF[i] !== undefined) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])}));\n\t});\n\tif(o.length === 1) return \"\";\n\to[o.length] = (\"</numFmts>\");\n\to[0] = writextag('numFmts', null, { count:o.length-2 }).replace(\"/>\", \">\");\n\treturn o.join(\"\");\n}\n\n/* 18.8.10 cellXfs CT_CellXfs */\nfunction parse_cellXfs(t, opts) {\n\tstyles.CellXf = [];\n\tt[0].match(tagregex).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '<cellXfs': case '<cellXfs>': case '<cellXfs/>': case '</cellXfs>': break;\n\n\t\t\t/* 18.8.45 xf CT_Xf */\n\t\t\tcase '<xf': delete y[0];\n\t\t\t\tif(y.numFmtId) y.numFmtId = parseInt(y.numFmtId, 10);\n\t\t\t\tif(y.fillId) y.fillId = parseInt(y.fillId, 10);\n\t\t\t\tstyles.CellXf.push(y); break;\n\t\t\tcase '</xf>': break;\n\n\t\t\t/* 18.8.1 alignment CT_CellAlignment */\n\t\t\tcase '<alignment': case '<alignment/>': break;\n\n\t\t\t/* 18.8.33 protection CT_CellProtection */\n\t\t\tcase '<protection': case '</protection>': case '<protection/>': break;\n\n\t\t\tcase '<extLst': case '</extLst>': break;\n\t\t\tcase '<ext': break;\n\t\t\tdefault: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in cellXfs';\n\t\t}\n\t});\n}\n\nfunction write_cellXfs(cellXfs) {\n\tvar o = [];\n\to[o.length] = (writextag('cellXfs',null));\n\tcellXfs.forEach(function(c) { o[o.length] = (writextag('xf', null, c)); });\n\to[o.length] = (\"</cellXfs>\");\n\tif(o.length === 2) return \"\";\n\to[0] = writextag('cellXfs',null, {count:o.length-2}).replace(\"/>\",\">\");\n\treturn o.join(\"\");\n}\n\n/* 18.8 Styles CT_Stylesheet*/\nvar parse_sty_xml= (function make_pstyx() {\nvar numFmtRegex = /<numFmts([^>]*)>.*<\\/numFmts>/;\nvar cellXfRegex = /<cellXfs([^>]*)>.*<\\/cellXfs>/;\nvar fillsRegex = /<fills([^>]*)>.*<\\/fills>/;\n\nreturn function parse_sty_xml(data, opts) {\n\t/* 18.8.39 styleSheet CT_Stylesheet */\n\tvar t;\n\n\t/* numFmts CT_NumFmts ? */\n\tif((t=data.match(numFmtRegex))) parse_numFmts(t, opts);\n\n\t/* fonts CT_Fonts ? */\n\t/*if((t=data.match(/<fonts([^>]*)>.*<\\/fonts>/))) parse_fonts(t, opts);*/\n\n\t/* fills CT_Fills */\n\tif((t=data.match(fillsRegex))) parse_fills(t, opts);\n\n\t/* borders CT_Borders ? */\n\t/* cellStyleXfs CT_CellStyleXfs ? */\n\n\t/* cellXfs CT_CellXfs ? */\n\tif((t=data.match(cellXfRegex))) parse_cellXfs(t, opts);\n\n\t/* dxfs CT_Dxfs ? */\n\t/* tableStyles CT_TableStyles ? */\n\t/* colors CT_Colors ? */\n\t/* extLst CT_ExtensionList ? */\n\n\treturn styles;\n};\n})();\n\nvar STYLES_XML_ROOT = writextag('styleSheet', null, {\n\t'xmlns': XMLNS.main[0],\n\t'xmlns:vt': XMLNS.vt\n});\n\nRELS.STY = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\";\n\nfunction write_sty_xml(wb, opts) {\n\tvar o = [XML_HEADER, STYLES_XML_ROOT], w;\n\tif((w = write_numFmts(wb.SSF)) != null) o[o.length] = w;\n\to[o.length] = ('<fonts count=\"1\"><font><sz val=\"12\"/><color theme=\"1\"/><name val=\"Calibri\"/><family val=\"2\"/><scheme val=\"minor\"/></font></fonts>');\n\to[o.length] = ('<fills count=\"2\"><fill><patternFill patternType=\"none\"/></fill><fill><patternFill patternType=\"gray125\"/></fill></fills>');\n\to[o.length] = ('<borders count=\"1\"><border><left/><right/><top/><bottom/><diagonal/></border></borders>');\n\to[o.length] = ('<cellStyleXfs count=\"1\"><xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\"/></cellStyleXfs>');\n\tif((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);\n\to[o.length] = ('<cellStyles count=\"1\"><cellStyle name=\"Normal\" xfId=\"0\" builtinId=\"0\"/></cellStyles>');\n\to[o.length] = ('<dxfs count=\"0\"/>');\n\to[o.length] = ('<tableStyles count=\"0\" defaultTableStyle=\"TableStyleMedium9\" defaultPivotStyle=\"PivotStyleMedium4\"/>');\n\n\tif(o.length>2){ o[o.length] = ('</styleSheet>'); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.651 BrtFmt */\nfunction parse_BrtFmt(data, length) {\n\tvar ifmt = data.read_shift(2);\n\tvar stFmtCode = parse_XLWideString(data,length-2);\n\treturn [ifmt, stFmtCode];\n}\n\n/* [MS-XLSB] 2.4.653 BrtFont TODO */\nfunction parse_BrtFont(data, length) {\n\tvar out = {flags:{}};\n\tout.dyHeight = data.read_shift(2);\n\tout.grbit = parse_FontFlags(data, 2);\n\tout.bls = data.read_shift(2);\n\tout.sss = data.read_shift(2);\n\tout.uls = data.read_shift(1);\n\tout.bFamily = data.read_shift(1);\n\tout.bCharSet = data.read_shift(1);\n\tdata.l++;\n\tout.brtColor = parse_BrtColor(data, 8);\n\tout.bFontScheme = data.read_shift(1);\n\tout.name = parse_XLWideString(data, length - 21);\n\n\tout.flags.Bold = out.bls === 0x02BC;\n\tout.flags.Italic = out.grbit.fItalic;\n\tout.flags.Strikeout = out.grbit.fStrikeout;\n\tout.flags.Outline = out.grbit.fOutline;\n\tout.flags.Shadow = out.grbit.fShadow;\n\tout.flags.Condense = out.grbit.fCondense;\n\tout.flags.Extend = out.grbit.fExtend;\n\tout.flags.Sub = out.sss & 0x2;\n\tout.flags.Sup = out.sss & 0x1;\n\treturn out;\n}\n\n/* [MS-XLSB] 2.4.816 BrtXF */\nfunction parse_BrtXF(data, length) {\n\tvar ixfeParent = data.read_shift(2);\n\tvar ifmt = data.read_shift(2);\n\tparsenoop(data, length-4);\n\treturn {ixfe:ixfeParent, ifmt:ifmt };\n}\n\n/* [MS-XLSB] 2.1.7.50 Styles */\nfunction parse_sty_bin(data, opts) {\n\tstyles.NumberFmt = [];\n\tfor(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y];\n\n\tstyles.CellXf = [];\n\tvar state = \"\"; /* TODO: this should be a stack */\n\tvar pass = false;\n\trecordhopper(data, function hopper_sty(val, R, RT) {\n\t\tswitch(R.n) {\n\t\t\tcase 'BrtFmt':\n\t\t\t\tstyles.NumberFmt[val[0]] = val[1]; SSF.load(val[1], val[0]);\n\t\t\t\tbreak;\n\t\t\tcase 'BrtFont': break; /* TODO */\n\t\t\tcase 'BrtKnownFonts': break; /* TODO */\n\t\t\tcase 'BrtFill': break; /* TODO */\n\t\t\tcase 'BrtBorder': break; /* TODO */\n\t\t\tcase 'BrtXF':\n\t\t\t\tif(state === \"CELLXFS\") {\n\t\t\t\t\tstyles.CellXf.push(val);\n\t\t\t\t}\n\t\t\t\tbreak; /* TODO */\n\t\t\tcase 'BrtStyle': break; /* TODO */\n\t\t\tcase 'BrtDXF': break; /* TODO */\n\t\t\tcase 'BrtMRUColor': break; /* TODO */\n\t\t\tcase 'BrtIndexedColor': break; /* TODO */\n\t\t\tcase 'BrtBeginStyleSheet': break;\n\t\t\tcase 'BrtEndStyleSheet': break;\n\t\t\tcase 'BrtBeginTableStyle': break;\n\t\t\tcase 'BrtTableStyleElement': break;\n\t\t\tcase 'BrtEndTableStyle': break;\n\t\t\tcase 'BrtBeginFmts': state = \"FMTS\"; break;\n\t\t\tcase 'BrtEndFmts': state = \"\"; break;\n\t\t\tcase 'BrtBeginFonts': state = \"FONTS\"; break;\n\t\t\tcase 'BrtEndFonts': state = \"\"; break;\n\t\t\tcase 'BrtACBegin': state = \"ACFONTS\"; break;\n\t\t\tcase 'BrtACEnd': state = \"\"; break;\n\t\t\tcase 'BrtBeginFills': state = \"FILLS\"; break;\n\t\t\tcase 'BrtEndFills': state = \"\"; break;\n\t\t\tcase 'BrtBeginBorders': state = \"BORDERS\"; break;\n\t\t\tcase 'BrtEndBorders': state = \"\"; break;\n\t\t\tcase 'BrtBeginCellStyleXFs': state = \"CELLSTYLEXFS\"; break;\n\t\t\tcase 'BrtEndCellStyleXFs': state = \"\"; break;\n\t\t\tcase 'BrtBeginCellXFs': state = \"CELLXFS\"; break;\n\t\t\tcase 'BrtEndCellXFs': state = \"\"; break;\n\t\t\tcase 'BrtBeginStyles': state = \"STYLES\"; break;\n\t\t\tcase 'BrtEndStyles': state = \"\"; break;\n\t\t\tcase 'BrtBeginDXFs': state = \"DXFS\"; break;\n\t\t\tcase 'BrtEndDXFs': state = \"\"; break;\n\t\t\tcase 'BrtBeginTableStyles': state = \"TABLESTYLES\"; break;\n\t\t\tcase 'BrtEndTableStyles': state = \"\"; break;\n\t\t\tcase 'BrtBeginColorPalette': state = \"COLORPALETTE\"; break;\n\t\t\tcase 'BrtEndColorPalette': state = \"\"; break;\n\t\t\tcase 'BrtBeginIndexedColors': state = \"INDEXEDCOLORS\"; break;\n\t\t\tcase 'BrtEndIndexedColors': state = \"\"; break;\n\t\t\tcase 'BrtBeginMRUColors': state = \"MRUCOLORS\"; break;\n\t\t\tcase 'BrtEndMRUColors': state = \"\"; break;\n\t\t\tcase 'BrtFRTBegin': pass = true; break;\n\t\t\tcase 'BrtFRTEnd': pass = false; break;\n\t\t\tcase 'BrtBeginStyleSheetExt14': break;\n\t\t\tcase 'BrtBeginSlicerStyles': break;\n\t\t\tcase 'BrtEndSlicerStyles': break;\n\t\t\tcase 'BrtBeginTimelineStylesheetExt15': break;\n\t\t\tcase 'BrtEndTimelineStylesheetExt15': break;\n\t\t\tcase 'BrtBeginTimelineStyles': break;\n\t\t\tcase 'BrtEndTimelineStyles': break;\n\t\t\tcase 'BrtEndStyleSheetExt14': break;\n\t\t\tdefault: if(!pass || opts.WTF) throw new Error(\"Unexpected record \" + RT + \" \" + R.n);\n\t\t}\n\t});\n\treturn styles;\n}\n\n/* [MS-XLSB] 2.1.7.50 Styles */\nfunction write_sty_bin(data, opts) {\n\tvar ba = buf_array();\n\twrite_record(ba, \"BrtBeginStyleSheet\");\n\t/* [FMTS] */\n\t/* [FONTS] */\n\t/* [FILLS] */\n\t/* [BORDERS] */\n\t/* CELLSTYLEXFS */\n\t/* CELLXFS*/\n\t/* STYLES */\n\t/* DXFS */\n\t/* TABLESTYLES */\n\t/* [COLORPALETTE] */\n\t/* FRTSTYLESHEET*/\n\twrite_record(ba, \"BrtEndStyleSheet\");\n\treturn ba.end();\n}\nRELS.THEME = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\";\n\n/* 20.1.6.2 clrScheme CT_ColorScheme */\nfunction parse_clrScheme(t, opts) {\n\tthemes.themeElements.clrScheme = [];\n\tvar color = {};\n\tt[0].match(tagregex).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '<a:clrScheme': case '</a:clrScheme>': break;\n\n\t\t\t/* 20.1.2.3.32 srgbClr CT_SRgbColor */\n\t\t\tcase '<a:srgbClr': color.rgb = y.val; break;\n\n\t\t\t/* 20.1.2.3.33 sysClr CT_SystemColor */\n\t\t\tcase '<a:sysClr': color.rgb = y.lastClr; break;\n\n\t\t\t/* 20.1.4.1.9 dk1 (Dark 1) */\n\t\t\tcase '<a:dk1>':\n\t\t\tcase '</a:dk1>':\n\t\t\t/* 20.1.4.1.10 dk2 (Dark 2) */\n\t\t\tcase '<a:dk2>':\n\t\t\tcase '</a:dk2>':\n\t\t\t/* 20.1.4.1.22 lt1 (Light 1) */\n\t\t\tcase '<a:lt1>':\n\t\t\tcase '</a:lt1>':\n\t\t\t/* 20.1.4.1.23 lt2 (Light 2) */\n\t\t\tcase '<a:lt2>':\n\t\t\tcase '</a:lt2>':\n\t\t\t/* 20.1.4.1.1 accent1 (Accent 1) */\n\t\t\tcase '<a:accent1>':\n\t\t\tcase '</a:accent1>':\n\t\t\t/* 20.1.4.1.2 accent2 (Accent 2) */\n\t\t\tcase '<a:accent2>':\n\t\t\tcase '</a:accent2>':\n\t\t\t/* 20.1.4.1.3 accent3 (Accent 3) */\n\t\t\tcase '<a:accent3>':\n\t\t\tcase '</a:accent3>':\n\t\t\t/* 20.1.4.1.4 accent4 (Accent 4) */\n\t\t\tcase '<a:accent4>':\n\t\t\tcase '</a:accent4>':\n\t\t\t/* 20.1.4.1.5 accent5 (Accent 5) */\n\t\t\tcase '<a:accent5>':\n\t\t\tcase '</a:accent5>':\n\t\t\t/* 20.1.4.1.6 accent6 (Accent 6) */\n\t\t\tcase '<a:accent6>':\n\t\t\tcase '</a:accent6>':\n\t\t\t/* 20.1.4.1.19 hlink (Hyperlink) */\n\t\t\tcase '<a:hlink>':\n\t\t\tcase '</a:hlink>':\n\t\t\t/* 20.1.4.1.15 folHlink (Followed Hyperlink) */\n\t\t\tcase '<a:folHlink>':\n\t\t\tcase '</a:folHlink>':\n\t\t\t\tif (y[0][1] === '/') {\n\t\t\t\t\tthemes.themeElements.clrScheme.push(color);\n\t\t\t\t\tcolor = {};\n\t\t\t\t} else {\n\t\t\t\t\tcolor.name = y[0].substring(3, y[0].length - 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in clrScheme';\n\t\t}\n\t});\n}\n\n/* 20.1.4.1.18 fontScheme CT_FontScheme */\nfunction parse_fontScheme(t, opts) { }\n\n/* 20.1.4.1.15 fmtScheme CT_StyleMatrix */\nfunction parse_fmtScheme(t, opts) { }\n\nvar clrsregex = /<a:clrScheme([^>]*)>[^\\u2603]*<\\/a:clrScheme>/;\nvar fntsregex = /<a:fontScheme([^>]*)>[^\\u2603]*<\\/a:fontScheme>/;\nvar fmtsregex = /<a:fmtScheme([^>]*)>[^\\u2603]*<\\/a:fmtScheme>/;\n\n/* 20.1.6.10 themeElements CT_BaseStyles */\nfunction parse_themeElements(data, opts) {\n\tthemes.themeElements = {};\n\n\tvar t;\n\n\t[\n\t\t/* clrScheme CT_ColorScheme */\n\t\t['clrScheme', clrsregex, parse_clrScheme],\n\t\t/* fontScheme CT_FontScheme */\n\t\t['fontScheme', fntsregex, parse_fontScheme],\n\t\t/* fmtScheme CT_StyleMatrix */\n\t\t['fmtScheme', fmtsregex, parse_fmtScheme]\n\t].forEach(function(m) {\n\t\tif(!(t=data.match(m[1]))) throw m[0] + ' not found in themeElements';\n\t\tm[2](t, opts);\n\t});\n}\n\nvar themeltregex = /<a:themeElements([^>]*)>[^\\u2603]*<\\/a:themeElements>/;\n\n/* 14.2.7 Theme Part */\nfunction parse_theme_xml(data, opts) {\n\t/* 20.1.6.9 theme CT_OfficeStyleSheet */\n\tif(!data || data.length === 0) return themes;\n\n\tvar t;\n\n\t/* themeElements CT_BaseStyles */\n\tif(!(t=data.match(themeltregex))) throw 'themeElements not found in theme';\n\tparse_themeElements(t[0], opts);\n\n\treturn themes;\n}\n\nfunction write_theme() { return '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2><a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/></a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5><a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/></a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Cambria\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"MS Pゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"MS Pゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"1\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"100000\"/><a:shade val=\"100000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:shade val=\"100000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/></a:schemeClr></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera><a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"40000\"><a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:spDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"3\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"lt1\"/></a:fontRef></a:style></a:spDef><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"0\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/></a:theme>'; }\n/* [MS-XLS] 2.4.326 TODO: payload is a zip file */\nfunction parse_Theme(blob, length) {\n\tvar dwThemeVersion = blob.read_shift(4);\n\tif(dwThemeVersion === 124226) return;\n\tblob.l += length-4;\n}\n\n/* 2.5.49 */\nfunction parse_ColorTheme(blob, length) { return blob.read_shift(4); }\n\n/* 2.5.155 */\nfunction parse_FullColorExt(blob, length) {\n\tvar o = {};\n\to.xclrType = blob.read_shift(2);\n\to.nTintShade = blob.read_shift(2);\n\tswitch(o.xclrType) {\n\t\tcase 0: blob.l += 4; break;\n\t\tcase 1: o.xclrValue = parse_IcvXF(blob, 4); break;\n\t\tcase 2: o.xclrValue = parse_LongRGBA(blob, 4); break;\n\t\tcase 3: o.xclrValue = parse_ColorTheme(blob, 4); break;\n\t\tcase 4: blob.l += 4; break;\n\t}\n\tblob.l += 8;\n\treturn o;\n}\n\n/* 2.5.164 TODO: read 7 bits*/\nfunction parse_IcvXF(blob, length) {\n\treturn parsenoop(blob, length);\n}\n\n/* 2.5.280 */\nfunction parse_XFExtGradient(blob, length) {\n\treturn parsenoop(blob, length);\n}\n\n/* 2.5.108 */\nfunction parse_ExtProp(blob, length) {\n\tvar extType = blob.read_shift(2);\n\tvar cb = blob.read_shift(2);\n\tvar o = [extType];\n\tswitch(extType) {\n\t\tcase 0x04: case 0x05: case 0x07: case 0x08:\n\t\tcase 0x09: case 0x0A: case 0x0B: case 0x0D:\n\t\t\to[1] = parse_FullColorExt(blob, cb); break;\n\t\tcase 0x06: o[1] = parse_XFExtGradient(blob, cb); break;\n\t\tcase 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 5 ? 1 : 2); break;\n\t\tdefault: throw new Error(\"Unrecognized ExtProp type: \" + extType + \" \" + cb);\n\t}\n\treturn o;\n}\n\n/* 2.4.355 */\nfunction parse_XFExt(blob, length) {\n\tvar end = blob.l + length;\n\tblob.l += 2;\n\tvar ixfe = blob.read_shift(2);\n\tblob.l += 2;\n\tvar cexts = blob.read_shift(2);\n\tvar ext = [];\n\twhile(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l));\n\treturn {ixfe:ixfe, ext:ext};\n}\n\n/* xf is an XF, see parse_XFExt for xfext */\nfunction update_xfext(xf, xfext) {\n\txfext.forEach(function(xfe) {\n\t\tswitch(xfe[0]) { /* 2.5.108 extPropData */\n\t\t\tcase 0x04: break; /* foreground color */\n\t\t\tcase 0x05: break; /* background color */\n\t\t\tcase 0x07: case 0x08: case 0x09: case 0x0a: break;\n\t\t\tcase 0x0d: break; /* text color */\n\t\t\tcase 0x0e: break; /* font scheme */\n\t\t\tdefault: throw \"bafuq\" + xfe[0].toString(16);\n\t\t}\n\t});\n}\n\n/* 18.6 Calculation Chain */\nfunction parse_cc_xml(data, opts) {\n\tvar d = [];\n\tvar l = 0, i = 1;\n\t(data.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '<?xml': break;\n\t\t\t/* 18.6.2 calcChain CT_CalcChain 1 */\n\t\t\tcase '<calcChain': case '<calcChain>': case '</calcChain>': break;\n\t\t\t/* 18.6.1 c CT_CalcCell 1 */\n\t\t\tcase '<c': delete y[0]; if(y.i) i = y.i; else y.i = i; d.push(y); break;\n\t\t}\n\t});\n\treturn d;\n}\n\nfunction write_cc_xml(data, opts) { }\n/* [MS-XLSB] 2.6.4.1 */\nfunction parse_BrtCalcChainItem$(data, length) {\n\tvar out = {};\n\tout.i = data.read_shift(4);\n\tvar cell = {};\n\tcell.r = data.read_shift(4);\n\tcell.c = data.read_shift(4);\n\tout.r = encode_cell(cell);\n\tvar flags = data.read_shift(1);\n\tif(flags & 0x2) out.l = '1';\n\tif(flags & 0x8) out.a = '1';\n\treturn out;\n}\n\n/* 18.6 Calculation Chain */\nfunction parse_cc_bin(data, opts) {\n\tvar out = [];\n\tvar pass = false;\n\trecordhopper(data, function hopper_cc(val, R, RT) {\n\t\tswitch(R.n) {\n\t\t\tcase 'BrtCalcChainItem$': out.push(val); break;\n\t\t\tcase 'BrtBeginCalcChain$': break;\n\t\t\tcase 'BrtEndCalcChain$': break;\n\t\t\tdefault: if(!pass || opts.WTF) throw new Error(\"Unexpected record \" + RT + \" \" + R.n);\n\t\t}\n\t});\n\treturn out;\n}\n\nfunction write_cc_bin(data, opts) { }\n\nfunction parse_comments(zip, dirComments, sheets, sheetRels, opts) {\n\tfor(var i = 0; i != dirComments.length; ++i) {\n\t\tvar canonicalpath=dirComments[i];\n\t\tvar comments=parse_cmnt(getzipdata(zip, canonicalpath.replace(/^\\//,''), true), canonicalpath, opts);\n\t\tif(!comments || !comments.length) continue;\n\t\t// find the sheets targeted by these comments\n\t\tvar sheetNames = keys(sheets);\n\t\tfor(var j = 0; j != sheetNames.length; ++j) {\n\t\t\tvar sheetName = sheetNames[j];\n\t\t\tvar rels = sheetRels[sheetName];\n\t\t\tif(rels) {\n\t\t\t\tvar rel = rels[canonicalpath];\n\t\t\t\tif(rel) insertCommentsIntoSheet(sheetName, sheets[sheetName], comments);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction insertCommentsIntoSheet(sheetName, sheet, comments) {\n\tcomments.forEach(function(comment) {\n\t\tvar cell = sheet[comment.ref];\n\t\tif (!cell) {\n\t\t\tcell = {};\n\t\t\tsheet[comment.ref] = cell;\n\t\t\tvar range = safe_decode_range(sheet[\"!ref\"]||\"BDWGO1000001:A1\");\n\t\t\tvar thisCell = decode_cell(comment.ref);\n\t\t\tif(range.s.r > thisCell.r) range.s.r = thisCell.r;\n\t\t\tif(range.e.r < thisCell.r) range.e.r = thisCell.r;\n\t\t\tif(range.s.c > thisCell.c) range.s.c = thisCell.c;\n\t\t\tif(range.e.c < thisCell.c) range.e.c = thisCell.c;\n\t\t\tvar encoded = encode_range(range);\n\t\t\tif (encoded !== sheet[\"!ref\"]) sheet[\"!ref\"] = encoded;\n\t\t}\n\n\t\tif (!cell.c) cell.c = [];\n\t\tvar o = {a: comment.author, t: comment.t, r: comment.r};\n\t\tif(comment.h) o.h = comment.h;\n\t\tcell.c.push(o);\n\t});\n}\n\n/* 18.7.3 CT_Comment */\nfunction parse_comments_xml(data, opts) {\n\tif(data.match(/<(?:\\w+:)?comments *\\/>/)) return [];\n\tvar authors = [];\n\tvar commentList = [];\n\tdata.match(/<(?:\\w+:)?authors>([^\\u2603]*)<\\/(?:\\w+:)?authors>/)[1].split(/<\\/\\w*:?author>/).forEach(function(x) {\n\t\tif(x === \"\" || x.trim() === \"\") return;\n\t\tauthors.push(x.match(/<(?:\\w+:)?author[^>]*>(.*)/)[1]);\n\t});\n\t(data.match(/<(?:\\w+:)?commentList>([^\\u2603]*)<\\/(?:\\w+:)?commentList>/)||[\"\",\"\"])[1].split(/<\\/\\w*:?comment>/).forEach(function(x, index) {\n\t\tif(x === \"\" || x.trim() === \"\") return;\n\t\tvar y = parsexmltag(x.match(/<(?:\\w+:)?comment[^>]*>/)[0]);\n\t\tvar comment = { author: y.authorId && authors[y.authorId] ? authors[y.authorId] : undefined, ref: y.ref, guid: y.guid };\n\t\tvar cell = decode_cell(y.ref);\n\t\tif(opts.sheetRows && opts.sheetRows <= cell.r) return;\n\t\tvar textMatch = x.match(/<text>([^\\u2603]*)<\\/text>/);\n\t\tif (!textMatch || !textMatch[1]) return; // a comment may contain an empty text tag.\n\t\tvar rt = parse_si(textMatch[1]);\n\t\tcomment.r = rt.r;\n\t\tcomment.t = rt.t;\n\t\tif(opts.cellHTML) comment.h = rt.h;\n\t\tcommentList.push(comment);\n\t});\n\treturn commentList;\n}\n\nfunction write_comments_xml(data, opts) { }\n/* [MS-XLSB] 2.4.28 BrtBeginComment */\nfunction parse_BrtBeginComment(data, length) {\n\tvar out = {};\n\tout.iauthor = data.read_shift(4);\n\tvar rfx = parse_UncheckedRfX(data, 16);\n\tout.rfx = rfx.s;\n\tout.ref = encode_cell(rfx.s);\n\tdata.l += 16; /*var guid = parse_GUID(data); */\n\treturn out;\n}\n\n/* [MS-XLSB] 2.4.324 BrtCommentAuthor */\nvar parse_BrtCommentAuthor = parse_XLWideString;\n\n/* [MS-XLSB] 2.4.325 BrtCommentText */\nvar parse_BrtCommentText = parse_RichStr;\n\n/* [MS-XLSB] 2.1.7.8 Comments */\nfunction parse_comments_bin(data, opts) {\n\tvar out = [];\n\tvar authors = [];\n\tvar c = {};\n\tvar pass = false;\n\trecordhopper(data, function hopper_cmnt(val, R, RT) {\n\t\tswitch(R.n) {\n\t\t\tcase 'BrtCommentAuthor': authors.push(val); break;\n\t\t\tcase 'BrtBeginComment': c = val; break;\n\t\t\tcase 'BrtCommentText': c.t = val.t; c.h = val.h; c.r = val.r; break;\n\t\t\tcase 'BrtEndComment':\n\t\t\t\tc.author = authors[c.iauthor];\n\t\t\t\tdelete c.iauthor;\n\t\t\t\tif(opts.sheetRows && opts.sheetRows <= c.rfx.r) break;\n\t\t\t\tdelete c.rfx; out.push(c); break;\n\t\t\tcase 'BrtBeginComments': break;\n\t\t\tcase 'BrtEndComments': break;\n\t\t\tcase 'BrtBeginCommentAuthors': break;\n\t\t\tcase 'BrtEndCommentAuthors': break;\n\t\t\tcase 'BrtBeginCommentList': break;\n\t\t\tcase 'BrtEndCommentList': break;\n\t\t\tdefault: if(!pass || opts.WTF) throw new Error(\"Unexpected record \" + RT + \" \" + R.n);\n\t\t}\n\t});\n\treturn out;\n}\n\nfunction write_comments_bin(data, opts) { }\n/* TODO: it will be useful to parse the function str */\nvar rc_to_a1 = (function(){\n\tvar rcregex = /(^|[^A-Za-z])R(\\[?)(-?\\d+|)\\]?C(\\[?)(-?\\d+|)\\]?/g;\n\tvar rcbase;\n\tfunction rcfunc($$,$1,$2,$3,$4,$5) {\n\t\tvar R = $3.length>0?parseInt($3,10)|0:0, C = $5.length>0?parseInt($5,10)|0:0;\n\t\tif(C<0 && $4.length === 0) C=0;\n\t\tif($4.length > 0) C += rcbase.c;\n\t\tif($2.length > 0) R += rcbase.r;\n\t\treturn $1 + encode_col(C) + encode_row(R);\n\t}\n\treturn function rc_to_a1(fstr, base) {\n\t\trcbase = base;\n\t\treturn fstr.replace(rcregex, rcfunc);\n\t};\n})();\n\n/* --- formula references point to MS-XLS --- */\n/* Small helpers */\nfunction parseread(l) { return function(blob, length) { blob.l+=l; return; }; }\nfunction parseread1(blob, length) { blob.l+=1; return; }\n\n/* Rgce Helpers */\n\n/* 2.5.51 */\nfunction parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}\n\n/* 2.5.198.105 */\nfunction parse_RgceArea(blob, length) {\n\tvar r=blob.read_shift(2), R=blob.read_shift(2);\n\tvar c=parse_ColRelU(blob, 2);\n\tvar C=parse_ColRelU(blob, 2);\n\treturn { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };\n}\n\n/* 2.5.198.105 TODO */\nfunction parse_RgceAreaRel(blob, length) {\n\tvar r=blob.read_shift(2), R=blob.read_shift(2);\n\tvar c=parse_ColRelU(blob, 2);\n\tvar C=parse_ColRelU(blob, 2);\n\treturn { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };\n}\n\n/* 2.5.198.109 */\nfunction parse_RgceLoc(blob, length) {\n\tvar r = blob.read_shift(2);\n\tvar c = parse_ColRelU(blob, 2);\n\treturn {r:r, c:c[0], cRel:c[1], rRel:c[2]};\n}\n\n/* 2.5.198.111 */\nfunction parse_RgceLocRel(blob, length) {\n\tvar r = blob.read_shift(2);\n\tvar cl = blob.read_shift(2);\n\tvar cRel = (cl & 0x8000) >> 15, rRel = (cl & 0x4000) >> 14;\n\tcl &= 0x3FFF;\n\tif(cRel !== 0) while(cl >= 0x100) cl -= 0x100;\n\treturn {r:r,c:cl,cRel:cRel,rRel:rRel};\n}\n\n/* Ptg Tokens */\n\n/* 2.5.198.27 */\nfunction parse_PtgArea(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar area = parse_RgceArea(blob, 8);\n\treturn [type, area];\n}\n\n/* 2.5.198.28 */\nfunction parse_PtgArea3d(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar ixti = blob.read_shift(2);\n\tvar area = parse_RgceArea(blob, 8);\n\treturn [type, ixti, area];\n}\n\n/* 2.5.198.29 */\nfunction parse_PtgAreaErr(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 8;\n\treturn [type];\n}\n/* 2.5.198.30 */\nfunction parse_PtgAreaErr3d(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar ixti = blob.read_shift(2);\n\tblob.l += 8;\n\treturn [type, ixti];\n}\n\n/* 2.5.198.31 */\nfunction parse_PtgAreaN(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar area = parse_RgceAreaRel(blob, 8);\n\treturn [type, area];\n}\n\n/* 2.5.198.32 -- ignore this and look in PtgExtraArray for shape + values */\nfunction parse_PtgArray(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 7;\n\treturn [type];\n}\n\n/* 2.5.198.33 */\nfunction parse_PtgAttrBaxcel(blob, length) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}\n\n/* 2.5.198.34 */\nfunction parse_PtgAttrChoose(blob, length) {\n\tblob.l +=2;\n\tvar offset = blob.read_shift(2);\n\tvar o = [];\n\t/* offset is 1 less than the number of elements */\n\tfor(var i = 0; i <= offset; ++i) o.push(blob.read_shift(2));\n\treturn o;\n}\n\n/* 2.5.198.35 */\nfunction parse_PtgAttrGoto(blob, length) {\n\tvar bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 2;\n\treturn [bitGoto, blob.read_shift(2)];\n}\n\n/* 2.5.198.36 */\nfunction parse_PtgAttrIf(blob, length) {\n\tvar bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 2;\n\treturn [bitIf, blob.read_shift(2)];\n}\n\n/* 2.5.198.37 */\nfunction parse_PtgAttrSemi(blob, length) {\n\tvar bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 4;\n\treturn [bitSemi];\n}\n\n/* 2.5.198.40 (used by PtgAttrSpace and PtgAttrSpaceSemi) */\nfunction parse_PtgAttrSpaceType(blob, length) {\n\tvar type = blob.read_shift(1), cch = blob.read_shift(1);\n\treturn [type, cch];\n}\n\n/* 2.5.198.38 */\nfunction parse_PtgAttrSpace(blob, length) {\n\tblob.read_shift(2);\n\treturn parse_PtgAttrSpaceType(blob, 2);\n}\n\n/* 2.5.198.39 */\nfunction parse_PtgAttrSpaceSemi(blob, length) {\n\tblob.read_shift(2);\n\treturn parse_PtgAttrSpaceType(blob, 2);\n}\n\n/* 2.5.198.84 TODO */\nfunction parse_PtgRef(blob, length) {\n\tvar ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar loc = parse_RgceLoc(blob,4);\n\treturn [type, loc];\n}\n\n/* 2.5.198.88 TODO */\nfunction parse_PtgRefN(blob, length) {\n\tvar ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar loc = parse_RgceLocRel(blob,4);\n\treturn [type, loc];\n}\n\n/* 2.5.198.85 TODO */\nfunction parse_PtgRef3d(blob, length) {\n\tvar ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tvar loc = parse_RgceLoc(blob,4);\n\treturn [type, ixti, loc];\n}\n\n\n/* 2.5.198.62 TODO */\nfunction parse_PtgFunc(blob, length) {\n\tvar ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(2);\n\treturn [FtabArgc[iftab], Ftab[iftab]];\n}\n/* 2.5.198.63 TODO */\nfunction parse_PtgFuncVar(blob, length) {\n\tblob.l++;\n\tvar cparams = blob.read_shift(1), tab = parsetab(blob);\n\treturn [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];\n}\n\nfunction parsetab(blob, length) {\n\treturn [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF];\n}\n\n/* 2.5.198.41 */\nvar parse_PtgAttrSum = parseread(4);\n/* 2.5.198.43 */\nvar parse_PtgConcat = parseread1;\n\n/* 2.5.198.58 */\nfunction parse_PtgExp(blob, length) {\n\tblob.l++;\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(2);\n\treturn [row, col];\n}\n\n/* 2.5.198.57 */\nfunction parse_PtgErr(blob, length) { blob.l++; return BErr[blob.read_shift(1)]; }\n\n/* 2.5.198.66 TODO */\nfunction parse_PtgInt(blob, length) { blob.l++; return blob.read_shift(2); }\n\n/* 2.5.198.42 */\nfunction parse_PtgBool(blob, length) { blob.l++; return blob.read_shift(1)!==0;}\n\n/* 2.5.198.79 */\nfunction parse_PtgNum(blob, length) { blob.l++; return parse_Xnum(blob, 8); }\n\n/* 2.5.198.89 */\nfunction parse_PtgStr(blob, length) { blob.l++; return parse_ShortXLUnicodeString(blob); }\n\n/* 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */\nfunction parse_SerAr(blob) {\n\tvar val = [];\n\tswitch((val[0] = blob.read_shift(1))) {\n\t\t/* 2.5.192.113 */\n\t\tcase 0x04: /* SerBool -- boolean */\n\t\t\tval[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE';\n\t\t\tblob.l += 7; break;\n\t\t/* 2.5.192.114 */\n\t\tcase 0x10: /* SerErr -- error */\n\t\t\tval[1] = BErr[blob[blob.l]];\n\t\t\tblob.l += 8; break;\n\t\t/* 2.5.192.115 */\n\t\tcase 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */\n\t\t\tblob.l += 8; break;\n\t\t/* 2.5.192.116 */\n\t\tcase 0x01: /* SerNum -- Xnum */\n\t\t\tval[1] = parse_Xnum(blob, 8); break;\n\t\t/* 2.5.192.117 */\n\t\tcase 0x02: /* SerStr -- XLUnicodeString (<256 chars) */\n\t\t\tval[1] = parse_XLUnicodeString(blob); break;\n\t\t// default: throw \"Bad SerAr: \" + val[0]; /* Unreachable */\n\t}\n\treturn val;\n}\n\n/* 2.5.198.61 */\nfunction parse_PtgExtraMem(blob, cce) {\n\tvar count = blob.read_shift(2);\n\tvar out = [];\n\tfor(var i = 0; i != count; ++i) out.push(parse_Ref8U(blob, 8));\n\treturn out;\n}\n\n/* 2.5.198.59 */\nfunction parse_PtgExtraArray(blob) {\n\tvar cols = 1 + blob.read_shift(1); //DColByteU\n\tvar rows = 1 + blob.read_shift(2); //DRw\n\tfor(var i = 0, o=[]; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob);\n\treturn o;\n}\n\n/* 2.5.198.76 */\nfunction parse_PtgName(blob, length) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar nameindex = blob.read_shift(4);\n\treturn [type, 0, nameindex];\n}\n\n/* 2.5.198.77 */\nfunction parse_PtgNameX(blob, length) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tvar nameindex = blob.read_shift(4);\n\treturn [type, ixti, nameindex];\n}\n\n/* 2.5.198.70 */\nfunction parse_PtgMemArea(blob, length) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tblob.l += 4;\n\tvar cce = blob.read_shift(2);\n\treturn [type, cce];\n}\n\n/* 2.5.198.72 */\nfunction parse_PtgMemFunc(blob, length) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar cce = blob.read_shift(2);\n\treturn [type, cce];\n}\n\n\n/* 2.5.198.86 */\nfunction parse_PtgRefErr(blob, length) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tblob.l += 4;\n\treturn [type];\n}\n\n/* 2.5.198.26 */\nvar parse_PtgAdd = parseread1;\n/* 2.5.198.45 */\nvar parse_PtgDiv = parseread1;\n/* 2.5.198.56 */\nvar parse_PtgEq = parseread1;\n/* 2.5.198.64 */\nvar parse_PtgGe = parseread1;\n/* 2.5.198.65 */\nvar parse_PtgGt = parseread1;\n/* 2.5.198.67 */\nvar parse_PtgIsect = parseread1;\n/* 2.5.198.68 */\nvar parse_PtgLe =