@livepreso/api 6.52.0 → 6.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.rush/temp/chunked-rush-logs/api.build.chunks.jsonl +5 -2
  2. package/.rush/temp/operation/build/all.log +5 -2
  3. package/.rush/temp/operation/build/error.log +3 -0
  4. package/.rush/temp/operation/build/log-chunks.jsonl +5 -2
  5. package/.rush/temp/operation/build/state.json +1 -1
  6. package/.rush/temp/shrinkwrap-deps.json +11 -2
  7. package/CHANGELOG.json +32 -0
  8. package/CHANGELOG.md +20 -1
  9. package/cjs/collections/base.js +15 -1
  10. package/cjs/collections/base.js.map +1 -1
  11. package/cjs/collections/base.spec.js +61 -0
  12. package/cjs/collections/base.spec.js.map +1 -1
  13. package/cjs/models/base.js +54 -12
  14. package/cjs/models/base.js.map +1 -1
  15. package/cjs/models/base.spec.js +28 -0
  16. package/cjs/models/base.spec.js.map +1 -1
  17. package/cjs/models/deck-version.js +14 -5
  18. package/cjs/models/deck-version.js.map +1 -1
  19. package/cjs/presentation/presentation-deck.js +28 -15
  20. package/cjs/presentation/presentation-deck.js.map +1 -1
  21. package/cjs/presentation/presentation-section.js +19 -9
  22. package/cjs/presentation/presentation-section.js.map +1 -1
  23. package/cjs/presentation/presentation-section.spec.js +3 -3
  24. package/cjs/presentation/presentation-section.spec.js.map +1 -1
  25. package/cjs/presentation/presentation-slide.js +22 -5
  26. package/cjs/presentation/presentation-slide.js.map +1 -1
  27. package/cjs/presentation/presentation.js +2 -2
  28. package/cjs/presentation/presentation.js.map +1 -1
  29. package/package.json +3 -3
  30. package/rush-logs/api.build.error.log +3 -0
  31. package/rush-logs/api.build.log +5 -2
  32. package/src/collections/base.js +13 -2
  33. package/src/collections/base.spec.js +37 -0
  34. package/src/models/base.js +38 -11
  35. package/src/models/base.spec.js +18 -0
  36. package/src/models/deck-version.js +7 -4
  37. package/src/presentation/presentation-deck.js +34 -17
  38. package/src/presentation/presentation-section.js +15 -3
  39. package/src/presentation/presentation-section.spec.js +2 -6
  40. package/src/presentation/presentation-slide.js +17 -2
  41. package/src/presentation/presentation.js +2 -2
  42. package/.rush/temp/1aebf46f78ad5c45f82f8147751890adb37bef9d.log +0 -10
  43. package/.rush/temp/256021b5963b4c0221d3dec247b697b9691a9b2c.log +0 -10
  44. package/.rush/temp/2a322f00f12cf9d1e64afe81275cc78d01c49050.log +0 -10
  45. package/.rush/temp/30061f1865447dcbb3f20a305061205f3dbe6091.log +0 -10
  46. package/.rush/temp/3cdc82c352e8ed90607952873f3aa4c200490874.log +0 -10
  47. package/.rush/temp/45522aea0dee8cb2be1a53248ba45bd235743b43.log +0 -10
  48. package/.rush/temp/5489ab737e406518983c16c57fc3e1edc07c0341.log +0 -10
  49. package/.rush/temp/58fcbb7f15a76326d40e0839ab179755da82a891.log +0 -10
  50. package/.rush/temp/5bc0bba70b733baa4dd976667ba0a1386e516186.log +0 -10
  51. package/.rush/temp/64f1bb696f8d7d7e72907b80df316b127f72e23e.log +0 -10
  52. package/.rush/temp/6f640f951414ea68adb65c17e4ed7527cde54faf.log +0 -10
  53. package/.rush/temp/7c7b958682d4ab5697530be47d0aac62efe1adf1.log +0 -10
  54. package/.rush/temp/82bfb987463fbcfebf04022e6ed00015c73879c8.log +0 -10
  55. package/.rush/temp/844034aa6e542115075e8f3dc5ffc640973e0064.log +0 -10
  56. package/.rush/temp/8b42957a7c15da1f29cb57bee125f13affa70dca.log +0 -10
  57. package/.rush/temp/924652444ab5a6063f328a2217123a2227058896.log +0 -10
  58. package/.rush/temp/9f2030f96d62f3e38052e35201819a216566f14f.log +0 -10
  59. package/.rush/temp/a769db9d81a23000c0e9b1bf4f1a9a9e721d0d7c.log +0 -10
  60. package/.rush/temp/a87d3a8b4ece87ec66f27c86226a9f205617681f.log +0 -10
  61. package/.rush/temp/bb7a5bdcc4af4ad1507f81f33774b31f5b4e4fb7.log +0 -10
  62. package/.rush/temp/build-cache-tar.log +0 -7
  63. package/.rush/temp/c20e29ccaaa9231b38a28bb24451b4ce7562cdc0.log +0 -10
  64. package/.rush/temp/chunked-rush-logs/api.test.chunks.jsonl +0 -1
  65. package/.rush/temp/e21303db8f59b4625fd184c9114377d781fd24f8.log +0 -10
  66. package/.rush/temp/e6d303862765b6a5f41dd483d0f9ae083a1fae10.log +0 -10
  67. package/.rush/temp/eaf69fbc059d2f1258d7569136180d4a1d3c7072.log +0 -10
  68. package/.rush/temp/f85d279e2674966daaec83e1c3986a96f86ef304.log +0 -10
  69. package/.rush/temp/fc0a332c5b34c6b90006850cf2d93a48fb4b9a6e.log +0 -10
  70. package/.rush/temp/operation/test/all.log +0 -19
  71. package/.rush/temp/operation/test/state.json +0 -3
  72. package/.rush/temp/package-deps_build.json +0 -185
  73. package/api.build.log +0 -9
  74. package/api.test.cache.log +0 -1
  75. package/api.test.log +0 -19
  76. package/rush-logs/api.test.cache.log +0 -1
  77. package/rush-logs/api.test.log +0 -1
@@ -129,7 +129,9 @@ var DeckVersionModel = exports.DeckVersionModel = _base.BaseModel.extend(/** @le
129
129
  }
130
130
  return _bluebird.default.resolve().then(function () {
131
131
  if (Object.keys(_this.getSafeAttrs()).length === 1 || !_this.index_asset) {
132
- return _this.fetch();
132
+ return _this.fetch({
133
+ fetchTemplates: false
134
+ });
133
135
  }
134
136
  return null;
135
137
  }).then(function () {
@@ -182,14 +184,21 @@ var DeckVersionModel = exports.DeckVersionModel = _base.BaseModel.extend(/** @le
182
184
  });
183
185
  return _bluebird.default.all(imports);
184
186
  },
185
- fetch: function fetch() {
186
- var _this2 = this;
187
- var fetch = _base.BaseModel.prototype.fetch.apply(this, arguments);
187
+ fetch: function fetch(opts) {
188
+ var _opts$fetchTemplates,
189
+ _this2 = this;
190
+ for (var _len = arguments.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
191
+ other[_key - 1] = arguments[_key];
192
+ }
193
+ var fetch = _base.BaseModel.prototype.fetch.apply(this, [opts].concat(other));
194
+ var shouldFetchTemplates = (_opts$fetchTemplates = opts === null || opts === void 0 ? void 0 : opts.fetchTemplates) !== null && _opts$fetchTemplates !== void 0 ? _opts$fetchTemplates : true;
188
195
  return _bluebird.default.resolve(fetch).tap(function () {
189
196
  // `template_set` used to come on the deckversion response, but we have since
190
197
  // decided to request it separately (this helps with caching). To keep the app
191
198
  // working with minimal changes, we're making the extra request here.
192
- return _this2.template_set.fetch();
199
+ if (shouldFetchTemplates) {
200
+ return _this2.template_set.fetch();
201
+ }
193
202
  });
194
203
  },
195
204
  getRootAssetUrl: function getRootAssetUrl() {
@@ -1 +1 @@
1
- {"version":3,"file":"deck-version.js","names":["require","_auth","_base","_deckVersionScreenshots","_bluebird","_interopRequireDefault","_collections","_lodash","_stateRegister","_superagent","DeckVersionModel","exports","BaseModel","extend","modelName","props","image_128","image_256","image_512","image_128_archive","image_256_archive","image_512_archive","namespaced_key","creation_status","creation_percent","update_description","version","approved","approval","pack_root_url","upgrade_description","friendly_release_notes","has_editable_share_support","has_signing_support","point_in_time_share_policy","tags","cmsvalkey_set","children","deck","index_asset","pack","manifest_json","collections","section_set","note_set","derived","screenshots","deps","fn","DeckVersionScreenshotCollection","deckversion","template_set","templates","TemplateCollection","data","id","scope","getHooksPath","_this","_ref","arguments","length","undefined","_ref$rootAssetPath","rootAssetPath","isNew","Error","Promise","resolve","concat","hooks","then","Object","keys","getSafeAttrs","fetch","rootAssetUrl","getRootAssetUrl","getHooks","_ref2","_ref2$rootAssetPath","hooksPath","SystemJS","import","default","getFixtures","fixtures","fixturePaths","imports","_","map","fixture","key","path","superagent","get","response","text","JSON","parse","body","catch","SuperagentPromiseError","e","all","_this2","prototype","apply","tap","indexAsset","_retrieveURL","split","slice","join","replace","fetchLayout","presetId","teamIds","queryParams","preset_id","team_id","reject","url","set","Auth","headers","query","res","ok","toServer","register"],"sources":["../../src/models/deck-version.js"],"sourcesContent":["import \"../collections/sections.js\";\nimport \"../collections/deck-notes.js\";\nimport \"./pack.js\";\nimport \"./deck.js\";\nimport \"./asset.js\";\nimport \"./manifest-json.js\";\n\nimport { Auth } from \"../auth.js\";\nimport { BaseModel } from \"./base.js\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport Promise from \"bluebird\";\nimport { TemplateCollection } from \"../collections.js\";\nimport _ from \"lodash\";\nimport { register } from \"../state-register.js\";\nimport superagent from \"superagent\";\n\n/**\n * @constructor\n * @alias models.DeckVersionModel\n * @extends models.BaseModel\n */\nexport const DeckVersionModel = BaseModel.extend(\n\t/** @lends models.DeckVersionModel# */ {\n\t\tmodelName: \"deckversions\",\n\n\t\t/**\n\t\t * @property {string} image_128\n\t\t * @property {string} image_256\n\t\t * @property {string} image_512\n\t\t * @property {string} image_128_archive\n\t\t * @property {string} image_256_archive\n\t\t * @property {string} image_512_archive\n\t\t * @property {string} namespaced_key\n\t\t * @property {string} creation_status\n\t\t * @property {string} update_description\n\t\t * @property {version} version\n\t\t * @property {boolean} approved\n\t\t * @property {string} approval\n\t\t * @property {string} pack_root_url\n\t\t * @property {string} upgrade_description\n\t\t * @property {string} friendly_release_notes\n\t\t * @property {boolean} has_editable_share_support\n\t\t * @property {string} point_in_time_share_policy\n\t\t * @property {string[]} tags\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\timage_128: \"string\",\n\t\t\timage_256: \"string\",\n\t\t\timage_512: \"string\",\n\t\t\timage_128_archive: \"string\",\n\t\t\timage_256_archive: \"string\",\n\t\t\timage_512_archive: \"string\",\n\t\t\tnamespaced_key: \"string\",\n\t\t\tcreation_status: \"string\",\n\t\t\tcreation_percent: \"number\",\n\t\t\tupdate_description: \"string\",\n\t\t\tversion: \"number\",\n\t\t\tapproved: \"boolean\",\n\t\t\tapproval: \"string\",\n\t\t\tpack_root_url: \"string\",\n\t\t\tupgrade_description: \"string\",\n\t\t\tfriendly_release_notes: \"string\",\n\t\t\thas_editable_share_support: \"boolean\",\n\t\t\thas_signing_support: \"boolean\",\n\t\t\tpoint_in_time_share_policy: \"string\",\n\t\t\ttags: \"array\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t},\n\n\t\t/**\n\t\t * @property {models.DeckModel} deck\n\t\t * @property {models.AssetModel} index_asset\n\t\t * @property {models.PackModel} pack\n\t\t * @property {models.ManifestJSONModel} manifest_json\n\t\t */\n\t\tchildren: {\n\t\t\tdeck: \"DeckModel\",\n\t\t\tindex_asset: \"AssetModel\",\n\t\t\tpack: \"PackModel\",\n\t\t\tmanifest_json: \"ManifestJSONModel\",\n\t\t},\n\n\t\t/**\n\t\t * @property {collections.SectionCollection} section_set\n\t\t * @property {models.DeckNoteCollection} note_set\n\t\t */\n\t\tcollections: {\n\t\t\tsection_set: \"SectionCollection\",\n\t\t\tnote_set: \"DeckNoteCollection\",\n\t\t},\n\n\t\t/**\n\t\t * @property {collections.DeckVersionScreenshotCollection} screenshots\n\t\t */\n\t\tderived: {\n\t\t\tscreenshots: {\n\t\t\t\tdeps: [\"id\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\tconst screenshots = new DeckVersionScreenshotCollection(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdeckversion: this,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn screenshots;\n\t\t\t\t},\n\t\t\t},\n\n\t\t\ttemplate_set: {\n\t\t\t\tdeps: [\"id\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\tconst templates = new TemplateCollection(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tdeckversion: this.id,\n\t\t\t\t\t\t\t\tscope: \"global\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn templates;\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tgetHooksPath({ rootAssetPath = null } = {}) {\n\t\t\tif (this.isNew()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Can only get hooks from a fetched deckversion or at least have an ID\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (rootAssetPath) {\n\t\t\t\treturn Promise.resolve(`${rootAssetPath}${this.manifest_json.hooks}`);\n\t\t\t}\n\n\t\t\treturn Promise.resolve()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tObject.keys(this.getSafeAttrs()).length === 1 ||\n\t\t\t\t\t\t!this.index_asset\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn this.fetch();\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (this.manifest_json.isNew()) {\n\t\t\t\t\t\treturn this.manifest_json.fetch();\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tconst rootAssetUrl = this.getRootAssetUrl();\n\t\t\t\t\tif (!this.manifest_json.hooks) {\n\t\t\t\t\t\tthrow new Error(\"Manifest does not contain a hooks entry\");\n\t\t\t\t\t}\n\t\t\t\t\treturn `${rootAssetUrl}${this.manifest_json.hooks}`;\n\t\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * @todo This should eventually return a hooks interface\n\t\t * @returns {object}\n\t\t */\n\t\tgetHooks({ rootAssetPath = null } = {}) {\n\t\t\treturn this.getHooksPath({ rootAssetPath })\n\t\t\t\t.then((hooksPath) => {\n\t\t\t\t\treturn SystemJS.import(hooksPath);\n\t\t\t\t})\n\t\t\t\t.then((hooks) => {\n\t\t\t\t\tif (hooks.default) {\n\t\t\t\t\t\treturn hooks.default;\n\t\t\t\t\t}\n\t\t\t\t\treturn hooks;\n\t\t\t\t});\n\t\t},\n\n\t\tgetFixtures(fixtures = {}, rootAssetUrl = this.getRootAssetUrl()) {\n\t\t\tconst fixturePaths = this.manifest_json.fixtures || {};\n\n\t\t\tconst imports = _.map(fixturePaths, (fixture, key) => {\n\t\t\t\tconst path = `${rootAssetUrl}${fixture}`;\n\n\t\t\t\treturn superagent\n\t\t\t\t\t.get(path)\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tif (response.text) {\n\t\t\t\t\t\t\tfixtures[key] = JSON.parse(response.text);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfixtures[key] = response.body || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch(superagent.SuperagentPromiseError, (e) => {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(imports);\n\t\t},\n\n\t\tfetch() {\n\t\t\tconst fetch = BaseModel.prototype.fetch.apply(this, arguments);\n\n\t\t\treturn Promise.resolve(fetch).tap(() => {\n\t\t\t\t// `template_set` used to come on the deckversion response, but we have since\n\t\t\t\t// decided to request it separately (this helps with caching). To keep the app\n\t\t\t\t// working with minimal changes, we're making the extra request here.\n\t\t\t\treturn this.template_set.fetch();\n\t\t\t});\n\t\t},\n\n\t\tgetRootAssetUrl() {\n\t\t\tconst indexAsset = this._retrieveURL(this.index_asset);\n\t\t\treturn (\n\t\t\t\t`${indexAsset.split(\"/\").slice(0, -1).join(\"/\")}/`\n\t\t\t\t\t// HACK: We've got instances (see: myob) that are returning ports in their urls.\n\t\t\t\t\t// SystemJS gets confused and starts caching multiple versions (one with and without\n\t\t\t\t\t// this port), causing havoc. If we see it, strip it.\n\t\t\t\t\t.replace(\":443\", \"\")\n\t\t\t);\n\t\t},\n\n\t\tfetchLayout: function (presetId, teamIds) {\n\t\t\tlet queryParams = { version: this.version };\n\t\t\tif (presetId) {\n\t\t\t\tqueryParams.preset_id = presetId;\n\t\t\t}\n\t\t\tif (teamIds) {\n\t\t\t\tqueryParams.team_id = teamIds;\n\t\t\t}\n\n\t\t\tif (!this.id) {\n\t\t\t\treturn Promise.reject(new Error(\"DeckVersion has no ID.\"));\n\t\t\t}\n\n\t\t\tconst path = `${this.deck.url()}layout/`;\n\n\t\t\treturn superagent\n\t\t\t\t.get(path)\n\t\t\t\t.set(Auth.headers)\n\t\t\t\t.query(queryParams)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\treturn Promise.reject(res);\n\t\t\t\t\t}\n\t\t\t\t\treturn res.body;\n\t\t\t\t});\n\t\t},\n\n\t\ttoServer() {\n\t\t\treturn {\n\t\t\t\tapproval: this.approval,\n\t\t\t\tupgrade_description: this.upgrade_description,\n\t\t\t};\n\t\t},\n\t},\n);\n\nregister(\"DeckVersionModel\", DeckVersionModel);\n"],"mappings":";;;;;;;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAJ,sBAAA,CAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMU,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,eAAS,CAACC,MAAM,CAC/C,sCAAuC;EACtCC,SAAS,EAAE,cAAc;EAEzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,KAAK,EAAE;IACNC,SAAS,EAAE,QAAQ;IACnBC,SAAS,EAAE,QAAQ;IACnBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,QAAQ;IAC3BC,iBAAiB,EAAE,QAAQ;IAC3BC,iBAAiB,EAAE,QAAQ;IAC3BC,cAAc,EAAE,QAAQ;IACxBC,eAAe,EAAE,QAAQ;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,OAAO,EAAE,IAAI,CAACA;IAAQ,CAAC;IAC3C,IAAI0F,QAAQ,EAAE;MACbE,WAAW,CAACC,SAAS,GAAGH,QAAQ;IACjC;IACA,IAAIC,OAAO,EAAE;MACZC,WAAW,CAACE,OAAO,GAAGH,OAAO;IAC9B;IAEA,IAAI,CAAC,IAAI,CAAC9D,EAAE,EAAE;MACb,OAAOY,iBAAO,CAACsD,MAAM,CAAC,IAAIvD,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3D;IAEA,IAAM2B,IAAI,MAAAxB,MAAA,CAAM,IAAI,CAAC/B,IAAI,CAACoF,GAAG,CAAC,CAAC,YAAS;IAExC,OAAO5B,mBAAU,CACfC,GAAG,CAACF,IAAI,CAAC,CACT8B,GAAG,CAACC,UAAI,CAACC,OAAO,CAAC,CACjBC,KAAK,CAACR,WAAW,CAAC,CAClB/C,IAAI,CAAC,UAACwD,GAAG,EAAK;MACd,IAAI,CAACA,GAAG,CAACC,EAAE,EAAE;QACZ,OAAO7D,iBAAO,CAACsD,MAAM,CAACM,GAAG,CAAC;MAC3B;MACA,OAAOA,GAAG,CAAC3B,IAAI;IAChB,CAAC,CAAC;EACJ,CAAC;EAED6B,QAAQ,WAARA,QAAQA,CAAA,EAAG;IACV,OAAO;MACNrG,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,mBAAmB,EAAE,IAAI,CAACA;IAC3B,CAAC;EACF;AACD,CACD,CAAC;AAED,IAAAoG,uBAAQ,EAAC,kBAAkB,EAAExH,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"deck-version.js","names":["require","_auth","_base","_deckVersionScreenshots","_bluebird","_interopRequireDefault","_collections","_lodash","_stateRegister","_superagent","DeckVersionModel","exports","BaseModel","extend","modelName","props","image_128","image_256","image_512","image_128_archive","image_256_archive","image_512_archive","namespaced_key","creation_status","creation_percent","update_description","version","approved","approval","pack_root_url","upgrade_description","friendly_release_notes","has_editable_share_support","has_signing_support","point_in_time_share_policy","tags","cmsvalkey_set","children","deck","index_asset","pack","manifest_json","collections","section_set","note_set","derived","screenshots","deps","fn","DeckVersionScreenshotCollection","deckversion","template_set","templates","TemplateCollection","data","id","scope","getHooksPath","_this","_ref","arguments","length","undefined","_ref$rootAssetPath","rootAssetPath","isNew","Error","Promise","resolve","concat","hooks","then","Object","keys","getSafeAttrs","fetch","fetchTemplates","rootAssetUrl","getRootAssetUrl","getHooks","_ref2","_ref2$rootAssetPath","hooksPath","SystemJS","import","default","getFixtures","fixtures","fixturePaths","imports","_","map","fixture","key","path","superagent","get","response","text","JSON","parse","body","catch","SuperagentPromiseError","e","all","opts","_opts$fetchTemplates","_this2","_len","other","Array","_key","prototype","apply","shouldFetchTemplates","tap","indexAsset","_retrieveURL","split","slice","join","replace","fetchLayout","presetId","teamIds","queryParams","preset_id","team_id","reject","url","set","Auth","headers","query","res","ok","toServer","register"],"sources":["../../src/models/deck-version.js"],"sourcesContent":["import \"../collections/sections.js\";\nimport \"../collections/deck-notes.js\";\nimport \"./pack.js\";\nimport \"./deck.js\";\nimport \"./asset.js\";\nimport \"./manifest-json.js\";\n\nimport { Auth } from \"../auth.js\";\nimport { BaseModel } from \"./base.js\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport Promise from \"bluebird\";\nimport { TemplateCollection } from \"../collections.js\";\nimport _ from \"lodash\";\nimport { register } from \"../state-register.js\";\nimport superagent from \"superagent\";\n\n/**\n * @constructor\n * @alias models.DeckVersionModel\n * @extends models.BaseModel\n */\nexport const DeckVersionModel = BaseModel.extend(\n\t/** @lends models.DeckVersionModel# */ {\n\t\tmodelName: \"deckversions\",\n\n\t\t/**\n\t\t * @property {string} image_128\n\t\t * @property {string} image_256\n\t\t * @property {string} image_512\n\t\t * @property {string} image_128_archive\n\t\t * @property {string} image_256_archive\n\t\t * @property {string} image_512_archive\n\t\t * @property {string} namespaced_key\n\t\t * @property {string} creation_status\n\t\t * @property {string} update_description\n\t\t * @property {version} version\n\t\t * @property {boolean} approved\n\t\t * @property {string} approval\n\t\t * @property {string} pack_root_url\n\t\t * @property {string} upgrade_description\n\t\t * @property {string} friendly_release_notes\n\t\t * @property {boolean} has_editable_share_support\n\t\t * @property {string} point_in_time_share_policy\n\t\t * @property {string[]} tags\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\timage_128: \"string\",\n\t\t\timage_256: \"string\",\n\t\t\timage_512: \"string\",\n\t\t\timage_128_archive: \"string\",\n\t\t\timage_256_archive: \"string\",\n\t\t\timage_512_archive: \"string\",\n\t\t\tnamespaced_key: \"string\",\n\t\t\tcreation_status: \"string\",\n\t\t\tcreation_percent: \"number\",\n\t\t\tupdate_description: \"string\",\n\t\t\tversion: \"number\",\n\t\t\tapproved: \"boolean\",\n\t\t\tapproval: \"string\",\n\t\t\tpack_root_url: \"string\",\n\t\t\tupgrade_description: \"string\",\n\t\t\tfriendly_release_notes: \"string\",\n\t\t\thas_editable_share_support: \"boolean\",\n\t\t\thas_signing_support: \"boolean\",\n\t\t\tpoint_in_time_share_policy: \"string\",\n\t\t\ttags: \"array\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t},\n\n\t\t/**\n\t\t * @property {models.DeckModel} deck\n\t\t * @property {models.AssetModel} index_asset\n\t\t * @property {models.PackModel} pack\n\t\t * @property {models.ManifestJSONModel} manifest_json\n\t\t */\n\t\tchildren: {\n\t\t\tdeck: \"DeckModel\",\n\t\t\tindex_asset: \"AssetModel\",\n\t\t\tpack: \"PackModel\",\n\t\t\tmanifest_json: \"ManifestJSONModel\",\n\t\t},\n\n\t\t/**\n\t\t * @property {collections.SectionCollection} section_set\n\t\t * @property {models.DeckNoteCollection} note_set\n\t\t */\n\t\tcollections: {\n\t\t\tsection_set: \"SectionCollection\",\n\t\t\tnote_set: \"DeckNoteCollection\",\n\t\t},\n\n\t\t/**\n\t\t * @property {collections.DeckVersionScreenshotCollection} screenshots\n\t\t */\n\t\tderived: {\n\t\t\tscreenshots: {\n\t\t\t\tdeps: [\"id\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\tconst screenshots = new DeckVersionScreenshotCollection(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdeckversion: this,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn screenshots;\n\t\t\t\t},\n\t\t\t},\n\n\t\t\ttemplate_set: {\n\t\t\t\tdeps: [\"id\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\tconst templates = new TemplateCollection(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tdeckversion: this.id,\n\t\t\t\t\t\t\t\tscope: \"global\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn templates;\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tgetHooksPath({ rootAssetPath = null } = {}) {\n\t\t\tif (this.isNew()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Can only get hooks from a fetched deckversion or at least have an ID\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (rootAssetPath) {\n\t\t\t\treturn Promise.resolve(`${rootAssetPath}${this.manifest_json.hooks}`);\n\t\t\t}\n\n\t\t\treturn Promise.resolve()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tObject.keys(this.getSafeAttrs()).length === 1 ||\n\t\t\t\t\t\t!this.index_asset\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn this.fetch({ fetchTemplates: false });\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (this.manifest_json.isNew()) {\n\t\t\t\t\t\treturn this.manifest_json.fetch();\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tconst rootAssetUrl = this.getRootAssetUrl();\n\t\t\t\t\tif (!this.manifest_json.hooks) {\n\t\t\t\t\t\tthrow new Error(\"Manifest does not contain a hooks entry\");\n\t\t\t\t\t}\n\t\t\t\t\treturn `${rootAssetUrl}${this.manifest_json.hooks}`;\n\t\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * @todo This should eventually return a hooks interface\n\t\t * @returns {object}\n\t\t */\n\t\tgetHooks({ rootAssetPath = null } = {}) {\n\t\t\treturn this.getHooksPath({ rootAssetPath })\n\t\t\t\t.then((hooksPath) => {\n\t\t\t\t\treturn SystemJS.import(hooksPath);\n\t\t\t\t})\n\t\t\t\t.then((hooks) => {\n\t\t\t\t\tif (hooks.default) {\n\t\t\t\t\t\treturn hooks.default;\n\t\t\t\t\t}\n\t\t\t\t\treturn hooks;\n\t\t\t\t});\n\t\t},\n\n\t\tgetFixtures(fixtures = {}, rootAssetUrl = this.getRootAssetUrl()) {\n\t\t\tconst fixturePaths = this.manifest_json.fixtures || {};\n\n\t\t\tconst imports = _.map(fixturePaths, (fixture, key) => {\n\t\t\t\tconst path = `${rootAssetUrl}${fixture}`;\n\n\t\t\t\treturn superagent\n\t\t\t\t\t.get(path)\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tif (response.text) {\n\t\t\t\t\t\t\tfixtures[key] = JSON.parse(response.text);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfixtures[key] = response.body || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch(superagent.SuperagentPromiseError, (e) => {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(imports);\n\t\t},\n\n\t\tfetch(opts, ...other) {\n\t\t\tconst fetch = BaseModel.prototype.fetch.apply(this, [opts, ...other]);\n\t\t\tconst shouldFetchTemplates = opts?.fetchTemplates ?? true;\n\n\t\t\treturn Promise.resolve(fetch).tap(() => {\n\t\t\t\t// `template_set` used to come on the deckversion response, but we have since\n\t\t\t\t// decided to request it separately (this helps with caching). To keep the app\n\t\t\t\t// working with minimal changes, we're making the extra request here.\n\t\t\t\tif (shouldFetchTemplates) {\n\t\t\t\t\treturn this.template_set.fetch();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tgetRootAssetUrl() {\n\t\t\tconst indexAsset = this._retrieveURL(this.index_asset);\n\t\t\treturn (\n\t\t\t\t`${indexAsset.split(\"/\").slice(0, -1).join(\"/\")}/`\n\t\t\t\t\t// HACK: We've got instances (see: myob) that are returning ports in their urls.\n\t\t\t\t\t// SystemJS gets confused and starts caching multiple versions (one with and without\n\t\t\t\t\t// this port), causing havoc. If we see it, strip it.\n\t\t\t\t\t.replace(\":443\", \"\")\n\t\t\t);\n\t\t},\n\n\t\tfetchLayout: function (presetId, teamIds) {\n\t\t\tlet queryParams = { version: this.version };\n\t\t\tif (presetId) {\n\t\t\t\tqueryParams.preset_id = presetId;\n\t\t\t}\n\t\t\tif (teamIds) {\n\t\t\t\tqueryParams.team_id = teamIds;\n\t\t\t}\n\n\t\t\tif (!this.id) {\n\t\t\t\treturn Promise.reject(new Error(\"DeckVersion has no ID.\"));\n\t\t\t}\n\n\t\t\tconst path = `${this.deck.url()}layout/`;\n\n\t\t\treturn superagent\n\t\t\t\t.get(path)\n\t\t\t\t.set(Auth.headers)\n\t\t\t\t.query(queryParams)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\treturn Promise.reject(res);\n\t\t\t\t\t}\n\t\t\t\t\treturn res.body;\n\t\t\t\t});\n\t\t},\n\n\t\ttoServer() {\n\t\t\treturn {\n\t\t\t\tapproval: this.approval,\n\t\t\t\tupgrade_description: this.upgrade_description,\n\t\t\t};\n\t\t},\n\t},\n);\n\nregister(\"DeckVersionModel\", DeckVersionModel);\n"],"mappings":";;;;;;;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAA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AI,CAACA;IAAQ,CAAC;IAC3C,IAAIkG,QAAQ,EAAE;MACbE,WAAW,CAACC,SAAS,GAAGH,QAAQ;IACjC;IACA,IAAIC,OAAO,EAAE;MACZC,WAAW,CAACE,OAAO,GAAGH,OAAO;IAC9B;IAEA,IAAI,CAAC,IAAI,CAACtE,EAAE,EAAE;MACb,OAAOY,iBAAO,CAAC8D,MAAM,CAAC,IAAI/D,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3D;IAEA,IAAM4B,IAAI,MAAAzB,MAAA,CAAM,IAAI,CAAC/B,IAAI,CAAC4F,GAAG,CAAC,CAAC,YAAS;IAExC,OAAOnC,mBAAU,CACfC,GAAG,CAACF,IAAI,CAAC,CACTqC,GAAG,CAACC,UAAI,CAACC,OAAO,CAAC,CACjBC,KAAK,CAACR,WAAW,CAAC,CAClBvD,IAAI,CAAC,UAACgE,GAAG,EAAK;MACd,IAAI,CAACA,GAAG,CAACC,EAAE,EAAE;QACZ,OAAOrE,iBAAO,CAAC8D,MAAM,CAACM,GAAG,CAAC;MAC3B;MACA,OAAOA,GAAG,CAAClC,IAAI;IAChB,CAAC,CAAC;EACJ,CAAC;EAEDoC,QAAQ,WAARA,QAAQA,CAAA,EAAG;IACV,OAAO;MACN7G,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,mBAAmB,EAAE,IAAI,CAACA;IAC3B,CAAC;EACF;AACD,CACD,CAAC;AAED,IAAA4G,uBAAQ,EAAC,kBAAkB,EAAEhI,gBAAgB,CAAC","ignoreList":[]}
@@ -238,7 +238,7 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
238
238
  realSection.slide_set.forEach(function (slideModel) {
239
239
  var isSection = (0, _utils.isImpostor)(slideModel);
240
240
  if (isSection) {
241
- var section = _presentationSection.PresentationSection.createFromImpostorSection(slideModel, _models.DeckVersionModel, options);
241
+ var section = _presentationSection.PresentationSection.createFromImpostorSection(slideModel, options);
242
242
  deck.sections.add(section);
243
243
  } else {
244
244
  var slide = _presentationSlide.PresentationSlide.createFromSlide(slideModel, options);
@@ -318,13 +318,10 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
318
318
  if (!auto.template) {
319
319
  throw new Error("Attempted to use an autoadjunct that has no template.");
320
320
  }
321
- var section = _presentationSection.PresentationSection.createFromTemplate(auto.template, deck.sections.length + index, options.getUniqueAdjunctID());
322
-
323
- // We've just borrowed the "from template" method above. We want to add
324
- // back some of the specific keys about the auto.
325
- section.autoAdjunctID = auto.id;
326
- section.key = auto.key;
327
- section.title = auto.name;
321
+ var section = _presentationSection.PresentationSection.createFromAutoAdjunct(auto, {
322
+ index: deck.sections.length + index,
323
+ deckversionID: deck.id
324
+ });
328
325
  return section;
329
326
  });
330
327
  deck.sections.add(autoSections);
@@ -332,7 +329,8 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
332
329
  (0, _utils.setSequentialSequences)(deck);
333
330
  return deck;
334
331
  };
335
- PresentationDeck.createFromManifestJSON = function (manifestJSON) {
332
+ PresentationDeck.createFromManifestJSON = function (manifestJSON, project) {
333
+ var _project$welcome$edit, _project$welcome;
336
334
  var deck = new PresentationDeck({
337
335
  id: parseInt(_lodash.default.uniqueId(), 10),
338
336
  index: 0,
@@ -346,7 +344,7 @@ PresentationDeck.createFromManifestJSON = function (manifestJSON) {
346
344
  title: "Local",
347
345
  version: 1,
348
346
  tags: manifestJSON.tags[""] || [],
349
- cmsvalkey_set: []
347
+ cmsvalkey_set: (_project$welcome$edit = project === null || project === void 0 ? void 0 : (_project$welcome = project.welcome) === null || _project$welcome === void 0 ? void 0 : _project$welcome.editables) !== null && _project$welcome$edit !== void 0 ? _project$welcome$edit : []
350
348
  });
351
349
  var usesImpostorSections = _lodash.default.some(manifestJSON.tags, function (tags) {
352
350
  return tags.indexOf("section-header") !== -1;
@@ -379,30 +377,45 @@ PresentationDeck.createFromManifestJSON = function (manifestJSON) {
379
377
  item.slides = slides;
380
378
  });
381
379
  deck.sections.add(sections.map(function (section, index) {
382
- return _presentationSection.PresentationSection.createFromManifestImpostor(section, index);
380
+ return _presentationSection.PresentationSection.createFromManifestImpostor(section, project, index);
383
381
  }));
384
- deck.realSection = _presentationSection.PresentationSection.createFromManifestImpostor(items[0]);
382
+ deck.realSection = _presentationSection.PresentationSection.createFromManifestImpostor(items[0], project);
385
383
  } else {
386
384
  var sectionKeys = Object.keys(manifestJSON.titles).filter(function (title) {
387
385
  return title.split("/").length === 1;
388
386
  });
389
387
  deck.sections.add(sectionKeys.map(function (key, index) {
390
- return _presentationSection.PresentationSection.createFromManifestJSON(manifestJSON, key, index);
388
+ return _presentationSection.PresentationSection.createFromManifestJSON(manifestJSON, project, key, index);
391
389
  }));
392
390
  }
393
391
  if (manifestJSON.templates) {
394
392
  var templates = Object.keys(manifestJSON.templates).map(function (key) {
393
+ var _project$templates$fi, _project$templates, _project$templates$fi2, _project$templates$fi3;
394
+ var cmsvals = (_project$templates$fi = project === null || project === void 0 ? void 0 : (_project$templates = project.templates) === null || _project$templates === void 0 ? void 0 : (_project$templates$fi2 = _project$templates.find) === null || _project$templates$fi2 === void 0 ? void 0 : (_project$templates$fi3 = _project$templates$fi2.call(_project$templates, function (t) {
395
+ return t.key === key;
396
+ })) === null || _project$templates$fi3 === void 0 ? void 0 : _project$templates$fi3.editables) !== null && _project$templates$fi !== void 0 ? _project$templates$fi : [];
395
397
  return _objectSpread(_objectSpread({}, manifestJSON.templates[key]), {}, {
396
398
  key: key,
397
399
  sequence: manifestJSON.templates[key].ordering,
398
400
  index_asset: {
399
401
  url: _url.default.resolve(manifestJSON.getTemplateAssetPath(key), "index.html")
400
- }
402
+ },
403
+ cmsvalkey_set: cmsvals
401
404
  });
402
405
  });
403
406
  var minID = _lodash.default.max(_lodash.default.map(deck.sections.toJSON(), "id"));
404
407
  deck.sections.add(templates.map(function (template, index) {
405
- return _presentationSection.PresentationSection.createFromTemplate(template, index, minID);
408
+ var _project$templates2, _project$templates2$f;
409
+ var section = _presentationSection.PresentationSection.createFromTemplate(template, index, minID);
410
+ var projTemplate = project === null || project === void 0 ? void 0 : (_project$templates2 = project.templates) === null || _project$templates2 === void 0 ? void 0 : (_project$templates2$f = _project$templates2.find) === null || _project$templates2$f === void 0 ? void 0 : _project$templates2$f.call(_project$templates2, function (s) {
411
+ return s.key === section.key.replace("template-", "");
412
+ });
413
+ if (projTemplate !== null && projTemplate !== void 0 && projTemplate.editables) {
414
+ section.cmsvalkey_set = projTemplate.editables.map(function (key) {
415
+ return "".concat(key, "-autoadjunct-").concat(section.autoAdjunctID);
416
+ });
417
+ }
418
+ return section;
406
419
  }));
407
420
  }
408
421
  return deck;
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","_url","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","tags","version","namespacedKey","cmsvalkey_set","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","isWelcome","sections","url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_deckVersionModel$nam","options","undefined","_","defaults","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","screenshots","DeckVersionScreenshotCollection","rootAssetPath","templates","choicelist","screenshotsToMap","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isSection","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","models","reverse","sectionSlides","Math","floor","template","createFromTemplate","autoSections","auto","Error","autoAdjunctID","name","setSequentialSequences","createFromManifestJSON","manifestJSON","parseInt","uniqueId","url2","resolve","getAssetPath","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","slice","createFromManifestImpostor","sectionKeys","getTemplateAssetPath","minID","max","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport url2 from \"url\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\t_.defaults(options, {\n\t\tindex: 0,\n\t\tautoAdjuncts: new collections.AutoAdjunctCollection(),\n\t\tadjunctSections: new collections.AdjunctSectionCollection(),\n\t\tadjunctSlides: new collections.AdjunctSlideCollection(),\n\t\tadjunctSubSlides: new collections.AdjunctSubSlideCollection(),\n\t\tsectionSelections: new collections.SectionSelectionCollection(),\n\t\tslideSelections: new collections.SlideSelectionCollection(),\n\t\tscreenshots: new collections.DeckVersionScreenshotCollection(),\n\t\trootAssetPath: null,\n\t\ttemplates: null,\n\t\tchoicelist: null,\n\t});\n\n\toptions.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides = options.adjunctSlides.filter((slide) => {\n\t\t\t\treturn slide.section && slide.section.id === section.id;\n\t\t\t});\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = slides.filter(\n\t\t\t\t(slide) => slide.sequence > section.sequence,\n\t\t\t);\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\n\t\t\tslides = slides.filter((slide) => slide.sequence <= section.sequence);\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\tauto.template,\n\t\t\t\tdeck.sections.length + index,\n\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t);\n\n\t\t\t// We've just borrowed the \"from template\" method above. We want to add\n\t\t\t// back some of the specific keys about the auto.\n\t\t\tsection.autoAdjunctID = auto.id;\n\t\t\tsection.key = auto.key;\n\t\t\tsection.title = auto.name;\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: url2.resolve(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: url2.resolve(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: url2.resolve(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: url2.resolve(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(section, index);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(items[0]);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: url2.resolve(\n\t\t\t\t\t\tmanifestJSON.getTemplateAssetPath(key),\n\t\t\t\t\t\t\"index.html\",\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t};\n\t\t});\n\n\t\tconst minID = _.max(_.map(deck.sections.toJSON(), \"id\"));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(template, index, minID);\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,cAAA,GAA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AC5D,GAAG,EAAEJ,KAAK,EAAK;MAC/B,OAAOkB,wCAAmB,CAACuF,sBAAsB,CAChDC,YAAY,EACZtG,GAAG,EACHJ,KACD,CAAC;IACF,CAAC,CACF,CAAC;EACF;EAEA,IAAI0G,YAAY,CAAC5D,SAAS,EAAE;IAC3B,IAAMA,SAAS,GAAG9E,MAAM,CAACS,IAAI,CAACiI,YAAY,CAAC5D,SAAS,CAAC,CAACkB,GAAG,CAAC,UAAC5D,GAAG,EAAK;MAClE,OAAApB,aAAA,CAAAA,aAAA,KACI0H,YAAY,CAAC5D,SAAS,CAAC1C,GAAG,CAAC;QAC9BA,GAAG,EAAHA,GAAG;QACH8D,QAAQ,EAAEwC,YAAY,CAAC5D,SAAS,CAAC1C,GAAG,CAAC,CAAC+G,QAAQ;QAC9ChE,WAAW,EAAE;UACZ7B,GAAG,EAAEuF,YAAI,CAACC,OAAO,CAChBJ,YAAY,CAACoB,oBAAoB,CAAC1H,GAAG,CAAC,EACtC,YACD;QACD;MAAC;IAEH,CAAC,CAAC;IAEF,IAAM2H,KAAK,GAAGlG,eAAC,CAACmG,GAAG,CAACnG,eAAC,CAACmC,GAAG,CAACV,IAAI,CAACjC,QAAQ,CAACyC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAExDR,IAAI,CAACjC,QAAQ,CAACwD,GAAG,CAChB/B,SAAS,CAACkB,GAAG,CAAC,UAACiC,QAAQ,EAAEjG,KAAK,EAAK;MAClC,OAAOkB,wCAAmB,CAACgF,kBAAkB,CAACD,QAAQ,EAAEjG,KAAK,EAAE+H,KAAK,CAAC;IACtE,CAAC,CACF,CAAC;EACF;EAEA,OAAOzE,IAAI;AACZ,CAAC;AAED,IAAA2E,uBAAQ,EAAC,kBAAkB,EAAE1I,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","_url","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","tags","version","namespacedKey","cmsvalkey_set","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","isWelcome","sections","url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_deckVersionModel$nam","options","undefined","_","defaults","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","screenshots","DeckVersionScreenshotCollection","rootAssetPath","templates","choicelist","screenshotsToMap","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isSection","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","models","reverse","sectionSlides","Math","floor","template","createFromTemplate","autoSections","auto","Error","createFromAutoAdjunct","deckversionID","setSequentialSequences","createFromManifestJSON","manifestJSON","project","_project$welcome$edit","_project$welcome","parseInt","uniqueId","url2","resolve","getAssetPath","welcome","editables","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","slice","createFromManifestImpostor","sectionKeys","_project$templates$fi","_project$templates","_project$templates$fi2","_project$templates$fi3","cmsvals","find","getTemplateAssetPath","minID","max","_project$templates2","_project$templates2$f","projTemplate","s","replace","autoAdjunctID","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport url2 from \"url\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\t_.defaults(options, {\n\t\tindex: 0,\n\t\tautoAdjuncts: new collections.AutoAdjunctCollection(),\n\t\tadjunctSections: new collections.AdjunctSectionCollection(),\n\t\tadjunctSlides: new collections.AdjunctSlideCollection(),\n\t\tadjunctSubSlides: new collections.AdjunctSubSlideCollection(),\n\t\tsectionSelections: new collections.SectionSelectionCollection(),\n\t\tslideSelections: new collections.SlideSelectionCollection(),\n\t\tscreenshots: new collections.DeckVersionScreenshotCollection(),\n\t\trootAssetPath: null,\n\t\ttemplates: null,\n\t\tchoicelist: null,\n\t});\n\n\toptions.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides = options.adjunctSlides.filter((slide) => {\n\t\t\t\treturn slide.section && slide.section.id === section.id;\n\t\t\t});\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = slides.filter(\n\t\t\t\t(slide) => slide.sequence > section.sequence,\n\t\t\t);\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\n\t\t\tslides = slides.filter((slide) => slide.sequence <= section.sequence);\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromAutoAdjunct(auto, {\n\t\t\t\tindex: deck.sections.length + index,\n\t\t\t\tdeckversionID: deck.id,\n\t\t\t});\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON, project) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: url2.resolve(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: url2.resolve(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: project?.welcome?.editables ?? [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: url2.resolve(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: url2.resolve(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(\n\t\t\t\t\tsection,\n\t\t\t\t\tproject,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(\n\t\t\titems[0],\n\t\t\tproject,\n\t\t);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tproject,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\tconst cmsvals =\n\t\t\t\tproject?.templates?.find?.((t) => t.key === key)?.editables ?? [];\n\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: url2.resolve(\n\t\t\t\t\t\tmanifestJSON.getTemplateAssetPath(key),\n\t\t\t\t\t\t\"index.html\",\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\tcmsvalkey_set: cmsvals,\n\t\t\t};\n\t\t});\n\n\t\tconst minID = _.max(_.map(deck.sections.toJSON(), \"id\"));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tindex,\n\t\t\t\t\tminID,\n\t\t\t\t);\n\t\t\t\tconst projTemplate = project?.templates?.find?.(\n\t\t\t\t\t(s) => s.key === section.key.replace(\"template-\", \"\"),\n\t\t\t\t);\n\t\t\t\tif (projTemplate?.editables) {\n\t\t\t\t\tsection.cmsvalkey_set = projTemplate.editables.map((key) => {\n\t\t\t\t\t\treturn `${key}-autoadjunct-${section.autoAdjunctID}`;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn section;\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY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,KAAK,GAAG7G,eAAC,CAAC8G,GAAG,CAAC9G,eAAC,CAACmC,GAAG,CAACV,IAAI,CAACjC,QAAQ,CAACyC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAExDR,IAAI,CAACjC,QAAQ,CAACwD,GAAG,CAChB/B,SAAS,CAACkB,GAAG,CAAC,UAACiC,QAAQ,EAAEjG,KAAK,EAAK;MAAA,IAAA4I,mBAAA,EAAAC,qBAAA;MAClC,IAAM1E,OAAO,GAAGjD,wCAAmB,CAACgF,kBAAkB,CACrDD,QAAQ,EACRjG,KAAK,EACL0I,KACD,CAAC;MACD,IAAMI,YAAY,GAAGnC,OAAO,aAAPA,OAAO,wBAAAiC,mBAAA,GAAPjC,OAAO,CAAE7D,SAAS,cAAA8F,mBAAA,wBAAAC,qBAAA,GAAlBD,mBAAA,CAAoBJ,IAAI,cAAAK,qBAAA,uBAAxBA,qBAAA,CAAAxK,IAAA,CAAAuK,mBAAA,EACpB,UAACG,CAAC;QAAA,OAAKA,CAAC,CAAC3I,GAAG,KAAK+D,OAAO,CAAC/D,GAAG,CAAC4I,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;MAAA,CACtD,CAAC;MACD,IAAIF,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAE1B,SAAS,EAAE;QAC5BjD,OAAO,CAACvD,aAAa,GAAGkI,YAAY,CAAC1B,SAAS,CAACpD,GAAG,CAAC,UAAC5D,GAAG,EAAK;UAC3D,UAAAgD,MAAA,CAAUhD,GAAG,mBAAAgD,MAAA,CAAgBe,OAAO,CAAC8E,aAAa;QACnD,CAAC,CAAC;MACH;MACA,OAAO9E,OAAO;IACf,CAAC,CACF,CAAC;EACF;EAEA,OAAOb,IAAI;AACZ,CAAC;AAED,IAAA4F,uBAAQ,EAAC,kBAAkB,EAAE3J,gBAAgB,CAAC","ignoreList":[]}
@@ -300,8 +300,8 @@ PresentationSection.createFromAdjunctSection = function (adjunctSectionModel, de
300
300
  }
301
301
  return section;
302
302
  };
303
- PresentationSection.createFromImpostorSection = function (slideModel, DeckVersionModel) {
304
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
303
+ PresentationSection.createFromImpostorSection = function (slideModel) {
304
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
305
305
  _lodash.default.defaults(options, {
306
306
  rootAssetPath: null,
307
307
  selections: null,
@@ -346,7 +346,11 @@ PresentationSection.createFromImpostorSection = function (slideModel, DeckVersio
346
346
  });
347
347
  return section;
348
348
  };
349
- PresentationSection.createFromManifestJSON = function (manifestJSON, sectionKey, index) {
349
+ PresentationSection.createFromManifestJSON = function (manifestJSON, project, sectionKey, index) {
350
+ var _projectSection$edita;
351
+ var projectSection = project === null || project === void 0 ? void 0 : project.sections.find(function (s) {
352
+ return s.key === sectionKey;
353
+ });
350
354
  var section = new PresentationSection({
351
355
  id: parseInt(_lodash.default.uniqueId(), 10),
352
356
  index: index,
@@ -360,29 +364,35 @@ PresentationSection.createFromManifestJSON = function (manifestJSON, sectionKey,
360
364
  visible: true,
361
365
  deckversion: 1,
362
366
  tags: manifestJSON.tags[sectionKey] || null,
363
- cmsvalkey_set: []
367
+ cmsvalkey_set: (_projectSection$edita = projectSection === null || projectSection === void 0 ? void 0 : projectSection.editables) !== null && _projectSection$edita !== void 0 ? _projectSection$edita : []
364
368
  });
365
369
  var slideKeys = Object.keys(manifestJSON.titles).filter(function (slideKey) {
366
370
  return slideKey.startsWith(sectionKey) && slideKey.split("/").length > 1;
367
371
  });
368
372
  section.slides.add(slideKeys.map(function (key, slideIndex) {
369
- return _presentationSlide.PresentationSlide.createFromManifestJSON(manifestJSON, key, section.id, slideIndex);
373
+ return _presentationSlide.PresentationSlide.createFromManifestJSON(manifestJSON, project, key, section.id, slideIndex);
370
374
  }));
371
375
  return section;
372
376
  };
373
- PresentationSection.createFromManifestImpostor = function (section, index) {
377
+ PresentationSection.createFromManifestImpostor = function (section, project, index) {
378
+ var _projectSection$edita2;
374
379
  var slides = section.slides || [];
375
380
  section.slides = null;
376
- var presentationSection = new PresentationSection(_objectSpread({
381
+ var projectSection = project === null || project === void 0 ? void 0 : project.sections.find(function (s) {
382
+ return s.key === project.key;
383
+ });
384
+ var presentationSection = new PresentationSection(_objectSpread(_objectSpread({
377
385
  id: parseInt(_lodash.default.uniqueId(), 10),
378
386
  thumbnail: null,
379
387
  custom: false,
380
388
  visible: true,
381
389
  deckversion: 1,
382
390
  index: index
383
- }, section));
391
+ }, section), {}, {
392
+ cmsvalkey_set: (_projectSection$edita2 = projectSection === null || projectSection === void 0 ? void 0 : projectSection.editables) !== null && _projectSection$edita2 !== void 0 ? _projectSection$edita2 : []
393
+ }));
384
394
  slides.forEach(function (slide, index) {
385
- presentationSection.slides.add(_presentationSlide.PresentationSlide.createFromManifestImpostor(slide, index, presentationSection.id));
395
+ presentationSection.slides.add(_presentationSlide.PresentationSlide.createFromManifestImpostor(slide, section, project, index, presentationSection.id));
386
396
  });
387
397
  return presentationSection;
388
398
  };