"use strict"
define("tco-app/adapters/cs-adapter-with-ids",["exports","tco-app/adapters/cs-adapter","uuid/v4"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({generateIdForRecord:function(){return(0,n.default)()}})
e.default=o}),define("tco-app/adapters/cs-adapter",["exports","ember-data/adapters/json-api","tco-app/src/lib/http"],function(e,t,n){function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
return(0,n.request)("adapter::".concat(e),Object.assign({action:"query",params:{}},t))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({ui:Ember.inject.service(),preview:Ember.inject.service(),findAll:function(e,t){return o(t.modelName)},findRecord:function(e,t,n){return o(t.modelName,{params:{query:{id:n},single:!0}})},query:function(e,t,n){return o(t.modelName,{params:{query:n}})},shouldReloadRecord:function(){return!!this.get("ui.initialLoad")},shouldBackgroundReloadRecord:function(){return!!this.get("ui.initialLoad")},createRecord:function(e,t,n){return this._updateRequest("create",e,t,n)},updateRecord:function(e,t,n){return this._updateRequest("update",e,t,n)},deleteRecord:function(e,t,n){return this._updateRequest("delete",e,t,n)},_updateRequest:function(e,t,o,r){return(0,n.requestOne)("adapter::".concat(o.modelName),{action:e,params:{model:this.serialize(r,{includeId:!0}),id:r.id}})}})
e.default=r}),define("tco-app/adapters/cs-client-side-adapter",["exports","tco-app/adapters/cs-read-only-adapter","uuid/v4"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({firstLoad:!1,generateIdForRecord:function(){return(0,n.default)()},shouldBackgroundReloadAll:function(){return!1},shouldReloadAll:function(e,t){return Ember.isEmpty(Ember.get(e.peekAll(t.type.modelName),"content"))},shouldReloadRecord:function(){return!1},shouldBackgroundReloadRecord:function(){return!1}})
e.default=o}),define("tco-app/adapters/cs-longevity-adapter",["exports","tco-app/adapters/cs-read-only-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({csBackgroundReloadRefreshRate:3e5,shouldReloadRecord:function(){return!1},shouldBackgroundReloadRecord:function(e,t){var n=t.record.get("loadedAt"),o=Date.now()
return o-n>this.csBackgroundReloadRefreshRate&&(t.record.set("loadedAt",o),!0)}})
e.default=n}),define("tco-app/adapters/cs-option-list-adapter",["exports","ember-data/adapters/json-api","uuid/v4"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({filterResponse:function(e,t,n){return n},option:null,generateIdForRecord:function(){return(0,n.default)()},findAll:function(e,t){var n=this
return new Ember.RSVP.Promise(function(o,r){e.findRecord("option",n.get("option")).then(function(r){o(n.filterResponse(e,t,r.serialize().data.attributes.value))},r)})},findRecord:function(e,t,n){var o=this
return new Ember.RSVP.Promise(function(r,a){o.findAll(e).then(function(){r(e.peekRecord(t.modelName,n))},a)})},query:function(){console.warn("This adapter does not support query")},shouldReloadRecord:function(){return!1},shouldBackgroundReloadRecord:function(){return!1},createRecord:function(e,t,n){return this._updateRequest("create",e,t,n)},updateRecord:function(e,t,n){return this._updateRequest("update",e,t,n)},deleteRecord:function(e,t,n){return this._updateRequest("delete",e,t,n)},_updateRequest:function(e,t,n){var o=this
return new Ember.RSVP.Promise(function(e,r){var a=t.peekRecord("option",o.get("option")),i=t.peekAll(n.modelName).filter(function(e){return!e.get("isDeleted")}).sortBy("order").map(function(e){return e.serialize({includeId:!0})})
a.set("value",i),a.save().then(function(){e()},r)})}})
e.default=o}),define("tco-app/adapters/cs-read-only-adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({createRecord:function(){return Ember.RSVP.resolve(void 0)},updateRecord:function(){return Ember.RSVP.resolve(void 0)},deleteRecord:function(){return Ember.RSVP.resolve(void 0)}})
e.default=n}),define("tco-app/app",["exports","ember-load-initializers","tco-app/mixins/link-to","tco-app/resolver","tco-app/src/boot"],function(e,t,n,o,r){function a(e,t,n,o,r,a,i){try{var s=e[a](i),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(o,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,Ember.$=window.jQuery
var i=Ember.Application.extend({podModulePrefix:"tco-app",modulePrefix:"tco-app",Resolver:o.default})
i.initializer({name:"global",initialize:function(){var e,t=(e=regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.deferReadiness(),e.next=3,(0,r.default)()
case 3:t.advanceReadiness(),t.inject("controller","debug","service:debug"),t.inject("component","debug","service:debug"),t.inject("route","debug","service:debug"),t.inject("controller","ui","service:ui"),t.inject("component","ui","service:ui"),t.inject("route","ui","service:ui"),t.inject("helper","config","service:config"),t.inject("route","config","service:config"),t.inject("service:controls","config","service:config"),t.inject("service:current-user","config","service:config"),t.inject("component","router","router:main"),t.inject("route","redux","service:redux"),t.inject("model","redux","service:redux"),t.inject("service:config","i18n","service:i18n"),t.inject("service:controls","i18n","service:i18n"),t.inject("route","i18n","service:i18n"),t.inject("component","i18n","service:i18n"),t.inject("model","i18n","service:i18n"),t.inject("controller","currentUser","service:current-user"),t.inject("component","currentUser","service:current-user"),t.inject("route","currentUser","service:current-user"),t.inject("controller:application","preview","service:preview"),Ember.LinkComponent.reopen(n.default)
case 27:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments
return new Promise(function(o,r){var i=e.apply(t,n)
function s(e){a(i,o,r,s,l,"next",e)}function l(e){a(i,o,r,s,l,"throw",e)}s(void 0)})})
return function(e){return t.apply(this,arguments)}}()}),i.instanceInitializer({name:"global",initialize:function(e){if(window.cornerstoneApp=e,e.lookup("service:redux"),window.csAppData.isPreview)e.lookup("service:preview").setup()
else{var t=Object.keys(window.csAppData.models),n=e.lookup("service:store")
"object"===Ember.typeOf(window.csAppData.models)&&t.forEach(function(e){return n.pushPayload(window.csAppData.models[e])})}}}),(0,t.default)(i,"tco-app"),Ember.Debug.registerWarnHandler(function(e,t,n){["ember-htmlbars.style-xss-warning"].includes(t.id)||n(e,t)}),Ember.Debug.registerDeprecationHandler(function(e,t,n){["events.inherited-function-listeners"].includes(t.id)||n(e,t)})
var s=i
e.default=s}),define("tco-app/application/adapter",["exports","tco-app/adapters/cs-read-only-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/application/route",["exports","tco-app/mixins/preview-listener"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=window.wp,o=Ember.Route.extend(t.default,{ui:Ember.inject.service(),i18n:Ember.inject.service(),redux:Ember.inject.service(),preview:Ember.inject.service(),preference:Ember.inject.service(),fontManager:Ember.inject.service(),colorManager:Ember.inject.service(),router:Ember.inject.service(),headData:Ember.inject.service(),model:function(){var e=this
return window.csAppData.isPreview?Ember.RSVP.resolve({}):new Ember.RSVP.Promise(function(t,n){Ember.run.next(function(){e.store.peekRecord("option","cornerstone_color_items"),Ember.RSVP.hash({elementDefinitions:e.store.peekAll("element/definition"),preferences:e.store.peekRecord("preference",window.csAppData.current_user),colorItems:e.store.findAll("color-manager/selection"),fontItems:e.store.findAll("font-manager/selection"),fontConfig:e.store.peekRecord("option","cornerstone_font_config")}).then(function(e){return t(e)},n)})})},afterModel:function(e){window.csAppData.isPreview||(this.get("preference").setup(e.preferences),this.get("colorManager").setup(e.colorItems),this.get("fontManager").setup(e.fontItems,e.fontConfig))},init:function(){var e=this
this._super.apply(this,arguments),window.csAppData.isPreview||this.listenTo("preview:ui-event",function(t){"media:open"===t.action&&e.send("openMedia")})},updateTitle:function(){var e=[window.csAppData.env.title],t=this.getWithDefault("router.currentRouteName","").replace("template-manager.design-cloud","design-cloud")
if(t){var n=t.split(".")
if("index"!==n[0]){var o="options"===n[0]?this.get("i18n").t("common.title.options-".concat(window.csAppData.optionsTitle||"styling")):this.get("i18n").t("common.title.".concat(n[0]))
if(e.push(o),n[1]){var r={globalBlocksBuilder:function(e){return this.modelFor(e).content.get("title")},headersHeader:function(e){return this.modelFor(e).header.get("title")},contentBuilder:function(e){return this.modelFor(e).content.get("title")},footersFooter:function(e){return this.modelFor(e).footer.get("title")}}[Ember.String.camelize("".concat(n[0],"-").concat(n[1]))]
r&&e.push(r.apply(this,[t]))}}}this.set("headData.title",e.reverse().join(" - "))},actions:{openMedia:function(){var e=this
if(window.wp&&window.wp.media&&window.wp.media.editor){var t=window.wp.media({frame:"post",state:"insert",title:window.wp.media.view.l10n.addMedia,multiple:!0})
t.open()
var o=!1
t.on("close",function(){setTimeout(function(){o||e.get("preview.xfr").message("preview:remote-media",{close:!0}),o=!1},0)})
var r=function(t){return e.get("preview.xfr").message("preview:remote-media",{close:!0,html:t})}
t.on("insert",function(e){o=!0
var n=t.state()
e=e||n.get("selection"),Ember.$.when.apply(Ember.$,e.map(function(e){n.display(e).toJSON()
return this.send.attachment(n.display(e).toJSON(),e.toJSON())},window.wp.media.editor)).done(r)}),t.state("gallery-edit").on("update",function(e){r(n.media.gallery.shortcode(e).string())},this),t.state("playlist-edit").on("update",function(e){r(n.media.playlist.shortcode(e).string())},this),t.state("video-playlist-edit").on("update",function(e){r(n.media.playlist.shortcode(e).string())},this),t.state("embed").on("select",function(){var e=t.state(),o=e.get("type"),a=e.props.toJSON()
a.url=a.url||"","link"===o?(_.defaults(a,{linkText:a.url,linkUrl:a.url}),window.wp.media.editor.send.link(a).done(function(e){r(e)})):"image"===o&&(_.defaults(a,{title:a.url,linkUrl:"",align:"none",link:"none"}),"none"===a.link?a.linkUrl="":"file"===a.link&&(a.linkUrl=a.url),r(n.media.string.image(a)))})}else this.get("preview.xfr").message("preview:remote-media",{close:!0})},selectLanguage:function(e){this.transitionTo({queryParams:{lang:e}})},save:function(){},error:function(e,t){console.warn("Transition Error",e,t)},cancel:function(){if(!this.get("preview.isPreview")){var e=Ember.$('<input type="text" style="opacity:0;position:absolute;">')
Ember.$("body").append(e),e.focus(),e.remove()}},toggleOrientation:function(){this.get("ui").send("toggleOrientation")},loading:function(e){var t=this
this.set("ui.transitioning",!0),e.promise.finally(function(){return t.set("ui.transitioning",!1)})},didTransition:function(){var e=this
return Ember.run.next(this,function(){var t=e.get("router.currentRouteName")
e.set("ui.currentRouteName",t),e.updateTitle(),e.get("ui").removePreloader()}),!0},observerNav:function(e){var t=[e.route]
e.id&&t.push(e.id),this.transitionTo.apply(this,t)}}})
e.default=o}),define("tco-app/application/serializer",["exports","ember-data/serializers/json-api"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({pushPayload:function(e,t){return e.push(this._normalizeDocumentHelper(t))}})
e.default=n}),define("tco-app/application/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"g4ChDs/8",block:'{"symbols":[],"statements":[[1,[21,"head-layout"],false],[0,"\\n"],[4,"unless",[[23,["preview","isPreview"]]],null,{"statements":[[4,"global/top-level",null,null,{"statements":[[4,"global/cs-bar",null,null,{"statements":[[1,[27,"outlet",["bar"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"global/settings-modal",null,null,{"statements":[[4,"if",[[23,["ui","preference","canManage"]]],null,{"statements":[[1,[21,"global/settings-modal/tab-preferences"],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["colors"],null]],null,{"statements":[[1,[27,"global/settings-modal/tab-colors",null,[["items"],[[23,["model","colorItems"]]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["fonts"],null]],null,{"statements":[[1,[27,"global/settings-modal/tab-fonts",null,[["items","fontConfig"],[[23,["model","fontItems"]],[23,["model","fontConfig"]]]]],false],[0,"\\n"]],"parameters":[]},null],[1,[27,"outlet",["settings"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[1,[27,"outlet",["global"],null],false],[0,"\\n"],[1,[21,"global/notification-queue"],false],[0,"\\n\\n"],[1,[27,"common/confirm-modal",null,[["screen"],["global"]]],false],[0,"\\n"],[1,[21,"react-bridge"],false],[0,"\\n\\n"],[1,[21,"global/progress-bar"],false],[0,"\\n\\n"],[1,[21,"outlet"],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[0,"\\n"],[4,"if",[[23,["preview","ready"]]],null,{"statements":[[0,"\\n"],[1,[21,"react-bridge/preview-manager"],false],[0,"\\n\\n"],[4,"unless",[[23,["preview","dragging"]]],null,{"statements":[[1,[27,"preview/cs-observer",null,[["eventNs","observeAttr","class"],["observer-nav","cs-observeable-nav","nav"]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"eq",[[23,["preview","initialRoute"]],"content"],null]],null,{"statements":[[1,[27,"preview/preview-builder",null,[["regions","context"],[[27,"array",["content"],null],[27,"concat",["content.",[23,["preview","initialRouteConfig","post_type"]]],null]]]],false]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"eq",[[23,["preview","initialRoute"]],"header"],null]],null,{"statements":[[1,[27,"preview/preview-builder",null,[["regions"],[[27,"array",["top","left","bottom","right"],null]]]],false]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"eq",[[23,["preview","initialRoute"]],"footer"],null]],null,{"statements":[[1,[27,"preview/preview-builder",null,[["regions"],[[27,"array",["footer"],null]]]],false]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"eq",[[23,["preview","initialRoute"]],"options"],null]],null,{"statements":[[1,[21,"preview/preview-options"],false]],"parameters":[]},null],[0,"\\n\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/application/template.hbs"}})
e.default=t}),define("tco-app/classic-template/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/classic-template/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),section:(0,n.default)(),type:(0,n.default)(),elements:(0,n.default)()})
e.default=o}),define("tco-app/color-manager/selection/adapter",["exports","tco-app/adapters/cs-option-list-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({option:"cornerstone_color_items"})
e.default=n}),define("tco-app/color-manager/selection/model",["exports","ember-data","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.Model.extend({title:(0,n.default)(),value:(0,n.default)(),order:(0,n.default)(),label:Ember.computed.alias("title"),selectable:Ember.computed("isDeleted","title",function(){return!this.get("isDeleted")&&!!this.get("title")}),sortableTitle:Ember.computed("title","order",function(){return"".concat(this.get("order")," ").concat(this.get("title"))})})
e.default=o}),define("tco-app/color-manager/selection/serializer",["exports","ember-data/serializers/json-api","uuid/v4"],function(e,t,n){function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var i=t.default.extend({normalizeResponse:function(e,t,r){var i=0
return{data:r.map(function(e){var r=e._id,s=a(e,["_id"])
return i+=1,{id:r||(0,n.default)(),type:t.modelName,attributes:o({order:i},s)}})}},serialize:function(){var e=this._super.apply(this,arguments)
return delete e.data.attributes.order,e.data.attributes._id=e.data.id,e.data.attributes}})
e.default=i}),define("tco-app/color-manager/service",["exports","color","tco-app/src/util/string"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Service.extend({store:Ember.inject.service(),setup:function(e){this.set("items",e)},saved:0,activeItems:Ember.computed.filterBy("items","selectable",!0),paletteItems:Ember.computed.sort("activeItems","orderSort"),orderSort:["order"],change:Ember.computed("paletteItems.[]","paletteItems.@each.value",function(){return this.get("paletteItems").forEach(function(e){return e.get("value")}),null}),getPaletteItems:function(){return this.get("paletteItems").map(function(e){return{id:"global-color:".concat(e.get("id")),label:e.get("label"),value:e.get("value")}})},makeRandomColor:function(){return"#".concat(("000000"+Math.floor(16777215*Math.random()).toString(16)).slice(-6))},lookupColor:function(e){var t=this
return(0,n.splitOnWhitespace)(e).map(function(e){return t.lookupSingleColor(e)}).join(" ")},lookupSingleColor:function(e){function n(n){try{(0,t.default)(n)}catch(o){return console.warn("Unable to resolve color: ".concat(e),o),"transparent"}return n}if("undefined"!==Ember.typeOf(e)&&e.includes&&e.includes("global-color:")){var o=e.replace("global-color:","")
this.get("change")
var r=this.get("paletteItems").find(function(e){return o===e.get("id")})
if(r)return n(r.get("value"))}return n(e)}})
e.default=o}),define("tco-app/components/click-outside",["exports","ember-click-outside/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/components/common/confirm-modal/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({active:!1,classNames:["cs-action-modal-outer"],classNameBindings:["screenClass","active:cs-active"],screenClass:Ember.computed("screen",function(){return this.get("screen")?"cs-action-modal-".concat(Ember.String.dasherize(this.get("screen"))):""}),init:function(){this._super.apply(this,arguments)
var e=this.get("screen")
e||console.warn("Confirm modals need an assigned screen"),this.set("ui.confirmHandlers.".concat(e),this.confirm.bind(this))},confirm:function(e){var t=Object.assign({accept:null,acceptUrl:null,decline:null,message:"",class:"",acceptBtn:this.get("i18n").t("app.confirm-yep"),declineBtn:this.get("i18n").t("app.confirm-nope"),back:!1,backBtn:this.get("i18n").t("app.back"),backBtnClass:"",acceptClass:"",declineClass:""},e)
t.screen===this.get("screen")&&(t.back&&(t.declineBtn=t.backBtn,t.declineClass=t.backClass),this.setProperties({message:t.message,acceptCallback:t.accept,declineCallback:t.decline,showAcceptBtn:!(!t.accept&&!t.acceptUrl),acceptUrl:t.acceptUrl,acceptBtn:t.acceptBtn,declineBtn:t.declineBtn,acceptClass:t.acceptClass,declineClass:t.declineClass}),this.set("active",!0))},actions:{accept:function(){var e=this.get("acceptCallback")
"function"===Ember.typeOf(e)&&e(),this.set("active",!1)},decline:function(){var e=this.get("declineCallback")
"function"===Ember.typeOf(e)&&e(),this.set("active",!1)}}})
e.default=t}),define("tco-app/components/common/confirm-modal/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"AU4nh7/1",block:'{"symbols":["&default"],"statements":[[7,"div"],[11,"class","cs-action-modal-inner"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-action-modal-content"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-action-modal-message"],[9],[1,[21,"message"],true],[10],[0,"\\n    "],[7,"div"],[11,"class","cs-action-modal-actions"],[9],[0,"\\n"],[4,"if",[[24,1]],null,{"statements":[[0,"      "],[14,1],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["showAcceptBtn"]]],null,{"statements":[[4,"if",[[23,["acceptUrl"]]],null,{"statements":[[0,"      "],[7,"a"],[12,"class",[28,["cs-btn ",[21,"acceptClass"]]]],[12,"href",[21,"acceptUrl"]],[9],[1,[21,"acceptBtn"],false],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"      "],[7,"button"],[12,"class",[28,["cs-btn ",[21,"acceptClass"]]]],[12,"onclick",[27,"action",[[22,0,[]],"accept"],null]],[9],[1,[21,"acceptBtn"],false],[10],[0,"\\n"]],"parameters":[]}]],"parameters":[]},null],[0,"\\n      "],[7,"button"],[12,"class",[28,["cs-btn ",[21,"declineClass"]]]],[12,"onclick",[27,"action",[[22,0,[]],"decline"],null]],[9],[1,[21,"declineBtn"],false],[10],[0,"\\n"]],"parameters":[]}],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/confirm-modal/template.hbs"}})
e.default=t}),define("tco-app/components/common/control-list/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-controls"],actions:{searchNav:function(e){this.onSearchNavigate(e)}}})
e.default=t}),define("tco-app/components/common/control-list/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"tYtDqn41",block:'{"symbols":["control","&default"],"statements":[[0,"\\n"],[14,2],[0,"\\n"],[4,"each",[[23,["controls"]]],null,{"statements":[[4,"unless",[[27,"or",[[27,"contains",[[22,1,["id"]],[23,["hiddenControls"]]],null],[22,1,["isHidden"]],[22,1,["excluded"]]],null]],null,{"statements":[[1,[27,"component",[[27,"locate-component",[[27,"concat",["controls/control-",[22,1,["type"]]],null],"controls/control-base"],null]],[["control","hidden"],[[22,1,[]],[27,"or",[[27,"contains",[[22,1,["id"]],[23,["hiddenControls"]]],null],[22,1,["isHidden"]],[22,1,["excluded"]]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/control-list/template.hbs"}})
e.default=t}),define("tco-app/components/common/create-translation/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-language-create"],languages:Ember.computed.alias("ui.wpmlLanguages"),targetLangData:Ember.computed("targetLang",function(){var e=this.get("targetLang")
return this.get("languages").find(function(t){return t.code===e})}),translationOptions:Ember.computed("model.language.translations",function(){var e=this.get("model.language.translations"),t=Ember.A()
return e&&this.getWithDefault("languages",[]).forEach(function(n){e[n.code]&&t.push({value:e[n.code],label:n.translated_name})}),t}),actions:{copyExisting:function(){this.send("create",!0)},startBlank:function(){this.send("create")},create:function(e){var t=this.get("model.language.source")
Ember.isNone(t)&&(t=this.get("model.id")),this.onCreateTranslation({source:t,copyFrom:!!e&&this.getWithDefault("selectedTranslation",this.get("translationOptions.firstObject.value")),lang:this.get("targetLang")})}}})
e.default=t}),define("tco-app/components/common/create-translation/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"6ZimpS3s",block:'{"symbols":[],"statements":[[7,"p"],[9],[1,[27,"t",["app.translation.create-message"],[["context","lang"],[[23,["contextLabel"]],[23,["targetLangData","translated_name"]]]]],false],[10],[0,"\\n\\n"],[7,"button"],[11,"class","cs-btn"],[12,"onclick",[27,"action",[[22,0,[]],"startBlank"],null]],[9],[1,[27,"t",["app.translation.start-blank"],null],false],[10],[0,"\\n\\n"],[7,"div"],[11,"class","cs-language-create-divider"],[9],[7,"span"],[9],[1,[27,"t",["app.translation.or"],null],false],[10],[10],[0,"\\n\\n"],[7,"div"],[11,"class","cs-language-create-control-group"],[9],[0,"\\n  "],[1,[27,"forms/styled-select",null,[["options","value"],[[23,["translationOptions"]],[23,["selectedTranslation"]]]]],false],[0,"\\n  "],[7,"button"],[11,"class","cs-btn"],[12,"onclick",[27,"action",[[22,0,[]],"copyExisting"],null]],[9],[1,[27,"t",["app.translation.copy-existing"],null],false],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/create-translation/template.hbs"}})
e.default=t}),define("tco-app/components/common/cs-picker/component",["exports","tco-app/mixins/dragula-events"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=function(e,t){return e&&e.contains&&e&&e.contains(t)},o=Ember.Component.extend(t.default,{rootSelector:".cs-app",modalInPosition:!1,canOpen:!0,onStateChange:function(){},dragulaEvents:["element"],classNames:["cs-picker"],classNameBindings:["class","open:cs-active"],floatingSide:"right",scrollEvent:"ps-y-reach-start ps-scroll-y ps-y-reach-end ps-x-reach-start ps-scroll-x ps-x-reach-end",modalMode:"hide",delayComplete:!1,onDropIndex:function(){},onDrop:function(){},attrModalClass:Ember.computed("modalClass","inTabModal",function(){var e=["cs-picker-modal"],t=this.get("modalClass")
return t&&e.push(t),this.get("inTabModal")&&e.push("cs-picker-modal-from-tab-modal"),e.join(" ")}),canDisplayModal:Ember.computed("modalInPosition","modalMode","delayComplete",function(){return!("hide"!==this.get("modalMode")||!this.get("delayComplete"))||this.get("modalInPosition")}),onInit:Ember.on("init",function(){this.triggerExternalOpen()}),observeExternalOpen:Ember.observer("externalOpen",function(){this.triggerExternalOpen()}),triggerExternalOpen:function(){this.get("externalOpen")&&this.get("canOpen")&&this.set("open",!0)},didInsertElement:function(){var e=this
this.set("$modal",this.$(".cs-picker-modal")),this.set("hasRendered",!0),this.$().closest(".cs-tab-modal").length>0&&this.set("inTabModal",!0),this.updatePositioning(),Ember.run.later(function(){e.isDestroyed||e.set("delayComplete",!0)},25)},observeState:Ember.observer("open",function(){this.updatePositioning()}),updatePositioning:function(){var e=this
if(!this.isDestroyed)if(this.get("hasRendered")){var t=Ember.$("body"),o=Ember.$(window),r=o,a=this.$(".cs-picker-swatch"),i=this.$(),s=this.get("$modal"),l=function o(r){e.isDestroyed||i[0]!==r.currentTarget&&s[0]!==r.currentTarget&&!n(i[0],r.currentTarget)&&n(e.get("ui.topLevelEl"),r.currentTarget)&&!n(s[0],r.currentTarget)?(t.off("focus","*",o),t.off("click","*",o),!e.isDestroyed&&s[0]&&(e.set("open",!1),e.onStateChange(!1))):r.stopPropagation()},c=function t(){if(!e.isDestroyed){var n=a[0].getBoundingClientRect(),i=s[0].getBoundingClientRect(),l=n.top-i.height,c=o.height()-(n.top+i.height),u=n.left-i.width,p=o.width()-(n.right+i.width),d=!1,f=!0
l<0&&(f=c<0&&c<l),p<0&&(d=!(u<0)||u>p),s.removeClass("cs-picker-floating-left huebert-floating-right").addClass(d?"cs-picker-floating-left":"cs-picker-floating-right").css({top:f?n.bottom-i.height:n.top,left:d?n.left-i.width:n.right}),s.hasClass("cs-picker-floating")||(r.off(e.get("scrollEvent"),t),o.off("resize",t))}}
this.get("open")?(s.detach().appendTo(this.get("rootSelector")),s.css("visibility","hidden").addClass("cs-picker-floating"),s.removeAttr("style"),c(),r.on(this.get("scrollEvent"),c),o.on("resize",c),t.on("focus","*",l),t.on("click","*",l),this.set("modalInPosition",!0),this.get("focusSelector")&&s.find(this.get("focusSelector")).focus()):(s.removeClass("cs-picker-floating cs-picker-floating-left cs-picker-floating-right"),this.set("modalInPosition",!1),s.detach().appendTo(this.$()))}else this.set("modalInPosition",!1)},willDestroy:function(){this._super.apply(this,arguments)
var e=this.get("$modal")
e&&e.remove()},dragulaDrop:function(e,t,n,o,r){var a=Ember.$(r).index()-1
this.onDropIndex(this.get("itemIndex"),a),this.onDrop(this.get("item"),a)},actions:{toggle:function(){this.get("canOpen")&&(this.set("open",!this.get("open")),this.onStateChange(this.get("open")))}}})
e.default=o}),define("tco-app/components/common/cs-picker/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"vNaJ7eUE",block:'{"symbols":["&default"],"statements":[[7,"div"],[11,"class","cs-picker-swatch"],[11,"tabindex","-1"],[12,"onclick",[27,"action",[[22,0,[]],"toggle"],null]],[9],[0,"\\n"],[4,"if",[[23,["label"]]],null,{"statements":[[0,"    "],[7,"span"],[9],[1,[21,"label"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[1,[21,"content"],true],[0,"\\n"],[4,"if",[[23,["contentComponent"]]],null,{"statements":[[0,"    "],[1,[27,"component",[[23,["contentComponent"]]],null],false],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n\\n"],[7,"div"],[12,"class",[21,"attrModalClass"]],[9],[0,"\\n"],[4,"if",[[23,["canDisplayModal"]]],null,{"statements":[[0,"    "],[14,1,[[27,"hash",null,[["open"],[[23,["open"]]]]]]],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/cs-picker/template.hbs"}})
e.default=t}),define("tco-app/components/common/cs-popover/component",["exports","ember-click-outside/mixin"],function(e,t){var n
function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Component.extend(t.default,(o(n={allowClickPropogation:!1,classNames:["cs-popover"],classNameBindings:["fixed:cs-popover-fixed","sideClass","flowClass","show:cs-active","transitioning:cs-transitioning"],sideClass:Ember.computed("side",function(){return"cs-popover-".concat(this.getWithDefault("side","bottom"))}),flowCorrection:!0,flow:!1,flowClass:Ember.computed("fixed","flowCorrection","flow",function(){var e=this.get("flow")
return this.get("fixed")&&this.get("flowCorrection")?"cs-popover-flow-".concat(e):""}),onMouseEnter:function(){},onMouseLeave:function(){},onScroll:function(){},onResize:function(){},init:function(){this._super.apply(this,arguments),this.set("onScroll",this.get("onScroll").bind(this)),this.set("onResize",this.get("onResize").bind(this))},mouseEnter:function(e){this.onMouseEnter(e,this)},mouseLeave:function(e){this.onMouseLeave(e,this)},click:function(e){this.get("allowClickPropogation")||e.stopPropagation()},listening:!1,clickOutside:function(){this.onOutsideClick()},toggleListeners:function(e){var t=this.get("listening")
!e&&t&&(Ember.run.cancel(this._cancelListener),this.removeClickOutsideListener(),this.set("listening",!1)),e&&!t&&(this._cancelListener=Ember.run.next(this,this.addClickOutsideListener),this.set("listening",!0))},activeObserver:Ember.observer("active",function(){var e=this,t=this.get("active")
this.toggleListeners(t),Ember.run.scheduleOnce("afterRender",function(){e.openOrClose(t)})})},"onResize",function(){this.updatePosition()}),o(n,"onScroll",function(){this.updatePosition()}),o(n,"didInsertElement",function(){if(Ember.$(window).on("resize",this.onResize),this.get("fixed")){var e=this.$().closest(".cs-scroll-box")
if(0!==e.length){var t=e[0]
this.set("closestScrollbox",t),t.addEventListener("ps-scroll-y",this.onScroll),t.addEventListener("ps-scroll-x",this.onScroll)}else{var n=this.$().closest(".cs-scroll-container")
0===n.length&&(n=Ember.$(window.document.body)),n.on("scroll",this.onScroll),this.set("closestScrollContainer",n)}this.set("parentElement",this.$().parent()[0]),this.$().appendTo(Ember.$(".cs-app"))}}),o(n,"willDestroyElement",function(){if(Ember.$(window).off("resize",this.onResize),this.get("fixed")){var e=this.get("closestScrollbox"),t=this.get("closestScrollContainer")
e&&(e.removeEventListener("ps-scroll-y",this.onScroll),e.removeEventListener("ps-scroll-x",this.onScroll)),t&&t.off("scroll",this.onScroll),this.get("element").remove()}this.toggleListeners(!1)}),o(n,"maybeFocusInput",function(){var e=this
this.get("focusInput")&&Ember.run.next(function(){Ember.run.scheduleOnce("afterRender",function(){e.isDestroyed||e.$("input").focus()})})}),o(n,"openOrClose",function(e){var t=this,n=this.$()
if(!this.get("fixed"))return this.set("show",e),void this.maybeFocusInput()
e?(this.get("transitioning")&&(this.set("transitioning",!1),n.attr("style",""),this.set("finishTransition",!1)),this.updatePosition(),this.set("show",!0),this.maybeFocusInput()):(this.set("transitioning",!0),this.set("show",!1),this.set("finishTransition",!0),n.one("transitionend",function(){t.get("finishTransition")&&t.set("transitioning",!1)}))}),o(n,"updatePosition",function(){if(!this.isDestroyed&&this.get("parentElement")&&(this.get("active")||this.get("show"))){var e,t=Ember.$(window),n=t.height(),o=t.width(),r=this.get("parentElement").getBoundingClientRect(),a=r.top,i=r.bottom,s=r.left,l=r.width,c=r.height,u=this.get("side")
switch(u){case"top":e={bottom:n-i+c+7+5,left:s}
break
case"left":e={top:a+c/2,right:o-s+7+5}
break
case"bottom":e={top:a+c+7+5,left:s}
break
case"right":e={top:a+c/2,left:s+l+7+5}}if(this.get("flowCorrection")){var p=this.get("element").getBoundingClientRect(),d=!1
if("left"===u||"right"===u){var f=p.height/2
e.top+f>n&&(e.top=a-p.height+30,d="end"),e.top-f<0&&(e.top=a-15,d="start")}this.set("flow",d)}this.$().css(e)}}),n))
e.default=r}),define("tco-app/components/common/cs-popover/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"7p5eGO2w",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/cs-popover/template.hbs"}})
e.default=t}),define("tco-app/components/common/help-text/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:"cs-help-text"})
e.default=t}),define("tco-app/components/common/help-text/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"TVHyIbq5",block:'{"symbols":["&default"],"statements":[[7,"h4"],[9],[1,[21,"title"],false],[10],[0,"\\n"],[7,"p"],[9],[1,[21,"message"],false],[14,1],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/help-text/template.hbs"}})
e.default=t})
define("tco-app/components/common/index-entry/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-index-entry"],classNameBindings:["selected:cs-active","isNew:cs-new","compact:is-compact"],canEdit:!0,click:function(e){Ember.$(e.target).is(".cs-index-entry-info-readonly-input-pre")||this.onClick()},actions:{titleUpdate:function(e){this.set("title",e),this.titleUpdate()}}})
e.default=t}),define("tco-app/components/common/index-entry/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ckov3btT",block:'{"symbols":["&default"],"statements":[[7,"div"],[11,"class","cs-index-entry-info"],[9],[0,"\\n"],[4,"if",[[23,["meta"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-index-entry-info-meta"],[9],[1,[21,"meta"],true],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["before"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-index-entry-info-before"],[9],[1,[21,"before"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[7,"h2"],[11,"class","cs-index-entry-info-title"],[9],[0,"\\n"],[4,"if",[[23,["canEdit"]]],null,{"statements":[[0,"      "],[1,[27,"forms/inline-edit",null,[["value","onDoneEditing"],[[23,["title"]],[27,"action",[[22,0,[]],"titleUpdate"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0,"      "],[7,"span"],[9],[1,[21,"title"],false],[10],[0,"\\n"]],"parameters":[]}],[0,"  "],[10],[0,"\\n"],[4,"if",[[23,["after"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-index-entry-info-after"],[9],[1,[21,"after"],true],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"],[7,"div"],[11,"class","cs-index-entry-actions"],[9],[0,"\\n  "],[14,1],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/index-entry/template.hbs"}})
e.default=t}),define("tco-app/components/common/language-picker/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"ul",classNames:["cs-language-picker"],classNameBindings:["top:cs-language-picker-top"],languages:Ember.computed.alias("ui.wpmlLanguages"),actions:{select:function(e,t){this.onSelectLanguage(e,t)}}})
e.default=t}),define("tco-app/components/common/language-picker/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"lP+ZCRGY",block:'{"symbols":["language"],"statements":[[4,"each",[[23,["languages"]]],null,{"statements":[[0,"  "],[7,"li"],[12,"class",[28,["cs-language-picker-item ",[27,"if",[[27,"eq",[[23,["activeLanguage"]],[22,1,["code"]]],null],"cs-active"],null]]]],[9],[0,"\\n    "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"select",[22,1,["code"]],[22,1,[]]],null]],[12,"data-native-title",[22,1,["native_name"]]],[9],[0,"\\n      "],[7,"img"],[12,"src",[28,[[22,1,["country_flag_url"]]]]],[9],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/language-picker/template.hbs"}})
e.default=t}),define("tco-app/components/common/link-out/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"a",classNameBindings:["class"],attributeBindings:["href"],output:Ember.computed("content",function(){return Ember.String.htmlSafe(this.get("content"))}),click:function(e){var t=this
this.get("ui.unsavedData")&&(e.preventDefault(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){window.location=t.get("href")},acceptClass:"sad"}))}})
e.default=t}),define("tco-app/components/common/link-out/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"1uUeQf7R",block:'{"symbols":["&default"],"statements":[[4,"if",[[24,1]],null,{"statements":[[0,"  "],[14,1],[0,"\\n"]],"parameters":[]},{"statements":[[0,"  "],[1,[21,"output"],true],[0,"\\n"]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/link-out/template.hbs"}})
e.default=t}),define("tco-app/components/common/preview-frame/component",["exports","url-parse","ember-redux","tco-app/mixins/hover-state","tco-app/xfr/agent","tco-app/mixins/preview-listener","tco-app/src/util/url","tco-app/src/util/base64","tco-app/src/actions/ui"],function(e,t,n,o,r,a,i,s,l){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=Ember.Component.extend(a.default,r.default,o.default,{xfrOrigin:"app",config:Ember.inject.service(),redux:Ember.inject.service(),ui:Ember.inject.service(),debugLogging:Ember.computed.alias("debug.logging"),ready:!1,showAsLoading:!0,loadedOnce:!1,loadError:!1,allowPreviewSizer:!0,usePreloader:!0,canResize:!0,state:{},name:"generic",content:"default",shrink:!1,classNames:["cs-preview-frame"],classNameBindings:["shrink:cs-preview-frame-mini:cs-preview-frame-full","noPreviewPointer:cs-preview-frame-no-pointer"],noPreviewPointer:Ember.computed("disablePreviewPointer","shrink",function(){return this.get("disablePreviewPointer")||this.get("shrink")}),clientShowPreloader:!0,preLoaderComplete:Ember.computed("ready","clientShowPreloader",function(){return this.get("ready")&&!this.get("clientShowPreloader")}),previewSizeClass:Ember.computed("canResize","ui.previewSize",function(){if(this.get("canResize"))return"cs-preview-size-".concat(this.get("ui.previewSize"))}),showPreviewSizer:Ember.computed("shrink","allowPreviewSizer","ui.routeEnabledPreviewSizer",function(){return this.get("allowPreviewSizer")&&!this.get("shrink")&&this.get("ui.routeEnabledPreviewSizer")}),detectStateChange:Ember.observer("src","state.inc",function(){this.generateIframeDebounce()}),generateIframeDebounce:function(){Ember.run.debounce(this,this.generateIframe,215)},init:function(){var e=this
this._super.apply(this,arguments),this.componentListenTo("navigate",function(t){return e.navigate(t)}),this.componentListenTo("load-activity",this.maybeShowLoadError),this.componentListenTo("pre-loader-state",function(t){var n=t.show
n||Ember.run.cancel(e.waitForClientPreloader),e.set("clientShowPreloader",n)}),this.componentListenTo("preview:package:setup",function(t,n){e.set("canUpdatePackage",!0),n(e.getWithDefault("package",{}))}),this.componentListenTo("preview:event-propagation",function(t){var n=t.event
return e.synthesizeEvent(n)}),this.componentListenTo("preview:action-propagation",function(t){var n=t.action
return e.get("ui.primaryRoute").send(n)}),this.componentListenTo("preview:error-message",function(t){var n=t.key
console.log("preview-error.".concat(n)),e.get("ui").notify({type:"error",message:"i18n.app.preview-error.".concat(n),timeout:15e3,extendedTimeout:650})}),this.componentListenTo("observer",function(t){e[Ember.String.camelize("on-observer-".concat(t.type))](t)}),this.componentListenTo("observer-nav",function(t){e.onObserverNav(t)}),this.componentListenTo("remote-action",function(t){e.onRemoteAction(t)}),this.componentListenTo("suspend-drag",function(){e.get("redux").dispatch((0,l.uiUpdate)({suspendDrag:!0})),e.$(".cs-preview-frame-container").one("mouseleave",function(){e.get("redux").dispatch((0,l.uiUpdate)({suspendDrag:!1})),e.get("ui.preview.xfr").message("preview:resume-drag")})}),this.componentListenTo("stop-drag",function(){return e.get("redux").dispatch((0,l.uiUpdate)({suspendDrag:!1}))})
var t=function t(){document.removeEventListener("mouseup",t),Ember.run.next(function(){e.get("ui.preview.xfr").message("preview:drag-existing-end")})}
this.componentListenTo("drag-existing",function(){return document.addEventListener("mouseup",t)})},didInsertElement:function(){this.set("rendered",!0),this.generateIframeDebounce()},packageChange:Ember.observer("package",function(){this.get("canUpdatePackage")&&this.message("preview:package:update",this.getWithDefault("package",{}))}),generateIframe:function(){var e=this
if(this.get("rendered")&&!this.isDestroyed){this.set("showAsLoading",!0),this.set("ready",!1)
var t=function(t,n){e.set("loadError",!0),e.set("loadErrorMessage",t),e.set("ready",!0),"function"==typeof n&&n.call(e)}
this.requestHTML(Object.assign({},this.get("state"))).then(function(n){var o=n.html,r=n.state
if(!e.isDestroyed){var a=o.replace(new RegExp("\x3c!--(.|[\r\n])*?--\x3e","g"),"")
a.substr(-100).includes("</html>")||(console.warn("No closing </html> tag>",{html:a}),e.get("ui").notify(e.get("i18n").t("app.preview-error.loading.incomplete-html"),"error")),Ember.run.cancel(e.scheduledUpdate),e.scheduledUpdate=Ember.run.scheduleOnce("afterRender",function(){if(!e.isDestroyed)try{var n=(0,s.base64Encode)(JSON.stringify(e.getWithDefault("package",{}))),a='<script>window.csPreviewSession="'.concat(e.get("previewSession"),'"; window.csPreviewPackage = "').concat(n,'";<\/script>')
o=o.replace("</head>","".concat(a,"</head>"))
var i=Ember.$("<iframe />")
e.$(".cs-preview-frame-container").append(i)
var l=i[0].contentWindow
l.document.open(),l.document.write(o),l.document.close(),Ember.run.cancel(e.loadTimeout),e.loadTimeout=Ember.run.later(function(){e.isDestroyed||(e.get("ui").incrementProperty("previewDelayed"),console.warn("Preview timeout"),e.get("previewDelayed")>1?t("timeout",function(){return e.$("iframe").not(i).remove()}):(e.set("showAsLoading",!0),e.set("loadError",!1),e.set("ready",!1),e.generateIframeDebounce()))},15e3*(e.get("ui.previewDelayed")+1)),e.initFrame(i[0],r.timestamp,function(){e.$("iframe").not(i).remove(),Ember.run.cancel(e.loadTimeout),e.set("loadError",!1),e.set("loadErrorMessage",null),e.set("ready",!0),e.maybeShowLoadError()})}catch(c){console.log(c)}})}},function(e){console.warn("preview-frame::update-aborted",e),e&&!1===e.error||t(e&&e.message?e.message:null)})}},maybeShowLoadError:function(){var e=this
Ember.run.cancel(this.waitForClientPreloader),this.waitForClientPreloader=Ember.run.later(function(){!e.isDestroyed&&e.get("clientShowPreloader")&&e.get("usePreloader")&&(console.warn("The preview booted, but never requested the loader be removed.",e.get("ui.previewDelayed")),e.set("loadError",!0),e.set("loadErrorMessage","timeout"),e.get("ui").incrementProperty("previewDelayed"))},15e3*(this.get("ui.previewDelayed")+1))},requestHTML:function(e){var n=this
return new Ember.RSVP.Promise(function(o,r){var a=n.get("src"),l=(0,t.default)(a,!0)
if(window.location.protocol!==l.protocol&&window.location.host===l.host)return r({error:!0,message:"https-mismatch"})
if(!(0,i.sameOrigin)(a,window.location.origin))return r({error:!0,message:"cross-origin"})
var c="".concat(l.origin).concat(l.pathname)
"/"!==c.charAt(c.length-1)&&(c+="/")
var u=Date.now()
e.timestamp="t-".concat(u)
var p=Ember.assign({},{_cs_nonce:n.get("config.global._cs_nonce"),cs_preview_state:(0,s.base64Encode)(JSON.stringify(e))},n.getWithDefault("requestParams",{}),l.query)
n.get("debugLogging")&&console.log("Requesting iFrame HTML",c,p),Ember.$.ajax({type:"POST",url:c,data:p}).done(function(t,a,i){if(n.get("lastUpdate")>u)r({error:!1,message:"updated since request"})
else{n.get("lastUpdate",u)
var s=i.responseText
n.get("debugLogging")&&console.log("Receiving iFrame HTML",i)
var l=s.lastIndexOf("CORNERSTONE_FRAME")
if(-1===l||l<s.lastIndexOf("</html>"))r({error:!0,message:"incomplete",response:s})
else{var c=s.slice(0,l)+s.slice(l+"CORNERSTONE_FRAME".length)
o({html:c,state:e})}}}).fail(function(e){return r(e)})})},loadErrorMessageDisplay:Ember.computed("loadErrorMessage",function(){var e=this.get("loadErrorMessage")
return e||(e="default"),this.get("i18n").t("app.preview-error.load.".concat(e))}),originUrl:Ember.computed(function(){return window.location.origin}),initFrame:function(e,t,n){var o=this
this.closeChannel()
var r=new MessageChannel
r.port1.addEventListener("message",this.get("xfrOnMessage"),!1),r.port1.start(),this.set("messageChannel",r),this.set("xfrMessagePort",r.port1),this.getWithDefault("xfrUnsubscribe",function(){})(),this.set("xfrUnsubscribe",this.get("xfrSubscribe")(e)),this.set("boundiFrameLoaded",function(a){o.get("debugLogging")&&console.log("Preview frame [".concat(t,"] recieving message"),a),"cs-preview-port-request::".concat(t)===a.data&&(e.contentWindow.postMessage("cs-preview-port","*",[r.port2]),n())}),window.addEventListener("message",this.get("boundiFrameLoaded"),!1)},willDestroyElement:function(){this.closeChannel(),this.getWithDefault("xfrUnsubscribe",function(){})()},closeChannel:function(){window.removeEventListener("message",this.get("boundiFrameLoaded"),!1)
var e=this.get("messageChannel")
e&&(e.port1.removeEventListener("message",this.get("xfrOnMessage"),!1),e.port1.close())},synthesizeEvent:function(e){["mousedown","mouseup","click"].includes(e.type)?function(e,t){var n=Ember.assign({},t,{view:window,bubbles:!0,cancelable:!0})
delete n.type
var o=new MouseEvent(e,n)
window.dispatchEvent(o)}(e.type,e):["keydown","keypress","keyup"].includes(e.type)&&function(e,t){var n=Ember.assign({},t,{view:window,bubbles:!0,cancelable:!0})
delete n.type
var o=new KeyboardEvent(e,n)
o.synthesizedWhich=t.which,document.body.dispatchEvent(o)}(e.type,e)},actions:{closeLoader:function(){this.set("loadedOnce",!0),this.set("showAsLoading",!1)},reloadAfterTimeout:function(){this.set("showAsLoading",!0),this.set("loadError",!1),this.set("ready",!1),this.generateIframeDebounce()}}}),u=(0,n.connect)(function(){return function(e){var t=e.ui.disablePreviewPointer
return{uiTheme:e.builder.preferences.uiTheme,disablePreviewPointer:t,previewSession:e.xfr.session,xfrSubscribe:e.xfr.subscribe}}})(c)
e.default=u}),define("tco-app/components/common/preview-frame/overlay-action/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-preview-frame-overlay-action"],attributeBindings:["ui.scrollBarWidthRightStyle:style"]})
e.default=t}),define("tco-app/components/common/preview-frame/overlay-action/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"PA9zgOkd",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/preview-frame/overlay-action/template.hbs"}})
e.default=t}),define("tco-app/components/common/preview-frame/pre-loader/component",["exports","tco-app/mixins/fadeable"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend(t.default,{classNames:["cs-pre-loader"],classNameBindings:["incomplete:cs-active","refreshing:cs-pre-loader-semi-transparent"],content:"default",contentPartial:Ember.computed("content",function(){return"iframe-loaders/".concat(this.get("content"))})})
e.default=n}),define("tco-app/components/common/preview-frame/pre-loader/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"yKXKobKG",block:'{"symbols":[],"statements":[[15,[23,["contentPartial"]],[]],[0,"\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/components/common/preview-frame/pre-loader/template.hbs"}})
e.default=t}),define("tco-app/components/common/preview-frame/preview-sizer/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-preview-sizer"],classNameBindings:["sizeClass","active:cs-active"],active:Ember.computed.alias("ui.showPreviewSizer"),size:Ember.computed.alias("ui.previewSize"),init:function(){this._super.apply(this,arguments)
var e=this.get("i18n"),t={};["xl","lg","md","sm","xs"].forEach(function(n){t[n]={icon:"preview-sizer-"+n,abbr:e.t("app.breakpoints.size-abbr.".concat(n)),desc:e.t("app.breakpoints.desc.".concat(n))}}),this.set("icons",t)},sizeClass:Ember.computed("size",function(){return"cs-preview-sizer-".concat(this.get("size"))}),actions:{selectSize:function(e){this.set("size",e)}}})
e.default=t}),define("tco-app/components/common/preview-frame/preview-sizer/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"IwPCylCF",block:'{"symbols":["item","sz"],"statements":[[4,"each",[[27,"-each-in",[[23,["icons"]]],null]],null,{"statements":[[0,"  "],[7,"button"],[12,"class",[28,["is-",[22,2,[]],[27,"if",[[27,"eq",[[22,2,[]],[23,["size"]]],null]," cs-active"],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"selectSize",[22,2,[]]],null]],[9],[0,"\\n    "],[1,[27,"icon",[[22,1,["icon"]]],null],false],[0,"\\n    "],[7,"span"],[9],[0,"\\n      "],[7,"b"],[11,"class","cs-preview-sizer-abbr"],[9],[1,[22,1,["abbr"]],false],[10],[0,"\\n      "],[7,"b"],[11,"class","cs-preview-sizer-desc"],[9],[1,[22,1,["desc"]],false],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[1,2]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/preview-frame/preview-sizer/template.hbs"}})
e.default=t}),define("tco-app/components/common/preview-frame/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"5GmgOTWe",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["showPreviewSizer"]]],null,{"statements":[[1,[21,"common/preview-frame/preview-sizer"],false],[0,"\\n"]],"parameters":[]},null],[7,"div"],[12,"class",[28,["cs-preview-frame-container ",[21,"previewSizeClass"]]]],[9],[0,"\\n"],[4,"if",[[23,["usePreloader"]]],null,{"statements":[[4,"if",[[23,["showAsLoading"]]],null,{"statements":[[0,"  "],[1,[27,"common/preview-frame/pre-loader",null,[["refreshing","complete","onComplete","content"],[[23,["loadedOnce"]],[23,["preLoaderComplete"]],[27,"action",[[22,0,[]],"closeLoader"],null],[23,["preloader"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"if",[[23,["loadError"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-preview-load-error-outer cs-active"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-preview-load-error-inner"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-action-modal-content"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-action-modal-message"],[9],[0,"\\n          "],[7,"p"],[9],[1,[21,"loadErrorMessageDisplay"],false],[10],[0,"\\n          "],[7,"p"],[11,"style","font-size: .75em;"],[9],[0,"Origin URL: "],[1,[21,"originUrl"],false],[10],[0,"\\n          "],[7,"p"],[11,"style","font-size: .75em;"],[9],[0,"Preview URL: "],[1,[21,"src"],false],[10],[0,"\\n        "],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-action-modal-actions"],[9],[0,"\\n          "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"reloadAfterTimeout"],null]],[9],[0,"Try again"],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[14,1],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/preview-frame/template.hbs"}})
e.default=t}),define("tco-app/components/common/scroll-box/component",["exports","perfect-scrollbar"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-scroll-box"],classNameBindings:["name","class"],ready:!1,initialized:!1,scrollEvents:["ps-scroll-y","ps-y-reach-start","ps-y-reach-end","ps-scroll-x","ps-x-reach-start","ps-x-reach-end"],suppressScrollY:!1,suppressScrollX:!1,psInit:function(){if(!this.isDestroyed){var e=this.get("element")
e&&(this.resetPs(),this.set("psInstance",new t.default(e,{wheelSpeed:2,scrollYMarginOffset:0,scrollXMarginOffset:0,wheelPropagation:!0,swipePropagation:!1,useBothWheelAxes:!1,minScrollbarLength:20,suppressScrollX:!0,suppressScrollY:this.get("suppressScrollY")})),e.psInstance=this.get("psInstance"))}},resetPs:function(){var e=this.get("psInstance")
e&&(e.destroy(),e=null)},updatePs:function(){var e=this.get("psInstance")
e&&e.update()},init:function(){this._super.apply(this,arguments),this.get("searchTarget")},setupTeardown:Ember.observer("ready",function(){this.refresh()}),workspaceOrientationChanged:Ember.observer("ui.workspaceOrientation",function(){var e=this
Ember.run.later(function(){e.isDestroyed||e.updatePs()},100)}),didInsertElement:function(){this.psInit()
var e=this.get("scrollTo")
e&&this.updateScrollTo(e)},willDestroyElement:function(){var e=this.get("psInstance")
e&&(e.destroy(),e=null)},scrollToObserver:Ember.observer("scrollTo",function(){this.updateScrollTo(this.get("scrollTo"))}),updateScrollTo:function(e){var t=this,n=e.$el,o=e.start,r=e.selector,a=e.offset,i=e.horizontal,s=e.duration,l=e.reset,c=e.after,u=this.get("element")
if(this.get("initialized")&&u){var p=0,d=0
if(!o){var f=n||this.$(r).first()
f.length>0&&(p=f.position().left+u.scrollLeft,d=f.position().top+u.scrollTop)}var m=isNaN(a)?0:a,h=i?{scrollLeft:p+m}:{scrollTop:d+m}
this.set("isScrollingTo",!0),this.$().animate(h,{duration:isNaN(s)?450:s,complete:function(){t.isDestroyed||(t.updatePs(),t.set("isScrollingTo",!1),l&&t.updatePs(),"function"===Ember.typeOf(c)&&c())}})}},search:Ember.inject.service(),searchTarget:Ember.computed("linkedSearch",function(){return this.get("search").getTarget(this.get("linkedSearch"))}),resetScroll:Ember.observer("searchTarget.query","resetScrollOn","resetScrollOn.[]",function(){Ember.run.debounce(this,this._resetScroll,25)}),_resetScroll:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){var t=e.get("element")
t&&(t.scrollTop=0,t.scrollLeft=0,e.updatePs())})}})
e.default=n}),define("tco-app/components/common/scroll-box/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"4luJ10Zl",block:'{"symbols":["&default"],"statements":[[14,1]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/scroll-box/template.hbs"}})
e.default=t}),define("tco-app/components/common/search-bar/component",["exports","tco-app/src/lib/keybindings"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNameBindings:["customClass"],customClass:"cs-search-bar",focusOnShortcut:!0,autoFocus:!1,showIcon:!0,search:Ember.inject.service(),searchTarget:Ember.computed("target",function(){return this.get("search").getTarget(this.get("target"))}),isSearching:Ember.computed.alias("query",function(){return!!this.get("query")}),init:function(){this._super.apply(this,arguments),Ember.isNone(this.get("query"))&&(Ember.defineProperty(this,"query",Ember.computed.alias("searchTarget.query")),this.get("searchTarget"))},didInsertElement:function(){var e=this
this.updateInput(),this.get("autoFocus")&&this.$("input[type=search]").focus(),this.getWithDefault("unbindKeys",function(){})(),this.set("unbindKeys",(0,t.default)({find:function(){return e.send("focus")},esc:function(){return e.send("clear")}}))},willDestroyElement:function(){this._super.apply(this,arguments),this.getWithDefault("unbindKeys",function(){})()},updateQuery:Ember.observer("query",function(){this.get("query")!==this.$("input[type=search]").val()&&this.updateInput()}),updateInput:function(){this.$("input[type=search]").val(this.get("query"))},keyUp:function(){this.set("query",this.$("input[type=search]").val())},shouldShowClear:Ember.computed("isSearching","alwaysShowClear",function(){return!!this.get("alwaysShowClear")||this.get("isSearching")}),actions:{clear:function(){this.set("query","")},focus:function(){this.get("focusOnShortcut")&&this.$("input[type=search]").focus()}}})
e.default=n}),define("tco-app/components/common/search-bar/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"YDHLaDpV",block:'{"symbols":[],"statements":[[7,"input"],[12,"class",[28,[[27,"if",[[23,["noFocus"]],"cs-no-input-focus"],null]]]],[12,"placeholder",[28,[[21,"placeholder"]]]],[11,"type","search"],[9],[10],[0,"\\n"],[4,"if",[[23,["showIcon"]]],null,{"statements":[[7,"span"],[9],[1,[27,"icon",["fa-search"],null],false],[10]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["shouldShowClear"]]],null,{"statements":[[7,"span"],[11,"class","cs-clear"],[12,"onclick",[27,"action",[[22,0,[]],"clear"],null]],[9],[1,[27,"icon",["fa-times"],null],false],[10]],"parameters":[]},null],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/search-bar/template.hbs"}})
e.default=t}),define("tco-app/components/common/sortable-container/component",["exports","tco-app/src/util/dragula","tco-app/src/actions/ui"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Component.extend({tagName:"ul",classNames:["cs-sortable"],classNameBindings:["isDragging:cs-sorting","canInlineAdd::cs-sortable-no-inline-add"],isDragging:!1,canInlineAdd:!0,redux:Ember.inject.service(),canDrag:!0,onDragStart:function(){},onDragEnd:function(){},didInsertElement:function(){var e=this
if(this.get("canDrag")){var o=(0,t.default)({moves:function(e,t,n){var o=Ember.$(e).find("> .cs-sortable-item-handle"),r=Ember.$(n)
return!(!r.length||!o.length)&&Ember.$.contains(o[0],r[0])},offset:function(e,t,n){return{x:e.x,y:Ember.$(n).find("> .cs-sortable-item-handle").height()/2}},revertOnSpill:!0,mirrorContainer:this.get("element")})
o.containers.push(this.get("element")),o.on("drag",function(){e.isDestroyed||(e.set("isDragging",!0),e.onDragStart(),e.get("redux").dispatch((0,n.disablePreviewPointer)()))}),o.on("dragend",function(){e.isDestroyed||(e.set("isDragging",!1),e.onDragEnd(),e.get("redux").dispatch((0,n.enablePreviewPointer)()))}),this.set("drake",o)}},willDestroyElement:function(){var e=this.get("drake")
e&&e.destroy()}})
e.default=o}),define("tco-app/components/common/sortable-container/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"i3kHwOU4",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/sortable-container/template.hbs"}})
e.default=t}),define("tco-app/components/common/sortable-item/component",["exports","ember-redux","tco-app/mixins/dragula-events","tco-app/src/selectors/elements"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Component.extend(n.default,{tagName:"li",classNames:["cs-sortable-item"],classNameBindings:["active:cs-active","canUseDrawer:cs-sortable-item-has-drawer"],dragulaEvents:["element"],canQuickDelete:!0,showAddBefore:!0,showAddAfter:!1,onDropIndex:function(){},onDrop:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onSelect:function(){},onAddBefore:function(){},onAddAfter:function(){},canEditLabel:Ember.computed("isMinimal",function(){return!this.get("isMinimal")}),canUseDrawer:Ember.computed("isMinimal","hasDrawer",function(){return!this.get("isMinimal")&&this.get("hasDrawer")}),addLabel:Ember.computed(function(){return this.get("i18n").t("app.add-item")}),deleteConfirm:Ember.computed("ui.deleteConfirm",function(){return this.get("canQuickDelete")&&this.get("ui.deleteConfirm")}),canShowAddBefore:Ember.computed("showAddBefore","onAddBefore",function(){return this.get("showAddBefore")&&this.get("onAddBefore")}),canShowAddAfter:Ember.computed("showAddAfter","onAddAfter",function(){return this.get("showAddAfter")&&this.get("onAddAfter")}),dragulaDrop:function(e,t,n,o,r){var a=Ember.$(r).index()-1
this.onDropIndex(this.get("itemIndex"),a),this.onDrop(this.get("item"),a)},didInsertElement:function(){var e=this
this.$().children(".cs-sortable-item-handle").on("mouseenter",function(){e.isDestroyed||e.onMouseEnter()}).on("mouseleave",function(){e.isDestroyed||e.onMouseLeave()})},actions:{updateLabel:function(e){this.onUpdateLabel(e)},selectFromButton:function(){this.onSelect()},selectFromLabel:function(){this.get("canUseDrawer")||this.onSelect()},addBefore:function(){this.onAddBefore()},addAfter:function(){this.onAddAfter()}}}),a=(0,t.connect)(function(){var e=(0,o.makeGetElement)()
return function(t,n){var o=n.elId
if(o){var r=e(t,{id:o})
return r?{item:r._id,label:r._label}:{}}return{}}})(r)
e.default=a}),define("tco-app/components/common/sortable-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"+Cs0qYtw",block:'{"symbols":["control","&default"],"statements":[[4,"if",[[23,["canShowAddBefore"]]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"addBefore"],[["allowedKeys"],["any"]]]],[11,"class","cs-add-sortable-item-before"],[9],[7,"span"],[9],[1,[27,"icon",["fa-plus"],null],false],[1,[21,"addLabel"],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-sortable-item-handle"],[9],[0,"\\n"],[4,"if",[[23,["canUseDrawer"]]],null,{"statements":[[0,"  "],[7,"button"],[11,"class","cs-sortable-item-handle-toggle"],[12,"onclick",[27,"action",[[22,0,[]],"selectFromButton"],null]],[9],[1,[27,"icon",["caret-collapse"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[7,"div"],[11,"class","cs-sortable-item-handle-label"],[12,"onclick",[27,"action",[[22,0,[]],"selectFromLabel"],null]],[9],[0,"\\n    "],[4,"if",[[23,["beforeLabel"]]],null,{"statements":[[1,[27,"component",[[23,["beforeLabel"]]],null],false]],"parameters":[]},null],[0,"\\n    "],[1,[27,"forms/inline-edit",null,[["class","value","enabled","placeholder","invalid","onDoneEditing"],["label",[23,["label"]],[23,["canEditLabel"]],[23,["labelPlaceholder"]],[23,["labelInvalid"]],[27,"action",[[22,0,[]],"updateLabel"],null]]]],false],[0,"\\n  "],[10],[0,"\\n"],[4,"unless",[[23,["isMinimal"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-sortable-item-handle-controls"],[9],[0,"\\n"],[4,"each",[[23,["controls"]]],null,{"statements":[[4,"if",[[22,1,["component"]]],null,{"statements":[[0,"    "],[1,[27,"component",[[22,1,["component"]]],null],false],[0,"\\n"]],"parameters":[]},{"statements":[[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[22,1,["action"]]],null]],[12,"title",[28,[[22,1,["label"]]]]],[9],[1,[27,"icon",[[22,1,["icon"]]],null],false],[10],[0,"\\n"]],"parameters":[]}]],"parameters":[1]},null],[4,"if",[[23,["onInspect"]]],null,{"statements":[[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onInspect"]]],null]],[11,"title","Inspect"],[9],[1,[27,"icon",["fa-search"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["onDuplicate"]]],null,{"statements":[[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onDuplicate"]]],null]],[11,"title","Duplicate"],[9],[1,[27,"icon",["fa-copy"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["onDelete"]]],null,{"statements":[[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onDelete"]]],[["allowedKeys"],["shift"]]]],[12,"class",[28,[[27,"if",[[23,["deleteConfirm"]],"cs-danger"],null]]]],[11,"title","Delete"],[9],[1,[27,"icon",["fa-trash-alt"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"],[4,"if",[[24,2]],null,{"statements":[[4,"if",[[23,["canUseDrawer"]]],null,{"statements":[[7,"div"],[12,"class",[28,["cs-sortable-item-drawer ",[27,"if",[[23,["active"]],"cs-active"],null]]]],[9],[0,"\\n"],[4,"if",[[23,["active"]]],null,{"statements":[[0,"  "],[14,2],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"if",[[23,["canShowAddAfter"]]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"addAfter"],[["allowedKeys"],["any"]]]],[11,"class","cs-add-sortable-item-after"],[9],[7,"span"],[9],[1,[27,"icon",["fa-plus"],null],false],[1,[21,"addLabel"],false],[10],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/sortable-item/template.hbs"}})
e.default=t}),define("tco-app/components/common/tab-modal/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-tab-modal"],classNameBindings:["active:cs-active"],closeOnSave:!1,showSave:!1,saveLabel:Ember.computed("saveLabel",function(){return this.getWithDefault("saveLabel",this.get("i18n").t("app.save"))}),showSaveButton:Ember.computed("onSave","closeOnSave","showSave",function(){return this.get("onSave")||this.get("closeOnSave")||this.get("showSave")}),collapseNav:!0,showNav:Ember.computed("panels.length","collapseNav",function(){return this.get("panels.length")>1&&this.get("collapseNav")}),selectedTab:!1,activeTab:Ember.computed("selectedTab","panels",function(){var e=this.get("panels"),t=this.get("selectedTab"),n=e.find(function(e){return e.name===t})
return n||(n=e[0]),n.name}),activeLabel:Ember.computed("activeTab",function(){var e=this.get("activeTab")
return this.get("navItems").filter(function(t){return t.name===e}).get("firstObject.label")}),activeContent:Ember.computed("activeTab","panels",function(){var e=this.get("activeTab")
return this.get("panels").find(function(t){return t.name===e}).content}),actions:{close:function(){this.set("active",!1)},nav:function(e){this.set("selectedTab",e)},tabSave:function(){this.$(".cs-tab-modal-content-tab").trigger("parent-modal",[function(e){e.send("modalSave")}])},save:function(){this.send("tabSave"),Ember.isPresent(this.get("onSave"))&&this.onSave(),this.get("closeOnSave")&&this.send("close")}}})
e.default=t}),define("tco-app/components/common/tab-modal/tab-modal-tab/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-tab-modal-content-tab"],didInsertElement:function(){var e=this
this._super.apply(this,arguments),this.$().on("parent-modal",function(t,n){return n(e)})},actions:{modalSave:function(){}}})
e.default=t}),define("tco-app/components/common/tab-modal/tab-modal-tab/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"xG1uO4HK",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/tab-modal/tab-modal-tab/template.hbs"}})
e.default=t}),define("tco-app/components/common/tab-modal/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"j5+2uNti",block:'{"symbols":["nav","&default"],"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"close"],null]],[11,"class","cs-tab-modal-close"],[12,"aria-label",[28,[[27,"t",["app.a11y.close"],null]]]],[9],[0,"\\n  "],[7,"span"],[9],[0,"×"],[10],[0,"\\n"],[10],[0,"\\n"],[7,"div"],[11,"class","cs-tab-modal-content-outer"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-tab-modal-content-inner"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-tab-modal-content"],[11,"role","document"],[9],[0,"\\n"],[4,"if",[[23,["showNav"]]],null,{"statements":[[0,"      "],[7,"nav"],[9],[0,"\\n"],[4,"each",[[23,["panels"]]],null,{"statements":[[0,"          "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"nav",[22,1,["name"]]],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeTab"]],[22,1,["name"]]],null],"cs-active"],null]]]],[9],[1,[22,1,["label"]],false],[10],[0,"\\n"]],"parameters":[1]},null],[0,"      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[7,"article"],[9],[0,"\\n"],[4,"common/scroll-box",null,null,{"statements":[[0,"          "],[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n"],[4,"if",[[24,2]],null,{"statements":[[0,"              "],[14,2,[[27,"hash",null,[["activeTab"],[[23,["activeTab"]]]]]]],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["tabPath"]]],null,{"statements":[[0,"                "],[1,[27,"component",[[27,"concat",[[23,["tabPath"]],[23,["activeTab"]]],null]],[["modal"],[[22,0,[]]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0,"                "],[1,[21,"activeContent"],true],[0,"\\n"]],"parameters":[]}]],"parameters":[]}],[0,"          "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["showSaveButton"]]],null,{"statements":[[0,"          "],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n            "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[21,"saveLabel"],false],[10],[0,"\\n          "],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/tab-modal/template.hbs"}})
e.default=t}),define("tco-app/components/common/welcome-message/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-welcome"]})
e.default=t}),define("tco-app/components/common/welcome-message/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"EfNTICcE",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["title"]]],null,{"statements":[[0,"  "],[7,"h3"],[11,"class","cs-welcome-title"],[9],[1,[21,"title"],false],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/common/welcome-message/template.hbs"}})
e.default=t}),define("tco-app/components/content/settings-modal-tab/component",["exports","fast-json-stable-stringify","tco-app/components/global/settings-modal/tab-base/component","tco-app/util/ember-control-factory"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=n.default.extend({currentUser:Ember.inject.service(),tabData:Ember.computed(function(){var e=this.get("model.content.postTypeLabel")
return{name:"content",label:this.get("i18n").t("app.settings-format",{type:e}).toString(),prefer:!0}}),didReceiveAttrs:function(){var e=this
this.set("sections",this.get("model.settingsSections.models").map(function(t){var n=t.name,r=t.controls,a=t.ui,i=r.map(function(t){var n=t.key,o=t.type,r=t.ui,a=t.condition,i=t.options
return"wpselect"===o?e.convertWpSelect({key:n,type:o,ui:r,condition:a,options:i}):{key:n,type:o,title:r.title,options:i,condition:a}}),s=(0,o.default)({owner:Ember.getOwner(e),sourcePath:"content.settings.".concat(n),controls:i,permissionCheck:function(t){return e.get("currentUser").can(t)}})
return Ember.Object.create({name:n,label:a.title,controls:s(e.get("model"))})}))},sections:Ember.A(),saveLabel:Ember.computed("model.content.postTypeLabel",function(){return"Save ".concat(this.get("model.content.postTypeLabel")," Settings")}),convertWpSelect:function(e){var t=e.key,n=(e.type,e.ui),o=e.options,r=e.condition
var a=this.normalizeWpSelectMarkup(o.markup,t).match(/<option.*?option>/g)
o.choices=[]
var i=new RegExp('value="(.*?)".*?>(.*?)</')
return a&&a.forEach(function(e){var t=i.exec(e)
t&&o.choices.push({value:t[1],label:t[2]})}),{key:t,type:"select",title:n.title,options:o,condition:r}},normalizeWpSelectMarkup:function(e,t){return"post_parent"===t?e.replace('value=""','value="0"'):e}})
e.default=r}),define("tco-app/components/content/settings-modal-tab/responsive-text/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t={type:"classic:responsive-text",title:"Responsive Text",selector:".h-responsive",compression:"1.0",min_size:"24",max_size:"96"},n=Ember.Component.extend({lastIndex:Ember.computed("items.length",function(){return this.get("items.length")-1}),unitSliderOptions:{available_units:["px"],ranges:{px:{min:0,max:100,step:1}}},actions:{updateLabel:function(e,t){Ember.set(e,"title",t)},addFirstItem:function(){this.send("addItem",{},0)},selectIndex:function(e){this.set("selectedIndex",e===this.get("selectedIndex")?"none":e)},moveItem:function(e,t){var n=this.get("items"),o=n.objectAt(e),r=n.slice(0,e),a=n.slice(e+1)
n=r.concat(a),r=n.slice(0,t),a=n.slice(t),r.push(o),this.set("items",r.concat(a))},addSiblingItem:function(e,t,n){this.send("addItem",{},n?e+1:e)},addItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0
Ember.isNone(n)&&(n=this.get("items.length"))
var o=this.get("items"),r=o.slice(0,n),a=o.slice(n)
r.push(Object.assign({},t,e)),this.set("items",r.concat(a))},duplicateItem:function(e,t){var n=Object.assign({},e)
n.title=this.get("i18n").t("app.copy-of",{title:n.title}).string,this.send("addItem",n,t+1)},deleteItem:function(e){this.set("items",this.get("items").filter(function(t,n){return e!==n}))}}})
e.default=n})
define("tco-app/components/content/settings-modal-tab/responsive-text/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"1qTBUJTK",block:'{"symbols":["item","index"],"statements":[[4,"common/sortable-container",null,[["canInlineAdd"],[false]],{"statements":[[4,"each",[[23,["items"]]],null,{"statements":[[4,"common/sortable-item",null,[["label","onUpdateLabel","item","itemIndex","active","showAddAfter","onSelect","onDropIndex","onDuplicate","onDelete","hasDrawer"],[[22,1,["title"]],[27,"action",[[22,0,[]],"updateLabel",[22,1,[]]],null],[22,1,[]],[22,2,[]],[27,"eq",[[22,2,[]],[23,["selectedIndex"]]],null],[27,"eq",[[22,2,[]],[23,["lastIndex"]]],null],[27,"action",[[22,0,[]],"selectIndex",[22,2,[]]],null],[27,"action",[[22,0,[]],"moveItem"],null],[27,"action",[[22,0,[]],"duplicateItem",[22,1,[]],[22,2,[]]],null],[27,"action",[[22,0,[]],"deleteItem",[22,2,[]]],null],true]],{"statements":[[7,"div"],[11,"class","cs-sortable-item-drawer-section"],[9],[0,"\\n  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.responsive-text.selector"],null],false],[10],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"input",null,[["type","value","placeholder"],["text",[22,1,["selector"]],".h-responsive"]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.responsive-text.compress"],null],false],[10],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"input",null,[["type","value","placeholder"],["text",[22,1,["compression"]],"1.0"]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.responsive-text.min-size"],null],false],[10],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/unit-slider",null,[["value","options"],[[22,1,["min_size"]],[23,["unitSliderOptions"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.responsive-text.max-size"],null],false],[10],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/unit-slider",null,[["value","options"],[[22,1,["max_size"]],[23,["unitSliderOptions"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[1,2]},null]],"parameters":[]},null],[0,"\\n"],[7,"button"],[11,"class","cs-sortable-ghost-add"],[12,"onclick",[27,"action",[[22,0,[]],"addItem"],null]],[9],[7,"strong"],[9],[1,[27,"icon",["fa-plus"],null],false],[1,[27,"t",["app.add"],null],false],[10],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/content/settings-modal-tab/responsive-text/template.hbs"}})
e.default=t}),define("tco-app/components/content/settings-modal-tab/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"dKrr60do",block:'{"symbols":["section"],"statements":[[4,"if",[[23,["isActive"]]],null,{"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n"],[4,"each",[[23,["sections"]]],null,{"statements":[[0,"  "],[7,"h3"],[9],[1,[22,1,["label"]],false],[10],[0,"\\n"],[4,"if",[[22,1,["controls"]]],null,{"statements":[[0,"  "],[1,[27,"common/control-list",null,[["controls","class"],[[22,1,["controls"]],"cs-controls-settings"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"eq",[[22,1,["name"]],"responsive-text"],null]],null,{"statements":[[0,"  "],[1,[27,"content/settings-modal-tab/responsive-text",null,[["items"],[[23,["model","content","responsiveTextItems"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[1]},null],[10],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[21,"saveLabel"],false],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/content/settings-modal-tab/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-base/component",["exports","ember-copy","tco-app/src/util/merge-options"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Component.extend({level:1,firstLevel:Ember.computed.equal("level",1),deeplyNested:Ember.computed.gt("level",2),classNameBindings:["baseClasses","hidden:cs-hide","class"],attributeBindings:["groupName:data-cs-control-group-name","control.id:data-cs-control-id"],groupName:Ember.computed.alias("control.group"),containerClass:Ember.computed(function(){var e=[]
if(this.get("firstLevel"))e.push("cs-control-input")
else{var t
e.push("cs-control-input-list-input")
var n=this.get("defaultHeight"),o=this.get("control.options.height")
Ember.isPresent(n)&&(t=n),Ember.isPresent(o)&&(t=o),Ember.isPresent(t)&&e.push("cs-control-input-list-input-height-".concat(t))}return e.join(" ")}),options:Ember.computed.alias("control.options"),value:Ember.computed.alias("control.keyValue"),service:Ember.inject.service("controls"),baseClasses:Ember.computed(function(){return"cs-control-group"}),isHidden:Ember.computed.alias("hidden"),label:Ember.computed("control.label",function(){var e=this.get("control.label")
return Ember.isPresent(e)?e:"&nbsp;"}),description:Ember.computed.alias("control.description"),eventTrigger:Ember.observer("control.keyValue",function(){["settings-wp-changed","settings-theme-changed"].includes(this.get("control.options.trigger"))&&this.get("ui").set("refreshPreviewAfterSave",!0)})})
o.isKeyMapped=function(e){return Ember.computed(function(){return Ember.isPresent(this.get("control.keys.".concat(e)))})},o.subOptions=function(e,o,r){var a="control.options.".concat(e)
return Ember.computed(a,function(){var e=(0,n.default)(Ember.isNone(o)?{}:(0,t.copy)(o,!0),this.getWithDefault(a,{}))
return"function"==typeof r&&(e=r.call(this,e)),e})}
var r=o
e.default=r}),define("tco-app/components/controls/control-base/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Ray9Q9XX",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n  "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"  "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-base/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-color/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({showAlt:t.default.isKeyMapped("alt"),colorValue:Ember.computed.alias("value"),altColorValue:Ember.computed.alias("control.keyAlt"),baseOptions:Ember.computed.alias("control.options"),altOptions:Ember.computed("baseOptions",function(){var e=Object.assign({},this.get("baseOptions"))
return e.alt_label&&(e.label=e.alt_label),e}),usePalette:Ember.computed("baseOptions.palette",function(){return!1!==this.get("baseOptions.palette")}),usePaletteAlt:Ember.computed("baseOptions.palette",function(){return!1!==this.get("altOptions.palette")})})
e.default=n}),define("tco-app/components/controls/control-color/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"eex1OZe2",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/color-picker",null,[["value","options","usePalette"],[[23,["value"]],[23,["baseOptions"]],[23,["usePalette"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-color/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-font-family/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({store:Ember.inject.service(),didReceiveAttrs:function(){this._super.apply(this,arguments),"fw_fallback"===this.get("value")&&this.set("value","inherit")},fontFamilyOptions:Ember.computed(function(){var e=this.get("store").peekAll("font-manager/selection").filter(function(e){return e.get("selectable")}).map(function(e){return{value:e.get("_id"),label:e.get("title")}})
return e.unshift({value:"inherit",label:"Inherit"}),e})})
e.default=n}),define("tco-app/components/controls/control-font-family/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"6qCr5KG5",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/styled-select",null,[["value","options","visibilityObservation"],[[23,["value"]],[23,["fontFamilyOptions"]],[23,["isHidden"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-font-family/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-font-weight/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({store:Ember.inject.service(),fonts:Ember.inject.service("font-manager"),didReceiveAttrs:function(){this._super.apply(this,arguments)
var e=this.get("value")
0===e.indexOf("fw_fallback")&&this.set("value",e.replace("fw_fallback","inherit"))},fontWeightOptions:Ember.computed("control.keyFontFamily",function(){var e=this,t=this.get("control.keyFontFamily"),n=this.get("store").peekAll("font-manager/selection").find(function(e){return t===e.get("_id")})
"inherit"===t&&(n=Ember.Object.create({_id:"inherit",weights:this.get("fonts.allWeights")}))
var o=Ember.isNone(n)?Ember.A():n.get("weights"),r=Ember.isNone(n)?"":n.get("_id")+":"
return o.sort(),o.reduce(function(t,n){return n.includes("i")||t.push({value:"".concat(r).concat(n),label:e.get("i18n").t("app.font-weight.".concat(n))}),t},Ember.A())}),determineNewWeight:Ember.computed(function(){var e=function(e){return this.get("fonts").normalizeWeight(e).split(":")[1]}.bind(this)
return function(t,n){return e(t)===e(n.value?n.value:n)}})})
e.default=n}),define("tco-app/components/controls/control-font-weight/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"7grTRYl3",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/styled-select",null,[["value","options","assignDefaultLocator"],[[23,["value"]],[23,["fontWeightOptions"]],[23,["determineNewWeight"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-font-weight/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-image/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){function n(e){return Ember.computed(e,"control.keyIsRetina",function(){var t=this.get(e)
return!t||isNaN(t)?"":this.get("control.keyIsRetina")?Math.round(t/2):t})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({defaultHeight:2,useWidth:t.default.isKeyMapped("width"),useHeight:t.default.isKeyMapped("height"),useImgSource:t.default.isKeyMapped("img_source"),showLink:t.default.isKeyMapped("has_link"),showInfo:t.default.isKeyMapped("has_info"),showRetinaReady:t.default.isKeyMapped("is_retina"),showAltText:t.default.isKeyMapped("alt_text"),showDimensionPreview:Ember.computed("useWidth","useHeight",function(){return this.get("useWidth")&&this.get("useHeight")}),widthPreview:n("control.keyWidth"),heightPreview:n("control.keyHeight"),showDisplayFunction:Ember.computed("showLink","showInfo",function(){return this.get("showLink")||this.get("showInfo")}),detectedHeight:Ember.computed("showDimensionPreview","showAltText","showLink","showInfo",function(){return Math.floor([{key:"showAltText",weight:1},{key:"showLink",weight:.5},{key:"showInfo",weight:.5},{key:"showDimensionPreview",weight:1}].reduce(function(e,t){return this.get(t.key)&&(e-=t.weight),e}.bind(this),5))}),altTextPlaceholder:Ember.computed("control.options",function(){var e=this.get("control.options.alt_text_placeholder")
return e||"Describe Your Image"}),actions:{toggleRetinaReady:function(){this.set("control.keyIsRetina",!this.get("control.keyIsRetina"))},dimensionChange:function(e){var t=e.width,n=e.height
this.set("control.keyWidth",t||48),this.set("control.keyHeight",n||48)}}})
e.default=o}),define("tco-app/components/controls/control-image/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"p4RWF3XB",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[0,"\\n        "],[1,[27,"if",[[23,["showRetinaReady"]],"Retina & Dimensions","Dimensions Preview"],null],false],[0,"\\n      "],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-image-dimensions"],[9],[0,"\\n"],[4,"if",[[23,["showRetinaReady"]]],null,{"statements":[[0,"              "],[7,"button"],[12,"class",[28,[[27,"if",[[23,["control","keyIsRetina"]],"cs-active"],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"toggleRetinaReady"],null]],[9],[1,[27,"icon",["fa-eye"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"            "],[7,"div"],[9],[0,"\\n              "],[7,"span"],[9],[0,"W"],[10],[0,"\\n              "],[1,[27,"input",null,[["disabled","value"],[true,[23,["widthPreview"]]]]],false],[0,"\\n            "],[10],[0,"\\n            "],[7,"div"],[9],[0,"\\n              "],[7,"span"],[9],[0,"H"],[10],[0,"\\n              "],[1,[27,"input",null,[["disabled","value"],[true,[23,["heightPreview"]]]]],false],[0,"\\n            "],[10],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n\\n    "],[7,"li"],[11,"class","cs-control is-height-5"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-label"],[9],[0,"Source"],[10],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n"],[4,"if",[[23,["useImgSource"]]],null,{"statements":[[0,"            "],[1,[27,"forms/image-upload",null,[["value","onDimensionChange"],[[23,["control","keyImgSource"]],[27,"action",[[22,0,[]],"dimensionChange"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0,"            "],[1,[27,"forms/image-upload",null,[["value","onDimensionChange"],[[23,["control","keyValue"]],[27,"action",[[22,0,[]],"dimensionChange"],null]]]],false],[0,"\\n"]],"parameters":[]}],[0,"        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n\\n\\n"],[4,"if",[[23,["showDisplayFunction"]]],null,{"statements":[[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[0," "],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n"],[4,"if",[[23,["showLink"]]],null,{"statements":[[0,"              "],[1,[27,"forms/rc-choice",null,[["value","label","half"],[[23,["control","keyHasLink"]],"Link",true]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["showInfo"]]],null,{"statements":[[0,"              "],[1,[27,"forms/rc-choice",null,[["value","label","half"],[[23,["control","keyHasInfo"]],"Info",true]]],false],[0,"\\n"]],"parameters":[]},null],[0,"          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["showAltText"]]],null,{"statements":[[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[0,"Alt Text"],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"input",null,[["type","placeholder","value"],["text",[23,["altTextPlaceholder"]],[23,["control","keyAltText"]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-image/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-select/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({service:Ember.inject.service("controls"),store:Ember.inject.service(),choices:Ember.computed("control.choices.[]","control.options.choices.[]",function(){var e=this.getWithDefault("control.choices",this.getWithDefault("control.options.choices",Ember.A()))
return"list:fonts"===e?this.get("service").getOptionList("fonts"):"list:font-weights"===e?this.get("service").getOptionList("font-weights"):"string"==typeof e&&0===e.indexOf("dynamic:")?e.replace("dynamic:",""):Ember.isArray(e)?Ember.A(e):Ember.A()})})
e.default=n}),define("tco-app/components/controls/control-select/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"EhZ9TWe3",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/styled-select",null,[["value","options","visibilityObservation"],[[23,["value"]],[23,["choices"]],[23,["isHidden"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-select/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-text/component",["exports","tco-app/components/controls/control-base/component","tco-app/mixins/controls/placeholder"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=["date"],r=t.default.extend(n.default,{inputType:Ember.computed("options.input_type",function(){var e=this.get("options.input_type")
return o.includes(e)?e:"text"}),classNameBindings:["monospace:cs-monospace-input"]})
e.default=r}),define("tco-app/components/controls/control-text/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"3PXWAd9/",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"input",[[27,"-input-type",[[23,["inputType"]]],null]],[["type","value","placeholder","class"],[[23,["inputType"]],[23,["control","keyValue"]],[23,["placeholder"]],[27,"if",[[23,["control","options","monospace"]],"cs-input-code"],null]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-text/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-textarea/component",["exports","tco-app/components/controls/control-base/component","tco-app/mixins/controls/placeholder"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend(n.default,{classNameBindings:["monospace:cs-monospace-input"],defaultHeight:5})
e.default=o}),define("tco-app/components/controls/control-textarea/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"CQ9btQvB",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"textarea",null,[["value","placeholder","class"],[[23,["value"]],[23,["placeholder"]],[27,"if",[[23,["control","options","monospace"]],"cs-input-code"],null]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-textarea/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-toggle/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/components/controls/control-toggle/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"sQtOs8FC",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/cs-toggle",null,[["value"],[[23,["value"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-toggle/template.hbs"}})
e.default=t}),define("tco-app/components/controls/control-unit-slider/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/components/controls/control-unit-slider/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"OTwJXPJh",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["control","label"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-control-group-header"],[9],[0,"\\n    "],[7,"label"],[11,"class","cs-control-group-label"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[4,"if",[[23,["description"]]],null,{"statements":[[0,"      "],[7,"span"],[11,"class","cs-control-group-description"],[9],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"unless",[[23,["isHidden"]]],null,{"statements":[[0,"  "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n    "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n      "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n          "],[1,[27,"forms/unit-slider",null,[["value","options"],[[23,["value"]],[23,["control","options"]]]]],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/control-unit-slider/template.hbs"}})
e.default=t}),define("tco-app/components/controls/input-list-item/component",["exports","tco-app/components/controls/control-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({level:2,tagName:"li",control:{type:"aggregate"}})
e.default=n}),define("tco-app/components/controls/input-list-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"pGo0+f0B",block:'{"symbols":["&default"],"statements":[[7,"div"],[12,"class",[28,[[21,"containerClass"]]]],[9],[14,1],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/input-list-item/template.hbs"}})
e.default=t}),define("tco-app/components/controls/input-list/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"ul",classNames:["cs-control-input-list"],level:Ember.computed("parentLevel",function(){return this.getWithDefault("parentLevel",1)+1})})
e.default=t}),define("tco-app/components/controls/input-list/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"trwycLpH",block:'{"symbols":["control","&default"],"statements":[[4,"if",[[24,2]],null,{"statements":[[0,"  "],[14,2],[0,"\\n"]],"parameters":[]},{"statements":[[4,"each",[[23,["controls"]]],null,{"statements":[[4,"unless",[[27,"or",[[22,1,["isHidden"]],[22,1,["excluded"]]],null]],null,{"statements":[[0,"      "],[1,[27,"component",[[27,"locate-component",[[27,"concat",["controls/control-",[22,1,["type"]]],null],"controls/input-list-item"],null]],[["control","level","tagName"],[[22,1,[]],[23,["level"]],"li"]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[1]},null]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/controls/input-list/template.hbs"}})
e.default=t}),define("tco-app/components/cs-dock/component",["exports","tco-app/src/actions/ui"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-dock"],classNameBindings:["workspaceOrientationClass","isReallyUndocked:is-undocked:is-docked","isResizingClass","isHidden:is-hidden"],isReallyUndocked:!1,isUndocked:!1,isHorizontal:!1,redux:Ember.inject.service(),attributeBindings:["style"],leftOffset:null,topOffset:null,offset:0,width:null,height:null,workspaceOrientationClass:Ember.computed("isHorizontal",function(){return"is-".concat(this.get("isHorizontal")?"horizontal":"vertical")}),resizeMinWidth:150,resizeMinHeight:150,isResizingClass:Ember.computed("draggingHandle",function(){var e=this.get("draggingHandle")
return e?"is-resizing-".concat(e):""}),init:function(){this._super.apply(this,arguments),this.set("onMouseDown",this.get("_onMouseDown").bind(this)),this.set("onMouseMove",this.get("_onMouseMove").bind(this)),this.set("onMouseUp",this.get("_onMouseUp").bind(this)),this.set("onMouseMoveHandle",this.get("_onMouseMoveHandle").bind(this))},style:Ember.computed("leftOffset","topOffset","width","height","isReallyUndocked","isHorizontal",function(){if(!this.get("isReallyUndocked")||Ember.isNone(this.get("leftOffset"))||Ember.isNone(this.get("topOffset"))||Ember.isNone(this.get("width"))||Ember.isNone(this.get("height")))return""
var e=this.get("isHorizontal")?"width:".concat(this.get("width"),"px;"):"height:".concat(this.get("height"),"px;")
return Ember.String.htmlSafe("top:".concat(this.get("topOffset"),"px;left:").concat(this.get("leftOffset"),"px;").concat(e))}),didInsertElement:function(){this.maybeAllowMoving()},swapDimensions:Ember.observer("isHorizontal",function(){var e=this.get("height"),t=this.get("width"),n=this.get("topOffset")||0,o=this.get("leftOffset")||40,r=this.get("resizeMinWidth"),a=this.get("resizeMinHeight")
if(this.get("isHorizontal")){o<90&&this.set("leftOffset",90),n<0&&this.set("topOffset",0)
var i=window.innerWidth-50
this.set("width",e),this.get("leftOffset")+this.get("width")>i&&this.set("width",i-this.get("leftOffset")),this.get("width")<r&&(this.set("leftOffset",this.get("leftOffset")-(r-this.get("width"))),this.set("width",r)),this.get("leftOffset")<90&&this.set("leftOffset",90)}else{n<50&&this.set("topOffset",50),o<40&&this.set("leftOffset",40)
var s=window.innerHeight-50
this.set("height",t),this.get("topOffset")+this.get("height")>s&&this.set("height",s-this.get("topOffset")),this.get("height")<a&&(this.set("topOffset",this.get("topOffset")-(a-this.get("height"))),this.set("height",a)),this.get("topOffset")<50&&this.set("topOffset",50),this.get("leftOffset")<90&&this.set("leftOffset",90)}}),toggleDocked:Ember.observer("isUndocked",function(){this.maybeAllowMoving()}),maybeAllowMoving:function(){this.get("isUndocked")?this.allowMoving():this.disallowMoving()},allowMoving:function(){this.$().on("mousedown",this.get("onMouseDown"))
try{var e=this.get("isHorizontal")?-50:50,t=this.get("isHorizontal")?50:0,n=this.get("element").getBoundingClientRect(),o=n.top,r=n.left,a=n.width,i=n.height,s=this.get("extraOffset")?350:0
this.set("topOffset",o+e),this.set("leftOffset",r+50+s),this.set("width",a-2*t),this.set("height",i-2*e),this.set("isReallyUndocked",!0)}catch(l){console.warn("unable to set initial undocked position")}},disallowMoving:function(){this.set("isReallyUndocked",!1),this.set("leftOffset",null),this.set("topOffset",null),this.set("width",null),this.set("height",null),this.stopMoving(),this.$().off("mousedown",this.get("onMouseDown"))},_onMouseDown:function(e){var t=this,n=Ember.$(e.target);(n.is(".cs-workspace-header")||n.closest(".cs-workspace-nav").length||n.closest(".cs-workspace-expander-head").length)&&(e.preventDefault(),e.stopPropagation(),Ember.$("body").on("mousemove",this.get("onMouseMove")),n.one("click",function(e){t.get("moving")&&(e.preventDefault(),e.stopPropagation(),t.stopMoving())}),this.setCursorOffset(e))},setCursorOffset:function(e){try{var t=e.clientX,n=e.clientY,o=this.get("element").getBoundingClientRect(),r=o.top,a=o.left,i=o.width,s=o.height
this.set("cursorOffset",{topOffset:n-r,rightOffset:t-(a+i),bottomOffset:n-(r+s),leftOffset:t-a})}catch(e){console.warn("unable to identity cursor offset")}},_onMouseMove:function(e){if(!e.buttons)return this.stopMoving()
e.preventDefault(),this.$().on("mouseup",this.get("onMouseUp")),this.set("moving",!0),this.get("redux").dispatch((0,t.disablePreviewPointer)())
try{var n=this.get("cursorOffset"),o=n.topOffset,r=n.leftOffset,a=e.clientX,i=e.clientY
this.set("leftOffset",a-r),this.set("topOffset",i-o)}catch(e){console.warn("unable to move undocked workspace")}},_onMouseUp:function(e){var t=this
e.preventDefault(),setTimeout(function(){return t.stopMoving()},0)},stopMoving:function(){this.get("redux").dispatch((0,t.enablePreviewPointer)()),this.set("moving",!1),this.$().off("mouseup",this.get("onMouseUp")),Ember.$("body").off("mousemove",this.get("onMouseMove"))},_onMouseMoveHandle:function(e){if(!e.buttons)return this.set("draggingHandle",null),void Ember.$("body").off("mousemove",this.get("onMouseMoveHandle"))
e.preventDefault()
try{var t=this.get("cursorOffset"),n=t.topOffset,o=t.leftOffset,r=t.rightOffset,a=t.bottomOffset,i=e.clientX,s=e.clientY
if(this.get("isHorizontal")){var l=this.get("width")
if("start"===this.get("draggingHandle")){var c=i-o,u=this.get("leftOffset")+this.get("width")-c;(u>=this.get("resizeMinWidth")||u>l)&&(this.set("leftOffset",c),this.set("width",u))}else{var p=i-r-this.get("leftOffset");(p>=this.get("resizeMinWidth")||p>l)&&this.set("width",p)}}else{var d=this.get("height")
if("start"===this.get("draggingHandle")){var f=s-n,m=this.get("topOffset")+this.get("height")-f;(m>=this.get("resizeMinHeight")||m>d)&&(this.set("topOffset",f),this.set("height",m))}else{var h=s-a-this.get("topOffset");(h>=this.get("resizeMinHeight")||h>d)&&this.set("height",h)}}}catch(e){console.warn("unable to resize undocked workspace",e)}},willDestroyElement:function(){this.$().off("mousedown",this.get("onMouseDown")),this.$().off("mouseup",this.get("onMouseUp")),Ember.$("body").off("mousemove",this.get("onMouseMove")),Ember.$("body").off("mousemove",this.get("onMouseMoveHandle"))},actions:{beginHandleDrag:function(e,n){this.set("draggingHandle",e),this.setCursorOffset(n),Ember.$("body").on("mousemove",this.get("onMouseMoveHandle")),this.get("redux").dispatch((0,t.disablePreviewPointer)())},endHandleDrag:function(){this.set("draggingHandle",null),Ember.$("body").off("mousemove",this.get("onMouseMoveHandle")),this.get("redux").dispatch((0,t.enablePreviewPointer)())}}})
e.default=n}),define("tco-app/components/cs-dock/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ojfyUXXW",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["isReallyUndocked"]]],null,{"statements":[[0,"  "],[7,"button"],[11,"class","cs-dock-handle is-start"],[12,"onmousedown",[27,"action",[[22,0,[]],"beginHandleDrag","start"],null]],[12,"onmouseup",[27,"action",[[22,0,[]],"endHandleDrag"],null]],[9],[7,"span"],[9],[1,[27,"t",["app.a11y.resize"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"],[4,"if",[[23,["isReallyUndocked"]]],null,{"statements":[[0,"  "],[7,"button"],[11,"class","cs-dock-handle is-end"],[12,"onmousedown",[27,"action",[[22,0,[]],"beginHandleDrag","end"],null]],[12,"onmouseup",[27,"action",[[22,0,[]],"endHandleDrag"],null]],[9],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.a11y.resize"],null],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/cs-dock/template.hbs"}})
e.default=t}),define("tco-app/components/design-cloud/dc-canvas/component",["exports","moment","tco-app/util/search"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Component.extend({classNames:["cs-dc-canvas","cs-tm"],selectedTypeFilter:"all",typeFilters:Ember.computed("availableItems.[]",function(){var e=this.get("availableItems").map(function(e){return e.get("assetType")}).reduce(function(e,t){return t.forEach(function(t){e.includes(t)||e.push(t)}),e},[])
return["all"].concat(o(e))}),onInit:Ember.on("init",function(){var e=n.default.create()
e.set("name","design-cloud"),this.set("searchData",e),e.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1},{name:"secondary",weight:.03}]}),this.updateSearchIndex()}),updateSearchIndexObserver:Ember.observer("searchableItems.[]","searchableItems.@each.title",function(){this.updateSearchIndex()}),updateSearchIndex:function(){this.get("searchData").updateIndex(this.getWithDefault("searchableItems",[]).map(function(e){var t=""
return t+=e.get("author"),{id:e.get("id"),title:e.get("title"),secondary:t}}))},isSearching:Ember.computed.alias("searchData.isSearching"),filteredItems:Ember.computed("searchData.results","sortedSearchableItems.[]",function(){var e=this.get("searchData.results")
return this.get("isSearching")?this.get("sortedSearchableItems").filter(function(t){return e.includes(t.get("id"))}).sort(function(t,n){return Ember.compare(e.indexOf(t.get("id")).toString(),e.indexOf(n.get("id")).toString())}):this.get("sortedSearchableItems")}),resetSearchOnFilter:Ember.observer("selectedTypeFilter",function(){this.set("searchData.query","")}),selectedSortMode:"new-old",canSortPopular:Ember.computed("items",function(){return this.get("items").reduce(function(e,t){return e||!Ember.isNone(t.get("popularity"))},!1)}),sortModes:Ember.computed("canSortPopular",function(){var e=Ember.A(["new-old","old-new","a-z","z-a"])
return this.get("canSortPopular")&&e.push("popular"),e}),sortOpen:!1,sortedSearchableItems:Ember.computed("selectedSortMode","searchableItems.[]",function(){return this.get(Ember.String.camelize("sortedSearchableItems-".concat(this.get("selectedSortMode"))))}),sortedSearchableItemsAZ:Ember.computed.sort("searchableItems",function(e,t){return Ember.compare(e.get("title"),t.get("title"))}).property("searchableItems.[]"),sortedSearchableItemsZA:Ember.computed.sort("searchableItems",function(e,t){return Ember.compare(t.get("title"),e.get("title"))}).property("searchableItems.[]"),sortedSearchableItemsOldNew:Ember.computed.sort("searchableItems",function(e,n){return Ember.compare((0,t.default)(e.get("createdAt")).unix(),(0,t.default)(n.get("createdAt")).unix())}).property("searchableItems.[]"),sortedSearchableItemsNewOld:Ember.computed.sort("searchableItems",function(e,n){return Ember.compare((0,t.default)(n.get("createdAt")).unix(),(0,t.default)(e.get("createdAt")).unix())}).property("searchableItems.[]"),sortedSearchableItemsPopular:Ember.computed.sort("searchableItems",function(e,t){return Ember.compare(t.get("popularity"),e.get("popularity"))}).property("searchableItems.[]"),availableItems:Ember.computed.filter("items",function(e){return!(!this.get("ui.isPro")&&e.get("proOnly"))}).property("ui.isPro"),searchableItems:Ember.computed.filter("availableItems",function(e){var t=e.get("assetType"),n=this.get("selectedTypeFilter")
return!("all"!==n&&!t.includes(n))}).property("selectedTypeFilter"),actions:{install:function(e){this.onInstallItem(e)},selectTypeFilter:function(e,t){t.preventDefault(),this.get("typeFilters").includes(e)&&this.set("selectedTypeFilter",e)},selectSortMode:function(e){this.get("sortModes").includes(e)&&this.set("selectedSortMode",e),this.send("closeSort")},toggleSortOpen:function(){this.set("sortOpen",!this.get("sortOpen"))},closeSort:function(){this.set("sortOpen",!1)}}})
e.default=r}),define("tco-app/components/design-cloud/dc-canvas/dc-item/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNameBindings:["class","inView:cs-in-view-in:cs-in-view-out"],attributeBindings:["style"],enabled:!0,tracker:!1,allowPartialVisibility:!0,ignoreX:!1,ignoreY:!1,scrollBoxSelector:".cs-scroll-box",nativeScrollBox:!1,inViewOffset:0,ready:Ember.computed("viewed","enabled",function(){return!this.get("enabled")||this.get("viewed")}),init:function(){this._super.apply(this,arguments),this.set("onScroll",this.onScroll.bind(this))},didInsertElement:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){e.onScroll(),e.get("ready")&&!e.get("tracker")||e.addEventListeners()})},addEventListeners:function(){Ember.$(document).on("ps-scroll-x ps-scroll-y",this.onScroll),Ember.$(document.body).on("scroll",this.onScroll),this.get("nativeScrollBox")&&this.$().closest(this.get("scrollBoxSelector")).on("scroll",this.onScroll)},removeEventListeners:function(){Ember.$(document).off("ps-scroll-x ps-scroll-y",this.onScroll),Ember.$(document.body).off("scroll",this.onScroll),this.get("nativeScrollBox")&&this.$().closest(this.get("scrollBoxSelector")).off("scroll",this.onScroll)},onScroll:function(){var e=this.get("element")
if(e){this.detectScrollbox()
var t=this.get("ignoreX"),n=this.get("ignoreY"),o=this.get("inViewOffset");(this.get("allowPartialVisibility")||o>0?function(e,r){return(e.top<=r.bottom+o||n)&&(e.right>=r.left-o||t)&&(e.bottom>=r.top-o||n)&&(e.left<=r.right+o||t)}:function(e,o){return(e.top>o.top||n)&&(e.right<o.right||t)&&(e.bottom<o.bottom||n)&&(e.left>o.left||t)})(e.getBoundingClientRect(),this.scrollBox.getBoundingClientRect())?(this.set("ready",!0),this.set("inView",!0),this.get("tracker")||this.removeEventListeners()):this.set("inView",!1)}},detectScrollbox:function(){this.scrollBox||(this.scrollBox=this.$().closest(this.get("scrollBoxSelector"))[0])},willDestroyElement:function(){this.removeEventListeners()}}).extend({tagName:"li",classNames:["cs-dc-item"],scrollBoxSelector:".cs-tm-body",nativeScrollBox:!0,inViewOffset:500,installButtonClass:Ember.computed("item.isInstalling","item.isInstalled",function(){var e=["cs-btn"]
return this.get("item.isInstalled")?e.push("is-installed"):this.get("item.isInstalling")&&e.push("is-installing"),e.join(" ")}),installButtonLabel:Ember.computed("item.isInstalling","item.isInstalled",function(){var e=this.get("i18n").t("app.design-cloud.install")
return this.get("item.isInstalled")?e=this.get("i18n").t("app.design-cloud.installed"):this.get("item.isInstalling")&&(e=this.get("i18n").t("app.design-cloud.installing")),Ember.String.htmlSafe(e)}),previewImageStyle:Ember.computed("ready","item.thumbnailUrl",function(){return this.get("ready")?Ember.String.htmlSafe("background-image: url(".concat(this.get("item.thumbnailUrl"),");")):""}),typeLabels:Ember.computed("item.assetType",function(){return this.get("item.assetType").map(function(e){return e})}),actions:{install:function(){this.onInstall.apply(this,arguments)}}})
e.default=t})
define("tco-app/components/design-cloud/dc-canvas/dc-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"E0uQnFpR",block:'{"symbols":["label"],"statements":[[7,"div"],[11,"class","cs-dc-item-preview"],[12,"data-dc-preview-label",[27,"if",[[23,["item","demoUrl"]],[27,"t",["app.design-cloud.see-it-live"],null],[27,"t",["app.design-cloud.demo-unavailable"],null]],null]],[9],[0,"\\n  "],[7,"a"],[11,"target","_blank"],[12,"href",[23,["item","demoUrl"]]],[12,"style",[21,"previewImageStyle"]],[9],[10],[0,"\\n"],[10],[0,"\\n"],[7,"div"],[11,"class","cs-dc-item-info"],[9],[0,"\\n  "],[7,"header"],[9],[0,"\\n    "],[7,"h2"],[11,"class","cs-dc-item-info-title"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[23,["item","title"]],false],[10],[0,"\\n"],[4,"if",[[23,["item","authorUrl"]]],null,{"statements":[[0,"      "],[7,"small"],[9],[1,[27,"t",["app.design-cloud.by-author-url"],[["author","url"],[[23,["item","authorName"]],[23,["item","authorUrl"]]]]],false],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"      "],[7,"small"],[9],[1,[27,"t",["app.design-cloud.by-author"],[["author"],[[23,["item","authorName"]]]]],false],[10],[0,"\\n"]],"parameters":[]}],[0,"    "],[10],[0,"\\n    "],[7,"div"],[11,"class","cs-dc-item-info-types"],[9],[0,"\\n"],[4,"each",[[23,["typeLabels"]]],null,{"statements":[[0,"      "],[7,"span"],[9],[1,[22,1,[]],false],[10],[0,"\\n"]],"parameters":[1]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n  "],[7,"footer"],[9],[0,"\\n    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"install",[23,["item"]]],null]],[11,"href","#"],[12,"class",[21,"installButtonClass"]],[9],[0,"\\n      "],[7,"span"],[9],[1,[21,"installButtonLabel"],false],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/design-cloud/dc-canvas/dc-item/template.hbs"}})
e.default=t}),define("tco-app/components/design-cloud/dc-canvas/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"t2RHBPcl",block:'{"symbols":["item","index","mode","filter"],"statements":[[7,"header"],[11,"class","cs-tm-header"],[9],[0,"\\n  "],[7,"section"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-tm-header-filters"],[9],[0,"\\n      "],[7,"ul"],[9],[0,"\\n"],[4,"each",[[23,["typeFilters"]]],null,{"statements":[[0,"        "],[7,"li"],[9],[0,"\\n          "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"selectTypeFilter",[22,4,[]]],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["selectedTypeFilter"]],[22,4,[]]],null],"cs-active"],null]]]],[11,"href",""],[9],[0,"\\n            "],[1,[27,"t",[[27,"concat",["app.templates.filter-",[22,4,[]]],null]],null],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[4]},null],[0,"      "],[10],[0,"\\n    "],[10],[0,"\\n    "],[1,[27,"common/search-bar",null,[["noFocus","query","placeholder"],[true,[23,["searchData","query"]],[27,"t",["app.search-thing"],[["context"],[[27,"t",["app.design-cloud.title"],null]]]]]]],false],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n\\n"],[7,"main"],[11,"class","cs-tm-body"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-dc"],[9],[0,"\\n    "],[7,"ul"],[11,"class","cs-dc-sort"],[9],[0,"\\n"],[4,"each",[[23,["sortModes"]]],null,{"statements":[[0,"      "],[7,"li"],[9],[0,"\\n        "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"selectSortMode",[22,3,[]]],null]],[12,"class",[28,[[22,3,[]]," ",[27,"if",[[27,"eq",[[23,["selectedSortMode"]],[22,3,[]]],null],"cs-active"],null]]]],[9],[0,"\\n          "],[1,[27,"t",[[27,"concat",["app.sort.",[22,3,[]]],null]],null],false],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[3]},null],[0,"    "],[10],[0,"\\n    "],[7,"ul"],[11,"class","cs-dc-items"],[9],[0,"\\n"],[4,"each",[[23,["filteredItems"]]],null,{"statements":[[0,"      "],[1,[27,"design-cloud/dc-canvas/dc-item",null,[["item","validation","enabled","onInstall"],[[22,1,[]],[23,["validation"]],[27,"not",[[27,"gte",[12,[22,2,[]]],null]],null],[27,"action",[[22,0,[]],"install"],null]]]],false],[0,"\\n"]],"parameters":[1,2]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/design-cloud/dc-canvas/template.hbs"}})
e.default=t}),define("tco-app/components/design-cloud/dc-workspace/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-dc-workspace"],activeToggle:"how-it-works"})
e.default=t}),define("tco-app/components/design-cloud/dc-workspace/dc-section/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-dc-workspace-section"],classNameBindings:["class","toggleActive:cs-active","isToggleable:is-toggleable"],toggleActive:Ember.computed("active","toggleId",function(){var e=this.get("active"),t=this.get("toggleId")
return t?t===e:e}),active:!1,toggleId:!1,actions:{toggle:function(){var e=this.get("toggleId"),t=this.get("active")
e?this.set("active",e===t?null:e):this.set("active",!t),this.get("active")||this.$(".cs-dc-workspace-section-toggle").blur()}}})
e.default=t}),define("tco-app/components/design-cloud/dc-workspace/dc-section/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Sqir5do1",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["isToggleable"]]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"toggle"],null]],[11,"class","cs-dc-workspace-section-toggle"],[9],[0,"\\n    "],[7,"span"],[9],[1,[21,"toggleLabel"],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-dc-workspace-section-content"],[9],[0,"\\n  "],[14,1],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/design-cloud/dc-workspace/dc-section/template.hbs"}})
e.default=t}),define("tco-app/components/design-cloud/dc-workspace/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"t/OQeqRF",block:'{"symbols":[],"statements":[[4,"unless",[[23,["validation"]]],null,{"statements":[[4,"design-cloud/dc-workspace/dc-section",null,null,{"statements":[[7,"h2"],[11,"class","cs-dc-workspace-validation-title"],[9],[1,[27,"t",["app.design-cloud.validate.title"],null],false],[10],[0,"\\n"],[7,"p"],[11,"class","cs-dc-workspace-validation-text"],[9],[1,[27,"t",["app.design-cloud.validate.confirm"],null],false],[10],[0,"\\n"],[7,"a"],[12,"href",[28,[[23,["ui","validationUrl"]]]]],[11,"class","cs-btn cs-dc-workspace-validation-btn"],[9],[1,[27,"t",["app.go-validate"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"design-cloud/dc-workspace/dc-section",null,[["isToggleable","active","toggleId","toggleLabel"],[true,[23,["activeToggle"]],"how-it-works",[27,"t",["app.design-cloud.how.title"],null]]],{"statements":[[7,"ul"],[11,"class","cs-dc-workspace-how"],[9],[0,"\\n  "],[7,"li"],[9],[0,"\\n    "],[7,"svg"],[11,"version","1.1"],[11,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[11,"xmlns:xlink","http://www.w3.org/1999/xlink","http://www.w3.org/2000/xmlns/"],[11,"x","0px"],[11,"y","0px"],[11,"viewBox","0 0 24 24"],[11,"xml:space","preserve","http://www.w3.org/XML/1998/namespace"],[9],[0,"\\n      "],[7,"line"],[11,"data-cap","butt"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-miterlimit","10"],[11,"x1","16"],[11,"y1","5"],[11,"x2","22"],[11,"y2","5"],[11,"stroke-linejoin","miter"],[11,"stroke-linecap","butt"],[9],[10],[0,"\\n      "],[7,"polygon"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"points","22,18 19,22 16,18 16,1 22,1 "],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"line"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"x1","2"],[11,"y1","6"],[11,"x2","5"],[11,"y2","6"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"line"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"x1","2"],[11,"y1","10"],[11,"x2","4"],[11,"y2","10"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"line"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"x1","2"],[11,"y1","14"],[11,"x2","5"],[11,"y2","14"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"line"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"x1","2"],[11,"y1","18"],[11,"x2","4"],[11,"y2","18"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"rect"],[11,"x","2"],[11,"y","1"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"width","8"],[11,"height","22"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.design-cloud.how.one"],null],false],[10],[0,"\\n  "],[10],[0,"\\n  "],[7,"li"],[9],[0,"\\n    "],[7,"svg"],[11,"version","1.1"],[11,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[11,"xmlns:xlink","http://www.w3.org/1999/xlink","http://www.w3.org/2000/xmlns/"],[11,"x","0px"],[11,"y","0px"],[11,"viewBox","0 0 24 24"],[11,"xml:space","preserve","http://www.w3.org/XML/1998/namespace"],[9],[0,"\\n      "],[7,"line"],[11,"data-cap","butt"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-miterlimit","10"],[11,"x1","12"],[11,"y1","22"],[11,"x2","12"],[11,"y2","9"],[11,"stroke-linejoin","miter"],[11,"stroke-linecap","butt"],[9],[10],[0,"\\n      "],[7,"polyline"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"points"," 9,12 12,9 15,12 "],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n      "],[7,"path"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"d","M16,17h3 c2.209,0,4-1.791,4-4c0-2.197-1.782-4.013-4.025-3.997C18.718,5.093,15.474,2,11.5,2C7.481,2,4.21,5.164,4.018,9.136 C2.287,9.575,1,11.132,1,13c0,2.209,1.791,4,4,4h3"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.design-cloud.how.two"],null],false],[10],[0,"\\n  "],[10],[0,"\\n  "],[7,"li"],[9],[0,"\\n    "],[7,"svg"],[11,"version","1.1"],[11,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[11,"xmlns:xlink","http://www.w3.org/1999/xlink","http://www.w3.org/2000/xmlns/"],[11,"x","0px"],[11,"y","0px"],[11,"viewBox","0 0 24 24"],[11,"xml:space","preserve","http://www.w3.org/XML/1998/namespace"],[9],[0,"\\n      "],[7,"path"],[11,"fill","none"],[11,"stroke-width","2"],[11,"stroke-linecap","square"],[11,"stroke-miterlimit","10"],[11,"d","M20,7L2,2l5,18l3-7l8,8 c0.828,0.828,2.172,0.828,3,0c0.824-0.824,0.831-2.169,0-3l-8-8L20,7z"],[11,"stroke-linejoin","miter"],[9],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.design-cloud.how.three"],null],false],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n\\n"],[4,"design-cloud/dc-workspace/dc-section",null,[["isToggleable","active","toggleId","toggleLabel"],[true,[23,["activeToggle"]],"faq",[27,"t",["app.design-cloud.faq.title"],null]]],{"statements":[[7,"div"],[11,"class","cs-dc-workspace-faq"],[9],[0,"\\n  "],[7,"dl"],[11,"class","cs-dc-workspace-faq-list"],[9],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"What is Design Cloud?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"A collection of premium design assets, including Content templates, Element Presets. Headers and Footers\\n        are available to Pro users."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"How do I access Design Cloud?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"Your site must be validated then you can navigate to Template Manager > Design Cloud."],[10],[0,"\\n    "],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"What happens when I install a template from Design Cloud?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"The template is added to your Template Manager and available for use on your site."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"What is included with the template?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"Everything you see in the demo including the design, images, and copy."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"Can I use the template more than once?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"Absolutely! Any template installed from Design Cloud can be used as many times as you\'d like on a\\n        validated site."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"What kind of templates are available to me?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"Header, Content, Footer, and Preset Templates."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"Do I have to update my theme to get the latest Design Cloud templates?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"No, new templates will automatically show up as they are added to the repository."],[10],[10],[0,"\\n\\n    "],[7,"dt"],[9],[7,"span"],[9],[0,"How often do you plan on adding templates?"],[10],[10],[0,"\\n    "],[7,"dd"],[9],[7,"span"],[9],[0,"We are focused on quality over quantity with Design Cloud. Typically new templates are added monthly;\\n        however, we can not estimate the amount or frequency with which they will be added."],[10],[10],[0,"\\n\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/design-cloud/dc-workspace/template.hbs"}})
e.default=t}),define("tco-app/components/flash-message",["exports","ember-cli-flash/components/flash-message"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/components/forms/color-input/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({colorManager:Ember.inject.service(),paletteItems:Ember.computed("usePalette","colorManager.paletteItems.[]",function(){return this.get("usePalette")?this.get("colorManager.paletteItems"):null}),classNames:["cs-form-color-input"],valueObserver:Ember.observer("value",function(){if(!this.get("updating")&&this.$input){var e=this.get("value")
this.$input.val(e),this.$(".huebert-picker-control-output-value").val(e),this.$input.trigger("change",{ember:!0})}}),selectedObserver:Ember.observer("selected",function(){if(!this.get("updating")&&this.getWithDefault("selected","").replace(/\ /g,"")!==this.getWithDefault("huebertValue","").replace(/\ /g,"")){var e=this.get("colorManager").lookupColor(this.get("selected"))
this.set("value",e)}}),colorValue:Ember.computed("value","colorManager.change",function(){return this.get("usePalette")?this.get("colorManager").lookupColor(this.get("value")):this.get("value")}),huebertValueObserver:Ember.observer("huebertValue",function(){var e=this
this.set("updating",!0),this.set("selected",this.get("huebertValue")),this.set("value",this.get("huebertValue")),Ember.run.next(function(){return e.set("updating",!1)})}),didInsertElement:function(){this.set("canRender",!0),this.renderWhenReady()},observeReady:Ember.observer("ready",function(){this.renderWhenReady()}),didReceiveAttrs:function(){if(this.get("selected")){var e=this.get("colorManager").lookupColor(this.get("selected"))
this.set("value",e)}},renderWhenReady:function(){var e=this
this.get("canRender")&&!this.get("isRendered")&&(this.set("isRendered",!0),this.$input=this.$("input[type=text]"),this.$input.val(this.get("value")),this.$input.on("change",function(t,n){n&&n.ember||e.set("huebertValue",e.$input.val())}),Ember.run.scheduleOnce("afterRender",function(){try{e.$input.huebert({outputFormat:e.getWithDefault("options.output_format","rgb"),label:e.getWithDefault("options.label",null),canToggle:!e.getWithDefault("inline",!1),scrollEvent:"ps-scroll-x ps-scroll-y"}),e.$(".huebert-picker-control-slider-a").after(e.$(".cs-form-color-input-palette"))}catch(t){console.warn(t)}}))},actions:{select:function(e){this.set("selected","global-color:".concat(Ember.get(e,"id")))}}})
e.default=t}),define("tco-app/components/forms/color-input/palette-item/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-form-color-input-palette-item"],classNameBindings:["active:cs-active"],attributeBindings:["style","title"],title:Ember.computed.alias("item.label"),colorStyle:Ember.computed("item.value",function(){return Ember.String.htmlSafe("background-color: ".concat(this.getWithDefault("item.value","transparent"),";"))}),active:Ember.computed("item.id","selected",function(){return"global-color:".concat(this.get("item.id"))===this.getWithDefault("selected",null)}),didInsertElement:function(){var e=this
this.$().on("click",function(){return e.select()})}})
e.default=t}),define("tco-app/components/forms/color-input/palette-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"PLLqwxL+",block:'{"symbols":["&default"],"statements":[[7,"div"],[12,"style",[21,"colorStyle"]],[9],[10],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/color-input/palette-item/template.hbs"}})
e.default=t}),define("tco-app/components/forms/color-input/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ZC29O07i",block:'{"symbols":["item","&default"],"statements":[[7,"input"],[11,"type","text"],[9],[10],[0,"\\n"],[7,"div"],[12,"class",[28,["cs-form-color-input-palette ",[27,"unless",[[23,["paletteItems"]],"cs-hide"],null]]]],[9],[0,"\\n"],[4,"each",[[23,["paletteItems"]]],null,{"statements":[[0,"    "],[1,[27,"forms/color-input/palette-item",null,[["item","selected","select"],[[22,1,[]],[23,["selected"]],[27,"action",[[22,0,[]],"select",[22,1,[]]],null]]]],false],[0,"\\n"]],"parameters":[1]},null],[10],[0,"\\n\\n"],[14,2]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/color-input/template.hbs"}})
e.default=t}),define("tco-app/components/forms/color-picker/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({colorManager:Ember.inject.service(),classNames:["cs-form-color-picker"],onInit:Ember.on("init",function(){this.get("usePalette")||this.set("ready",!0)}),swatchColor:Ember.computed("value","colorManager.change",function(){return this.get("usePalette")?this.get("colorManager").lookupColor(this.get("value")):this.get("value")}),label:Ember.computed("options.label",function(){return this.getWithDefault("options.label","Select Color")}),content:Ember.computed("swatchColor",function(){return Ember.String.htmlSafe('<div class="cs-picker-swatch-content" style="background-color: '.concat(this.get("swatchColor"),';"></div>'))})})
e.default=t}),define("tco-app/components/forms/color-picker/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"k4sYZugO",block:'{"symbols":["picker"],"statements":[[4,"common/cs-picker",null,[["label","content"],[[23,["label"]],[23,["content"]]]],{"statements":[[0,"  "],[1,[27,"forms/color-input",null,[["inline","selected","usePalette","options"],[true,[23,["value"]],[23,["usePalette"]],[23,["options"]]]]],false],[0,"\\n"]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/color-picker/template.hbs"}})
e.default=t}),define("tco-app/components/forms/cs-toggle/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"ul",classNames:["cs-toggle"],classNameBindings:["state:on:off"],state:Ember.computed("value",function(){return this.normalize(this.get("value"))}),normalize:function(e){return"1"===e||"true"===e||""!==e&&"false"!==e&&!!e},click:function(){this.send("toggle")},actions:{toggle:function(){this.set("value",!this.normalize(this.get("value")))}}})
e.default=t}),define("tco-app/components/forms/cs-toggle/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"bDxixCax",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"],[7,"li"],[11,"class","on"],[9],[7,"span"],[9],[0,"On"],[10],[10],[0,"\\n"],[7,"li"],[11,"class","off"],[9],[7,"span"],[9],[0,"Off"],[10],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/cs-toggle/template.hbs"}})
e.default=t}),define("tco-app/components/forms/ember-selectize/component",["exports","tco-app/components/forms/ember-selectize/selectize"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component,o=Ember.computed,r=Ember.observer,a=Ember.run,i=Ember.get,s=Ember.isArray,l=Ember.isEmpty,c=Ember.isNone,u=Ember.typeOf,p=Ember.String.camelize,d=Ember.assert,f=Ember.getOwner,m=Ember.assign,h=n.extend({attributeBindings:["name","multiple","autocomplete","required","tabindex"],classNames:["ember-selectize"],autocomplete:"off",multiple:!1,tabindex:0,maxItems:o("multiple",function(){return this.get("multiple")?null:1}),placeholder:o.alias("prompt"),sortField:null,sortDirection:"asc",tagName:"select",optionValuePath:"content",optionLabelPath:"content",optionGroupPath:"content.group",selection:null,value:o("selection",{get:function(){var e=this.get("_valuePath"),t=this.get("selection")
return e&&t?Ember.get(t,e):t},set:function(e,t){return t}}),optgroups:o("content.[]","groupedContent.[]",function(){var e=this,t=this.get("groupedContent")
if(t)return t.mapBy("label")
var n=this.get("content")
return s(n)?n.reduce(function(t,n){return t.addObject(i(n,e.get("_groupPath")))},Ember.A()):void 0}),content:o("groupedContent.[]",function(){var e=this,t=this.get("groupedContent")
if(t)return t.reduce(function(t,n){var o=i(n,"content")||Ember.A(),r=i(n,"label"),a=o.map(function(t){var n={content:t}
return n[e.get("_groupPath")]=r,Ember.ObjectProxy.create(n)})
return t.pushObjects(a)},Ember.A())}),_optgroupsDidChange:r("optgroups.[]",function(){var e=this
if(this._selectize){this._selectize.clearOptionGroups()
var t=this.get("optgroups")
t&&t.forEach(function(t){e._selectize.addOptionGroup(t,{label:t,value:t})})}}),plugins:["remove_button"],_valuePath:o("optionValuePath",function(){return this.get("optionValuePath").replace(/^content\.?/,"")}),_labelPath:o("optionLabelPath",function(){return this.get("optionLabelPath").replace(/^content\.?/,"")}),_groupPath:o("optionGroupPath",function(){return this.get("optionGroupPath").replace(/^content\.?/,"")}),getValueFor:function(e){var t=this.get("_valuePath")
return l(t)||l(e)?e:i(e,t)},getLabelFor:function(e){var t=this.get("_labelPath")
return l(t)||l(e)?e:i(e,t)},loading:!1,loadingClass:"loading",functionNames:["option","item","option_create","optgroup_header","optgroup"],templateSuffix:"Template",componentSuffix:"Component",functionSuffix:"Function",renderOptions:o(function(){var e=this,t=this.get("functionNames"),n={}
return t.forEach(function(t){var o=e.get("functionSuffix"),r=p(t)+o,a=e.get(r)
if(a)n[t]=function(t,n){return a.call(e.get("targetObject")||e,t.data||t,n)}
else{var i=e.get("componentSuffix"),s=p(t)+i,l=e.get(s)
l&&(n[t]=function(t){return e._componentToDOM(l,t.data||t)})}}),n}),selectizeOptions:o(function(){var e=this,t=this.get("create-item"),n=this.get("multiple")
"string"==typeof this.plugins&&(this.plugins=this.plugins.trim().split(/[\s,]+/))
var o=this.plugins.slice(0)
if(!n){var r=o.indexOf("remove_button");-1!==r&&o.splice(r,1)}var i={plugins:o,labelField:"label",valueField:"value",searchField:"label",optgroupField:"optgroup",create:!!t&&a.bind(this,"_create"),onItemAdd:a.bind(this,"_onItemAdd"),onItemRemove:a.bind(this,"_onItemRemove"),onType:a.bind(this,"_onType"),render:this.get("renderOptions"),placeholder:this.get("placeholder"),score:this.get("score"),onBlur:this._registerAction("on-blur"),onFocus:this._registerAction("on-focus"),onInitialize:this._registerAction("on-init"),onClear:this._registerAction("on-clear")}
return["delimiter","diacritics","createOnBlur","createFilter","highlight","persist","openOnFocus","maxOptions","maxItems","hideSelected","closeAfterSelect","allowEmptyOption","scrollDuration","loadThrottle","preload","dropdownParent","addPrecedence","selectOnTab","searchField"].forEach(function(t){i[t]=e.getWithDefault(t,i[t])}),i=this._mergeSortField(i)}),didInsertElement:function(){d("selectize has to be loaded","function"==typeof this.$().selectize),this.$().selectize(this.get("selectizeOptions")),this._selectize=this.$()[0].selectize,this._disabledDidChange(),this._optgroupsDidChange(),this.get("groupedContent")&&this._groupedContentDidChange(),this._contentDidChange()
var e=this.get("selection"),t=this.get("value")
c(e)||this._selectionDidChange(),c(t)||this._valueDidChange(),this._loadingDidChange()},willDestroyElement:function(){this._contentWillChange(this.get("content")),this._selectionWillChange(this.get("selection")),this._groupedContentWillChange(this.get("groupedContent")),this._selectize.destroy(),this._selectize=null},_create:function(e,t){this._selectize.setTextboxValue(""),a.schedule("actions",this,function(){this._sendAction("create-item",e)}),t(null)},_registerAction:function(e){return a.bind(this,function(){var t=Array.prototype.slice.call(arguments)
t.unshift(e),this._sendAction.apply(this,t)})},_onType:function(e){this.set("filter",e),a.schedule("actions",this,function(){this._sendAction("update-filter",e)})},_sendAction:function(e){if("function"==typeof this[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o]
this[e].apply(this,n)}},_onItemAdd:function(e){var t=this,n=this.get("content"),o=this.get("selection"),r=this.get("multiple")
if(n){var a=n.find(function(t){return"".concat(this.getValueFor(t))===e},this)
if(r&&s(o)&&a)o.find(function(e){return l(t.get("_valuePath"))?e===a:t.getValueFor(a)===t.getValueFor(e)})||this._addSelection(a)
else a&&(o&&this.getValueFor(a)===this.getValueFor(o)||this._updateSelection(a))}},_onItemRemove:function(e){if(!this._removing){var t=this.get("content"),n=this.get("selection"),o=this.get("multiple")
if(t){var r=t.find(function(t){return"".concat(this.getValueFor(t))===e},this)
o&&s(n)&&r?this._removeSelection(r):o||this._updateSelection(null)}}},_updateSelection:function(e){this.set("selection",e),a.schedule("actions",this,function(){var t=this.get("value")
this._sendAction("select-item",e,t),this._sendAction("select-value",t)})},_addSelection:function(e){var t=this.getValueFor(e)
this.get("selection").addObject(e),a.schedule("actions",this,function(){this._sendAction("add-item",e),this._sendAction("add-value",t)})},_removeSelection:function(e){var t=this.getValueFor(e)
this.get("selection").removeObject(e),a.schedule("actions",this,function(){this._sendAction("remove-item",e),this._sendAction("remove-value",t)})},_selectionWillChange:function(e){var t=this.get("multiple")
if(e&&s(e)&&t){e.removeArrayObserver(this,{willChange:"selectionArrayWillChange",didChange:"selectionArrayDidChange"})
var n=e?i(e,"length"):0
this.selectionArrayWillChange(e,0,n)}},_selectionDidChange:r("selection",function(){var e=this,t=this.get("selection")
if(this._oldSelection!==t&&(this._selectionWillChange(this._oldSelection),this._oldSelection=t),this._selectize){var n=this.get("multiple")
if(t)if(n){d("When ember-selectize is in multiple mode, the provided selection must be an array.",s(t)),t.addArrayObserver(this,{willChange:"selectionArrayWillChange",didChange:"selectionArrayDidChange"})
var o=t?i(t,"length"):0
this.selectionArrayDidChange(t,0,null,o)}else t.then?t.then(function(n){n?i(e,"selection")===t&&e._selectize.addItem(e.getValueFor(n)):(e._selectize.clear(),e._selectize.showInput())}):this._selectize.addItem(this.getValueFor(t))
else this._selectize.clear(),this._selectize.showInput()}}),_valueDidChange:r("value",function(){var e=this
if(!this.get("multiple")){var t,n=this.get("content"),o=this.get("value"),r=this.getValueFor(this.get("selection"))
o!==r&&(t=n?n.find(function(t){return o===e.getValueFor(t)}):null,this.set("selection",t))}}),selectionArrayWillChange:function(e,t,n){this._removing=!0
for(var o=t;o<t+n;o++)this.selectionObjectWasRemoved(e.objectAt(o))
this._removing=!1},selectionArrayDidChange:function(e,t,n,o){for(var r=t;r<t+o;r++)this.selectionObjectWasAdded(e.objectAt(r),r)},selectionObjectWasAdded:function(e){this._selectize&&this._selectize.addItem(this.getValueFor(e))},selectionObjectWasRemoved:function(e){this._selectize&&this._selectize.removeItem(this.getValueFor(e))},_contentWillChange:function(e){if(this._selectize){s(e)&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})
var t=e?i(e,"length"):0
this._removing=!0,this.contentArrayWillChange(e,0,t),this._removing=!1}},_contentDidChange:r("content",function(){var e=this,t=this.get("content")
if(this._oldContent!==t&&(this._contentWillChange(this._oldContent),this._oldContent=t),this._selectize){s(t)?t.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"}):t&&t.then&&t.then(function(n){i(e,"content")===t&&e.set("content",n)})
var n=t?i(t,"length"):0
this.contentArrayDidChange(t,0,null,n)}}),contentArrayWillChange:function(e,t,n){for(var o=t;o<t+n;o++)this.objectWasRemoved(e.objectAt(o))
this._selectize&&this._selectize.refreshOptions(this._selectize.isFocused&&!this._selectize.isInputHidden)},contentArrayDidChange:function(e,t,n,o){for(var r=t;r<t+o;r++)this.objectWasAdded(e.objectAt(r)),this.addLabelObserver(e.objectAt(r))
this._selectize&&this._selectize.refreshOptions(this._selectize.isFocused&&!this._selectize.isInputHidden),this._selectionDidChange()},_groupedContentWillChange:function(e){var t=this
this._selectize&&(l(e)||e.forEach(function(e){e.get("content").removeArrayObserver(t,{willChange:"_groupedContentArrayWillChange",didChange:"_groupedContentArrayDidChange"})}))},_groupedContentDidChange:r("groupedContent",function(){var e=this,t=this.get("groupedContent")
if(this._oldGroupedContent!==t&&(this._groupedContentWillChange(this._oldGroupedContent),this._oldGroupedContent=t),this._selectize&&!l(t)){t.forEach(function(t){t.get("content").addArrayObserver(e,{willChange:"_groupedContentArrayWillChange",didChange:"_groupedContentArrayDidChange"})})
var n=t?i(t,"length"):0
this._groupedContentArrayDidChange(t,0,null,n)}}),_groupedContentArrayWillChange:function(){},_groupedContentArrayDidChange:function(){this.notifyPropertyChange("groupedContent.[]")},objectWasAdded:function(e){var t={},n=this.get("sortField")
"object"===u(e)||"instance"===u(e)?(t={label:this.getLabelFor(e),value:this.getValueFor(e),data:e},n&&(s(n)?n.forEach(function(n){t[n.field]=i(e,n.field)}):t[n]=i(e,n)),i(e,this.get("_groupPath"))&&(t.optgroup=i(e,this.get("_groupPath")))):(t={label:e,value:e,data:e},n&&!s(n)&&(t[n]=e)),this._selectize&&t.label&&this._selectize.addOption(t)},addLabelObserver:function(e){"object"!==u(e)&&"instance"!==u(e)||Ember.addObserver(e,this.get("_labelPath"),this,"_labelDidChange")},objectWasRemoved:function(e){"object"!==u(e)&&"instance"!==u(e)||Ember.removeObserver(e,this.get("_labelPath"),this,"_labelDidChange"),this._selectize&&this._selectize.removeOption(this.getValueFor(e))},_labelDidChange:function(e){if(this._selectize){var t={label:this.getLabelFor(e),value:this.getValueFor(e),data:e}
0!==this._selectize.getOption(t.value).length?this._selectize.updateOption(t.value,t):this.objectWasAdded(e)}},_disabledDidChange:r("disabled",function(){this._selectize&&(this.get("disabled")?this._selectize.disable():this._selectize.enable())}),_placeholderDidChange:r("placeholder",function(){if(this._selectize){var e=this.get("placeholder")
this._selectize.settings.placeholder=e,this._selectize.updatePlaceholder()}}),_loadingDidChange:r("loading",function(){var e=this.get("loading"),t=this.get("loadingClass")
e?this._selectize.$wrapper.addClass(t):this._selectize.$wrapper.removeClass(t)}),_lookupComponent:function(e){var t=f(this),o="component:".concat(e),r="template:components/".concat(e),a=t._lookupFactory(r),i=t._lookupFactory(o)
return a&&!i&&(t.register(o,n),i=t._lookupFactory(o)),{component:i,layout:a}},_componentToDOM:function(e,t){var n=this._lookupComponent(e),o=n.component,r=n.layout
d('ember-selectize could not find a component named "'.concat(e,'" in your Ember application.'),o)
var a={data:t}
r&&(a.layout=r)
var i=o.create(a),s=document.createElement("div")
return i.appendTo(s),s},_mergeSortField:function(e){var t=this.get("sortField")
if(t){var n=this._getSortArray(t)
m(e,{sortField:n})}return e},_getSortArray:function(e){return s(e)?e:[{field:e,direction:this.get("sortDirection")}]}})
e.default=h}),define("tco-app/components/forms/ember-selectize/selectize",[],function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,n
window.csSifter=function(){var t=function(e,t){this.items=e,this.settings=t||{diacritics:!0}}
t.prototype.tokenize=function(e){if(!(e=a(String(e||"").toLowerCase()))||!e.length)return[]
var t,n,o,r,s=[],c=e.split(/ +/)
for(t=0,n=c.length;t<n;t++){if(o=i(c[t]),this.settings.diacritics)for(r in l)l.hasOwnProperty(r)&&(o=o.replace(new RegExp(r,"g"),l[r]))
s.push({string:c[t],regex:new RegExp(o,"i")})}return s},t.prototype.iterator=function(e,t){(s(e)?Array.prototype.forEach||function(e){for(var t=0,n=this.length;t<n;t++)e(this[t],t,this)}:function(e){for(var t in this)this.hasOwnProperty(t)&&e(this[t],t,this)}).apply(e,[t])},t.prototype.getScoreFunction=function(e,t){var n,o,a,i
e=this.prepareSearch(e,t),o=e.tokens,n=e.options.fields,a=o.length,i=e.options.nesting
var s,l=function(e,t){var n,o
return e?(e=String(e||""),-1===(o=e.search(t.regex))?0:(n=t.string.length/e.length,0===o&&(n+=.5),n)):0},c=(s=n.length)?1===s?function(e,t){return l(r(t,n[0],i),e)}:function(e,t){for(var o=0,a=0;o<s;o++)a+=l(r(t,n[o],i),e)
return a/s}:function(){return 0}
return a?1===a?function(e){return c(o[0],e)}:"and"===e.options.conjunction?function(e){for(var t,n=0,r=0;n<a;n++){if((t=c(o[n],e))<=0)return 0
r+=t}return r/a}:function(e){for(var t=0,n=0;t<a;t++)n+=c(o[t],e)
return n/a}:function(){return 0}},t.prototype.getSortFunction=function(e,t){var o,a,i,s,l,c,u,p,d,f,m
if(e=(i=this).prepareSearch(e,t),m=!e.query&&t.sort_empty||t.sort,d=function(e,n){return"$score"===e?n.score:r(i.items[n.id],e,t.nesting)},l=[],m)for(o=0,a=m.length;o<a;o++)(e.query||"$score"!==m[o].field)&&l.push(m[o])
if(e.query){for(f=!0,o=0,a=l.length;o<a;o++)if("$score"===l[o].field){f=!1
break}f&&l.unshift({field:"$score",direction:"desc"})}else for(o=0,a=l.length;o<a;o++)if("$score"===l[o].field){l.splice(o,1)
break}for(p=[],o=0,a=l.length;o<a;o++)p.push("desc"===l[o].direction?-1:1)
return(c=l.length)?1===c?(s=l[0].field,u=p[0],function(e,t){return u*n(d(s,e),d(s,t))}):function(e,t){var o,r,a
for(o=0;o<c;o++)if(a=l[o].field,r=p[o]*n(d(a,e),d(a,t)))return r
return 0}:null},t.prototype.prepareSearch=function(t,n){if("object"===e(t))return t
var r=(n=o({},n)).fields,a=n.sort,i=n.sort_empty
return r&&!s(r)&&(n.fields=[r]),a&&!s(a)&&(n.sort=[a]),i&&!s(i)&&(n.sort_empty=[i]),{options:n,query:String(t||"").toLowerCase(),tokens:this.tokenize(t),total:0,items:[]}},t.prototype.search=function(e,t){var n,o,r,a
return o=this.prepareSearch(e,t),t=o.options,e=o.query,a=t.score||this.getScoreFunction(o),e.length?this.iterator(this.items,function(e,r){n=a(e),(!1===t.filter||n>0)&&o.items.push({score:n,id:r})}):this.iterator(this.items,function(e,t){o.items.push({score:1,id:t})}),(r=this.getSortFunction(o,t))&&o.items.sort(r),o.total=o.items.length,"number"==typeof t.limit&&(o.items=o.items.slice(0,t.limit)),o}
var n=function(e,t){return"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=c(String(e||"")),t=c(String(t||"")),e>t?1:t>e?-1:0)},o=function(e,t){var n,o,r,a
for(n=1,o=arguments.length;n<o;n++)if(a=arguments[n])for(r in a)a.hasOwnProperty(r)&&(e[r]=a[r])
return e},r=function(e,t,n){if(e&&t){if(!n)return e[t]
for(var o=t.split(".");o.length&&(e=e[o.shift()]););return e}},a=function(e){return(e+"").replace(/^\s+|\s+$|/g,"")},i=function(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},s=Array.isArray||"undefined"!=typeof $&&$.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},l={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄＣｃ]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅＤｄð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇＥｅɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪＩｉ]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟＬｌ]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴＮｎŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},c=function(){var e,t,n,o,r="",a={}
for(n in l)if(l.hasOwnProperty(n))for(o=l[n].substring(2,l[n].length-1),r+=o,e=0,t=o.length;e<t;e++)a[o.charAt(e)]=n
var i=new RegExp("["+r+"]","g")
return function(e){return e.replace(i,function(e){return a[e]}).toLowerCase()}}()
return t}(),window.csMicroPlugin=(t={mixin:function(e){e.plugins={},e.prototype.initializePlugins=function(e){var t,o,r,a=[]
if(this.plugins={names:[],settings:{},requested:{},loaded:{}},n.isArray(e))for(t=0,o=e.length;t<o;t++)"string"==typeof e[t]?a.push(e[t]):(this.plugins.settings[e[t].name]=e[t].options,a.push(e[t].name))
else if(e)for(r in e)e.hasOwnProperty(r)&&(this.plugins.settings[r]=e[r],a.push(r))
for(;a.length;)this.require(a.shift())},e.prototype.loadPlugin=function(t){var n=this.plugins,o=e.plugins[t]
if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin')
n.requested[t]=!0,n.loaded[t]=o.fn.apply(this,[this.plugins.settings[t]||{}]),n.names.push(t)},e.prototype.require=function(e){var t=this.plugins
if(!this.plugins.loaded.hasOwnProperty(e)){if(t.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")')
this.loadPlugin(e)}return t.loaded[e]},e.define=function(t,n){e.plugins[t]={name:t,fn:n}}}},n={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},t),window.csSelectize=function(t,n,o){var r=function(e,t){if("string"!=typeof t||t.length){var n="string"==typeof t?new RegExp(t,"i"):t,o=function e(t){var o=0
if(3===t.nodeType){var r=t.data.search(n)
if(r>=0&&t.data.length>0){var a=t.data.match(n),i=document.createElement("span")
i.className="highlight"
var s=t.splitText(r),l=(s.splitText(a[0].length),s.cloneNode(!0))
i.appendChild(l),s.parentNode.replaceChild(i,s),o=1}}else if(1===t.nodeType&&t.childNodes&&!/(script|style)/i.test(t.tagName)&&("highlight"!==t.className||"SPAN"!==t.tagName))for(var c=0;c<t.childNodes.length;++c)c+=e(t.childNodes[c])
return o}
return e.each(function(){o(this)})}}
t.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName
var e=this.parentNode
e.replaceChild(this.firstChild,this),e.normalize()}).end()}
var a=function(){}
a.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){var n=arguments.length
return 0===n?delete this._events:1===n?delete this._events[e]:(this._events=this._events||{},void(e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)))},trigger:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},a.mixin=function(e){for(var t=["on","off","trigger"],n=0;n<t.length;n++)e.prototype[t[n]]=a.prototype[t[n]]}
var i,s,l=/Mac/.test(navigator.userAgent),c=l?91:17,u=l?18:17,p=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,d=function(e){return void 0!==e},f=function(e){return null==e?null:"boolean"==typeof e?e?"1":"0":e+""},m=function(e){return(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},h={before:function(e,t,n){var o=e[t]
e[t]=function(){return n.apply(e,arguments),o.apply(e,arguments)}},after:function(e,t,n){var o=e[t]
e[t]=function(){var t=o.apply(e,arguments)
return n.apply(e,arguments),t}}},g=function(e,t,n){var o,r=e.trigger,a={}
for(o in e.trigger=function(){var n=arguments[0]
if(-1===t.indexOf(n))return r.apply(e,arguments)
a[n]=arguments},n.apply(e,[]),e.trigger=r,a)a.hasOwnProperty(o)&&r.apply(e,a[o])},v=function(e){var t={}
if("selectionStart"in e)t.start=e.selectionStart,t.length=e.selectionEnd-t.start
else if(document.selection){e.focus()
var n=document.selection.createRange(),o=document.selection.createRange().text.length
n.moveStart("character",-e.value.length),t.start=n.text.length-o,t.length=o}return t},b=function e(o,r){var a,i,s,l;(l=o[0]).selectize=this
var c,u,p,d=window.getComputedStyle&&window.getComputedStyle(l,null)
if(s=(s=d?d.getPropertyValue("direction"):l.currentStyle&&l.currentStyle.direction)||o.parents("[dir]:first").attr("dir")||"",t.extend(this,{order:0,settings:r,$input:o,tabIndex:o.attr("tabindex")||"",tagType:"select"===l.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(s),eventNS:".selectize"+ ++e.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:o.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===r.loadThrottle?this.onSearchChange:(c=this.onSearchChange,u=r.loadThrottle,function(){var e=this,t=arguments
window.clearTimeout(p),p=window.setTimeout(function(){c.apply(e,t)},u)})}),this.sifter=new n(this.options,{diacritics:r.diacritics}),this.settings.options){for(a=0,i=this.settings.options.length;a<i;a++)this.registerOption(this.settings.options[a])
delete this.settings.options}if(this.settings.optgroups){for(a=0,i=this.settings.optgroups.length;a<i;a++)this.registerOptionGroup(this.settings.optgroups[a])
delete this.settings.optgroups}this.settings.mode=this.settings.mode||(1===this.settings.maxItems?"single":"multi"),"boolean"!=typeof this.settings.hideSelected&&(this.settings.hideSelected="multi"===this.settings.mode),this.initializePlugins(this.settings.plugins),this.setupCallbacks(),this.setupTemplates(),this.setup()}
return a.mixin(b),void 0!==o?o.mixin(b):(i="Dependency MicroPlugin is missing",(s={explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'})||(s={}),console.error("Selectize: "+i),s.explanation&&(console.group&&console.group(),console.error(s.explanation),console.group&&console.groupEnd())),t.extend(b.prototype,{setup:function(){var e,n,o,r,a,i,s,d,f,m,h,g,y,_,w=this,E=w.settings,O=w.eventNS,x=t(window),k=t(document),S=w.$input
if(s=w.settings.mode,d=S.attr("class")||"",e=t("<div>").addClass(E.wrapperClass).addClass(d).addClass(s),n=t("<div>").addClass(E.inputClass).addClass("items").appendTo(e),o=t('<input type="text" autocomplete="off" />').appendTo(n).attr("tabindex",S.is(":disabled")?"-1":w.tabIndex),i=t(E.dropdownParent||e),r=t("<div>").addClass(E.dropdownClass).addClass(s).hide().appendTo(i),a=t("<div>").addClass(E.dropdownContentClass).appendTo(r),(m=S.attr("id"))&&(o.attr("id",m+"-selectized"),t("label[for='"+m+"']").attr("for",m+"-selectized")),w.settings.copyClassesToDropdown&&r.addClass(d),e.css({width:S[0].style.width}),w.plugins.names.length&&(f="plugin-"+w.plugins.names.join(" plugin-"),e.addClass(f),r.addClass(f)),(null===E.maxItems||E.maxItems>1)&&1===w.tagType&&S.attr("multiple","multiple"),w.settings.placeholder&&o.attr("placeholder",E.placeholder),!w.settings.splitOn&&w.settings.delimiter){var P=w.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")
w.settings.splitOn=new RegExp("\\s*"+P+"+\\s*")}S.attr("autocorrect")&&o.attr("autocorrect",S.attr("autocorrect")),S.attr("autocapitalize")&&o.attr("autocapitalize",S.attr("autocapitalize")),o[0].type=S[0].type,w.$wrapper=e,w.$control=n,w.$control_input=o,w.$dropdown=r,w.$dropdown_content=a,r.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",function(e){e.stopImmediatePropagation()}),r.on("mouseenter","[data-selectable]",function(){return w.onOptionHover.apply(w,arguments)}),r.on("mousedown click","[data-selectable]",function(){return w.onOptionSelect.apply(w,arguments)}),g="mousedown",y="*:not(input)",_=function(){return w.onItemSelect.apply(w,arguments)},(h=n).on(g,y,function(e){for(var t=e.target;t&&t.parentNode!==h[0];)t=t.parentNode
return e.currentTarget=t,_.apply(this,[e])}),function(e){var n=null,o=function(o,r){var a,i,s,l,c,u,p,d,f,m
o=o||window.event||{},r=r||{},o.metaKey||o.altKey||(r.force||!1!==e.data("grow"))&&(a=e.val(),o.type&&"keydown"===o.type.toLowerCase()&&(i=o.keyCode,s=i>=48&&i<=57||i>=65&&i<=90||i>=96&&i<=111||i>=186&&i<=222||32===i,46===i||8===i?(d=v(e[0])).length?a=a.substring(0,d.start)+a.substring(d.start+d.length):8===i&&d.start?a=a.substring(0,d.start-1)+a.substring(d.start+1):46===i&&void 0!==d.start&&(a=a.substring(0,d.start)+a.substring(d.start+1)):s&&(u=o.shiftKey,p=String.fromCharCode(o.keyCode),p=u?p.toUpperCase():p.toLowerCase(),a+=p)),l=e.attr("placeholder"),!a&&l&&(a=l),m=e,(c=((f=a)?(b.$testInput||(b.$testInput=t("<span />").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")),b.$testInput.text(f),function(e,t,n){var o,r,a={}
if(n)for(o=0,r=n.length;o<r;o++)a[n[o]]=e.css(n[o])
else a=e.css()
t.css(a)}(m,b.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),b.$testInput.width()):0)+4)!==n&&(n=c,e.width(c),e.triggerHandler("resize")))}
e.on("keydown keyup update blur",o),o()}(o),n.on({mousedown:function(){return w.onMouseDown.apply(w,arguments)},click:function(){return w.onClick.apply(w,arguments)}}),o.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return w.onKeyDown.apply(w,arguments)},keyup:function(){return w.onKeyUp.apply(w,arguments)},keypress:function(){return w.onKeyPress.apply(w,arguments)},resize:function(){w.positionDropdown.apply(w,[])},blur:function(){return w.onBlur.apply(w,arguments)},focus:function(){return w.ignoreBlur=!1,w.onFocus.apply(w,arguments)},paste:function(){return w.onPaste.apply(w,arguments)}}),k.on("keydown"+O,function(e){w.isCmdDown=e[l?"metaKey":"ctrlKey"],w.isCtrlDown=e[l?"altKey":"ctrlKey"],w.isShiftDown=e.shiftKey}),k.on("keyup"+O,function(e){e.keyCode===u&&(w.isCtrlDown=!1),16===e.keyCode&&(w.isShiftDown=!1),e.keyCode===c&&(w.isCmdDown=!1)}),k.on("mousedown"+O,function(e){if(w.isFocused){if(e.target===w.$dropdown[0]||e.target.parentNode===w.$dropdown[0])return!1
w.$control.has(e.target).length||e.target===w.$control[0]||w.blur(e.target)}}),x.on(["scroll"+O,"resize"+O].join(" "),function(){w.isOpen&&w.positionDropdown.apply(w,arguments)}),x.on("mousemove"+O,function(){w.ignoreHover=!1}),this.revertSettings={$children:S.children().detach(),tabindex:S.attr("tabindex")},S.attr("tabindex",-1).hide().after(w.$wrapper),t.isArray(E.items)&&(w.setValue(E.items),delete E.items),p&&S.on("invalid"+O,function(e){e.preventDefault(),w.isInvalid=!0,w.refreshState()}),w.updateOriginalInput(),w.refreshItems(),w.refreshState(),w.updatePlaceholder(),w.isSetup=!0,S.is(":disabled")&&w.disable(),w.on("change",this.onChange),S.data("selectize",w),S.addClass("selectized"),w.trigger("initialize"),!0===E.preload&&w.onSearchChange("")},setupTemplates:function(){var e=this.settings.labelField,n=this.settings.optgroupLabelField,o={optgroup:function(e){return'<div class="optgroup">'+e.html+"</div>"},optgroup_header:function(e,t){return'<div class="optgroup-header">'+t(e[n])+"</div>"},option:function(t,n){return'<div class="option">'+n(t[e])+"</div>"},item:function(t,n){return'<div class="item">'+n(t[e])+"</div>"},option_create:function(e,t){return'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>"}}
this.settings.render=t.extend({},o,this.settings.render)},setupCallbacks:function(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"}
for(e in n)n.hasOwnProperty(e)&&(t=this.settings[n[e]])&&this.on(e,t)},onClick:function(e){this.isFocused&&this.isOpen||(this.focus(),e.preventDefault())},onMouseDown:function(e){var n=this,o=e.isDefaultPrevented()
if(t(e.target),n.isFocused){if(e.target!==n.$control_input[0])return"single"===n.settings.mode?n.isOpen?n.close():n.open():o||n.setActiveItem(null),!1}else o||window.setTimeout(function(){n.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(e){var n=this
n.isFull()||n.isInputHidden||n.isLocked?e.preventDefault():n.settings.splitOn&&setTimeout(function(){var e=n.$control_input.val()
if(e.match(n.settings.splitOn))for(var o=t.trim(e).split(n.settings.splitOn),r=0,a=o.length;r<a;r++)n.createItem(o[r])},0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault()
var t=String.fromCharCode(e.keyCode||e.which)
return this.settings.create&&"multi"===this.settings.mode&&t===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){if(e.target,this.$control_input[0],this.isLocked)9!==e.keyCode&&e.preventDefault()
else{switch(e.keyCode){case 65:if(this.isCmdDown)return void this.selectAll()
break
case 27:return void(this.isOpen&&(e.preventDefault(),e.stopPropagation(),this.close()))
case 78:if(!e.ctrlKey||e.altKey)break
case 40:if(!this.isOpen&&this.hasOptions)this.open()
else if(this.$activeOption){this.ignoreHover=!0
var t=this.getAdjacentOption(this.$activeOption,1)
t.length&&this.setActiveOption(t,!0,!0)}return void e.preventDefault()
case 80:if(!e.ctrlKey||e.altKey)break
case 38:if(this.$activeOption){this.ignoreHover=!0
var n=this.getAdjacentOption(this.$activeOption,-1)
n.length&&this.setActiveOption(n,!0,!0)}return void e.preventDefault()
case 13:return void(this.isOpen&&this.$activeOption&&(this.onOptionSelect({currentTarget:this.$activeOption}),e.preventDefault()))
case 37:return void this.advanceSelection(-1,e)
case 39:return void this.advanceSelection(1,e)
case 9:return this.settings.selectOnTab&&this.isOpen&&this.$activeOption&&(this.onOptionSelect({currentTarget:this.$activeOption}),this.isFull()||e.preventDefault()),void(this.settings.create&&this.createItem()&&e.preventDefault())
case 8:case 46:return void this.deleteSelection(e)}!this.isFull()&&!this.isInputHidden||(l?e.metaKey:e.ctrlKey)||e.preventDefault()}},onKeyUp:function(e){if(this.isLocked)return e&&e.preventDefault()
var t=this.$control_input.val()||""
this.lastValue!==t&&(this.lastValue=t,this.onSearchChange(t),this.refreshOptions(),this.trigger("type",t))},onSearchChange:function(e){var t=this,n=t.settings.load
n&&(t.loadedSearches.hasOwnProperty(e)||(t.loadedSearches[e]=!0,t.load(function(o){n.apply(t,[e,o])})))},onFocus:function(e){var t=this.isFocused
if(this.isDisabled)return this.blur(),e&&e.preventDefault(),!1
this.ignoreFocus||(this.isFocused=!0,"focus"===this.settings.preload&&this.onSearchChange(""),t||this.trigger("focus"),this.$activeItems.length||(this.showInput(),this.setActiveItem(null),this.refreshOptions(!!this.settings.openOnFocus)),this.refreshState())},onBlur:function(e,t){var n=this
if(n.isFocused&&(n.isFocused=!1,!n.ignoreFocus)){if(!n.ignoreBlur&&document.activeElement===n.$dropdown_content[0])return n.ignoreBlur=!0,void n.onFocus(e)
var o=function(){n.close(),n.setTextboxValue(""),n.setActiveItem(null),n.setActiveOption(null),n.setCaret(n.items.length),n.refreshState(),t&&t.focus&&t.focus(),n.isBlurring=!1,n.ignoreFocus=!1,n.trigger("blur")}
n.isBlurring=!0,n.ignoreFocus=!0,n.settings.create&&n.settings.createOnBlur?n.createItem(null,!1,o):o()}},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(e){var n,o,r=this
e.preventDefault&&(e.preventDefault(),e.stopPropagation()),(o=t(e.currentTarget)).hasClass("create")?r.createItem(null,function(){r.settings.closeAfterSelect&&r.close()}):void 0!==(n=o.attr("data-value"))&&(r.lastQuery=null,r.setTextboxValue(""),r.addItem(n),r.settings.closeAfterSelect?r.close():!r.settings.hideSelected&&e.type&&/mouse/.test(e.type)&&r.setActiveOption(r.getOption(n)))},onItemSelect:function(e){this.isLocked||"multi"===this.settings.mode&&(e.preventDefault(),this.setActiveItem(e.currentTarget,e))},load:function(e){var t=this,n=t.$wrapper.addClass(t.settings.loadingClass)
t.loading++,e.apply(t,[function(e){t.loading=Math.max(t.loading-1,0),e&&e.length&&(t.addOption(e),t.refreshOptions(t.isFocused&&!t.isInputHidden)),t.loading||n.removeClass(t.settings.loadingClass),t.trigger("load",e)}])},setTextboxValue:function(e){var t=this.$control_input
t.val()!==e&&(t.val(e).triggerHandler("update"),this.lastValue=e)},getValue:function(){return 1===this.tagType&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(e,t){g(this,t?[]:["change"],function(){this.clear(t),this.addItems(e,t)})},setActiveItem:function(e,n){var o,r,a,i,s,l,c,u
if("single"!==this.settings.mode){if(!(e=t(e)).length)return t(this.$activeItems).removeClass("active"),this.$activeItems=[],void(this.isFocused&&this.showInput())
if("mousedown"===(o=n&&n.type.toLowerCase())&&this.isShiftDown&&this.$activeItems.length){for(u=this.$control.children(".active:last"),(i=Array.prototype.indexOf.apply(this.$control[0].childNodes,[u[0]]))>(s=Array.prototype.indexOf.apply(this.$control[0].childNodes,[e[0]]))&&(c=i,i=s,s=c),r=i;r<=s;r++)l=this.$control[0].childNodes[r],-1===this.$activeItems.indexOf(l)&&(t(l).addClass("active"),this.$activeItems.push(l))
n.preventDefault()}else"mousedown"===o&&this.isCtrlDown||"keydown"===o&&this.isShiftDown?e.hasClass("active")?(a=this.$activeItems.indexOf(e[0]),this.$activeItems.splice(a,1),e.removeClass("active")):this.$activeItems.push(e.addClass("active")[0]):(t(this.$activeItems).removeClass("active"),this.$activeItems=[e.addClass("active")[0]])
this.hideInput(),this.isFocused||this.focus()}},setActiveOption:function(e,n,o){var r,a,i,s,l
this.$activeOption&&this.$activeOption.removeClass("active"),this.$activeOption=null,(e=t(e)).length&&(this.$activeOption=e.addClass("active"),!n&&d(n)||(r=this.$dropdown_content.height(),a=this.$activeOption.outerHeight(!0),n=this.$dropdown_content.scrollTop()||0,s=i=this.$activeOption.offset().top-this.$dropdown_content.offset().top+n,l=i-r+a,i+a>r+n?this.$dropdown_content.stop().animate({scrollTop:l},o?this.settings.scrollDuration:0):i<n&&this.$dropdown_content.stop().animate({scrollTop:s},o?this.settings.scrollDuration:0)))},selectAll:function(){"single"!==this.settings.mode&&(this.$activeItems=Array.prototype.slice.apply(this.$control.children(":not(input)").addClass("active")),this.$activeItems.length&&(this.hideInput(),this.close()),this.focus())},hideInput:function(){this.setTextboxValue(""),this.$control_input.css({opacity:0,position:"absolute",left:this.rtl?1e4:-1e4}),this.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var e=this
e.isDisabled||(e.ignoreFocus=!0,e.$control_input[0].focus(),window.setTimeout(function(){e.ignoreFocus=!1,e.onFocus()},0))},blur:function(e){this.$control_input[0].blur(),this.onBlur(null,e)},getScoreFunction:function(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())},getSearchOptions:function(){var e=this.settings,t=e.sortField
return"string"==typeof t&&(t=[{field:t}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}},search:function(e){var n,o,r,a=this.settings,i=this.getSearchOptions()
if(a.score&&"function"!=typeof(r=this.settings.score.apply(this,[e])))throw new Error('Selectize "score" setting must be a function that returns a function')
if(e!==this.lastQuery?(this.lastQuery=e,o=this.sifter.search(e,t.extend(i,{score:r})),this.currentResults=o):o=t.extend(!0,{},this.currentResults),a.hideSelected)for(n=o.items.length-1;n>=0;n--)-1!==this.items.indexOf(f(o.items[n].id))&&o.items.splice(n,1)
return o},refreshOptions:function(e){var n,o,a,i,s,l,c,u,p,d,m,h,g,v,b,y
void 0===e&&(e=!0)
var _,w,E=this,O=t.trim(E.$control_input.val()),x=E.search(O),k=E.$dropdown_content,S=E.$activeOption&&f(E.$activeOption.attr("data-value"))
for(i=x.items.length,"number"==typeof E.settings.maxOptions&&(i=Math.min(i,E.settings.maxOptions)),s={},l=[],n=0;n<i;n++)for(c=E.options[x.items[n].id],u=E.render("option",c),p=c[E.settings.optgroupField]||"",o=0,a=(d=t.isArray(p)?p:[p])&&d.length;o<a;o++)p=d[o],E.optgroups.hasOwnProperty(p)||(p=""),s.hasOwnProperty(p)||(s[p]=document.createDocumentFragment(),l.push(p)),s[p].appendChild(u)
for(this.settings.lockOptgroupOrder&&l.sort(function(e,t){return(E.optgroups[e].$order||0)-(E.optgroups[t].$order||0)}),m=document.createDocumentFragment(),n=0,i=l.length;n<i;n++)p=l[n],E.optgroups.hasOwnProperty(p)&&s[p].childNodes.length?((h=document.createDocumentFragment()).appendChild(E.render("optgroup_header",E.optgroups[p])),h.appendChild(s[p]),m.appendChild(E.render("optgroup",t.extend({},E.optgroups[p],{html:(_=h,w=void 0,w=document.createElement("div"),w.appendChild(_.cloneNode(!0)),w.innerHTML),dom:h})))):m.appendChild(s[p])
if(k.html(m),E.settings.highlight&&(k.removeHighlight(),x.query.length&&x.tokens.length))for(n=0,i=x.tokens.length;n<i;n++)r(k,x.tokens[n].regex)
if(!E.settings.hideSelected)for(n=0,i=E.items.length;n<i;n++)E.getOption(E.items[n]).addClass("selected");(g=E.canCreate(O))&&(k.prepend(E.render("option_create",{input:O})),y=t(k[0].childNodes[0])),E.hasOptions=x.items.length>0||g,E.hasOptions?(x.items.length>0?((b=S&&E.getOption(S))&&b.length?v=b:"single"===E.settings.mode&&E.items.length&&(v=E.getOption(E.items[0])),v&&v.length||(v=y&&!E.settings.addPrecedence?E.getAdjacentOption(y,1):k.find("[data-selectable]:first"))):v=y,E.setActiveOption(v),e&&!E.isOpen&&E.open()):(E.setActiveOption(null),e&&E.isOpen&&E.close())},addOption:function(e){var n,o,r
if(t.isArray(e))for(n=0,o=e.length;n<o;n++)this.addOption(e[n])
else(r=this.registerOption(e))&&(this.userOptions[r]=!0,this.lastQuery=null,this.trigger("option_add",r,e))},registerOption:function(e){var t=f(e[this.settings.valueField])
return null!=t&&!this.options.hasOwnProperty(t)&&(e.$order=e.$order||++this.order,this.options[t]=e,t)},registerOptionGroup:function(e){var t=f(e[this.settings.optgroupValueField])
return!!t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)},addOptionGroup:function(e,t){t[this.settings.optgroupValueField]=e,(e=this.registerOptionGroup(t))&&this.trigger("optgroup_add",e,t)},removeOptionGroup:function(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.renderCache={},this.trigger("optgroup_remove",e))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(e,n){var o,r,a,i,s,l,c
if(e=f(e),a=f(n[this.settings.valueField]),null!==e&&this.options.hasOwnProperty(e)){if("string"!=typeof a)throw new Error("Value must be set in option data")
c=this.options[e].$order,a!==e&&(delete this.options[e],-1!==(i=this.items.indexOf(e))&&this.items.splice(i,1,a)),n.$order=n.$order||c,this.options[a]=n,s=this.renderCache.item,l=this.renderCache.option,s&&(delete s[e],delete s[a]),l&&(delete l[e],delete l[a]),-1!==this.items.indexOf(a)&&(o=this.getItem(e),r=t(this.render("item",n)),o.hasClass("active")&&r.addClass("active"),o.replaceWith(r)),this.lastQuery=null,this.isOpen&&this.refreshOptions(!1)}},removeOption:function(e,t){e=f(e)
var n=this.renderCache.item,o=this.renderCache.option
n&&delete n[e],o&&delete o[e],delete this.userOptions[e],delete this.options[e],this.lastQuery=null,this.trigger("option_remove",e),this.removeItem(e,t)},clearOptions:function(){var e=this
e.loadedSearches={},e.userOptions={},e.renderCache={}
var n=e.options
t.each(e.options,function(t,o){-1==e.items.indexOf(t)&&delete n[t]}),e.options=e.sifter.items=n,e.lastQuery=null,e.trigger("option_clear")},getOption:function(e){return this.getElementWithValue(e,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(e,n){var o=this.$dropdown.find("[data-selectable]"),r=o.index(e)+n
return r>=0&&r<o.length?o.eq(r):t()},getElementWithValue:function(e,n){if(null!=(e=f(e)))for(var o=0,r=n.length;o<r;o++)if(n[o].getAttribute("data-value")===e)return t(n[o])
return t()},getItem:function(e){return this.getElementWithValue(e,this.$control.children())},addItems:function(e,n){this.buffer=document.createDocumentFragment()
for(var o=this.$control[0].childNodes,r=0;r<o.length;r++)this.buffer.appendChild(o[r])
for(var a=t.isArray(e)?e:[e],i=(r=0,a.length);r<i;r++)this.isPending=r<i-1,this.addItem(a[r],n)
var s=this.$control[0]
s.insertBefore(this.buffer,s.firstChild),this.buffer=null},addItem:function(e,n){g(this,n?[]:["change"],function(){var o,r,a,i,s,l=this.settings.mode
e=f(e),-1===this.items.indexOf(e)?this.options.hasOwnProperty(e)&&("single"===l&&this.clear(n),"multi"===l&&this.isFull()||(o=t(this.render("item",this.options[e])),s=this.isFull(),this.items.splice(this.caretPos,0,e),this.insertAtCaret(o),(!this.isPending||!s&&this.isFull())&&this.refreshState(),this.isSetup&&(a=this.$dropdown_content.find("[data-selectable]"),this.isPending||(r=this.getOption(e),i=this.getAdjacentOption(r,1).attr("data-value"),this.refreshOptions(this.isFocused&&"single"!==l),i&&this.setActiveOption(this.getOption(i))),!a.length||this.isFull()?this.close():this.isPending||this.positionDropdown(),this.updatePlaceholder(),this.trigger("item_add",e,o),this.isPending||this.updateOriginalInput({silent:n})))):"single"===l&&this.close()})},removeItem:function(e,n){var o,r,a
o=e instanceof t?e:this.getItem(e),e=f(o.attr("data-value")),-1!==(r=this.items.indexOf(e))&&(o.remove(),o.hasClass("active")&&(a=this.$activeItems.indexOf(o[0]),this.$activeItems.splice(a,1)),this.items.splice(r,1),this.lastQuery=null,!this.settings.persist&&this.userOptions.hasOwnProperty(e)&&this.removeOption(e,n),r<this.caretPos&&this.setCaret(this.caretPos-1),this.refreshState(),this.updatePlaceholder(),this.updateOriginalInput({silent:n}),this.positionDropdown(),this.trigger("item_remove",e,o))},createItem:function(n,o){var r=this,a=r.caretPos
n=n||t.trim(r.$control_input.val()||"")
var i=arguments[arguments.length-1]
if("function"!=typeof i&&(i=function(){}),"boolean"!=typeof o&&(o=!0),!r.canCreate(n))return i(),!1
r.lock()
var s,l,c="function"==typeof r.settings.create?this.settings.create:function(e){var t={}
return t[r.settings.labelField]=e,t[r.settings.valueField]=e,t},u=(s=function(t){if(r.unlock(),!t||"object"!==e(t))return i()
var n=f(t[r.settings.valueField])
if("string"!=typeof n)return i()
r.setTextboxValue(""),r.addOption(t),r.setCaret(a),r.addItem(n),r.refreshOptions(o&&"single"!==r.settings.mode),i(t)},l=!1,function(){l||(l=!0,s.apply(this,arguments))}),p=c.apply(this,[n,u])
return void 0!==p&&u(p),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1
var e=!this.items.length
this.isInvalid=e,this.$control_input.prop("required",e),this.$input.prop("required",!e)},refreshClasses:function(){var e=this.isFull(),n=this.isLocked
this.$wrapper.toggleClass("rtl",this.rtl),this.$control.toggleClass("focus",this.isFocused).toggleClass("disabled",this.isDisabled).toggleClass("required",this.isRequired).toggleClass("invalid",this.isInvalid).toggleClass("locked",n).toggleClass("full",e).toggleClass("not-full",!e).toggleClass("input-active",this.isFocused&&!this.isInputHidden).toggleClass("dropdown-active",this.isOpen).toggleClass("has-options",!t.isEmptyObject(this.options)).toggleClass("has-items",this.items.length>0),this.$control_input.data("grow",!e&&!n)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,n,o,r
if(e=e||{},1===this.tagType){for(o=[],t=0,n=this.items.length;t<n;t++)r=this.options[this.items[t]][this.settings.labelField]||"",o.push('<option value="'+m(this.items[t])+'" selected="selected">'+m(r)+"</option>")
o.length||this.$input.attr("multiple")||o.push('<option value="" selected="selected"></option>'),this.$input.html(o.join(""))}else this.$input.val(this.getValue()),this.$input.attr("value",this.$input.val())
this.isSetup&&(e.silent||this.trigger("change",this.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var e=this.$control_input
this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0})}},open:function(){this.isLocked||this.isOpen||"multi"===this.settings.mode&&this.isFull()||(this.focus(),this.isOpen=!0,this.refreshState(),this.$dropdown.css({visibility:"hidden",display:"block"}),this.positionDropdown(),this.$dropdown.css({visibility:"visible"}),this.trigger("dropdown_open",this.$dropdown))},close:function(){var e=this.isOpen
"single"===this.settings.mode&&this.items.length&&(this.hideInput(),this.isBlurring||this.$control_input.blur()),this.isOpen=!1,this.$dropdown.hide(),this.setActiveOption(null),this.refreshState(),e&&this.trigger("dropdown_close",this.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position()
t.top+=e.outerHeight(!0),this.$dropdown.css({width:e[0].getBoundingClientRect().width,top:t.top,left:t.left})},clear:function(e){this.items.length&&(this.$control.children(":not(input)").remove(),this.items=[],this.lastQuery=null,this.setCaret(0),this.setActiveItem(null),this.updatePlaceholder(),this.updateOriginalInput({silent:e}),this.refreshState(),this.showInput(),this.trigger("clear"))},insertAtCaret:function(e){var t=Math.min(this.caretPos,this.items.length),n=e[0],o=this.buffer||this.$control[0]
0===t?o.insertBefore(n,o.firstChild):o.insertBefore(n,o.childNodes[t]),this.setCaret(t+1)},deleteSelection:function(e){var n,o,r,a,i,s,l,c,u
if(r=e&&8===e.keyCode?-1:1,a=v(this.$control_input[0]),this.$activeOption&&!this.settings.hideSelected&&(l=this.getAdjacentOption(this.$activeOption,-1).attr("data-value")),i=[],this.$activeItems.length){for(u=this.$control.children(".active:"+(r>0?"last":"first")),s=this.$control.children(":not(input)").index(u),r>0&&s++,n=0,o=this.$activeItems.length;n<o;n++)i.push(t(this.$activeItems[n]).attr("data-value"))
e&&(e.preventDefault(),e.stopPropagation())}else(this.isFocused||"single"===this.settings.mode)&&this.items.length&&(r<0&&0===a.start&&0===a.length?i.push(this.items[this.caretPos-1]):r>0&&a.start===this.$control_input.val().length&&i.push(this.items[this.caretPos]))
if(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete.apply(this,[i]))return!1
for(void 0!==s&&this.setCaret(s);i.length;)this.removeItem(i.pop())
return this.showInput(),this.positionDropdown(),this.refreshOptions(!0),l&&(c=this.getOption(l)).length&&this.setActiveOption(c),!0},advanceSelection:function(e,t){var n,o,r,a,i
0!==e&&(this.rtl&&(e*=-1),n=e>0?"last":"first",o=v(this.$control_input[0]),this.isFocused&&!this.isInputHidden?(a=this.$control_input.val().length,(e<0?0===o.start&&0===o.length:o.start===a)&&!a&&this.advanceCaret(e,t)):(i=this.$control.children(".active:"+n)).length&&(r=this.$control.children(":not(input)").index(i),this.setActiveItem(null),this.setCaret(e>0?r+1:r)))},advanceCaret:function(e,t){var n,o
0!==e&&(n=e>0?"next":"prev",this.isShiftDown?(o=this.$control_input[n]()).length&&(this.hideInput(),this.setActiveItem(o),t&&t.preventDefault()):this.setCaret(this.caretPos+e))},setCaret:function(e){var n,o,r,a
if(e="single"===this.settings.mode?this.items.length:Math.max(0,Math.min(this.items.length,e)),!this.isPending)for(n=0,o=(r=this.$control.children(":not(input)")).length;n<o;n++)a=t(r[n]).detach(),n<e?this.$control_input.before(a):this.$control.append(a)
this.caretPos=e},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){this.$input.prop("disabled",!0),this.$control_input.prop("disabled",!0).prop("tabindex",-1),this.isDisabled=!0,this.lock()},enable:function(){this.$input.prop("disabled",!1),this.$control_input.prop("disabled",!1).prop("tabindex",this.tabIndex),this.isDisabled=!1,this.unlock()},destroy:function(){var e=this.eventNS,n=this.revertSettings
this.trigger("destroy"),this.off(),this.$wrapper.remove(),this.$dropdown.remove(),this.$input.html("").append(n.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:n.tabindex}).show(),this.$control_input.removeData("grow"),this.$input.removeData("selectize"),0==--b.count&&b.$testInput&&(b.$testInput.remove(),b.$testInput=void 0),t(window).off(e),t(document).off(e),t(document.body).off(e),delete this.$input[0].selectize},render:function(e,n){var o,r,a="",i=!1
return"option"!==e&&"item"!==e||(i=!!(o=f(n[this.settings.valueField]))),i&&(d(this.renderCache[e])||(this.renderCache[e]={}),this.renderCache[e].hasOwnProperty(o))?this.renderCache[e][o]:(a=t(this.settings.render[e].apply(this,[n,m])),"option"===e||"option_create"===e?n[this.settings.disabledField]||a.attr("data-selectable",""):"optgroup"===e&&(r=n[this.settings.optgroupValueField]||"",a.attr("data-group",r),n[this.settings.disabledField]&&a.attr("data-disabled","")),"option"!==e&&"item"!==e||a.attr("data-value",o||""),i&&(this.renderCache[e][o]=a[0]),a[0])},clearCache:function(e){void 0===e?this.renderCache={}:delete this.renderCache[e]},canCreate:function(e){if(!this.settings.create)return!1
var t=this.settings.createFilter
return e.length&&("function"!=typeof t||t.apply(this,[e]))&&("string"!=typeof t||new RegExp(t).test(e))&&(!(t instanceof RegExp)||t.test(e))}}),b.count=0,b.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},t.fn.selectize=function(e){var n=t.fn.selectize.defaults,o=t.extend({},n,e),r=o.dataAttr,a=o.labelField,i=o.valueField,s=o.disabledField,l=o.optgroupField,c=o.optgroupLabelField,u=o.optgroupValueField
return this.each(function(){if(!this.selectize){var p=t(this),d=this.tagName.toLowerCase(),m=p.attr("placeholder")||p.attr("data-placeholder")
m||o.allowEmptyOption||(m=p.children('option[value=""]').text())
var h={placeholder:m,options:[],optgroups:[],items:[]}
"select"===d?function(e,n){var p,d,m,h,g=n.options,v={},b=function(e){var t=r&&e.attr(r)
return"string"==typeof t&&t.length?JSON.parse(t):null},y=function(e,r){e=t(e)
var c=f(e.val())
if(c||o.allowEmptyOption)if(v.hasOwnProperty(c)){if(r){var u=v[c][l]
u?t.isArray(u)?u.push(r):v[c][l]=[u,r]:v[c][l]=r}}else{var p=b(e)||{}
p[a]=p[a]||e.text(),p[i]=p[i]||c,p[s]=p[s]||e.prop("disabled"),p[l]=p[l]||r,v[c]=p,g.push(p),e.is(":selected")&&n.items.push(c)}},_=function(e){var o,r,a,i,l
for((a=(e=t(e)).attr("label"))&&((i=b(e)||{})[c]=a,i[u]=a,i[s]=e.prop("disabled"),n.optgroups.push(i)),o=0,r=(l=t("option",e)).length;o<r;o++)y(l[o],a)}
for(n.maxItems=e.attr("multiple")?null:1,p=0,d=(h=e.children()).length;p<d;p++)"optgroup"===(m=h[p].tagName.toLowerCase())?_(h[p]):"option"===m&&y(h[p])}(p,h):function(e,n){var s,l,c,u,p=e.attr(r)
if(p)for(n.options=JSON.parse(p),s=0,l=n.options.length;s<l;s++)n.items.push(n.options[s][i])
else{var d=t.trim(e.val()||"")
if(!o.allowEmptyOption&&!d.length)return
for(s=0,l=(c=d.split(o.delimiter)).length;s<l;s++)(u={})[a]=c[s],u[i]=c[s],n.options.push(u)
n.items=c}}(p,h),new b(p,t.extend(!0,{},n,h,e))}})},t.fn.selectize.defaults=b.defaults,t.fn.selectize.support={validity:p},b.define("drag_drop",function(e){if(!t.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".')
if("multi"===this.settings.mode){var n,o=this
o.lock=(n=o.lock,function(){var e=o.$control.data("sortable")
return e&&e.disable(),n.apply(o,arguments)}),o.unlock=function(){var e=o.unlock
return function(){var t=o.$control.data("sortable")
return t&&t.enable(),e.apply(o,arguments)}}(),o.setup=function(){var e=o.setup
return function(){e.apply(this,arguments)
var n=o.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:o.isLocked,start:function(e,t){t.placeholder.css("width",t.helper.css("width")),n.css({overflow:"visible"})},stop:function(){n.css({overflow:"hidden"})
var e=o.$activeItems?o.$activeItems.slice():null,r=[]
n.children("[data-value]").each(function(){r.push(t(this).attr("data-value"))}),o.setValue(r),o.setActiveItem(e)}})}}()}}),b.define("dropdown_header",function(e){var n,o=this
e=t.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(e){return'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a href="javascript:void(0)" class="'+e.closeClass+'">&times;</a></div></div>'}},e),o.setup=(n=o.setup,function(){n.apply(o,arguments),o.$dropdown_header=t(e.html(e)),o.$dropdown.prepend(o.$dropdown_header)})}),b.define("optgroup_columns",function(e){var n,o=this
e=t.extend({equalizeWidth:!0,equalizeHeight:!0},e),this.getAdjacentOption=function(e,n){var o=e.closest("[data-group]").find("[data-selectable]"),r=o.index(e)+n
return r>=0&&r<o.length?o.eq(r):t()},this.onKeyDown=(n=o.onKeyDown,function(e){var t,r,a,i
return!this.isOpen||37!==e.keyCode&&39!==e.keyCode?n.apply(this,arguments):(o.ignoreHover=!0,t=(i=this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption),void((r=(a=(i=37===e.keyCode?i.prev("[data-group]"):i.next("[data-group]")).find("[data-selectable]")).eq(Math.min(a.length-1,t))).length&&this.setActiveOption(r)))})
var r=function(){var n,r,a,i,s,l,c
if((r=(c=t("[data-group]",o.$dropdown_content)).length)&&o.$dropdown_content.width()){if(e.equalizeHeight){for(a=0,n=0;n<r;n++)a=Math.max(a,c.eq(n).height())
c.css({height:a})}e.equalizeWidth&&(l=o.$dropdown_content.innerWidth()-function e(){var t,n=e.width,o=document
return void 0===n&&((t=o.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',t=t.firstChild,o.body.appendChild(t),n=e.width=t.offsetWidth-t.clientWidth,o.body.removeChild(t)),n}(),i=Math.round(l/r),c.css({width:i}),r>1&&(s=l-i*(r-1),c.eq(r-1).css({width:s})))}};(e.equalizeHeight||e.equalizeWidth)&&(h.after(this,"positionDropdown",r),h.after(this,"refreshOptions",r))}),b.define("remove_button",function(e){e=t.extend({label:"&times;",title:"Remove",className:"remove",append:!0},e),"single"!==this.settings.mode?function(e,n){var o,r=e,a='<a href="javascript:void(0)" class="'+n.className+'" tabindex="-1" title="'+m(n.title)+'">'+n.label+"</a>"
e.setup=(o=r.setup,function(){if(n.append){var i=r.settings.render.item
r.settings.render.item=function(t){return n=i.apply(e,arguments),o=a,r=n.search(/(<\/[^>]+>\s*)$/),n.substring(0,r)+o+n.substring(r)
var n,o,r}}o.apply(e,arguments),e.$control.on("click","."+n.className,function(e){if(e.preventDefault(),!r.isLocked){var n=t(e.currentTarget).parent()
r.setActiveItem(n),r.deleteSelection()&&r.setCaret(r.items.length)}})})}(this,e):function(e,n){n.className="remove-single"
var o,r=e,a='<a href="javascript:void(0)" class="'+n.className+'" tabindex="-1" title="'+m(n.title)+'">'+n.label+"</a>"
e.setup=(o=r.setup,function(){if(n.append){var i=t(r.$input.context).attr("id"),s=(t("#"+i),r.settings.render.item)
r.settings.render.item=function(n){return o=s.apply(e,arguments),r=a,t("<span>").append(o).append(r)
var o,r}}o.apply(e,arguments),e.$control.on("click","."+n.className,function(e){e.preventDefault(),r.isLocked||r.clear()})})}(this,e)}),b.define("restore_on_backspace",function(e){var t,n=this
e.text=e.text||function(e){return e[this.settings.labelField]},this.onKeyDown=(t=n.onKeyDown,function(n){var o,r
return 8===n.keyCode&&""===this.$control_input.val()&&!this.$activeItems.length&&(o=this.caretPos-1)>=0&&o<this.items.length?(r=this.options[this.items[o]],this.deleteSelection(n)&&(this.setTextboxValue(e.text.apply(this,[r])),this.refreshOptions(!0)),void n.preventDefault()):t.apply(this,arguments)})}),b}(window.jQuery,window.csSifter,window.csMicroPlugin)}),define("tco-app/components/forms/ember-selectize/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"xBRdFj9i",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/ember-selectize/template.hbs"}})
e.default=t}),define("tco-app/components/forms/expandable-code-editor/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({hasToggle:!0,beforeButtons:Ember.computed("run",function(){return this.get("run")?[{class:"cs-label",label:"Run",action:this.get("run")}]:null}),finalHeaderLabel:Ember.computed("headerLabel",function(){return this.get("headerLabel")}),classNames:["cs-expandable-code-editor"],content:Ember.computed("value","placeholder","height",function(){var e=Ember.Handlebars.Utils.escapeExpression(this.getWithDefault("value",this.getWithDefault("placeholder","")))
return this.getWithDefault("height",1)>1?Ember.String.htmlSafe("<textarea disabled>".concat(e,"</textarea>")):Ember.String.htmlSafe('<input type="text" value="'.concat(e,'" disabled>'))})})
e.default=t}),define("tco-app/components/forms/expandable-code-editor/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"XxkkOBdy",block:'{"symbols":["picker","&default"],"statements":[[4,"workspace/workspace-expander",null,[["expanderClass","label","headerLabel","open","closeOnFocusLoss","beforeButtons","hasToggle","noPreview","content"],["cs-code-editor-wrapper cs-workspace-expander-content-expandable-code-editor",[23,["buttonLabel"]],[23,["finalHeaderLabel"]],[23,["active"]],false,[23,["beforeButtons"]],[23,["hasToggle"]],[23,["noPreview"]],[23,["content"]]]],{"statements":[[0,"  "],[1,[27,"forms/inline-code-editor",null,[["value","placeholder","mode"],[[23,["value"]],[23,["placeholder"]],[23,["mode"]]]]],false],[0,"\\n"]],"parameters":[1]},null],[14,2],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/expandable-code-editor/template.hbs"}})
e.default=t}),define("tco-app/components/forms/image-upload/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({wpMedia:Ember.inject.service(),classNames:["cs-image"],classNameBindings:["pattern","empty","class"],attributeBindings:["style"],pattern:Ember.computed.alias("options.pattern"),empty:Ember.computed("value",function(){return!this.get("value")}),style:Ember.computed("value",function(){var e=this.get("value")
return Ember.String.htmlSafe(e?"background-image: url(".concat(e,");"):"")}),didInsertElement:function(){this.detectDimensions()},dimensionUpdate:Ember.observer("value",function(){this.detectDimensions()}),detectDimensions:function(){var e=this
if(this.get("value")){var t=Ember.$('<img src="'.concat(this.get("value"),'" style="opacity:0;position:absolute;pointer-events:none;">'))
t.on("load",function(){e.onDimensionChange({width:t[0].width,height:t[0].height}),Ember.run.next(function(){t.remove()})}),this.$().append(t)}else this.onDimensionChange({width:"",height:""})},actions:{add:function(){var e=this
this.get("wpMedia").promise().then(function(t){return e.set("value",t)})},remove:function(){this.set("value","")}}})
e.default=t}),define("tco-app/components/forms/image-upload/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"gbHCbZz6",block:'{"symbols":[],"statements":[[7,"span"],[12,"onclick",[27,"action",[[22,0,[]],"add"],null]],[11,"class","add"],[9],[1,[27,"icon",["fa-plus-circle"],null],false],[10],[0,"\\n"],[7,"span"],[12,"onclick",[27,"action",[[22,0,[]],"remove"],null]],[11,"class","remove"],[9],[1,[27,"icon",["fa-times-circle"],null],false],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/image-upload/template.hbs"}})
e.default=t}),define("tco-app/components/forms/inline-code-editor/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t={mode:"css",theme:"solarized dark",indentUnit:2,smartIndent:!0,tabSize:2,indentWithTabs:!1,electricChars:!0,keyMap:"sublime",lineWrapping:!1,lineNumbers:!0,firstLineNumber:1,fixedGutter:!0,scrollbarStyle:"overlay",inputStyle:"contenteditable",showCursorWhenSelecting:!1,lineWiseCopyCut:!1,undoDepth:200,historyEventDelay:1500,autofocus:!1,dragDrop:!0,cursorBlinkRate:750,cursorScrollMargin:0,cursorHeight:1,resetSelectionOnContextMenu:!0,workTime:200,workDelay:300,pollInterval:100,flattenSpans:!0,addModeClass:!0,maxHighlightLength:1e4,viewportMargin:10,showTrailingSpace:!0,styleActiveLine:!0,styleSelectedText:!1,matchBrackets:!0,autoCloseBrackets:!0,autoCloseTags:!0,closeTag:!0,foldGutter:!0},n=Ember.Component.extend({canUseCodeMirror:Ember.computed(function(){return!!window.wp.CodeMirror}),classNames:["cs-inline-code-editor"],classNameBindings:["canUseCodeMirror::cs-code-editor-no-cm"],autoFocus:!0,mode:Ember.computed("mode",function(){return!this.get("mode")}),showPlaceholder:Ember.computed("value",function(){return!this.get("value")}),didInsertElement:function(){var e=this
if(this.get("canUseCodeMirror")){var n=this.get("codeMirrorSettings")
Ember.isNone(n)&&(n={mode:this.get("mode")})
var o=Object.assign({},t,n),r=this.$("textarea.cm-target")
r.val(this.get("value"))
var a=window.wp.CodeMirror.fromTextArea(r[0],o)
this.set("cmInstance",a),a.on("change",function(t){var n=e.get("value"),o=t.doc.getValue()
n!==o&&(e.set("value",o),e.set("updating",!0))}),this.get("autoFocus")&&(a.focus(),a.execCommand("goDocEnd"))}},valueObserver:Ember.observer("value",function(){this.set("updating"),this.set("updating",!1)})})
e.default=n}),define("tco-app/components/forms/inline-code-editor/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"turw5PGv",block:'{"symbols":[],"statements":[[4,"if",[[23,["showPlaceholder"]]],null,{"statements":[[0,"  "],[7,"pre"],[11,"class","cs-code-editor-placeholder"],[9],[1,[21,"placeholder"],true],[10],[0,""]],"parameters":[]},null],[4,"if",[[23,["canUseCodeMirror"]]],null,{"statements":[[0,"  "],[7,"textarea"],[11,"class","cm-target"],[9],[10],[0,""]],"parameters":[]},{"statements":[[0,"  "],[1,[27,"textarea",null,[["class","value"],["cs-no-input-focus",[23,["value"]]]]],false],[0,""]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/inline-code-editor/template.hbs"}})
e.default=t}),define("tco-app/components/forms/inline-edit/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"span",classNames:["cs-inline-edit"],classNameBindings:["class","usingPlaceholder:cs-inline-edit-placeholder","invalid:cs-inline-edit-invalid","disabled:cs-inline-edit-disabled"],disabled:Ember.computed.not("enabled"),enabled:!0,label:Ember.computed("value",function(){var e=this.get("value")
return e||(e=this.getWithDefault("placeholder","Double click to edit.")),e}),usingPlaceholder:Ember.computed("value",function(){return!this.get("value")}),inputClass:Ember.computed("editing",function(){return this.get("editing")?"":"cs-hide"}),click:function(){if(this.get("blockClickThrough"))return!1},didRender:function(){var e=this,t=!1,n=this.$("input")
n.val(this.get("value")),n.on("keydown",function(n){13===n.keyCode&&(e.send("doneEditing"),n.preventDefault()),27===n.keyCode&&(t=!0,e.set("editing",!1),n.preventDefault())}),n.on("blur",function(){t||e.send("doneEditing")})},doubleClick:function(){var e=this
!this.get("editing")&&this.get("enabled")&&(this.set("editing",!0),Ember.run.scheduleOnce("afterRender",function(){e.$("input").focus()}))},actions:{doneEditing:function(){if(this.get("editing")){var e=this.$("input").val()
this.onDoneEditing(e),e!==this.get("value")&&this.$("input").val(this.get("value"))}this.set("editing",!1)}}})
e.default=t}),define("tco-app/components/forms/inline-edit/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"vfcl/XDn",block:'{"symbols":[],"statements":[[4,"if",[[23,["editing"]]],null,{"statements":[[0,"  "],[7,"input"],[11,"name",""],[11,"value",""],[11,"type","text"],[9],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"  "],[1,[21,"label"],true],[0,"\\n"]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/inline-edit/template.hbs"}})
e.default=t}),define("tco-app/components/forms/rc-choice/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({half:!1,tagName:"label",classNames:["cs-rc"],classNameBindings:["class","modeClass","half:cs-rc-1-2"],attributeBindings:["style"],mode:"checkbox",modeClass:Ember.computed("mode",function(){return"radio"===this.get("mode")?"cs-rc-radio":"cs-rc-checkbox"}),castArrayVal:Ember.computed("arrayVal",function(){var e=this.get("arrayVal")
return Ember.isArray(e)?e:Ember.A([e])}),isChecked:Ember.computed("value",{get:function(){var e=this.get("mode")
if("radio"===e)return this.get("value")===this.get("optVal")
if("array"===e){var t=this.get("value")
return this.get("castArrayVal").every(function(e){return t.includes(e)})}return this.get("value")},set:function(e,t){var n=this,o=this.get("mode")
return"radio"===o?(this.set("value",this.get("optVal")),!0):"array"===o?(t?this.get("castArrayVal").forEach(function(e){n.get("value").addObject(e)}):this.get("castArrayVal").forEach(function(e){n.get("value").removeObject(e)}),t):(this.set("value",t),t)}})})
e.default=t}),define("tco-app/components/forms/rc-choice/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"KvMlh28d",block:'{"symbols":["&default"],"statements":[[1,[27,"input",null,[["type","checked","disabled"],["checkbox",[23,["isChecked"]],[23,["disabled"]]]]],false],[0,"\\n"],[7,"span"],[11,"class","cs-rc-indicator"],[9],[10],[0,"\\n"],[7,"span"],[11,"class","cs-rc-label"],[9],[0,"\\n"],[4,"if",[[24,1]],null,{"statements":[[0,"    "],[14,1],[0,"\\n"]],"parameters":[]},{"statements":[[0,"    "],[1,[21,"label"],false],[0,"\\n"]],"parameters":[]}],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/rc-choice/template.hbs"}})
e.default=t}),define("tco-app/components/forms/select-base/component",["exports","tco-app/mixins/forms/visibility-observation","tco-app/mixins/forms/assign-default"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Component.extend(t.default,n.default,{assignDefaultOptionsPath:"computedOptions",store:Ember.inject.service(),didReceiveAttrs:function(){this.processDynamicContent()},processDynamicContent:function(){var e=this,t=this.get("options")
"string"==typeof t?(this.set("loadingDynamic",!0),this.get("store").findRecord("fragment","app-choices::".concat(t)).then(function(t){e.setDynamicContent(Ember.get(t,"value"))})):t.then&&(this.set("loadingDynamic",!0),t.then(function(t){e.setDynamicContent(t)}))},setDynamicContent:function(e){var t=this
this.isDestroyed||(this.set("dynamicContent",Ember.A(e)),this.set("loadingDynamic",!1),Ember.run.scheduleOnce("afterRender",function(){t.send("assignDefaultOption")}))},observerDynamicOptions:Ember.observer("options",function(){this.processDynamicContent()}),computedOptions:Ember.computed("options.[]","dynamicContent.[]",function(){var e=this.get("dynamicContent")
return e||(e=this.getWithDefault("options",[])),Ember.isArray(e)&&"undefined"!==Ember.typeOf(e.length)?Ember.A(e.map(function(e){if("string"==typeof e)return{value:e,label:e}
if(Ember.isNone(e.value))return null
var t={value:e.value,label:e.label?e.label:e.value}
return Ember.isPresent(e.group)&&(t.group=e.group),e}).filter(Ember.isPresent)):Ember.A()}),computedOptionsChange:Ember.observer("computedOptions.[]",function(){var e=this
this.get("allowInvalidOption")||Ember.run.next(this,function(){e.send("assignDefaultOption")})}),actions:{isVisible:function(){this.get("loadingDynamic")||this.send("assignDefaultOption")}}})
e.default=o}),define("tco-app/components/forms/select-base/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"+KujQ3Bx",block:'{"symbols":["option","&default"],"statements":[[7,"div"],[12,"class",[28,["cs-styled-select-label ",[27,"if",[[23,["showPlaceholder"]],"cs-styled-select-placeholder"],null]]]],[9],[0,"\\n  "],[7,"span"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[10],[0,"\\n"],[7,"select"],[12,"disabled",[21,"disabled"]],[12,"onclick",[27,"action",[[22,0,[]],"change"],[["on"],["change"]]]],[9],[0,"\\n"],[4,"if",[[23,["showPlaceholder"]]],null,{"statements":[[0,"    "],[1,[27,"forms/styled-select/styled-option",null,[["selected","disabled","label"],[true,true,[23,["placeholderText"]]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[24,2]],null,{"statements":[[0,"    "],[14,2,[[22,0,[]]]],[0,"\\n"]],"parameters":[]},{"statements":[[4,"each",[[23,["computedOptions"]]],null,{"statements":[[0,"      "],[1,[27,"forms/styled-select/styled-option",null,[["select","option"],[[22,0,[]],[22,1,[]]]]],false],[0,"\\n"]],"parameters":[1]},null]],"parameters":[]}],[10]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/select-base/template.hbs"}})
e.default=t})
define("tco-app/components/forms/select-multi/component",["exports","tco-app/components/forms/select-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({classNames:["cs-select","cs-select-multi"],classNameBindings:["disableInput:is-disabled"],selection:Ember.computed("value",function(){return Ember.A(this.getWithDefault("value",[]).map(function(e){return{value:e}}))}),ensureValueIsEnumerable:function(){var e=this.get("value")
e.addObject||this.set("value",Ember.A(e))},disableInput:Ember.computed("disabled","computedOptions.[]",function(){return this.get("computedOptions.length")<=0||this.get("disabled")}),actions:{add:function(e){this.ensureValueIsEnumerable(),this.get("value").addObject(e.value)},remove:function(e){this.ensureValueIsEnumerable(),this.get("value").removeObject(e.value)}}})
e.default=n}),define("tco-app/components/forms/select-multi/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"MAbj95UC",block:'{"symbols":[],"statements":[[1,[27,"forms/ember-selectize",null,[["content","optionValuePath","optionLabelPath","selection","multiple","placeholder","optionGroupPath","add-item","remove-item","disabled"],[[23,["computedOptions"]],"content.value","content.label",[23,["selection"]],true,[23,["placeholder"]],"group",[27,"action",[[22,0,[]],"add"],null],[27,"action",[[22,0,[]],"remove"],null],[23,["disableInput"]]]]],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/select-multi/template.hbs"}})
e.default=t}),define("tco-app/components/forms/select-single/component",["exports","tco-app/components/forms/select-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({classNames:["cs-select","cs-select-single"],classNameBindings:["disableInput:is-disabled"],disableInput:Ember.computed("disabled","computedOptions.[]",function(){return this.get("computedOptions.length")<=0||this.get("disabled")}),didReceiveAttrs:function(){this._super.apply(this,arguments),this.set("selection",this.get("value"))},selectPlaceholder:Ember.computed("loadingDynamic","loadingPlaceholder","placeholder","emptyPlaceholder","computedOptions.length",function(){var e=this.get("placeholder")
return this.get("loadingDynamic")?this.getWithDefault("loadingPlaceholder",e):(this.get("computedOptions.length")<=0&&(e=this.getWithDefault("emptyPlaceholder",e)),e)}),observeValue:Ember.observer("value",function(){var e=this.get("value")
this.get("localUpdate")||this.set("selection",e),this.set("localUpdate",!1)}),observeDynamicLoading:Ember.observer("loadingDynamic",function(){this.get("loadingDynamic")||this.set("selection",this.get("value"))}),didInsertElement:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){try{var t=e.$("select")[0].selectize
t.on("dropdown_open",function(){return e.send("dropdownOpen")}),t.on("dropdown_close",function(){return e.send("dropdownClose")})}catch(n){console.warn("Unable to reference selectize instance",n)}})},actions:{selectItem:function(e){this.set("localUpdate",!0),this.set("value",e?e.value:null)},dropdownOpen:function(){this.set("ui.isSelectizeOpen",!0)},dropdownClose:function(){this.set("ui.isSelectizeOpen",!1)}}})
e.default=n}),define("tco-app/components/forms/select-single/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"N/TB2+B+",block:'{"symbols":[],"statements":[[1,[27,"forms/ember-selectize",null,[["content","optionValuePath","optionLabelPath","value","placeholder","optionGroupPath","select-item","disabled"],[[23,["computedOptions"]],"content.value","content.label",[23,["selection"]],[23,["selectPlaceholder"]],"group",[27,"action",[[22,0,[]],"selectItem"],null],[23,["disableInput"]]]]],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/select-single/template.hbs"}})
e.default=t}),define("tco-app/components/forms/styled-select/component",["exports","tco-app/components/forms/select-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({classNames:["cs-styled-select"],classNameBindings:["focused:cs-active"],focused:!1,hasRendered:!1,hasOpened:!1,didInsertElement:function(){var e=this
this.$("select").on("focus",function(){e.set("focused",!0)}).on("blur",function(){e.set("focused",!1)}),Ember.run.next(function(){if(!e.get("isDestroyed")){e.set("hasRendered",!0)
var t=e.get("value")
Ember.isNone(t)&&e.send("assignDefaultOption")}})},placeholderText:Ember.computed("placeholder","value",function(){var e=this.get("placeholder")
return Ember.isNone(e)?this.get("value"):e}),label:Ember.computed("selectedOption","loadingDynamic",function(){if(this.get("loadingDynamic"))return"Loading&hellip;"
if(this.get("showPlaceholder")||!this.get("selectedOption"))return this.get("placeholderText")
var e=this.getWithDefault("selectedOption",{})
return Ember.getWithDefault(e,"label",Ember.getWithDefault(e,"value",this.get("selectedOption")))}),someOptions:Ember.computed("hasOpened","computedOptions.[]",function(){var e=this.get("computedOptions")
return this.get("hasOpened")?e:e.filter(function(e,t){return t<=10})}),selectedOption:Ember.computed("value","computedOptions.[]",function(){var e=this.get("value")
return this.get("computedOptions").find(function(t){return e==Ember.getWithDefault(t,"value",t)})}),showPlaceholder:Ember.computed.none("selectedOption"),actions:{populateSelect:function(){this.set("hasOpened",!0)},clearSelect:function(){this.set("hasOpened",!1)},change:function(){var e=this.get("computedOptions"),t=this.$("select")[0].selectedIndex
this.get("showPlaceholder")&&t--,this.set("value",Ember.getWithDefault(e[t],"value",e[t]))}}})
e.default=n}),define("tco-app/components/forms/styled-select/styled-option/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"option",attributeBindings:["value","selected","disabled"],value:Ember.computed("option","option.value",function(){var e=this.getWithDefault("option",{})
return Ember.getWithDefault(e,"value",Ember.getWithDefault(e,"label",this.get("option")))}),label:Ember.computed("option","option.label",function(){var e=this.getWithDefault("option",{})
return Ember.getWithDefault(e,"label",Ember.getWithDefault(e,"value",this.get("option")))}),selected:Ember.computed("select.value",function(){return this.get("select.value")==this.get("value")})})
e.default=t}),define("tco-app/components/forms/styled-select/styled-option/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Fe/5rOby",block:'{"symbols":[],"statements":[[1,[21,"label"],true]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/styled-select/styled-option/template.hbs"}})
e.default=t}),define("tco-app/components/forms/styled-select/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"YXihprs5",block:'{"symbols":["option","&default"],"statements":[[7,"div"],[12,"class",[28,["cs-styled-select-label ",[27,"if",[[23,["showPlaceholder"]],"cs-styled-select-placeholder"],null]]]],[9],[0,"\\n  "],[7,"span"],[9],[1,[21,"label"],true],[10],[0,"\\n"],[10],[0,"\\n"],[7,"select"],[12,"disabled",[21,"disabled"]],[12,"onfocus",[27,"action",[[22,0,[]],"populateSelect"],null]],[12,"onblur",[27,"action",[[22,0,[]],"clearSelect"],null]],[12,"onchange",[27,"action",[[22,0,[]],"change"],null]],[9],[0,"\\n"],[4,"if",[[23,["showPlaceholder"]]],null,{"statements":[[0,"  "],[1,[27,"forms/styled-select/styled-option",null,[["selected","disabled","label"],[true,true,[23,["placeholderText"]]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[24,2]],null,{"statements":[[0,"  "],[14,2,[[22,0,[]]]],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["hasRendered"]]],null,{"statements":[[4,"each",[[23,["someOptions"]]],null,{"statements":[[0,"  "],[1,[27,"forms/styled-select/styled-option",null,[["select","option"],[[22,0,[]],[22,1,[]]]]],false],[0,"\\n"]],"parameters":[1]},null]],"parameters":[]},null]],"parameters":[]}],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/styled-select/template.hbs"}})
e.default=t}),define("tco-app/components/forms/text-editor/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-text-editor"],classNameBindings:["modeClass"],preference:Ember.inject.service(),allModes:["html","text"],editorWrapID:Ember.computed("editorID",function(){return"wp-".concat(this.get("editorID"),"-wrap")}),editorContainerID:Ember.computed("editorID",function(){return"wp-".concat(this.get("editorID"),"-editor-container")}),init:function(){this._super.apply(this,arguments)
var e="cswpeditor-".concat(Ember.guidFor(this))
this.set("editorID",e),window.tinyMCEPreInit.mceInit[e]=Object.assign({},window.tinyMCEPreInit.mceInit.cswpeditor),window.tinyMCEPreInit.mceInit[e].id=e,window.tinyMCEPreInit.mceInit[e].selector="#".concat(e),window.tinyMCEPreInit.mceInit[e].resize=!1,window.tinyMCEPreInit.mceInit[e].valid_elements="*[*]",window.tinyMCEPreInit.mceInit[e].extended_valid_elements="*[*]"},setupTinyMCE:function(){var e=this
return new Ember.RSVP.Promise(function(t,n){if(e.get("tinyMCERendered")||void 0===window.tinymce)return n()
var o=e.get("editorID")
"dark"===e.get("ui.uiTheme")&&(window.tinyMCEPreInit.mceInit[o].content_style="body { color: #a5a5a5; background-color: #333333; }"),window.tinyMCEPreInit.mceInit[o].setup=e.get("setupTinyMCE")
window.tinymce.init(Ember.assign({},window.tinyMCEPreInit.mceInit[o],{setup:function(n){e.set("editorInstance",n),n.on("init",function(){window.wpActiveEditor||(window.wpActiveEditor=o),e.set("tinyMCERendered",!0),t(n)}),n.addButton("cs_media",{icon:"image",onclick:function(){window.wp&&window.wp.media&&window.wp.media.editor&&window.wp.media.editor.open(e.get("editorID"),{frame:"post",state:"insert",title:window.wp.media.view.l10n.addMedia,multiple:!0})}})
var r=function(){var t=e.get("editorInstance").getContent().replace(/<p/gi,"<p cs-preserve-p").replace(/\n?<br\s*?\/>\n?/gi,"%%cs-preserve-br%%")
t=window.wp.editor.removep(t).replace(/<p cs-preserve-p/gi,"<p").replace(/%%cs-preserve-br%%/gi,"<br />\n"),e.set("isUpdatingText",!0),e.set("value",t),e.set("isUpdatingText",!1)}
n.on("keyup change NodeChange",function(){"text"===e.get("activeMode")&&Ember.run.debounce(r,150)})}}))})},availableModes:Ember.computed(function(){var e=this.get("allModes"),t=this.get("mode")
return e.includes(t)?[t]:e}),modeClass:Ember.computed("activeMode",function(){return"cs-text-editor-mode-".concat(this.get("activeMode"))}),pickerOpen:Ember.observer("picker.open",function(){}),onInit:Ember.on("init",function(){if(Ember.isNone(this.get("activeMode"))){if(this.get("preference.richTextDefault")&&this.get("availableModes").includes("text"))return this.set("activeMode","text")
this.set("activeMode",this.get("availableModes.firstObject"))}}),observeValue:Ember.observer("value",function(){var e=this.get("editorInstance")
!e||this.isDestroyed||this.get("isUpdatingText")||(e.setContent(this.get("value"),{format:"raw"}),this.set("isUpdatingText",!1))}),didInsertElement:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){e.get("availableModes").includes("text")?(e.$(".cs-text-editor-text textarea").val(e.get("value")),e.setupTinyMCE().then(function(){e.send("focus")})):e.send("focus")})},prepareEditorContent:function(e){return e},cleanEditorUpdate:function(e){return e},activeModeObserver:Ember.observer("activeMode",function(){this.send("focus")}),actions:{focus:function(){var e=this
Ember.run.later(function(){"text"===e.get("activeMode")?e.send("focusTextEditor"):e.$("textarea").focus()},10)},switchTo:function(e){this.set("activeMode",e)},focusTextEditor:function(){var e=this.get("editorInstance")
e&&(e.focus(),e.selection.select(e.getBody(),!0),e.selection.collapse(!1))}}})
e.default=t}),define("tco-app/components/forms/text-editor/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"WvksgZ3K",block:'{"symbols":["&default"],"statements":[[4,"unless",[[23,["externalSwitcher"]]],null,{"statements":[[0,"  "],[1,[27,"forms/text-editor/text-editor-switcher",null,[["classNames","switchTo","availableModes","activeMode"],[[27,"array",["cs-workspace-expander-head-actions"],null],[27,"action",[[22,0,[]],"switchTo"],null],[23,["availableModes"]],[23,["activeMode"]]]]],false],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-text-editor-text"],[9],[0,"\\n  "],[7,"div"],[12,"id",[21,"editorWrapID"]],[11,"class","wp-core-ui wp-editor-wrap tmce-active"],[9],[0,"\\n    "],[7,"div"],[12,"id",[21,"editorContainerID"]],[11,"class","wp-editor-container"],[9],[0,"\\n      "],[7,"textarea"],[11,"class","cs-wp-editor wp-editor-area"],[12,"id",[21,"editorID"]],[9],[10],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n\\n"],[1,[27,"textarea",null,[["value","class"],[[23,["value"]],"cs-text-editor-html"]]],false],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/text-editor/template.hbs"}})
e.default=t}),define("tco-app/components/forms/text-editor/text-editor-switcher/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({})
e.default=t}),define("tco-app/components/forms/text-editor/text-editor-switcher/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ZmYJf723",block:'{"symbols":[],"statements":[[4,"if",[[27,"contains",["html",[23,["availableModes"]]],null]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["switchTo"]],"html"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeMode"]],"html"],null],"cs-active"],null]]]],[9],[1,[27,"icon",["fa-code"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"contains",["text",[23,["availableModes"]]],null]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["switchTo"]],"text"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeMode"]],"text"],null],"cs-active"],null]]]],[9],[1,[27,"icon",["action-btn-fonts"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/text-editor/text-editor-switcher/template.hbs"}})
e.default=t}),define("tco-app/components/forms/unit-input/component",["exports","tco-app/src/lib/coalescence/common","tco-app/src/util/string"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Component.extend({classNames:["cs-unit-input"],classNameBindings:["invalidInput:cs-unit-input-invalid","choicesDisabled:cs-unit-input-hide-switcher"],open:!1,isFocused:!1,unitMode:Ember.computed("options.unit_mode",function(){return this.getWithDefault("options.unit_mode","distance")}),distanceUnits:["none","px","em","rem","vh","vw","%"],angleUnits:["deg","rad"],timeUnits:["s","ms"],solitaryInput:Ember.computed.lte("allowedUnits.length",1),isUnitless:Ember.computed.equal("unitMode","unitless"),choicesDisabled:Ember.computed("solitaryInput","options.disabled","usingKeyword","isUnitless",function(){return this.get("options.disabled")||this.get("solitaryInput")||this.get("usingKeyword")||this.get("isUnitless")}),init:function(){this._super.apply(this,arguments)
var e=this.get("parent")
Ember.isPresent(e)&&e.set("unitInput",this),this.set("usingKeyword",this.isKeywordValid(this.get("value")))},focusChange:Ember.observer("isFocused",function(){this.fallback()}),fallbackWhenInvalid:Ember.computed("value",function(){this.fallback()}),fallback:function(){this.get("isFocused")||!this.get("invalidInput")&&""!==this.get("value")||(this.set("value",this.getWithDefault("options.fallback_value","0".concat(this.get("allowedUnits")[0]))),this.notifyPropertyChange("rawValue"))},valToString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:""
return String(e)},detectUnit:function(e){var t,n=this.valToString(e),o=n.match(/-?\d*(?:\.\d+)?/),r=this.get("previousUnit")
o&&(t=n.replace(o[0],"")),r&&""===n&&(t=r)
var a=this.get("allowedUnits")
return a.includes(t)?t:a[0]},stripUnit:function(e,t){var n=this.valToString(e).match(/-?\d*(?:\.\d+)?/),o=t
return n&&(o=parseFloat(n[0])),isNaN(o)?t:o},unit:Ember.computed("value","allowedUnits",{get:function(){if(this.get("isUnitless"))return""
var e=this.get("value")
return this.isKeywordValid(e)?"":this.detectUnit(e)},set:function(e,t){var n=this.get("rawValue")
if(this.isKeywordValid(n))return""
var o=this.stripUnit(n,0)
return this.set("value","none"===t?o:"".concat(o).concat(t)),this.set("previousUnit",t),t}}),observeUsingKeyword:Ember.observer("value",function(){this.set("usingKeyword",this.isKeywordValid(this.get("value")))}),rawValue:Ember.computed("value",{get:function(){var e=this.get("value")
return this.isKeywordValid(e)?e:this.stripUnit(e,void 0)},set:function(e,t){if(this.isKeywordValid(t))return this.set("value",t),this.set("invalidInput",!1),t
var n=this.valToString(t).match(/^-?\d*(?:\.\d+)?$/)
if(n&&!isNaN(parseFloat(t))){var o=this.get("usingKeyword")?this.detectUnit(t):this.get("unit")
"none"===o?this.set("value",n[0]):this.set("value","".concat(n[0]).concat(o)),this.set("invalidInput",!1)}else""===t&&""===this.get("options.fallback_value")?(this.set("value",""),this.set("invalidInput",!1)):this.set("invalidInput",!0)
return t}}),rawNumeric:Ember.computed("value",function(){var e=this.get("value")
return!this.isKeywordValid(e)&&this.stripUnit(e,!1)}),allowedUnits:Ember.computed("options.available_units","unitMode",function(){if(this.get("isUnitless"))return[""]
var e=this.get("angle"===this.get("unitMode")?"angleUnits":"time"===this.get("unitMode")?"timeUnits":"distanceUnits"),t=this.get("options.available_units")
return t&&(e=e.filter(function(e){return t.includes(e)})),e}),isKeywordValid:function(e){return!("string"!==Ember.typeOf(e)||(0,n.splitOnWhitespace)(e).length>1)&&!!this.getWithDefault("options.valid_keywords",[]).find(function(n){"calc"===n&&(n="calc%")
var o=(e.match(/\(/g)||[]).length===(e.match(/\)/g)||[]).length
return(0,t.stringLike)(e,n)&&o})},actions:{focus:function(){this.set("isFocused",!0)},blur:function(){this.set("isFocused",!1)},selectUnit:function(e){this.set("unit",e),this.set("open",!1)},toggle:function(){this.get("open")?this.set("open",!1):this.get("solitaryInput")||this.set("open",!0)},clickOutside:function(){this.set("open",!1)},detectUnitOnEnter:function(){var e=this.get("rawValue")
if(!this.isKeywordValid(e)&&!this.get("isUnitless")){var t=this.get("options.fallback_value")
if(""===e&&t)this.set("rawValue",t)
else{var n=this.valToString(e),o=n.match(/-?\d*(?:\.\d+)?/),r=!n.replace(o[0],""),a=this.detectUnit(e)
a===this.get("unit")||r?this.set("rawValue",this.stripUnit(e,0)):this.set("unit",a)}}}}})
e.default=o}),define("tco-app/components/forms/unit-input/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"wGpoJCYX",block:'{"symbols":["&default"],"statements":[[1,[27,"input",null,[["value","enter","placeholder","disabled","focus-out","focus-in"],[[23,["rawValue"]],[27,"action",[[22,0,[]],"detectUnitOnEnter"],null],[23,["placeholder"]],[23,["options","disabled"]],[27,"action",[[22,0,[]],"blur"],null],[27,"action",[[22,0,[]],"focus"],null]]]],false],[0,"\\n"],[7,"div"],[11,"class","cs-unit-input-selection"],[9],[0,"\\n"],[4,"if",[[23,["unit"]]],null,{"statements":[[0,"  "],[7,"button"],[12,"class",[28,["cs-unit-input-unit ",[27,"if",[[23,["open"]],"cs-active"],null]," ",[27,"if",[[23,["choicesDisabled"]],"cs-solitary"],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"toggle"],null]],[9],[1,[21,"unit"],false],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/unit-input/template.hbs"}})
e.default=t}),define("tco-app/components/forms/unit-slider/component",["exports","nouislider"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({defaultsRanges:{none:{min:0,max:3,step:.001},px:{min:0,max:1500,step:1},em:{min:-.15,max:.5,step:.001},rem:{min:-.15,max:.5,step:.001},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1},"%":{min:0,max:100,step:1},deg:{min:0,max:360,step:1},rad:{min:0,max:6.2832,step:1e-4}},unitInputOptions:Ember.computed("options",function(){var e=this.getWithDefault("options",{})
return{disabled:e.disabled,available_units:e.available_units,valid_keywords:e.valid_keywords,unit_mode:e.unit_mode,fallback_value:e.fallback_value}}),rangeVal:Ember.computed("unitInput.unit",function(){var e,t,n,o={step:.1,min:0,max:100}
if("unitless"===this.get("options.unit_mode"))e=parseFloat(this.get("options.step")),t=parseFloat(this.get("options.min")),n=parseFloat(this.get("options.max"))
else{var r=this.get("defaultsRanges"),a=this.get("options.ranges"),i=this.get("unitInput.unit")
r[i]&&(e=r[i].step,t=r[i].min,n=r[i].max),a&&a[i]&&(e=parseFloat(a[i].step),t=parseFloat(a[i].min),n=parseFloat(a[i].max))}return isNaN(e)||(o.step=e),isNaN(t)||(o.min=t),isNaN(n)||(o.max=n),o}),classNames:["cs-unit-slider"],rangeUpdate:Ember.observer("unitInput.unit",function(){var e=this.get("unitInput.unit")
if(e!==this.get("currentRangeUnit")){this.set("currentRangeUnit",e)
var t=this.get("rangeVal"),n=this.get("sliderEl")
t&&n&&n.noUiSlider&&n.noUiSlider.updateOptions({step:t.step,range:{min:t.min,max:t.max}})}}),didInsertElement:function(){var e=this
this.set("sliderEl",this.$(".cs-unit-slider-target")[0]),Ember.run.later(function(){var n=e.get("sliderEl")
if(n&&!e.isDestroyed){var o=e.get("rangeVal"),r=e.get("unitInput.rawNumeric")
t.default.create(e.get("sliderEl"),{start:isNaN(r)?0:r,step:o.step,connect:"lower",cssPrefix:"cs-unit-slider-noui-",range:{min:o.min,max:o.max}}),n.noUiSlider.on("change",function(){this.isDestroyed||(this.set("isSliding",!1),this.sliderChanged(n.noUiSlider.get(),"change",n.noUiSlider))}.bind(e)),n.noUiSlider.on("slide",function(){this.isDestroyed||(this.set("isSliding",!0),this.sliderChanged(n.noUiSlider.get(),"slide",n.noUiSlider))}.bind(e)),e.notifyPropertyChange("canSlide"),e.get("unitInput.previousUnit"),Ember.$(n).removeClass("cs-unit-slider-target-waiting"),e.maybeDisable()}},3)},sliderChanged:function(e){this.set("unitInput.rawValue",String(parseFloat(e)))},canSlide:Ember.computed("options.disabled","unitInput.rawNumeric","unitInput.usingKeyword",function(){return!(this.get("options.disabled")||isNaN(this.get("unitInput.rawNumeric"))||this.get("unitInput.usingKeyword"))}),observeCanSlide:Ember.observer("canSlide",function(){this.maybeDisable()}),maybeDisable:function(){var e=this.get("sliderEl")
e&&!this.isDestroyed&&(this.get("canSlide")?e.removeAttribute("disabled"):(e.setAttribute("disabled",!0),e.noUiSlider.set(0)))},updateSlider:Ember.observer("unitInput.rawNumeric",function(){var e=this.get("sliderEl")
e&&this.get("canSlide")&&!this.get("isSliding")&&e.noUiSlider.set(this.get("unitInput.rawNumeric"))})})
e.default=n}),define("tco-app/components/forms/unit-slider/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"IawJDYE3",block:'{"symbols":["&default"],"statements":[[7,"div"],[11,"class","cs-unit-slider-target-container"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-unit-slider-target cs-unit-slider-target-waiting"],[9],[10],[0,"\\n"],[10],[0,"\\n"],[1,[27,"forms/unit-input",null,[["value","parent","options"],[[23,["value"]],[22,0,[]],[23,["unitInputOptions"]]]]],false],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/forms/unit-slider/template.hbs"}})
e.default=t}),define("tco-app/components/global/action-history/component",["exports","ember-redux"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-action-history"],classNameBindings:["ui.workspaceIsHorizontal:is-horizontal:is-vertical"],icons:{add:"fa-plus-square",move:"fa-arrows-alt",delete:"fa-trash-alt",duplicate:"fa-clone",update:"fa-marker",initial:"fa-check-circle"},pastItems:Ember.computed("past.[]",function(){var e=this
return this.get("past").map(function(t,n){return{index:n,label:t.meta.label,icon:e.get("icons")[t.meta.type]}}).reverse()}),futureItems:Ember.computed("future.[]",function(){var e=this
return this.get("future").map(function(t,n){return{index:n,label:t.meta.label,icon:e.get("icons")[t.meta.type]}}).reverse()}),actions:{}}),o=(0,t.connect)(function(){return function(e){return{past:e.history.past||[],current:e.history.meta,future:e.history.future||[]}}},function(e){return{stepForward:function(t){return e({type:"HISTORY_STEP_FORWARD",payload:{index:t}})},stepBackward:function(t){return e({type:"HISTORY_STEP_BACKWARD",payload:{index:t}})}}})(n)
e.default=o}),define("tco-app/components/global/action-history/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"5Vwsz+tc",block:'{"symbols":["actionItem","actionItem"],"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"ul"],[9],[0,"\\n"],[4,"each",[[23,["futureItems"]]],null,{"statements":[[0,"  "],[7,"li"],[12,"onclick",[27,"action",[[22,0,[]],"stepForward",[22,2,["index"]]],null]],[9],[7,"i"],[9],[1,[27,"icon",[[22,2,["icon"]]],null],false],[10],[0,"\\n    "],[7,"div"],[9],[7,"span"],[9],[1,[22,2,["label"]],false],[10],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[2]},null],[4,"if",[[23,["current"]]],null,{"statements":[[0,"  "],[7,"li"],[11,"class","cs-active"],[9],[7,"i"],[9],[1,[27,"icon",[[27,"get",[[23,["icons"]],[23,["current","type"]]],null]],null],false],[10],[0,"\\n    "],[7,"div"],[9],[7,"span"],[9],[1,[23,["current","label"]],false],[10],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"each",[[23,["pastItems"]]],null,{"statements":[[0,"  "],[7,"li"],[12,"onclick",[27,"action",[[22,0,[]],"stepBackward",[22,1,["index"]]],null]],[9],[7,"i"],[9],[1,[27,"icon",[[22,1,["icon"]]],null],false],[10],[0,"\\n    "],[7,"div"],[9],[7,"span"],[9],[1,[22,1,["label"]],false],[10],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[1]},null],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/action-history/template.hbs"}})
e.default=t}),define("tco-app/components/global/bar-button/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"li",classNameBindings:["class","active:cs-active"],attributeBindings:["disabled"],active:!1,actions:{press:function(e){e.stopPropagation(),this.onClick()}}})
e.default=t}),define("tco-app/components/global/bar-button/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"WZuVot/P",block:'{"symbols":["&default"],"statements":[[7,"button"],[12,"disabled",[21,"disabled"]],[12,"class",[28,["cs-bar-btn ",[21,"buttonClass"]," ",[27,"if",[[23,["active"]],"cs-active",""],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"press"],[["bubbles"],[false]]]],[9],[14,1],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/bar-button/template.hbs"}})
e.default=t}),define("tco-app/components/global/bar-nav/component",["exports","ember-click-outside/mixin"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend(t.default,{classNameBindings:["class","open:cs-active"],listening:!1,listenWhenOpen:Ember.observer("open",function(){this.toggleListeners(this.get("open"))}),clickOutside:function(){this.outsideClick()},toggleListeners:function(e){var t=this.get("listening")
!e&&t&&(Ember.run.cancel(this._cancelListener),this.removeClickOutsideListener(),this.set("listening",!1)),e&&!t&&(this._cancelListener=Ember.run.next(this,this.addClickOutsideListener),this.set("listening",!0))},didInsertElement:function(){this.toggleListeners(this.get("open"))},willDestroyElement:function(){this.toggleListeners(!1)}}).extend({open:!1,classNames:["cs-bar-nav"],outsideClickHandler:function(){this.set("open",!1)},click:function(){this.toggleProperty("open")}})
e.default=n}),define("tco-app/components/global/bar-nav/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"BaMK9r/U",block:'{"symbols":[],"statements":[[7,"a"],[11,"class","cs-bar-nav-toggle"],[9],[0,"\\n  "],[7,"span"],[9],[10],[0,"\\n"],[10],[0,"\\n"],[7,"div"],[11,"class","cs-bar-nav-dropdown"],[9],[0,"\\n  "],[1,[27,"global/cs-launchpad",null,[["compact"],[true]]],false],[0,"\\n"],[10]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/bar-nav/template.hbs"}})
e.default=t}),define("tco-app/components/global/cs-bar/component",["exports","ember-redux","tco-app/src/actions/ui"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=(0,t.connect)(function(){return function(e){return e.ui}},function(e){return{toggleHideWorkSpace:function(){return e((0,n.uiToggleHideWorkspace)())}}})(Ember.Component.extend({classNames:["cs-bar"]}))
e.default=o}),define("tco-app/components/global/cs-bar/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"k2EUMIZK",block:'{"symbols":["&default"],"statements":[[1,[21,"global/bar-nav"],false],[0,"\\n"],[7,"nav"],[11,"class","cs-bar-btns"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[0,"    "],[14,1],[0,"\\n\\n"],[4,"if",[[23,["ui","routeEnabledOrientation"]]],null,{"statements":[[0,"    "],[7,"li"],[9],[0,"\\n      "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["disabled","class","onClick"],[[23,["hideWorkspace"]],[27,"concat",["cs-action-toggle-orientation cs-action-toggle-orientation-",[23,["ui","workspaceOrientation"]]],null],[27,"action",[[22,0,[]],"toggleOrientation"],[["bubbles","target"],[false,[23,["ui"]]]]]]],{"statements":[[0,"        "],[1,[27,"icon",["fa-window-maximize"],[["rotation"],[[27,"if",[[23,["ui","workspaceIsHorizontal"]],270,180],null]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"global/bar-button",null,[["disabled","active","onClick"],[[23,["hideWorkspace"]],[23,["ui","workspaceIsUndocked"]],[27,"action",[[22,0,[]],"toggleDocked"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"        "],[1,[27,"icon",["fa-window-restore"],null],false],[0,"\\n"]],"parameters":[]},null],[4,"global/bar-button",null,[["disabled","class","active","onClick"],[[23,["ui","workspaceIsUndocked"]],[27,"concat",["cs-action-toggle-collapse-submenu cs-action-toggle-collapse-",[23,["ui","workspaceOrientation"]]],null],[23,["hideWorkspace"]],[27,"action",[[22,0,[]],"toggleHideWorkSpace"],null]]],{"statements":[[0,"        "],[1,[27,"icon",[[27,"concat",["action-btn-collapse-",[23,["ui","workspaceOrientation"]]],null]],null],false],[0,"\\n"]],"parameters":[]},null],[0,"      "],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n    "],[7,"li"],[9],[0,"\\n      "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[23,["ui","routeEnabledCollapse"]]],null,{"statements":[[4,"global/bar-button",null,[["disabled","class","active","onClick"],[[23,["ui","workspaceIsUndocked"]],[27,"concat",["cs-action-toggle-collapse-submenu cs-action-toggle-collapse-",[23,["ui","workspaceOrientation"]]],null],[23,["hideWorkspace"]],[27,"action",[[22,0,[]],"toggleHideWorkSpace"],null]]],{"statements":[[0,"        "],[1,[27,"icon",[[27,"concat",["action-btn-collapse-",[23,["ui","workspaceOrientation"]]],null]],null],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[0,"\\n"],[4,"if",[[23,["ui","routeEnabledPreviewSizer"]]],null,{"statements":[[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showPreviewSizer"]],[27,"action",[[22,0,[]],"toggle","showPreviewSizer"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"        "],[1,[27,"icon",["action-btn-responsive"],null],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["ui","canViewSite"]]],null,{"statements":[[0,"        "],[7,"li"],[9],[7,"a"],[11,"class","cs-bar-btn"],[12,"href",[28,[[23,["ui","viewSiteURL"]]]]],[11,"target","_blank"],[9],[1,[27,"icon",["action-btn-view-site"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["ui","canManageSettings"]]],null,{"statements":[[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showSettings"]],[27,"action",[[22,0,[]],"toggle","showSettings"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"        "],[1,[27,"icon",["fa-cog"],null],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["debug","devTools"]]],null,{"statements":[[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","devToolsOpen"]],[27,"action",[[22,0,[]],"toggle","devToolsOpen"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"        "],[1,[27,"icon",["fa-bug"],null],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"      "],[10],[0,"\\n    "],[10],[0,"\\n\\n"],[4,"if",[[23,["ui","routeEnabledSave"]]],null,{"statements":[[0,"    "],[7,"li"],[9],[0,"\\n      "],[7,"ul"],[9],[0,"\\n        "],[7,"li"],[9],[7,"button"],[12,"class",[28,["cs-bar-btn cs-action-save ",[27,"if",[[23,["ui","unsavedData"]],"cs-unsaved",""],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"save"],[["target"],[[23,["ui","primaryRoute"]]]]]],[12,"disabled",[23,["ui","saving"]]],[9],[0,"SAVE"],[10],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/cs-bar/template.hbs"}})
e.default=t}),define("tco-app/components/global/cs-canvas/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-canvas"],classNameBindings:["ui.workspaceOrientationClass"]})
e.default=t}),define("tco-app/components/global/cs-canvas/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"hEAnWRMG",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["ui","devToolsOpen"]]],null,{"statements":[[1,[21,"react-bridge/debug/element-data"],false]],"parameters":[]},null],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/cs-canvas/template.hbs"}})
e.default=t}),define("tco-app/components/global/cs-launchpad/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"nav",classNames:["cs-launchpad"],classNameBindings:["compact:is-compact"]})
e.default=t}),define("tco-app/components/global/cs-launchpad/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"cCHN+0GY",block:'{"symbols":[],"statements":[[0,"\\n"],[4,"if",[[27,"or",[[23,["currentUser","canUseHeaders"]],[23,["currentUser","canUseBuilder"]],[23,["currentUser","canUseFooters"]]],null]],null,{"statements":[[7,"ul"],[11,"class","cs-launchpad-list-lg"],[9],[0,"\\n"],[4,"if",[[23,["currentUser","canUseHeaders"]]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["headers"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-headers"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.headers"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.headers.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["currentUser","canUseBuilder"]]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["content"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-content"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.content"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.content.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["currentUser","canUseFooters"]]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["footers"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-footers"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.footers"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.footers.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n\\n"],[4,"if",[[27,"user-can",["theme_options"],null]],null,{"statements":[[7,"ul"],[9],[0,"\\n  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["options"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-options"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["app.options.title"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.options.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n\\n"],[4,"if",[[27,"or",[[27,"user-can",["templates"],null],[27,"user-can",["content.cs_global_block"],null],[27,"user-can",["templates.design_cloud"],null]],null]],null,{"statements":[[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"user-can",["templates"],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["template-manager"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-templates"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.template-manager"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.templates.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["content.cs_global_block"],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["global-blocks"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-global-blocks"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.global-blocks"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.global-blocks.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["templates.design_cloud"],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n"],[4,"link-to",["design-cloud"],null,{"statements":[[0,"    "],[1,[27,"icon",["global-nav-design-cloud"],null],false],[0,"\\n    "],[7,"div"],[9],[0,"\\n      "],[7,"strong"],[9],[1,[27,"t",["common.title.design-cloud"],null],false],[10],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.launchpad.design-cloud.description"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[0,"\\n"],[7,"ul"],[11,"class","cs-launchpad-list-exit"],[9],[0,"\\n  "],[7,"li"],[11,"class","cs-bar-nav-items-divider"],[9],[0,"\\n"],[4,"common/link-out",null,[["class","href"],["abc",[23,["ui","dashboardUrl"]]]],{"statements":[[0,"    "],[7,"div"],[9],[1,[27,"t",["app.exit-to-dashboard"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/cs-launchpad/template.hbs"}})
e.default=t}),define("tco-app/components/global/cs-window/component",["exports","ember-redux"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=(0,t.connect)(function(){return function(e){return{hideWorkspace:e.ui.hideWorkspace}}})(Ember.Component.extend({classNames:["cs-window"],classNameBindings:["screenClass","hideWorkspace:collapse","directionClass"],screenClass:Ember.computed("screen",function(){return"cs-window-".concat(Ember.String.dasherize(this.getWithDefault("screen","")))}),directionClass:Ember.computed("ui.workspaceIsHorizontal",function(){return this.get("ui.workspaceIsHorizontal")?"is-col":"is-row"})}))
e.default=n}),define("tco-app/components/global/cs-window/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Jwy48g+f",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/cs-window/template.hbs"}})
e.default=t})
define("tco-app/components/global/launch-screen/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({})
e.default=t}),define("tco-app/components/global/launch-screen/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"IyjS+eOD",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["index"]],{"statements":[[0,"\\n"],[4,"global/cs-canvas",null,null,{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.welcome-app"],null]]],{"statements":[[0,"      "],[1,[21,"global/cs-launchpad"],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/launch-screen/template.hbs"}})
e.default=t}),define("tco-app/components/global/notification-item/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-notification-item"],classNameBindings:["typeClass","active:cs-active","exiting:cs-fade"],active:!1,title:Ember.computed.readOnly("flash.title"),message:Ember.computed.readOnly("flash.message"),exiting:Ember.computed.readOnly("flash.exiting"),canClose:Ember.computed.readOnly("flash.canClose"),typeClass:Ember.computed("flash.type",function(){var e=Ember.String.dasherize(this.getWithDefault("flash.type","notice"))
return"cs-notification-item-".concat(e)}),didInsertElement:function(){var e=this
this.set("readiness",Ember.run.next(this,function(){e.set("active",!0)}))},willDestroy:function(){this._super(),this.teardown(),Ember.run.cancel(this.get("readiness"))},teardown:function(){var e=this.getWithDefault("flash",!1)
e&&e.destroyMessage()},actions:{close:function(){this.teardown()}}})
e.default=t}),define("tco-app/components/global/notification-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"alMo4cVd",block:'{"symbols":["&default"],"statements":[[4,"if",[[24,1]],null,{"statements":[[0,"  "],[14,1,[[22,0,[]],[23,["flash"]]]],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["canClose"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-notification-item-close"],[12,"onclick",[27,"action",[[22,0,[]],"close"],null]],[9],[0,"×"],[10],[0,"\\n"]],"parameters":[]},null],[0,"  "],[7,"div"],[11,"class","cs-notification-item-title"],[9],[1,[21,"title"],false],[10],[0,"\\n  "],[7,"div"],[11,"class","cs-notification-item-message"],[9],[1,[23,["flash","message"]],false],[10],[0,"\\n"]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/notification-item/template.hbs"}})
e.default=t}),define("tco-app/components/global/notification-queue/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({flashMessages:Ember.inject.service(),classNames:["cs-notification-queue"],didRender:function(){var e=this.get("ui.scrollBarWidth")
e>0&&this.$().css({right:e})}})
e.default=t}),define("tco-app/components/global/notification-queue/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"qZhIvuQ9",block:'{"symbols":["flash"],"statements":[[4,"each",[[23,["flashMessages","queue"]]],null,{"statements":[[0,"  "],[1,[27,"global/notification-item",null,[["flash"],[[22,1,[]]]]],false],[0,"\\n"]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/notification-queue/template.hbs"}})
e.default=t}),define("tco-app/components/global/progress-bar/component",["exports","nprogress"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-progress-bar-container"],saving:Ember.computed.alias("ui.saving"),progress:Ember.computed.alias("ui.savingProgress"),transitioning:Ember.computed.alias("ui.transitioning"),jobs:Ember.computed.alias("ui.savingJobs"),classNameBindings:["saving:cs-saving","transitioning:cs-transitioning"],ready:!1,uiUpdate:Ember.observer("saving","transitioning",function(){var e=this,n=!1
this.get("saving")&&(n=!0),this.get("transitioning")&&this.get("ui.noTransitionProgress")?this.set("noTransitionProgress",!1):(this.get("transitioning")&&(n=!0),!this.get("running")&&this.get("jobs")>0?t.default.configure({minimum:.1}):t.default.configure({minimum:.925}),Ember.run.scheduleOnce("afterRender",function(){n?(e.set("running",!0),t.default.start()):(e.set("running",!1),t.default.done())}))}),uiUpdateJobs:Ember.observer("progress",function(){if(this.get("running")){var e=this.get("jobs")
e>0&&t.default.inc(1/e)}}),didInsertElement:function(){t.default.configure({showSpinner:!1,speed:850,minimum:.925,parent:".cs-progress-bar-container",barSelector:".cs-progress-bar",template:'<div class="cs-progress-bar"><div class="cs-progress-bar-peg"></div></div></div>'})}})
e.default=n}),define("tco-app/components/global/progress-bar/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"oqVT7b0x",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/progress-bar/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/component",["exports","tco-app/src/lib/keybindings"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-tab-modal"],classNameBindings:["ui.showSettings:cs-active"],didInsertElement:function(){var e=this
this.getWithDefault("unbindKeys",function(){})(),this.set("unbindKeys",(0,t.default)({esc:function(){return e.send("close")}}))},willDestroyElement:function(){this._super.apply(this,arguments),this.getWithDefault("unbindKeys",function(){})()},activeLabel:Ember.computed("ui.activeSettingsTab",function(){return this.getWithDefault("ui.settingsLabels.".concat(this.get("ui.activeSettingsTab")),"")}),warning:Ember.computed("ui.activeSettingsTab",function(){return this.getWithDefault("ui.settingsWarnings.".concat(this.get("ui.activeSettingsTab")),null)}),click:function(e){Ember.$.contains(this.$(".cs-tab-modal-content")[0],e.target)||this.send("close")},actions:{close:function(){var e=this,t=this.get("warning")
t&&t.check()?this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.rollback&&t.rollback(),e.set("ui.showSettings",!1)},acceptClass:"sad"}):this.set("ui.showSettings",!1)},nav:function(e){var t=this,n=this.get("warning")
n&&n.check()?this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){n.rollback&&n.rollback(),t.set("ui.selectedSettingsTab",e)},acceptClass:"sad"}):this.set("ui.selectedSettingsTab",e)}}})
e.default=n}),define("tco-app/components/global/settings-modal/tab-base/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"article",classNameBindings:["isActive:cs-active"],isActive:Ember.computed("tabData.name","ui.activeSettingsTab",function(){return this.get("tabData.name")===this.get("ui.activeSettingsTab")}),didInsertElement:function(){this.get("ui").registerSettingsTab(this.get("tabData"))},willDestroyElement:function(){this.get("ui").unregisterSettingsTab(this.get("tabData"))},actions:{save:function(){Ember.isPresent(this.get("onSave"))&&this.onSave()}}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-base/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"SuOgE8VS",block:'{"symbols":["&default"],"statements":[[4,"common/scroll-box",null,null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n    "],[14,1],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["onSave"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onSave"]]],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[21,"saveLabel"],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-base/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-colors/color-list/color-choice/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({inlineStyle:Ember.computed("item.value",function(){return Ember.String.htmlSafe("background-color: ".concat(this.get("item.value"),";"))}),actions:{onDelete:function(e){e.stopPropagation(),this.get("onDelete")()},onDuplicate:function(e){e.stopPropagation(),this.get("onDuplicate")()}}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-colors/color-list/color-choice/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"wRH42V1X",block:'{"symbols":[],"statements":[[7,"div"],[11,"class","cs-color-choice-actions"],[9],[0,"\\n  "],[4,"if",[[23,["onDuplicate"]]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"onDuplicate"],null]],[9],[1,[27,"icon",["fa-copy"],null],false],[10]],"parameters":[]},null],[0,"\\n  "],[4,"if",[[23,["onDelete"]]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"onDelete"],null]],[9],[1,[27,"icon",["fa-trash-alt"],null],false],[10]],"parameters":[]},null],[0,"\\n"],[10],[0,"\\n"],[7,"div"],[11,"class","cs-color-choice"],[9],[0,"\\n  "],[7,"span"],[11,"class","cs-color-choice-color"],[12,"style",[21,"inlineStyle"]],[9],[0," "],[10],[0,"\\n  "],[7,"span"],[11,"class","cs-color-choice-label"],[9],[1,[23,["item","title"]],false],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-colors/color-list/color-choice/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-colors/color-list/component",["exports","tco-app/src/util/dragula","tco-app/src/actions/ui"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Component.extend({classNames:["cs-colors"],store:Ember.inject.service(),redux:Ember.inject.service(),colorManager:Ember.inject.service("color-manager"),activeColorItems:Ember.computed.filterBy("items","isDeleted",!1),orderSort:["order"],orderedColorItems:Ember.computed.sort("activeColorItems","orderSort"),didInsertElement:function(){var e=this
this._super.apply(this,arguments)
var o=(0,t.default)({moves:function(e,t,n){return Ember.$(e).is(".cs-colors > .cs-picker")},offset:function(e,t,n){return{x:Ember.$(n).width()/2,y:Ember.$(n).height()/2}},revertOnSpill:!0,mirrorContainer:this.get("element"),containers:[this.get("element")]})
o.on("drag",function(){e.isDestroyed||e.get("redux").dispatch((0,n.disablePreviewPointer)())}),o.on("dragend",function(){e.isDestroyed||e.get("redux").dispatch((0,n.enablePreviewPointer)())}),this.set("drake",o)},willDestroyElement:function(){this._super.apply(this,arguments)
var e=this.get("drake")
e&&e.destroy()},nameInUse:function(e){return this.get("activeColorItems").any(function(t){return e===t.get("title")})},actions:{addNew:function(e,t,n){var o={value:this.get("colorManager").makeRandomColor()},r=this.get("items.length")
o.order=r
var a=this.get("i18n").t("app.colors.entity")
for(o.title=this.get("i18n").t("app.indexed",{label:a,index:r}).string;this.nameInUse(o.title);)r+=1,o.title=this.get("i18n").t("app.indexed",{label:a,index:r}).string
var i=this.get("store").createRecord("color-manager/selection",o)
t&&this.send("moveItem",i,n?t.get("order")+1:t.get("order"))},moveItem:function(e,t){var n=e.get("order")
n<t?this.get("orderedColorItems").forEach(function(e,o){o>n&&o<=t&&e.set("order",o-1)}):this.get("orderedColorItems").forEach(function(e,o){o<n&&o>=t&&e.set("order",o+1)}),e.set("order",t)},duplicateItem:function(e){var t=e.serialize(),n=e.get("order")
t.title=this.get("i18n").t("app.copy-of",{title:e.get("title")}).string,t.order=this.get("orderedColorItems.length")
for(var o=1,r=t.title;this.nameInUse(t.title);)t.title=this.get("i18n").t("app.copy-of-numeric",{title:r,index:o++}).string
var a=this.get("store").createRecord("color-manager/selection",t)
this.send("moveItem",a,n)},deleteItem:function(e){var t=this,n=this.get("i18n").t("app.colors.entity")
this.get("ui").confirm({message:this.get("i18n").t("app.notify.delete-confirm",{context:n}),acceptClass:"sad",accept:function(){e.deleteRecord(),t.get("ui").notify(t.get("i18n").t("app.notify.deleted",{context:n})),t.get("orderedColorItems").forEach(function(e,t){e.set("order",t)})}})}}})
e.default=o}),define("tco-app/components/global/settings-modal/tab-colors/color-list/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"dRa1dFM4",block:'{"symbols":["item","picker"],"statements":[[4,"each",[[23,["orderedColorItems"]]],null,{"statements":[[4,"common/cs-picker",null,[["canOpen","focusSelector","item","onDrop","contentComponent"],[[27,"user-can",["colors.change"],null],".cs-picker-modal-title",[22,1,[]],[27,"action",[[22,0,[]],"moveItem"],null],[27,"component",["global/settings-modal/tab-colors/color-list/color-choice"],[["item","onDelete","onDuplicate"],[[22,1,[]],[27,"if",[[27,"user-can",["colors.delete"],null],[27,"action",[[22,0,[]],"deleteItem",[22,1,[]]],null],null],null],[27,"if",[[27,"user-can",["colors.create"],null],[27,"action",[[22,0,[]],"duplicateItem",[22,1,[]]],null],null],null]]]]]],{"statements":[[1,[27,"input",null,[["type","class","value"],["text","cs-picker-modal-title",[22,1,["title"]]]]],false],[0,"\\n"],[1,[27,"forms/color-input",null,[["inline","value"],[true,[22,1,["value"]]]]],false],[0,"\\n"]],"parameters":[2]},null]],"parameters":[1]},null],[0,"\\n"],[7,"div"],[11,"class","cs-color-add"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"addNew"],null]],[9],[7,"span"],[9],[7,"strong"],[9],[1,[27,"icon",["fa-plus"],null],false],[7,"span"],[9],[1,[27,"t",["app.add"],null],false],[10],[10],[10],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-colors/color-list/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-colors/component",["exports","fast-json-stable-stringify","tco-app/components/global/settings-modal/tab-base/component"],function(e,t,n){function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=n.default.extend({tabData:Ember.computed(function(){var e=this
return{name:"colors",label:"Colors",warning:{check:function(){return e.get("previousContent")!==e.getContentString()},rollback:function(){return e.get("items").map(function(e){return e.rollbackAttributes()})}}}}),getContentString:function(){return(0,t.default)(this.get("orderedColorItems").map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}({id:e.get("id")},e.serialize())}))},classNames:["cs-color-workspace"],store:Ember.inject.service(),colorManager:Ember.inject.service("color-manager"),activeColorItems:Ember.computed.filterBy("items","isDeleted",!1),orderSort:["order"],orderedColorItems:Ember.computed.sort("activeColorItems","orderSort"),didReceiveAttrs:function(){this.set("previousContent",this.getContentString())},actions:{save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress()
var n=this.get("items.firstObject")
n?n.save().then(function(){e.set("previousContent",e.getContentString()),t.notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.title.colors")}),"success"),e.set("colorManager.saved",e.get("colorManager.saved")+1),t.endSaveProgress()},function(n){t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.failed-to-save",{context:e.get("i18n").t("common.title.colors")}),"error"),console.warn("Could not save colors",n)}):(t.notify(this.get("i18n").t("app.notify.saved",{context:this.get("i18n").t("common.title.colors")}),"success"),t.endSaveProgress())}}})
e.default=r}),define("tco-app/components/global/settings-modal/tab-colors/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"L+pNe2C2",block:'{"symbols":[],"statements":[[4,"if",[[23,["isActive"]]],null,{"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n  "],[7,"h3"],[9],[1,[27,"t",["app.colors.title"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.colors.description"],null],false],[10],[0,"\\n  "],[1,[27,"global/settings-modal/tab-colors/color-list",null,[["items"],[[23,["items"]]]]],false],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[27,"t",["app.save-thing"],[["context"],[[27,"t",["common.title.colors"],null]]]],false],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-colors/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/component",["exports","fast-json-stable-stringify","ember-copy","lodash","tco-app/components/global/settings-modal/tab-base/component"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=r.default.extend({tabData:Ember.computed(function(){var e=this
return{name:"fonts",label:"Fonts",warning:{check:function(){return e.get("previousContent")!==e.getContentString()},rollback:function(){e.get("items").map(function(e){return e.rollbackAttributes()}),Object.keys(e.get("fontConfig.value")).forEach(function(t){return e.set("fontConfig.value.".concat(t),e.get("previous.".concat(t)))}),e.get("fontConfig").rollbackAttributes(),e.set("previousContent",e.getContentString())}}}}),store:Ember.inject.service(),redux:Ember.inject.service(),fontManager:Ember.inject.service(),activeFontItems:Ember.computed.filterBy("items","isDeleted",!1),orderedFontItems:Ember.computed.sort("activeFontItems","orderSort"),orderSort:["order"],getContentString:function(){return(0,t.default)({items:this.get("orderedFontItems").map(function(e){return e.serialize()}),config:this.get("fontConfig").serialize()})},didReceiveAttrs:function(){this.set("previousContent",this.getContentString()),this.set("previous",(0,n.copy)(this.get("fontConfig.value")))},invalidItemsMessage:Ember.observer("invalidItems.[]",function(){if(this.get("invalidItems.length")>0)return this.get("ui").notify(this.get("i18n").t("app.fonts.duplicate-name-error"),"error")}),invalidItems:Ember.computed("orderedFontItems.@each._id",function(){for(var e=this.get("orderedFontItems").map(function(e){return e.get("_id")}),t=[];e.length>0;){var n=e.pop()
e.includes(n)&&t.push(n)}return t}),nameInUse:function(e){return this.get("activeFontItems").any(function(t){return e===t.get("title")})},actions:{updateLabel:function(e,t){e.set("title",t)},selectFont:function(e){this.set("selectedItem",this.get("selectedItem.id")===e.get("id")?null:e)},addNew:function(e){var t=this.get("activeFontItems.length")+1,n=Object.assign({},this.getWithDefault("fontManager.fallbackFont",{}),e||{})
n.order=t
var o=this.get("i18n").t("app.fonts.entity")
for(n.title||(n.title=this.get("i18n").t("app.indexed",{label:o,index:t}).string);this.nameInUse(n.title);)n.title=this.get("i18n").t("app.indexed",{label:o,index:t++}).string
return this.get("store").createRecord("font-manager/selection",n)},moveFont:function(e,t){var n=e.get("order")
n<t?this.get("orderedFontItems").forEach(function(e,o){o>n&&o<=t&&e.set("order",o-1)}):this.get("orderedFontItems").forEach(function(e,o){o<n&&o>=t&&e.set("order",o+1)}),e.set("order",t)},duplicateItem:function(e){var t=e.serialize(),n=e.get("order")+1
t.title=this.get("i18n").t("app.copy-of",{title:e.get("title")}).string,t.order=this.get("orderedFontItems.length")
for(var o=1,r=t.title;this.nameInUse(t.title);)t.title=this.get("i18n").t("app.copy-of-numeric",{title:r,index:o++}).string
var a=this.get("store").createRecord("font-manager/selection",t)
this.send("moveFont",a,n)},deleteItem:function(e){var t=this
if(this.get("orderedFontItems.length")<=1)this.get("ui").confirm({noSkip:!0,back:!0,message:this.get("i18n").t("app.fonts.min-one-error")})
else{var n=this.get("i18n").t("app.fonts.entity-selection")
this.get("ui").confirm({message:this.get("i18n").t("app.notify.delete-confirm",{context:n}),acceptClass:"sad",accept:function(){e.deleteRecord(),t.get("ui").notify(t.get("i18n").t("app.notify.deleted",{context:n})),t.get("orderedFontItems").forEach(function(e,t){e.set("order",t)})}})}},createFromCustomFonts:function(e){var t=e.title,n=e.item
if(n.family){this.send("addNew",{title:t,family:n.family,source:"custom",stack:'"'.concat(n.family,'"'),weights:(0,o.uniq)((n.files||[]).map(function(e){return e.weight||400}))})
var r=this.get("i18n").t("app.fonts.entity-selection")
this.get("ui").notify(this.get("i18n").t("app.notify.created",{context:r}),"success")}},save:function(){var e=this
this.get("ui").beginSaveProgress()
var t=function(t){e.get("ui").endSaveProgress(),e.get("ui").notify(e.get("i18n").t("app.notify.failed-to-save",{context:e.get("i18n").t("common.title.fonts")}),"error"),console.warn("Failed to save fonts",t)}
Ember.RSVP.allSettled([this.get("items.firstObject").save(),this.get("fontConfig").save()]).then(function(n){if(n.find(function(e){return"rejected"===e.state}))return t(n)
e.set("previousContent",e.getContentString()),e.set("fontManager.saved",e.get("fontManager.saved")+1),e.get("ui").notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.title.fonts")}),"success"),e.get("ui").endSaveProgress()},t)}}})
e.default=a}),define("tco-app/components/global/settings-modal/tab-fonts/font-canvas/component",["exports","lodash"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=function(e){return(0,t.memoize)(function(){var t=window.csAppData.font_data||{}
return Object.keys(t).reduce(function(n,o){var r=t[o]||{},a=r.source,i=r.family,s=r.stack,l=r.weights
return a===e&&i&&s&&l&&n.push({family:i,stack:s,weights:l}),n},[])})},o=n("google"),r=n("system"),a=Ember.Component.extend({classNames:["cs-fonts"],fontManager:Ember.inject.service(),config:Ember.inject.service("config"),didInsertElement:function(){},fontDefinition:Ember.computed("selectedItem.family",function(){var e=[],t={source:this.get("selectedItem.source")}
"custom"===t.source&&(e=this.getWithDefault("fontConfig.value.customFontItems",[]).map(function(e){var t=e.family,n=[]
return e.files.forEach(function(e){var t="italic"===e.style?"".concat(e.weight,"i"):e.weight
n.includes(t)||n.push(t)}),{family:t,stack:'"'.concat(t,'"'),weights:n}})),"typekit"===t.source&&(e=this.getWithDefault("fontConfig.value.typekitItems",[])),"system"===t.source&&(e=r()),"google"===t.source&&(e=o())
var n=this.get("selectedItem.family"),a=e.find(function(e){return e.family===n})
return Ember.isNone(a)?this.get("fontManager.fallbackFont"):Ember.assign(t,a)}),availableWeights:Ember.computed("fontDefinition",function(){var e=this,t=this.get("fontDefinition.weights").reduce(function(t,n){var o=n.includes("i")?n.replace("italic","").replace("i",""):n
return t[o]?Ember.isArray(t[o].value)?t[o].value.push(n):t[o].value=[t[o].value,n]:t[o]={value:o,label:o,textLabel:e.get("i18n").t("app.font-weight.".concat(o))},t},{}),n=[]
for(var o in t)n.push(t[o])
return Ember.A(n)}),availableWeightsChanged:Ember.observer("fontDefinition.weights.[]",function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){var t=e.get("fontDefinition.weights"),n=e.get("selectedItem.weights").filter(function(e){return t.includes(e)})
e.set("selectedItem.weights",Ember.A(n)),e.updatePreviewWeight()})}),updatePreviewWeight:function(){var e=this.get("fontDefinition.weights")
e.includes(this.get("previewWeight"))||this.set("previewWeight",e.includes("400")?"400":e[0])},selectedFamily:Ember.computed("selectedItem.source","selectedItem.family",{get:function(){return"".concat(this.get("selectedItem.source"),":").concat(this.get("selectedItem.family"))},set:function(e,t){if("string"!=typeof t)return t
var n=this.get("selectChoices").find(function(e){return e.value===t})
return this.set("selectedItem.source",t.split(":").shift()),this.set("selectedItem.family",n.label),this.set("selectedItem.stack",n.stack),t}}),selectChoices:Ember.computed("fontConfig.value.typekitItems.[]","fontConfig.value.customFontItems.[]",function(){var e=[],t=this.get("i18n").t("app.fonts.group.custom"),n=this.get("i18n").t("app.fonts.group.adobe"),a=this.get("i18n").t("app.fonts.group.system"),i=this.get("i18n").t("app.fonts.group.google")
return this.getWithDefault("fontConfig.value.customFontItems",[]).forEach(function(n){e.push({value:"custom:".concat(n.family),label:n.family,stack:'"'.concat(n.family,'"'),group:t})}),this.getWithDefault("fontConfig.value.typekitItems",[]).forEach(function(t){e.push({value:"typekit:".concat(t.family),label:t.family,stack:t.stack,group:n})}),r().forEach(function(t){e.push({value:"system:".concat(t.family),label:t.family,stack:t.stack,group:a})}),o().forEach(function(t){e.push({value:"google:".concat(t.family),label:t.family,stack:t.stack,group:i})}),e}),actions:{preview:function(e){this.set("previewWeight",Ember.isArray(e)?e[0].replace("i",""):e)}}})
e.default=a}),define("tco-app/components/global/settings-modal/tab-fonts/font-canvas/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"IJjgnOmw",block:'{"symbols":["weight"],"statements":[[4,"if",[[27,"user-can",["fonts.change"],null]],null,{"statements":[[7,"div"],[11,"class","cs-fonts-settings"],[9],[0,"\\n  "],[1,[27,"forms/select-single",null,[["placeholder","options","value"],[[27,"t",["app.fonts.select-family"],null],[23,["selectChoices"]],[23,["selectedFamily"]]]]],false],[0,"\\n  "],[7,"ul"],[11,"class","cs-fonts-weights"],[9],[0,"\\n"],[4,"each",[[23,["availableWeights"]]],null,{"statements":[[0,"    "],[7,"li"],[9],[0,"\\n"],[4,"forms/rc-choice",null,[["value","arrayVal","wide","mode"],[[23,["selectedItem","weights"]],[22,1,["value"]],true,"array"]],{"statements":[[0,"      "],[7,"strong"],[9],[1,[22,1,["label"]],false],[10],[0," | "],[1,[22,1,["textLabel"]],false],[0,"\\n"]],"parameters":[]},null],[0,"      "],[7,"button"],[12,"class",[28,["cs-fonts-weight-preview ",[27,"if",[[27,"eq",[[23,["previewWeight"]],[22,1,["label"]]],null],"cs-active"],null]]]],[12,"onclick",[27,"action",[[22,0,[]],"preview",[22,1,["value"]]],null]],[9],[7,"span"],[9],[1,[27,"t",["app.fonts.preview"],null],false],[10],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[1]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[1,[27,"global/settings-modal/tab-fonts/preview-area",null,[["fontConfig","fontDefinition","selectedWeight"],[[23,["fontConfig"]],[23,["fontDefinition"]],[23,["previewWeight"]]]]],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/font-canvas/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/preview-area/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-fonts-preview"],fonts:Ember.inject.service("font-manager"),didInsertElement:function(){this.loadFont()},styleUpdated:0,loadFont:function(){var e=this
this.get("fonts").loadFont(this.get("fontDefinition")).then(function(){e.incrementProperty("styleUpdated")},function(e){console.warn("The font manager was unable to load the requested fonts",e)})},loadFontOnChange:Ember.observer("fontDefinition.family","fontConfig.value.googleSubsets.[]",function(){this.loadFont()}),style:Ember.computed("styleUpdated","selectedWeight",function(){return Ember.String.htmlSafe("font-family:".concat(this.get("fontDefinition.stack"),";font-weight:").concat(this.get("selectedWeight"),";"))})})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/preview-area/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"zfNXLR++",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"],[7,"div"],[11,"contenteditable","true"],[12,"style",[21,"style"]],[9],[1,[27,"t",["app.fonts.preview-text"],null],false],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/preview-area/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-custom/component",["exports","ember-copy"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n={family:"Custom Font Family",files:[]},o=Ember.Component.extend({fontManager:Ember.inject.service(),items:Ember.computed.alias("fontConfig.value.customFontItems"),lastIndex:Ember.computed("items.length",function(){return this.get("items.length")-1}),fileChange:Ember.observer("items.[]","items.@each.family",function(){this.get("fontManager").updateCustomFonts()}),didReceiveAttrs:function(){this.get("fontManager").updateCustomFonts()},actions:{updateLabel:function(e,t){Ember.set(e,"family",t)},addFirstItem:function(){this.send("addItem",{},0)},selectIndex:function(e){this.set("selectedIndex",e===this.get("selectedIndex")?"none":e)},moveItem:function(e,t){var n=this.get("items"),o=n.objectAt(e),r=n.slice(0,e),a=n.slice(e+1)
n=r.concat(a),r=n.slice(0,t),a=n.slice(t),r.push(o),this.set("items",r.concat(a))},addSiblingItem:function(e,t,n){this.send("addItem",{},n?e+1:e)},addItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0
Ember.isNone(t)&&(t=this.get("items.length"))
var o=this.get("items"),r=o.slice(0,t),a=o.slice(t)
r.push(Object.assign({},n,e)),this.set("items",r.concat(a)),this.set("selectedIndex",t)},duplicateItem:function(e,n){var o=(0,t.copy)(e)
o.family=this.get("i18n").t("app.copy-of",{title:o.family}).string,this.send("addItem",o,n+1)},deleteItem:function(e){this.set("items",this.get("items").filter(function(t,n){return e!==n}))}}})
e.default=o}),define("tco-app/components/global/settings-modal/tab-fonts/section-custom/cs-fonts/component",["exports"],function(e){function t(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=["woff2","woff","ttf","svg","eot"].reverse(),o={thin:"100",extralight:"200",ultralight:"200",light:"300",book:"400",normal:"400",regular:"400",roman:"400",medium:"500",semibold:"600",demibold:"600",extrabold:"800",ultrabold:"800",bold:"700",black:"900",heavy:"900"}
function r(e){var t=e.toLowerCase().replace(new RegExp("[^\\w\\d]|_","g"),""),n=Object.keys(o).find(function(e){return t.includes(e)})
if(n)return o[n]
var r=Object.keys(o).find(function(e){return t.includes(o[e])})
return r?o[r]:"400"}function a(e){return e.toLowerCase().includes("italic")?"italic":"regular"}var i=Ember.Component.extend({classNames:["cs-fonts","is-always-column"],fontManager:Ember.inject.service(),files:Ember.computed("item.files.[]",function(){var e=this.get("mimeTypes")
return this.get("item.files").filter(function(t){return e.includes(t.mime)}).sort(function(e,t){return Ember.compare(e.filename,t.filename)}).sort(function(e,t){return Ember.compare(n.indexOf(t.filename.split(".").pop()),n.indexOf(e.filename.split(".").pop()))})}),getFrame:function(){var e=this.get("frame")
return e||(e=this.createFrame(),this.set("frame",e)),e},mimeTypes:Ember.computed(function(){return Object.keys(window.csAppData.customFontMimeTypes).reduce(function(e,n){return[].concat(t(e),t(window.csAppData.customFontMimeTypes[n].split("|")))},[])}),createFrame:function(){var e=this,t=window.wp.media({library:{type:this.get("mimeTypes")},title:this.get("i18n").t("app.fonts.upload"),button:{text:this.get("i18n").t("app.fonts.select-files")},multiple:!0})
return t.on("select",function(){return e.send("select",t.state().get("selection").toJSON())}),t},fileChange:Ember.observer("files.[]","files.@each.url","files.@each.style","files.@each.weight","files.@each.filename",function(){this.get("fontManager").updateCustomFonts()}),actions:{addItem:function(e){var n=e.id,o=e.url,i=e.filename,s=e.mime
if(!this.get("files").find(function(e){return e.id===n})){var l={id:n,url:o,filename:i,mime:s,weight:r(i),style:a(i)}
this.set("item.files",[].concat(t(this.getWithDefault("item.files",[])),[l]))}},deleteFile:function(e){this.set("item.files",this.get("files").filter(function(t,n){return e!==n}))},import:function(){this.getFrame().open()},select:function(e){var t=this;(e||[]).forEach(function(e){return t.send("addItem",e)})},addToFontManager:function(){this.set("showAddToFontManager",!1),this.onAddToFontManager({title:this.get("addToFontManagerName"),item:this.get("item")})},toggleAddToFontManager:function(){var e=this
Ember.run.next(function(){e.set("addToFontManagerName",""),e.set("showAddToFontManager",!e.get("showAddToFontManager"))})},idleClosePopover:function(){this.set("showSaveTemplatePopover",!1)}}})
e.default=i}),define("tco-app/components/global/settings-modal/tab-fonts/section-custom/cs-fonts/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"PiGUzExK",block:'{"symbols":["file","index"],"statements":[[7,"ul"],[11,"class","cs-fonts-custom"],[9],[0,"\\n"],[4,"each",[[23,["files"]]],null,{"statements":[[0,"    "],[7,"li"],[9],[0,"\\n      "],[7,"div"],[9],[0,"\\n        "],[7,"span"],[9],[1,[22,1,["filename"]],false],[10],[0,"\\n        "],[1,[27,"forms/styled-select",null,[["value","options"],[[22,1,["weight"]],[27,"array",[[27,"hash",null,[["value","label"],["100","100"]]],[27,"hash",null,[["value","label"],["200","200"]]],[27,"hash",null,[["value","label"],["300","300"]]],[27,"hash",null,[["value","label"],["400","400"]]],[27,"hash",null,[["value","label"],["500","500"]]],[27,"hash",null,[["value","label"],["600","600"]]],[27,"hash",null,[["value","label"],["700","700"]]],[27,"hash",null,[["value","label"],["800","800"]]],[27,"hash",null,[["value","label"],["900","900"]]]],null]]]],false],[0,"\\n        "],[1,[27,"forms/styled-select",null,[["value","options"],[[22,1,["style"]],[27,"array",[[27,"hash",null,[["value","label"],["regular",[27,"t",["app.fonts.regular"],null]]]],[27,"hash",null,[["value","label"],["italic",[27,"t",["app.fonts.italic"],null]]]]],null]]]],false],[0,"\\n      "],[10],[0,"\\n      "],[7,"div"],[9],[0,"\\n        "],[7,"button"],[9],[1,[27,"icon",["fa-trash-alt"],null],false],[3,"action",[[22,0,[]],"deleteFile",[22,2,[]]],[["bubbles"],[false]]],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[1,2]},null],[10],[0,"\\n"],[7,"div"],[11,"class","cs-fonts-custom-import"],[9],[0,"\\n  "],[7,"button"],[11,"class","cs-btn cs-btn-sm"],[9],[1,[27,"t",["app.fonts.import-files"],null],false],[3,"action",[[22,0,[]],"import"]],[10],[0,"\\n"],[4,"if",[[27,"gt",[[23,["files","length"]],0],null]],null,{"statements":[[0,"    "],[7,"div"],[11,"style","position:relative;"],[9],[0,"\\n      "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"toggleAddToFontManager"],[["bubbles"],[false]]]],[11,"class","cs-btn cs-btn-sm"],[9],[1,[27,"t",["app.fonts.manager-add"],null],false],[10],[0,"\\n"],[4,"common/cs-popover",null,[["active","fixed","focusInput","side","onOutsideClick"],[[23,["showAddToFontManager"]],false,true,"top",[27,"action",[[22,0,[]],"idleClosePopover"],null]]],{"statements":[[0,"        "],[7,"div"],[11,"class","cs-popover-section is-compact is-footer"],[9],[0,"\\n          "],[1,[27,"input",null,[["type","class","enter","value","placeholder"],["text","cs-no-input-focus",[27,"action",[[22,0,[]],"addToFontManager"],null],[23,["addToFontManagerName"]],[27,"t",["app.fonts.item-name"],null]]]],false],[0,"\\n          "],[7,"button"],[11,"class","cs-btn"],[11,"style","max-width: 62px;"],[12,"onclick",[27,"action",[[22,0,[]],"addToFontManager"],[["bubbles"],[false]]]],[9],[1,[27,"t",["app.add"],null],false],[10],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/section-custom/cs-fonts/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-custom/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"QxOIldI+",block:'{"symbols":["item","index"],"statements":[[4,"common/sortable-container",null,[["canInlineAdd"],[false]],{"statements":[[4,"each",[[23,["items"]]],null,{"statements":[[4,"common/sortable-item",null,[["label","onUpdateLabel","item","itemIndex","active","onSelect","onDropIndex","onDuplicate","onDelete","hasDrawer"],[[22,1,["family"]],[27,"action",[[22,0,[]],"updateLabel",[22,1,[]]],null],[22,1,[]],[22,2,[]],[27,"eq",[[22,2,[]],[23,["selectedIndex"]]],null],[27,"action",[[22,0,[]],"selectIndex",[22,2,[]]],null],[27,"action",[[22,0,[]],"moveItem"],null],[27,"action",[[22,0,[]],"duplicateItem",[22,1,[]],[22,2,[]]],null],[27,"action",[[22,0,[]],"deleteItem",[22,2,[]]],null],true]],{"statements":[[1,[27,"global/settings-modal/tab-fonts/section-custom/cs-fonts",null,[["item","onAddToFontManager"],[[22,1,[]],[23,["onAddToFontManager"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[1,2]},null]],"parameters":[]},null],[0,"\\n"],[7,"button"],[11,"class","cs-sortable-ghost-add"],[12,"onclick",[27,"action",[[22,0,[]],"addItem"],null]],[9],[7,"strong"],[9],[1,[27,"icon",["fa-plus"],null],false],[1,[27,"t",["app.add"],null],false],[10],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/section-custom/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-display/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"dl"})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-display/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"/+xQ7RIF",block:'{"symbols":[],"statements":[[7,"dt"],[9],[1,[27,"t",["app.fonts.display.label"],null],false],[10],[0,"\\n"],[7,"dd"],[9],[0,"\\n  "],[1,[27,"forms/styled-select",null,[["options","value"],[[27,"array",[[27,"hash",null,[["value","label"],["auto","auto"]]],[27,"hash",null,[["value","label"],["block","block"]]],[27,"hash",null,[["value","label"],["swap","swap"]]],[27,"hash",null,[["value","label"],["fallback","fallback"]]],[27,"hash",null,[["value","label"],["optional","optional"]]]],null],[23,["fontConfig","value","fontDisplay"]]]]],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/section-display/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-google/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"dl",additionalSubsets:Ember.A([{value:"arabic",label:"Arabic"},{value:"bengali",label:"Bengali"},{value:"cyrillic",label:"Cyrillic"},{value:"cyrillic-ext",label:"Cyrillic Extended"},{value:"devanagari",label:"Devanagari"},{value:"greek",label:"Greek"},{value:"greek-ext",label:"Greek Extended"},{value:"gujarati",label:"Gujarati"},{value:"gurmukhi",label:"Gurmkhi"},{value:"hebrew",label:"Hebrew"},{value:"kannada",label:"Kannada"},{value:"khmer",label:"Khmer"},{value:"malayalam",label:"Malayalam"},{value:"myanmar",label:"Myanmar"},{value:"oriya",label:"Oriya"},{value:"sinhala",label:"Sinhala"},{value:"tamil",label:"Tamil"},{value:"thai",label:"Thai"},{value:"vietnamese",label:"Vietnamese"}])})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/section-google/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"HFrAVtaz",block:'{"symbols":[],"statements":[[7,"dt"],[9],[1,[27,"t",["app.fonts.google.subsets"],null],false],[10],[0,"\\n"],[7,"dd"],[9],[0,"\\n  "],[1,[27,"forms/select-multi",null,[["placeholder","options","value"],[[27,"t",["app.fonts.google.placeholder"],null],[23,["additionalSubsets"]],[23,["fontConfig","value","googleSubsets"]]]]],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/section-google/template.hbs"}})
e.default=t})
define("tco-app/components/global/settings-modal/tab-fonts/section-typekit/component",["exports","tco-app/src/lib/http"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({tagName:"dl",errorMessage:null,typekitItems:Ember.computed("fontConfig.value.typekitItems.[]",function(){return Ember.A(this.getWithDefault("fontConfig.value.typekitItems",[]).map(function(e){return{family:e.family,weights:e.weights.filter(function(e){return!e.includes("i")}).join(", ")}}))}),refreshDisabled:Ember.computed("refreshing",function(){return!!this.get("refreshing")||null}),updateTypeKit:function(){var e=this
return Ember.isArray(this.get("fontConfig.value.typekitItems"))?this.get("fontConfig.value.typekitItems").clear():this.set("fontConfig.value.typekitItems",Ember.A()),new Ember.RSVP.Promise(function(n,o){(0,t.request)("typekit::get_kit_by_id",{id:e.get("fontConfig.value.typekitKitID")}).then(function(t){if(!t||!t.kit||!t.kit.families)return o()
t.kit.families.map(function(e){return{family:e.name,stack:e.css_stack.replace(";",""),weights:e.variations.map(function(e){var t="i"===e.substr(0,1)?"i":""
return"".concat(e.substr(1,1),"00").concat(t)})}}).forEach(function(t){return e.get("fontConfig.value.typekitItems").addObject(t)}),n()},function(e){return o(e)})})},actions:{refresh:function(){var e=this
this.set("error",!1),this.set("refreshing",!0),this.updateTypeKit().then(function(){e.set("refreshing",!1)},function(t){e.set("refreshing",!1),e.set("error",!0),console.warn("Typekit error",t)})}}})
e.default=n}),define("tco-app/components/global/settings-modal/tab-fonts/section-typekit/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Ghgr8em6",block:'{"symbols":["item"],"statements":[[7,"dt"],[9],[1,[27,"t",["app.fonts.adobe.project-id"],null],false],[10],[0,"\\n"],[7,"dd"],[9],[1,[27,"input",null,[["value"],[[23,["fontConfig","value","typekitKitID"]]]]],false],[10],[0,"\\n"],[7,"dt"],[9],[1,[27,"t",["app.fonts.adobe.available"],null],false],[10],[0,"\\n"],[7,"dd"],[9],[0,"\\n  "],[7,"table"],[9],[0,"\\n"],[4,"unless",[[23,["refreshing"]]],null,{"statements":[[4,"if",[[23,["typekitItems"]]],null,{"statements":[[0,"        "],[7,"tr"],[9],[7,"th"],[9],[1,[27,"t",["app.fonts.adobe.fonts"],null],false],[10],[7,"th"],[9],[1,[27,"t",["app.fonts.adobe.weights"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},{"statements":[[4,"unless",[[23,["error"]]],null,{"statements":[[0,"          "],[7,"tr"],[9],[7,"td"],[11,"colspan","2"],[9],[1,[27,"t",["app.fonts.adobe.enter-id"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"          "],[7,"tr"],[9],[7,"td"],[11,"colspan","2"],[9],[1,[27,"t",["app.fonts.adobe.not-found"],null],false],[10],[10],[0,"\\n"]],"parameters":[]}]],"parameters":[]}],[4,"each",[[23,["typekitItems"]]],null,{"statements":[[0,"      "],[7,"tr"],[9],[7,"td"],[9],[1,[22,1,["family"]],false],[10],[7,"td"],[9],[1,[22,1,["weights"]],false],[10],[10],[0,"\\n"]],"parameters":[1]},null]],"parameters":[]},{"statements":[[0,"      "],[7,"tr"],[9],[7,"td"],[11,"colspan","2"],[9],[1,[27,"t",["app.fonts.adobe.refreshing"],null],false],[10],[10],[0,"\\n"]],"parameters":[]}],[0,"  "],[10],[0,"\\n  "],[7,"button"],[12,"disabled",[21,"refreshDisabled"]],[11,"class","cs-btn cs-btn-sm"],[12,"onclick",[27,"action",[[22,0,[]],"refresh"],null]],[9],[1,[27,"t",["app.fonts.adobe.refresh"],null],false],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/section-typekit/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-fonts/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"W5mBItK3",block:'{"symbols":["item"],"statements":[[4,"if",[[23,["isActive"]]],null,{"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n  "],[7,"h3"],[9],[1,[27,"t",["app.fonts.manager"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.fonts.description"],null],false],[10],[0,"\\n\\n"],[4,"common/sortable-container",null,[["canDrag","canInlineAdd"],[[27,"user-can",["fonts.change"],null],false]],{"statements":[[4,"each",[[23,["orderedFontItems"]]],null,{"statements":[[4,"common/sortable-item",null,[["active","item","label","canEditLabel","onUpdateLabel","labelInvalid","labelPlaceholder","onDrop","onSelect","onDuplicate","onDelete","hasDrawer"],[[27,"eq",[[22,1,["id"]],[23,["selectedItem","id"]]],null],[22,1,[]],[22,1,["title"]],[27,"user-can",["fonts.rename"],null],[27,"action",[[22,0,[]],"updateLabel",[22,1,[]]],null],[27,"contains",[[22,1,["_id"]],[23,["invalidItems"]]],null],[27,"t",["app.forms.label-input.placeholder"],null],[27,"action",[[22,0,[]],"moveFont"],null],[27,"action",[[22,0,[]],"selectFont",[22,1,[]]],null],[27,"if",[[27,"user-can",["fonts.create"],null],[27,"action",[[22,0,[]],"duplicateItem",[22,1,[]]],null],null],null],[27,"if",[[27,"user-can",["fonts.delete"],null],[27,"action",[[22,0,[]],"deleteItem",[22,1,[]]],null]],null],true]],{"statements":[[0,"  "],[1,[27,"global/settings-modal/tab-fonts/font-canvas",null,[["selectedItem","fontConfig"],[[22,1,[]],[23,["fontConfig"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[1]},null]],"parameters":[]},null],[0,"  "],[7,"button"],[11,"class","cs-sortable-ghost-add"],[12,"onclick",[27,"action",[[22,0,[]],"addNew"],null]],[9],[7,"strong"],[9],[1,[27,"icon",["fa-plus"],null],false],[1,[27,"t",["app.add"],null],false],[10],[10],[0,"\\n\\n"],[4,"if",[[27,"user-can",["fonts.manage-google"],null]],null,{"statements":[[0,"  "],[7,"h3"],[9],[1,[27,"t",["app.fonts.google.title"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.fonts.google.description"],null],false],[10],[0,"\\n  "],[1,[27,"global/settings-modal/tab-fonts/section-google",null,[["fontConfig"],[[23,["fontConfig"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"user-can",["fonts.manage-adobe-fonts"],null]],null,{"statements":[[0,"  "],[7,"h3"],[9],[1,[27,"t",["app.fonts.adobe.title"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.fonts.adobe.description"],null],false],[10],[0,"\\n  "],[1,[27,"global/settings-modal/tab-fonts/section-typekit",null,[["fontConfig"],[[23,["fontConfig"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"user-can",["fonts.manage-custom-fonts"],null]],null,{"statements":[[0,"  "],[7,"h3"],[9],[1,[27,"t",["app.fonts.custom.title"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.fonts.custom.description"],null],false],[10],[0,"\\n  "],[1,[27,"global/settings-modal/tab-fonts/section-custom",null,[["fontConfig","onAddToFontManager"],[[23,["fontConfig"]],[27,"action",[[22,0,[]],"createFromCustomFonts"],null]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n  "],[7,"h3"],[9],[1,[27,"t",["app.fonts.display.title"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.fonts.display.description"],null],false],[10],[0,"\\n  "],[1,[27,"global/settings-modal/tab-fonts/section-display",null,[["fontConfig"],[[23,["fontConfig"]]]]],false],[0,"\\n\\n"],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[27,"t",["app.save-thing"],[["context"],[[27,"t",["common.title.fonts"],null]]]],false],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-fonts/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/tab-preferences/component",["exports","tco-app/components/global/settings-modal/tab-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({tabData:Ember.computed(function(){return{name:"preferences",label:this.get("i18n").t("common.title.preferences")}}),preference:Ember.inject.service(),controls:Ember.computed.alias("preference.controls"),actions:{save:function(){this.get("preference").save()}}})
e.default=n}),define("tco-app/components/global/settings-modal/tab-preferences/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"qoItyyCN",block:'{"symbols":[],"statements":[[4,"if",[[23,["isActive"]]],null,{"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n  "],[7,"h3"],[9],[1,[27,"t",["common.title.preferences"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.preferences.description"],null],false],[10],[0,"\\n  "],[1,[27,"common/control-list",null,[["controls","class"],[[23,["controls"]],"cs-controls-settings"]]],false],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[27,"t",["app.save-thing"],[["context"],[[27,"t",["common.title.preferences"],null]]]],false],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/tab-preferences/template.hbs"}})
e.default=t}),define("tco-app/components/global/settings-modal/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"h6e4BHQb",block:'{"symbols":["item","item","&default"],"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"close"],null]],[11,"class","cs-tab-modal-close"],[12,"aria-label",[28,[[27,"t",["app.a11y.close"],null]]]],[9],[0,"\\n  "],[7,"span"],[9],[0,"×"],[10],[0,"\\n"],[10],[0,"\\n"],[7,"div"],[11,"class","cs-tab-modal-content-outer"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-tab-modal-content-inner"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-tab-modal-content"],[11,"role","document"],[9],[0,"\\n      "],[7,"nav"],[9],[0,"\\n"],[4,"each",[[23,["ui","settingsTabs"]]],null,{"statements":[[0,"        "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"nav",[22,2,[]]],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["ui","activeSettingsTab"]],[22,2,[]]],null],"cs-active"],null]]]],[9],[1,[27,"get",[[23,["ui","settingsLabels"]],[22,2,[]]],null],false],[10],[0,"\\n"]],"parameters":[2]},null],[4,"if",[[23,["ui","canShowCheatsheet"]]],null,{"statements":[[0,"        "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"nav","cheatsheet"],null]],[12,"class",[28,["cs-secondary ",[27,"if",[[27,"eq",[[23,["ui","activeSettingsTab"]],"cheatsheet"],null],"cs-active"],null]]]],[9],[1,[27,"t",["app.cheatsheet.title"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[10],[0,"\\n\\n      "],[14,3],[0,"\\n\\n"],[4,"if",[[27,"and",[[23,["ui","canShowCheatsheet"]],[27,"eq",[[23,["ui","activeSettingsTab"]],"cheatsheet"],null]],null]],null,{"statements":[[0,"      "],[7,"article"],[11,"class","cs-active"],[9],[0,"\\n"],[4,"common/scroll-box",null,null,{"statements":[[0,"        "],[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n"],[4,"each",[[23,["ui","cheatsheetItems"]]],null,{"statements":[[0,"          "],[1,[22,1,["content"]],true],[0,"\\n"]],"parameters":[1]},null],[0,"        "],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/settings-modal/template.hbs"}})
e.default=t}),define("tco-app/components/global/top-level/component",["exports","bowser","ember-redux"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.getParser(window.navigator.userAgent),r=Ember.Component.extend({ui:Ember.inject.service(),classNames:["cs-app","cs-forms"],classNameBindings:["routeNameClass","browserClass","ui.transitioning:cs-transitioning","quickConfirm:cs-delete-quick-confirm","controlNavClass"],browserClass:Ember.computed(function(){var e=Ember.String.dasherize(parseInt(o.getBrowserVersion(),10).toString()),t=Ember.String.dasherize(o.getBrowserName()),n=o.getOSName()
return"cs-browser-".concat(t," cs-browser-").concat(t,"-").concat(e," cs-os-").concat(n)}),controlNavClass:Ember.computed("controlNav",function(){var e=this.get("controlNav")
return"inline"===e?"":"cs-navigation-bar-is-active-".concat(e)}),routeNameClass:Ember.computed("ui.currentRouteName",function(){return this.getWithDefault("ui.currentRouteName","unknown").replace(new RegExp(/\./,"g"),"-").match(/(content-builder|headers-header|footers-footer|global-blocks-builder)/)?"is-builder":""}),didInsertElement:function(){(function(){var e,t
function n(){Ember.$(window).off("beforeunload.wp-auth-check"),Ember.$(document).off("heartbeat-tick.wp-auth-check"),window.wp.heartbeat.connectNow(),r().fadeOut(200,function(){r().addClass("hidden").css("display",""),Ember.$("#wp-auth-check-frame").remove(),Ember.$("body").removeClass("modal-open")})}function o(){t=(new Date).getTime()+18e4}function r(){return e||(e=Ember.$("#wp-auth-check-wrap"))}Ember.$(document).on("heartbeat-tick.wp-auth-check",function(e,t){"wp-auth-check"in t&&(o(),!t["wp-auth-check"]&&r().hasClass("hidden")?function(){var t,o=Ember.$("#wp-auth-check"),a=Ember.$("#wp-auth-check-form"),i=r().find(".wp-auth-fallback-expired"),s=!1
a.length&&(Ember.$(window).on("beforeunload.wp-auth-check",function(e){e.originalEvent.returnValue="Your session has expired. You can log in again from this page or go to the login page."}),(t=Ember.$('<iframe id="wp-auth-check-frame" frameborder="0">').attr("title",i.text())).on("load",function(){var t,l
s=!0,a.removeClass("loading")
try{l=Ember.$(this).contents().find("body"),t=l.height()}catch(e){return r().addClass("fallback"),o.css("max-height",""),a.remove(),void i.focus()}t?l&&l.hasClass("interim-login-success")?n():o.css("max-height","".concat(t+40,"px")):l&&l.length||(r().addClass("fallback"),o.css("max-height",""),a.remove(),i.focus())}).attr("src",a.data("src")),a.append(t))
Ember.$("body").addClass("modal-open"),r().removeClass("hidden"),t?(t.focus(),setTimeout(function(){s||(r().addClass("fallback"),a.remove(),i.focus())},1e4)):i.focus()}():t["wp-auth-check"]&&!r().hasClass("hidden")&&n())}).on("heartbeat-send.wp-auth-check",function(e,n){(new Date).getTime()>t&&(n["wp-auth-check"]=!0)}).ready(function(){o(),r().find(".wp-auth-check-close").on("click",function(){n()})})})(),this.set("ui.topLevelEl",this.get("element"))}})
var a=(0,n.connect)(function(){return function(e){var t=e.ui.quickConfirm
return{controlNav:e.builder.preferences.controlNav,quickConfirm:t}}})(r)
e.default=a}),define("tco-app/components/global/top-level/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ajWGOYiV",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/global/top-level/template.hbs"}})
e.default=t}),define("tco-app/components/head-content",["exports","tco-app/templates/head"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({tagName:"",model:Ember.inject.service("head-data"),layout:t.default})
e.default=n}),define("tco-app/components/head-layout",["exports","ember-cli-head/components/head-layout"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/components/hf-index/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-hf-index"],sortedEntriesAZ:Ember.computed.sort("entries",function(e,t){return Ember.compare(e.get("title"),t.get("title"))}),sortedEntries:Ember.computed.sort("sortedEntriesAZ",function(e,t){return Ember.compare(t.get("isNew"),e.get("isNew"))}),observeSelectedTemplate:Ember.observer("selectedTemplate",function(){this.get("selectedTemplate")&&(this.set("selected",null),this.set("defaultSelected",!1))}),actions:{selectEntry:function(e,t){this.set("defaultSelected",!1),this.set("selectedTemplate",null),this.set("selected",this.get("selected.id")!==Ember.get(e,"id")||t?e:null)},selectDefault:function(){this.set("selectedTemplate",null),this.set("selected",null),this.set("defaultSelected",!this.get("defaultSelected"))},titleUpdate:function(){this.onTitleUpdate.apply(this,arguments)}}})
e.default=t}),define("tco-app/components/hf-index/hf-assign/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-hf-index-assign"],classNameBindings:["isSearching:is-searching"],selected:Ember.computed("selectedEntry","assignments.value",function(){var e=this.get("selectedEntry.language.source")
e||(e=this.get("selectedEntry.id")),e&&(e=String(e))
var t=[],n=[],o=this.get("assignments.value"),r=this.get("assignContexts")
for(var a in o)o.hasOwnProperty(a)&&e===o[a]&&t.push(a)
for(var i in r)r.hasOwnProperty(i)&&t.includes(i)&&(r[i].value=i,n.push(r[i]))
return t.includes("global")&&n.push({value:"global"}),n}),resetSearchScroll:0,init:function(){this._super.apply(this,arguments)
var e=this.get("ui.search").getTarget("header-assign")
this.set("searchData",e),e.setOptions({id:"id",threshold:.15,distance:100,tokenize:!0,keys:[{name:"title",weight:.1},{name:"tag",weight:.8}]}),this.updateSearchIndex()},updateSearchIndex:function(){this.get("searchData").updateIndex(this.get("searchable").map(function(e){return{id:e.value,title:e.title,tag:e.tag}}))},searchObserver:Ember.observer("searchable",function(){this.updateSearchIndex()}),isGlobal:Ember.computed("selected",function(){return this.get("selected").map(function(e){return e.value}).includes("global")}),available:Ember.computed("searchable.[]","isSearching","searchResults.[]",function(){return this.get(this.get("isSearching")?"searchResults":"searchable")}),searchable:Ember.computed("assignContexts.[]","selected.[]",function(){var e=[],t=this.get("assignContexts"),n=this.get("selected").reduce(function(e,t){return e.push(t.value),e},[])
for(var o in t)n.includes(t[o].group)||(t[o].value=o,Ember.set(t[o],"selected",n.includes(o)||n.includes(t[o].group)),e.push(t[o]))
return e}),isSearching:Ember.computed.alias("searchData.isSearching"),searchResults:Ember.computed("searchable","searchData.results",function(){var e=this.get("searchData.results")
return this.get("searchable").filter(function(t){return e.includes(t.value)})}),actions:{close:function(){this.get("onClose")()},searchUpdated:function(){this.incrementProperty("resetSearchScroll")},setGlobal:function(){var e=this
if(!this.get("isGlobal")){var t=this.get("assignments"),n=t.get("value"),o=this.get("selectedEntry.id"),r=this.get("i18n").t("common.".concat(this.get("context"),".entity"))
n.global?this.get("ui").confirm({message:this.get("i18n").t("app.assign.collision-global",{context:r}),accept:function(){a.call(e)},acceptClass:"sad",acceptBtn:this.get("i18n").t("app.assign.collision-global-yep",{context:r}),declineBtn:this.get("i18n").t("app.assign.collision-global-nope",{context:r})}):a.call(this)}function a(){var e=this
for(var r in n)o===n[r]&&delete n[r]
n.global=o,t.set("value",n),t.save().then(function(){e.get("ui").notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("app.assign.entities")}),"success")})}},unsetGlobal:function(){this.send("remove",{value:"global"})},add:function(e){var t=this,n=this.get("assignments"),o=n.get("value"),r=this.get("selectedEntry.language.source")
r||(r=this.get("selectedEntry.id")),r&&(r=String(r))
var a=this.get("selected").filter(function(t){return t.group&&t.group===e.value}).map(function(e){return e.value})
if(o[e.value]){var i=this.get("i18n").t("common.".concat(this.get("context"),".entity"))
this.get("ui").confirm({message:this.get("i18n").t("app.assign.collision",{context:i}),accept:function(){s.call(t)}})}else s.call(this)
function s(){var t=this
o.global===r&&delete o.global,a.forEach(function(e){delete o[e]}),o[e.value]=r,n.set("value",o),n.save().then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.saved",{context:t.get("i18n").t("app.assign.entities")}),"success")})}},remove:function(e){var t=this,n=this.get("assignments"),o=n.get("value")
delete o[e.value],n.set("value",o),n.save().then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.saved",{context:t.get("i18n").t("app.assign.entities")}),"success")})}}})
e.default=t}),define("tco-app/components/hf-index/hf-assign/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"m7eb2rcb",block:'{"symbols":["item","item"],"statements":[[0,"\\n"],[4,"if",[[23,["selectedEntry"]]],null,{"statements":[[4,"if",[[23,["isGlobal"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-hf-index-assign-message-global"],[9],[0,"\\n      "],[1,[27,"icon",["fa-globe"],null],false],[0,"\\n      "],[7,"span"],[9],[1,[27,"t",["app.assign.global-message"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]],false],[10],[0,"\\n      "],[7,"button"],[11,"class","cs-btn cs-btn-sm"],[12,"onclick",[27,"action",[[22,0,[]],"unsetGlobal"],null]],[9],[1,[27,"t",["app.remove"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"    "],[1,[27,"common/search-bar",null,[["noFocus","target","placeholder","onSearch"],[true,"header-assign",[27,"t",["app.search"],null],[27,"action",[[22,0,[]],"searchUpdated"],null]]]],false],[0,"\\n"],[4,"common/scroll-box",null,[["linkedSearch"],["header-assign"]],{"statements":[[0,"\\n      "],[7,"div"],[12,"onclick",[27,"action",[[22,0,[]],"setGlobal"],null]],[11,"class","cs-hf-index-assignment cs-hf-index-assignment-global"],[9],[0,"\\n        "],[7,"span"],[9],[1,[27,"t",["app.assign.make-global"],null],false],[10],[0,"\\n      "],[10],[0,"\\n\\n"],[4,"if",[[23,["selected"]]],null,{"statements":[[0,"      "],[7,"div"],[11,"class","cs-hf-index-assigned"],[9],[0,"\\n"],[4,"each",[[23,["selected"]]],null,{"statements":[[0,"        "],[7,"div"],[12,"onclick",[27,"action",[[22,0,[]],"remove",[22,2,[]]],null]],[11,"class","cs-hf-index-assignment"],[9],[0,"\\n          "],[7,"span"],[11,"class","cs-hf-index-assignment-title"],[9],[1,[22,2,["title"]],false],[10],[0,"\\n          "],[4,"if",[[22,2,["tag"]]],null,{"statements":[[7,"span"],[11,"class","cs-hf-index-assignment-meta"],[9],[1,[22,2,["tag"]],false],[1,[22,2,["status"]],false],[10]],"parameters":[]},null],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[2]},null],[0,"      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"each",[[23,["available"]]],null,{"statements":[[4,"if",[[22,1,["selected"]]],null,{"statements":[],"parameters":[]},{"statements":[[0,"        "],[7,"div"],[12,"onclick",[27,"action",[[22,0,[]],"add",[22,1,[]]],null]],[12,"class",[28,["cs-hf-index-assignment ",[27,"if",[[22,1,["highlight"]],"cs-hf-index-assignment-highlight"],null]]]],[9],[0,"\\n          "],[7,"span"],[11,"class","cs-hf-index-assignment-title"],[9],[1,[22,1,["title"]],true],[10],[0,"\\n          "],[4,"if",[[22,1,["tag"]]],null,{"statements":[[7,"span"],[11,"class","cs-hf-index-assignment-meta"],[9],[1,[22,1,["tag"]],true],[1,[22,1,["status"]],true],[10]],"parameters":[]},null],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[]}]],"parameters":[1]},null],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"if",[[23,["entries"]]],null,{"statements":[[0,"    "],[1,[27,"workspace/workspace-message",null,[["title","message"],[[27,"concat",["← ",[27,"t",["app.select-thing"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]]],null],[27,"t",["app.assign.manage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"tco-app/components/hf-index/hf-assign/template.hbs"}})
e.default=t}),define("tco-app/components/hf-index/hf-create/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-hf-index-create"],templates:[],newTitle:"",mode:"blank",noTemplates:Ember.computed.lte("templateOptions.length",0),didReceiveAttrs:function(){!this.get("showCreateChoices")&&this.get("currentUser").can("".concat(this.get("context"),".create_from_template"))&&this.set("mode","template")},showCreateChoices:Ember.computed("currentUser.permissions","context",function(){return this.get("currentUser").can("".concat(this.get("context"),".create"))&&this.get("currentUser").can("".concat(this.get("context"),".create_from_template"))}),selectionChange:Ember.observer("selection",function(){var e=this
this.get("selection")?Ember.run.scheduleOnce("afterRender",function(){e.$().find("input.cs-hf-name-template-input").focus()}):this.set("newTitle","")}),actions:{setMode:function(e){"blank"===e&&this.set("selection",null),this.set("mode",e)},createBlank:function(){this.onCreate(this.get("newTitle"))},createFromTemplate:function(){this.onCreate(this.get("newTitle"),this.get("selection"))}}})
e.default=t}),define("tco-app/components/hf-index/hf-create/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"/sgGK8iF",block:'{"symbols":[],"statements":[[7,"h1"],[9],[1,[27,"t",["app.create-thing"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]],false],[10],[0,"\\n\\n"],[4,"if",[[23,["showCreateChoices"]]],null,{"statements":[[7,"div"],[11,"class","cs-hf-index-create-choices"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"setMode","blank"],null]],[12,"class",[28,[[27,"if",[[27,"eq",["blank",[23,["mode"]]],null],"cs-active"],null]]]],[9],[0,"\\n    "],[1,[27,"icon",["fa-file-alt"],null],false],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.create-index.start-blank"],null],false],[10],[0,"\\n  "],[10],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"setMode","template"],null]],[12,"class",[28,[[27,"if",[[27,"eq",["template",[23,["mode"]]],null],"cs-active"],null]]]],[9],[0,"\\n    "],[1,[27,"icon",["fa-file-image"],null],false],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.create-index.use-template"],null],false],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"div"],[11,"class","cs-hf-index-create-steps"],[9],[0,"\\n"],[4,"if",[[27,"eq",["blank",[23,["mode"]]],null]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-hf-index-create-step"],[9],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.name-thing"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]],false],[10],[0,"\\n    "],[1,[27,"input",null,[["type","class","enter","value"],["text","cs-no-input-focus",[27,"action",[[22,0,[]],"createBlank"],null],[23,["newTitle"]]]]],false],[0,"\\n    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"createBlank"],null]],[9],[1,[27,"t",["app.create"],null],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["noTemplates"]]],null,{"statements":[[0,"      "],[7,"div"],[11,"class","cs-hf-index-create-step"],[9],[0,"\\n        "],[7,"p"],[9],[0,"\\n          "],[1,[27,"t",["app.templates.no-thing-templates"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]],false],[0,"\\n          "],[7,"br"],[9],[10],[0,"\\n          "],[4,"link-to",["template-manager"],null,{"statements":[[1,[27,"t",["app.templates.visit-manager"],null],false]],"parameters":[]},null],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},{"statements":[[0,"      "],[7,"div"],[11,"class","cs-hf-index-create-step"],[9],[0,"\\n        "],[7,"span"],[9],[1,[27,"t",["app.select-thing"],[["context"],[[27,"t",["app.templates.entity"],null]]]],false],[10],[0,"\\n        "],[1,[27,"forms/select-single",null,[["placeholder","options","value"],[[27,"t",["app.choose"],null],[23,["templateOptions"]],[23,["selection"]]]]],false],[0,"\\n      "],[10],[0,"\\n"],[4,"if",[[23,["selection"]]],null,{"statements":[[0,"        "],[7,"div"],[11,"class","cs-hf-index-create-step"],[9],[0,"\\n          "],[7,"span"],[9],[1,[27,"t",["app.name-thing"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]],false],[10],[0,"\\n          "],[1,[27,"input",null,[["type","class","enter","value"],["text","cs-hf-name-template-input cs-no-input-focus",[27,"action",[[22,0,[]],"createFromTemplate"],null],[23,["newTitle"]]]]],false],[0,"\\n          "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"createFromTemplate"],null]],[9],[1,[27,"t",["app.create"],null],false],[10],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]}],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/hf-index/hf-create/template.hbs"}})
e.default=t}),define("tco-app/components/hf-index/hf-manage/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-hf-index-manage"],assignmentArray:Ember.computed("assignments.value",function(){var e=this.get("assignments.value"),t=[]
for(var n in e)e.hasOwnProperty(n)&&t.push({context:n,id:e[n]})
return t}),newEntry:0,scrollTo:0,observeNewEntry:Ember.observer("sortedEntries.@each.isNew",function(){var e=this
Ember.run.next(function(){var t=e.get("sortedEntries")
t&&(t.filter(function(e){return e.get("isNew")}),Ember.get(t,"length")>0&&Ember.run.next("afterRender",function(){e.set("scrollTo",{start:!0,duration:250,reset:!0})}))})}),entries:Ember.computed("assignmentArray.[]","sortedEntries.[]","activeLanguage",function(){var e=this,t=this.get("assignmentArray"),n=this.get("assignContexts"),o=this.get("ui.wpmlLanguages").length>0,r=this.get("activeLanguage")
return this.get("sortedEntries").map(function(o){var r=e.get("i18n").t("app.assign.unassigned").string,a=t.filter(function(e){return e.id==="".concat(o.get("id"))||e.id==="".concat(o.get("language.source"))})
if(1===a.length){if("global"===a[0].context)r=e.get("i18n").t("app.assign.global").string
else if(n[a[0].context]){var i=n[a[0].context]
r=i.tag?e.get("i18n").t("app.assign.tagged",{tag:i.tag,title:i.title}).string:i.title}}else 1<a.length&&(r=e.get("i18n").t("app.assign.multiple").string)
return{model:o,meta:r}}).filter(function(e){return!(o&&r!==e.model.get("language.code")&&!e.model.getWithDefault("language.fallback",[]).includes(r))})}),actions:{button:function(){this.onAction.apply(this,arguments)},select:function(){this.set("showSaveTemplatePopover",!1),this.onSelect.apply(this,arguments)},titleUpdate:function(){this.onTitleUpdate.apply(this,arguments)},selectDefault:function(){this.onSelectDefault()},toggleSaveTemplate:function(e){var t=this
Ember.run.next(function(){t.set("saveTemplateName",""),t.onSelect(e,!0)
var n=t.get("selectedSaveTemplateModel"),o=e.get("id")
n&&o===n?t.set("selectedSaveTemplateModel",null):t.set("selectedSaveTemplateModel",o),t.set("showSaveTemplatePopover",!!t.get("selectedSaveTemplateModel"))})},saveTemplate:function(){this.set("selectedSaveTemplateModel",null),this.set("showSaveTemplatePopover",!1),this.onSaveTemplate.apply(this,arguments)},templatePopoverLeaveView:function(e){this.get("selected.id")===e.get("id")&&this.get("showSaveTemplatePopover")&&(this.set("selectedSaveTemplateModel",null),this.set("showSaveTemplatePopover",!1))},idleClosePopover:function(){this.set("showSaveTemplatePopover",!1)}}})
e.default=t}),define("tco-app/components/hf-index/hf-manage/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"9uA2dswN",block:'{"symbols":["entry"],"statements":[[4,"common/scroll-box",null,[["resetScrollOn","scrollTo"],[[23,["newEntry"]],[23,["scrollTo"]]]],{"statements":[[0,"\\n"],[4,"each",[[23,["entries"]]],null,{"statements":[[0,"\\n"],[4,"common/index-entry",null,[["title","meta","selected","isNew","onClick","canEdit","titleUpdate"],[[22,1,["model","title"]],[22,1,["meta"]],[27,"eq",[[22,1,["model","id"]],[23,["selected","id"]]],null],[22,1,["model","isNew"]],[27,"action",[[22,0,[]],"select",[22,1,["model"]]],null],[27,"user-can",[[27,"concat",[[23,["context"]],".rename"],null]],null],[27,"action",[[22,0,[]],"titleUpdate",[22,1,["model"]]],null]]],{"statements":[[4,"if",[[27,"contains",[[23,["activeLanguage"]],[22,1,["model","language","fallback"]]],null]],null,{"statements":[[0,"        "],[4,"link-to",[[23,["editRoute"]],[22,1,["model","id"]],[27,"query-params",null,[["lang"],[[23,["activeLanguage"]]]]]],null,{"statements":[[1,[27,"t",["app.translate"],null],false]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},{"statements":[[0,"        "],[4,"link-to",[[23,["editRoute"]],[22,1,["model","id"]]],null,{"statements":[[1,[27,"t",["app.edit"],null],false]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"user-can",[[27,"concat",[[23,["context"]],".create"],null]],null]],null,{"statements":[[0,"          "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"button","entryDuplicate",[22,1,["model"]]],[["bubbles"],[false]]]],[9],[1,[27,"t",["app.copy"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",[[27,"concat",[[23,["context"]],".delete"],null]],null]],null,{"statements":[[0,"          "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"button","entryDelete",[22,1,["model"]]],[["allowedKeys","bubbles"],["shift",false]]]],[12,"class",[28,[[27,"if",[[23,["ui","deleteConfirm"]],"cs-danger"],null]]]],[9],[1,[27,"t",["app.delete"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",[[27,"concat",[[23,["context"]],".save_as_template"],null]],null]],null,{"statements":[[0,"          "],[7,"div"],[11,"style","position:relative;"],[9],[0,"\\n            "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"toggleSaveTemplate",[22,1,["model"]]],[["bubbles"],[false]]]],[9],[1,[27,"t",["app.templates.save-as"],null],false],[10],[0,"\\n"],[4,"common/cs-popover",null,[["active","fixed","focusInput","side","onOutsideClick"],[[27,"and",[[27,"eq",[[22,1,["model","id"]],[23,["selected","id"]]],null],[23,["showSaveTemplatePopover"]]],null],true,true,"top",[27,"action",[[22,0,[]],"idleClosePopover"],null]]],{"statements":[[0,"              "],[7,"div"],[11,"class","cs-popover-section is-compact is-footer"],[9],[0,"\\n                "],[1,[27,"input",null,[["type","class","enter","value","placeholder"],["text","cs-no-input-focus",[27,"action",[[22,0,[]],"saveTemplate",[22,1,["model"]],[23,["saveTemplateName"]]],null],[23,["saveTemplateName"]],[27,"t",["app.thing-name"],[["context"],[[27,"t",["app.templates.entity"],null]]]]]]],false],[0,"\\n                "],[7,"button"],[11,"class","cs-btn"],[11,"style","max-width: 62px;"],[12,"onclick",[27,"action",[[22,0,[]],"saveTemplate",[22,1,["model"]],[23,["saveTemplateName"]]],[["bubbles"],[false]]]],[9],[1,[27,"t",["app.save"],null],false],[10],[0,"\\n              "],[10],[0,"\\n"]],"parameters":[]},null],[0,"          "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null]],"parameters":[1]},{"statements":[[0,"    "],[1,[27,"workspace/workspace-message",null,[["title","message"],[[27,"concat",["← ",[27,"t",["app.create-thing"],[["context"],[[27,"t",[[27,"concat",["common.",[23,["context"]],".entity"],null]],null]]]]],null],[27,"t",["app.create-index.manage-blank"],null]]]],false],[0,"\\n"]],"parameters":[]}],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/hf-index/hf-manage/template.hbs"}})
e.default=t}),define("tco-app/components/hf-index/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"89Px4PCK",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n\\n"],[4,"if",[[27,"or",[[27,"user-can",[[27,"concat",[[23,["context"]],".create"],null]],null],[27,"user-can",[[27,"concat",[[23,["context"]],".create_from_template"],null]],null]],null]],null,{"statements":[[0,"  "],[1,[27,"hf-index/hf-create",null,[["context","templateOptions","selection","onCreate"],[[23,["context"]],[23,["templateOptions"]],[23,["selectedTemplate"]],[23,["onCreate"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[1,[27,"hf-index/hf-manage",null,[["context","assignContexts","assignments","sortedEntries","onAction","editRoute","onSelect","onSelectDefault","onTitleUpdate","onSaveTemplate","activeLanguage","defaultSelected","selected"],[[23,["context"]],[23,["assignContexts"]],[23,["assignments"]],[23,["sortedEntries"]],[23,["onAction"]],[23,["editRoute"]],[27,"action",[[22,0,[]],"selectEntry"],null],[27,"action",[[22,0,[]],"selectDefault"],null],[27,"action",[[22,0,[]],"titleUpdate"],null],[23,["onSaveTemplate"]],[23,["activeLanguage"]],[23,["defaultSelected"]],[23,["selected"]]]]],false],[0,"\\n\\n"],[4,"if",[[27,"and",[[23,["sortedEntries"]],[27,"user-can",[[27,"concat",[[23,["context"]],".manage_assignments"],null]],null]],null]],null,{"statements":[[0,"  "],[1,[27,"hf-index/hf-assign",null,[["entries","context","assignments","selectedEntry","assignContexts"],[[23,["sortedEntries"]],[23,["context"]],[23,["assignments"]],[23,["selected"]],[23,["assignContexts"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/hf-index/template.hbs"}})
e.default=t}),define("tco-app/components/options/launch-footers/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({service:Ember.inject.service("options"),store:Ember.inject.service(),classNames:["cs-workspace-intro"],classicMode:Ember.computed.alias("service.virtualValues.classicFooters"),actions:{switchBack:function(){var e=this
this.get("ui").confirm({message:this.get("i18n").t("app.options.footers.confirm-switch-back"),accept:function(){var t=e.get("store").peekRecord("option","cornerstone_footer_assignments"),n=t.get("value")
delete n.global
var o=e.get("ui")
o.beginSaveProgress(),t.set("value",n),t.save().then(function(){o.notify(e.get("i18n").t("app.options.footers.notify-switch-back"),"success"),o.endSaveProgress(),e.set("classicMode",!0),e.get("service").trigger("option.value.changed")})},acceptClass:"sad",acceptBtn:this.get("i18n").t("app.confirm-yep"),declineBtn:this.get("i18n").t("app.confirm-nope")})}}})
e.default=t}),define("tco-app/components/options/launch-footers/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"DvdQO4Jo",block:'{"symbols":[],"statements":[[4,"if",[[23,["ui","isPro"]]],null,{"statements":[[4,"if",[[27,"user-can",["footers.manage_assignments"],null]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-workspace-actions"],[9],[0,"\\n"],[4,"link-to",["footers"],null,{"statements":[[0,"        "],[1,[27,"icon",["fa-external-link-alt"],null],false],[0,"\\n        "],[7,"span"],[9],[1,[27,"t",["app.options.footers.launch-builder"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["classicMode"]]],null,{"statements":[[0,"    "],[7,"p"],[9],[1,[27,"t",["app.options.footers.is-original"],null],false],[10],[0,"\\n"],[4,"if",[[27,"user-can",["footers.manage_assignments"],null]],null,{"statements":[[0,"      "],[7,"p"],[9],[1,[27,"t",["app.options.footers.assign"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[0,"    "],[7,"p"],[9],[1,[27,"t",["app.options.footers.is-pro"],null],false],[10],[0,"\\n"],[4,"if",[[27,"user-can",["footers.manage_assignments"],null]],null,{"statements":[[0,"      "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"switchBack"],null]],[9],[1,[27,"t",["app.options.footers.switch-back"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/options/launch-footers/template.hbs"}})
e.default=t}),define("tco-app/components/options/launch-headers/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({service:Ember.inject.service("options"),store:Ember.inject.service(),classNames:["cs-workspace-intro"],classicMode:Ember.computed.alias("service.virtualValues.classicHeaders"),actions:{switchBack:function(){var e=this
this.get("ui").confirm({message:this.get("i18n").t("app.options.headers.confirm-switch-back"),accept:function(){var t=e.get("store").peekRecord("option","cornerstone_header_assignments"),n=t.get("value")
delete n.global
var o=e.get("ui")
o.beginSaveProgress(),t.set("value",n),t.save().then(function(){o.notify(e.get("i18n").t("app.options.headers.notify-switch-back"),"success"),o.endSaveProgress(),e.set("classicMode",!0),e.get("service").trigger("option.value.changed")})},acceptClass:"sad",acceptBtn:this.get("i18n").t("app.confirm-yep"),declineBtn:this.get("i18n").t("app.confirm-nope")})}}})
e.default=t}),define("tco-app/components/options/launch-headers/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Na1AWtwK",block:'{"symbols":[],"statements":[[4,"if",[[23,["ui","isPro"]]],null,{"statements":[[4,"if",[[27,"user-can",["headers.manage_assignments"],null]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-workspace-actions"],[9],[0,"\\n"],[4,"link-to",["headers"],null,{"statements":[[0,"        "],[1,[27,"icon",["fa-external-link-alt"],null],false],[0,"\\n        "],[7,"span"],[9],[1,[27,"t",["app.options.headers.launch-builder"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["classicMode"]]],null,{"statements":[[0,"    "],[7,"p"],[9],[1,[27,"t",["app.options.headers.is-original"],null],false],[10],[0,"\\n"],[4,"if",[[27,"user-can",["headers.manage_assignments"],null]],null,{"statements":[[0,"      "],[7,"p"],[9],[1,[27,"t",["app.options.headers.assign"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[0,"    "],[7,"p"],[9],[1,[27,"t",["app.options.headers.is-pro"],null],false],[10],[0,"\\n"],[4,"if",[[27,"user-can",["headers.manage_assignments"],null]],null,{"statements":[[0,"      "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"switchBack"],null]],[9],[1,[27,"t",["app.options.headers.switch-back"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/options/launch-headers/template.hbs"}})
e.default=t}),define("tco-app/components/options/option-search-result/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({isVisible:Ember.computed.alias("control.isVisible"),classNames:["cs-workspace-sections-search-result"],nav:Ember.computed("control.section",function(){var e=this.get("control.section")
if(!e)return!1
var t=e.get("parent"),n={id:!1,route:"options.section",label:"&nbsp"}
if(e.get("panel"))n.id=e.get("id"),n.label=e.get("title")
else{n.id=t.get("id"),n.sub=e.get("id")
var o=[t.get("title"),e.get("title")]
this.get("ui.isRTL")?(o.reverse(),n.label=o.join(" &larr; ")):n.label=o.join(" &rarr; ")}return!(!n.id||"root"===n.id)&&n}),actions:{targetSubHeading:function(e){this.get("ui").oneTimeValue("options/search-goto-sub-heading",e)}}})
e.default=t}),define("tco-app/components/options/option-search-result/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Y2sfxkWP",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"],[4,"if",[[23,["nav"]]],null,{"statements":[[4,"link-to",[[23,["nav","route"]],[23,["nav","id"]]],[["class","invokeAction"],["cs-workspace-section-sub-heading",[27,"action",[[22,0,[]],"targetSubHeading",[23,["nav","sub"]]],null]]],{"statements":[[1,[23,["nav","label"]],true]],"parameters":[]},null]],"parameters":[]},{"statements":[[0," "]],"parameters":[]}],[0,"\\n"],[1,[27,"component",[[27,"locate-component",[[27,"concat",["controls/control-",[23,["control","type"]]],null],"controls/control-base"],null]],[["control"],[[23,["control"]]]]],false]],"hasEval":false}',meta:{moduleName:"tco-app/components/options/option-search-result/template.hbs"}})
e.default=t}),define("tco-app/components/options/option-section-content/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace-sections"],classNameBindings:["name"],isVisible:Ember.computed.alias("section.isVisible"),name:Ember.computed.alias("section.id"),description:Ember.computed.alias("section.description"),descriptionComponentPath:Ember.computed("description",function(){var e=this.getWithDefault("description","")
return 0===e.indexOf("component:")&&e.split(":")[1]})})
e.default=t}),define("tco-app/components/options/option-section-content/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"QMvmtJVR",block:'{"symbols":["child"],"statements":[[4,"unless",[[23,["section","panel"]]],null,{"statements":[[7,"h4"],[11,"class","cs-workspace-section-sub-heading"],[9],[1,[23,["section","title"]],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["descriptionComponentPath"]]],null,{"statements":[[1,[27,"component",[[23,["descriptionComponentPath"]]],null],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"if",[[23,["description"]]],null,{"statements":[[7,"p"],[11,"class","cs-workspace-section-description"],[9],[7,"span"],[9],[1,[27,"t",["app.options.info"],null],false],[10],[1,[21,"description"],true],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[23,["section","controls"]]],null,{"statements":[[1,[27,"common/control-list",null,[["controls"],[[23,["section","controls"]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"each",[[23,["section","children"]]],null,{"statements":[[4,"unless",[[22,1,["isHidden"]]],null,{"statements":[[4,"if",[[22,1,["panel"]]],null,{"statements":[[4,"link-to",["options.section",[22,1,["id"]]],[["class"],["cs-workspace-section-goto"]],{"statements":[[1,[22,1,["title"]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[1,[27,"options/option-section-content",null,[["section"],[[22,1,[]]]]],false],[0,"\\n"]],"parameters":[]}]],"parameters":[]},null]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/options/option-section-content/template.hbs"}})
e.default=t}),define("tco-app/components/options/option-section-header/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace-section-nav"],breadcrumbs:Ember.computed("section.parent",function(){for(var e=[],t=this.get("section.parent");t&&"root"!==t.get("id");)e.push({route:"options.section",id:t.get("id"),label:t.get("title")}),t=t.get("parent")
return e.reverse(),e.unshift({route:"options",label:this.get("i18n").t("app.options.title")}),Ember.A(e)}),backUp:Ember.computed("breadcrumbs",function(){var e=this.get("breadcrumbs")
return e.objectAt(e.length-1)})})
e.default=t}),define("tco-app/components/options/option-section-header/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"3WaN/ihy",block:'{"symbols":["breadcrumb"],"statements":[[4,"if",[[23,["backUp","id"]]],null,{"statements":[[0,"  "],[4,"link-to",[[23,["backUp","route"]],[23,["backUp","id"]]],[["class"],["cs-workspace-section-nav-back"]],{"statements":[[0,"◀"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},{"statements":[[0,"  "],[4,"link-to",[[23,["backUp","route"]]],[["class"],["cs-workspace-section-nav-back"]],{"statements":[[0,"◀"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]}],[7,"div"],[11,"class","cs-workspace-section-nav-info"],[9],[0,"\\n  "],[7,"ul"],[11,"class","cs-workspace-section-nav-info-breadcrumbs"],[9],[0,"\\n    "],[4,"each",[[23,["breadcrumbs"]]],null,{"statements":[[4,"if",[[22,1,["route"]]],null,{"statements":[[4,"if",[[22,1,["id"]]],null,{"statements":[[7,"li"],[9],[4,"link-to",[[22,1,["route"]],[22,1,["id"]]],null,{"statements":[[1,[22,1,["label"]],false]],"parameters":[]},null],[10]],"parameters":[]},{"statements":[[7,"li"],[9],[4,"link-to",[[22,1,["route"]]],null,{"statements":[[1,[22,1,["label"]],false]],"parameters":[]},null],[10]],"parameters":[]}]],"parameters":[]},{"statements":[[7,"li"],[9],[7,"span"],[9],[1,[22,1,["label"]],false],[10],[10]],"parameters":[]}]],"parameters":[1]},null],[0,"\\n  "],[10],[0,"\\n  "],[7,"h3"],[11,"class","cs-workspace-section-nav-info-title"],[9],[1,[23,["section","title"]],true],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/options/option-section-header/template.hbs"}})
e.default=t}),define("tco-app/components/preview/cs-observer/component",["exports","ember-redux","tco-app/src/util/scrollbar-width"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=(0,t.connect)(function(){return function(e){return{hideWorkspace:e.ui.hideWorkspace}}})(Ember.Component.extend({preview:Ember.inject.service(),classNames:["cs-observer"],classNameBindings:["mode","edge","inactive","class"],visible:Ember.computed.alias("hideWorkspace"),attributeBindings:["style"],style:Ember.computed("hideWorkspace",function(){return this.get("hideWorkspace")?"display:none;":""}),active:!0,disabled:Ember.computed.not("active"),noTarget:Ember.computed.not("targetData"),inactive:Ember.computed.or("disabled","noTarget","silent"),silent:Ember.computed.equal("mode","silent"),observeAttr:"cs-observeable",eventNs:null,label:Ember.computed("targetData",function(){return this.getWithDefault("targetData.label",this.getWithDefault("targetData.title",""))}),mode:Ember.computed("targetData","targetData.mode",function(){return this.getWithDefault("targetData.mode","")}),edge:Ember.computed("visibleEdges",function(){var e=this.getWithDefault("visibleEdges","top left"),t=e.includes("top")?"top":"bottom"
"bottom"!==t||e.includes("bottom ")||(t="top-inside")
var n=e.includes("left")?"left":"right"
return"".concat(t," ").concat(n)}),scrollBarWidth:Ember.computed.alias("ui.scrollBarWidth"),updatePosition:function(){if(!this.isDestroyed){var e=this.get("targetElement")
if(e){var t=2
try{t=parseInt(window.getComputedStyle(this.get("element")).borderWidth)}catch(d){}var o=e.getBoundingClientRect(),r=[],a=window.innerWidth-(0,n.scrollBarWidth)(),i=window.innerHeight
o.top-22>=0&&r.push("top"),o.right>a&&r.push("right"),o.bottom+22<i&&r.push("bottom"),o.left>=0&&r.push("left"),this.set("visibleEdges",r.join(" "))
var s=this.getWithDefault("targetData.insetOutline",!1)?0:t,l=Math.max(0,o.top-s),c=Math.max(0,o.left-s),u=o.width,p=o.height
l>0&&(p+=s),c>0&&(u+=s),c+u+s<=a&&(u+=s),l+p+s<=i&&(p+=s),this.$().css({top:l,left:c,width:u,height:p})}}},onMouseMove:function(e){e.csObserverCancel||Ember.$.contains(this.get("element"),e.target)||this.get("preview.dragging")||this.get("maybeDragging")||(e.csObserverCancel=!0,this.set("nextTarget",{root:e.currentTarget,src:e.target}),Ember.run.cancel(this.leaving),Ember.run.throttle(this,this.newTarget,115))},newTarget:function(){var e=this,t=this.get("nextTarget.root")
try{this.set("targetData",JSON.parse(t.getAttribute("data-".concat(this.get("observeAttr")))))}catch(o){return}var n=t
Ember.$(this.get("nextTarget.src")).parentsUntil(t).each(function(){"fixed"===Ember.$(this).css("position")&&(n=this)}),this.set("targetElement",n),Ember.run.scheduleOnce("afterRender",function(){e.updatePosition()})},onMousedownGlobal:function(){this.set("maybeDragging",!0)},onMouseupGlobal:function(){this.set("maybeDragging",!1)},onMouseup:function(e){e.target.closest("a")&&(e.metaKey||1===e.button)||Ember.run.debounce(this,this.sendClickAction,0)},sendClickAction:function(){if(!(this.get("preview.dragging")||this.get("disabled")||this.get("silent"))){this.set("maybeDragging",!1)
var e=this.get("eventNs"),t=this.get("targetData.action")
console.log({eventNs:e,action:t}),e&&t&&this.get("preview").message(e,t)}},onMouseLeave:function(e){var t=this
Ember.$.contains(this.get("element"),e.relatedTarget||e.toElement)||(this.set("maybeDragging",!1),Ember.run.cancel(this.leaving),this.leaving=Ember.run.later(this,function(){t.completeLeave()},100))},completeLeave:function(){this.isDestroyed||(this.set("targetData",null),this.set("targetElement",null))},onScroll:function(){this.updatePosition()},init:function(){this._super.apply(this,arguments),this.set("onScroll",this.get("onScroll").bind(this)),this.set("onMouseup",this.get("onMouseup").bind(this)),this.set("onMouseupGlobal",this.get("onMouseupGlobal").bind(this)),this.set("onMousedownGlobal",this.get("onMousedownGlobal").bind(this)),this.set("onMouseMove",this.get("onMouseMove").bind(this)),this.set("onMouseLeave",this.get("onMouseLeave").bind(this))},didInsertElement:function(){var e=this
this.interval=setInterval(function(){return e.updatePosition()},250),Ember.$(window).on("scroll",this.get("onScroll")),Ember.$("body").on("mouseover mouseenter mousemove","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseMove")).on("mouseleave","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseLeave")).on("mouseup","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseup")).on("mouseup",this.get("onMouseupGlobal")).on("mousedown",this.get("onMousedownGlobal"))},willDestroyElement:function(){clearInterval(this.interval),Ember.$(window).off("scroll",this.get("onScroll")),Ember.$("body").off("mouseover mouseenter mousemove","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseMove")).off("mouseleave","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseLeave")).off("mouseup","[data-".concat(this.get("observeAttr"),"]"),this.get("onMouseup")).off("mouseup",this.get("onMouseupGlobal")).off("mousedown",this.get("onMousedownGlobal"))},actions:{button:function(){var e=this.get("eventNs"),t=this.get("targetData.button.action")
e&&t&&this.get("preview").message(e,t)}}}))
e.default=o}),define("tco-app/components/preview/cs-observer/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Yv27h81v",block:'{"symbols":[],"statements":[[7,"div"],[11,"class","cs-observer-label"],[9],[7,"span"],[9],[1,[21,"label"],true],[10],[10],[0,"\\n"],[4,"if",[[23,["targetData","button"]]],null,{"statements":[[0,"  "],[7,"a"],[11,"class","cs-observer-button"],[12,"onclick",[27,"action",[[22,0,[]],"button"],null]],[9],[1,[23,["targetData","button","label"]],false],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/preview/cs-observer/template.hbs"}})
e.default=t})
define("tco-app/components/preview/preview-builder/component",["exports","ember-redux","tco-app/src/util/dragula","tco-app/mixins/preview-listener","tco-app/src/actions/ui"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=Ember.Component.extend(o.default,{preview:Ember.inject.service(),store:Ember.inject.service(),redux:Ember.inject.service(),customCSSContext:"content",regions:[],init:function(){var e=this
this._super.apply(this,arguments)
var t=[]
this.get("regions").forEach(function(n){var o=function(t){switch(t){case"footer":return e.set("context","footers"),"x_colophon"
case"content":return"cs_content"
case"top":case"left":case"bottom":case"right":return e.set("context","headers"),"x_masthead"}return null}(n),r=document.querySelector('[data-cs-zone="'.concat(o,'"]'))
r?t.push({name:n,zone:r}):(e.get("preview").notateMissingZone(o),console.log("Could not render region ".concat(n," into ").concat(o)))}),this.set("regionsWithZones",t),this.componentListenTo("preview:resume-drag",function(){e.get("redux").dispatch((0,r.uiUpdate)({previewSuspendDrag:!0})),document.addEventListener("mousemove",e.get("eventualDragResume"),!1)}),this.componentListenTo("preview:drag-existing-end",function(){var t=e.get("elementDrake")
t&&t.cancel&&t.cancel()}),this.set("eventualDragStart",this.get("eventualDragStart").bind(this)),this.set("eventualDragResume",this.get("eventualDragResume").bind(this)),this.set("stopDragging",this.get("stopDragging").bind(this))},didInsertElement:function(){var e=this
this.updateCustomCSS(),this.setupDragging(),Ember.run.later(function(){return e.get("preview").removePreloader()},50)},setupDragging:function(){var e=this,t=this.get("currentUser").can("".concat(this.get("context"),".elements_move")),o=(0,n.default)({isContainer:function(e){return e&&!!e.classList&&(e.classList.contains("cs-drop-target")||e.classList.contains("cs-indicator-container"))},moves:function(n){if(!n.classList)return!1
if(n.classList.contains("cs-is-inline-editing"))return!1
if(!e.get("hideWorkspace")){var o=!!n.classList&&n.classList.contains("cs-indicator")
return!(!t&&!o)&&(!!n.classList&&(o||n.classList.contains("cs-element-preview")&&n.classList.contains("cs-draggable")))}},accepts:function(e){return!!e.classList&&(e.classList.contains("cs-element-preview")&&e.classList.contains("cs-draggable")||e.classList.contains("cs-indicator"))},offset:function(e){return e.x=0,e.y=0,e},copy:function(e){return!!e.classList&&e.classList.contains("cs-indicator")},hideIndicator:!0,revertOnSpill:!0,direction:function(e,t,n,o){var r,a=(r=e).currentStyle||window.getComputedStyle(r),i=a.flexDirection
return"flex"===a.display&&!["column","column-reverse"].includes(i)}})
o.on("drag",function(t){if(t.classList&&t.classList.contains("cs-indicator")){if(o.incoming){var n=new MouseEvent("mousedown",{buttons:1,which:1,view:window,bubbles:!0,cancelable:!0,synthetic:!0})
t.dispatchEvent(n,!0)}o.incoming=!1}else e.get("preview").message("drag-existing")
e.set("preview.dragging",!0)}),o.on("drop",function(e,t,n){t!==n&&(e.style.display="none",o.cancel(!0))}),o.on("dragend",function(){e.send("uiResetLiftedElement"),e.set("preview.dragging",!1),e.get("redux").dispatch((0,r.uiUpdate)({previewSuspendDrag:!1}))}),this.set("elementDrake",o)},customCSS:Ember.computed.alias("preview.previewPackage.customCSS"),customCSSObserver:Ember.observer("customCSS",function(){this.updateCustomCSS()}),updateCustomCSS:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){Ember.$("style#".concat(e.get("customCSSContext"),"-custom-css")).remove()
var t=Ember.$('<style id="'.concat(e.get("customCSSContext"),'-custom-css">').concat(e.get("customCSS"),"</style>")),n=e.get("preview.initialRouteConfig.dynamic_css_selector")
Ember.$(n||"style#x-generated-css").after(t)})},observeIncomingElement:Ember.observer("incomingElement",function(){var e=this.get("incomingElement")
e?(this.set("preview.dragging",e.type),document.addEventListener("mousemove",this.get("eventualDragStart"),!1)):(document.removeEventListener("mousemove",this.get("eventualDragStart"),!1),this.get("elementDrake").cancel(),this.set("preview.dragging",!1))}),eventualDragStart:function(){if(!this.isDestroyed){this.get("preview").message("suspend-drag")
var e=this.get("elementDrake")
e.incoming=!0,e.start(this.$(".cs-indicator")[0]),document.removeEventListener("mousemove",this.get("eventualDragStart"),!1),document.addEventListener("mouseup",this.get("stopDragging"),!1)}},eventualDragResume:function(){this.get("redux").dispatch((0,r.uiUpdate)({previewSuspendDrag:!1})),this.get("preview").message("suspend-drag"),this.isDestroyed||document.removeEventListener("mousemove",this.get("eventualDragResume"),!1)},stopDragging:function(){this.get("redux").dispatch((0,r.uiUpdate)({previewSuspendDrag:!1})),this.get("preview").message("stop-drag")},willDestroyElement:function(){this.get("elementDrake").teardown(),Ember.$("style#".concat(this.get("customCSSContext"),"-custom-css")).remove()}}),i=(0,t.connect)(function(e){return{incomingElement:e.builder.incomingElement,hideWorkspace:e.ui.hideWorkspace,previewSuspendDrag:e.ui.previewSuspendDrag}},function(e){return{uiResetLiftedElement:function(){return e((0,r.uiResetLiftedElement)())}}})(a)
e.default=i}),define("tco-app/components/preview/preview-builder/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"vqLSIFwb",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"],[1,[27,"react-bridge/preview-builder",null,[["regions","incomingElement"],[[23,["regionsWithZones"]],[27,"if",[[23,["preview","dragging"]],[23,["incomingElement"]],null],null]]]],false],[0,"\\n"],[7,"div"],[11,"class","cs-indicator-container"],[11,"style","display:none"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-indicator"],[9],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/preview/preview-builder/template.hbs"}})
e.default=t}),define("tco-app/components/preview/preview-options/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({preview:Ember.inject.service(),didInsertElement:function(){this.setupCustomCSS()},customCSS:Ember.computed.alias("preview.previewPackage.customCSS"),customCSSObserver:Ember.observer("customCSS",function(){this.updateCustomCSS()}),setupCustomCSS:function(){var e=Ember.$(window.csAppData.optionsCustomCSSSelector)
0===e.length&&(e=Ember.$('<style id="cs-generated-custom-css"></style>'),Ember.$("head").append(e)),this.set("customCSSEl",e[0]),this.updateCustomCSS()},updateCustomCSS:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){Ember.$(e.get("customCSSEl")).html(e.get("customCSS"))})}})
e.default=t}),define("tco-app/components/preview/preview-options/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"VwYF2l/o",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/preview/preview-options/template.hbs"}})
e.default=t}),define("tco-app/components/react-bridge/builder-workspace/component",["exports","react","tco-app/src/components/builder/BuilderWorkspace"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return t.default.createElement(n.default,null)}}),define("tco-app/components/react-bridge/component",["exports","react","tco-app/src/components/global/AppConfirmModal","tco-app/src/components/global/Ui","tco-app/src/components/global/KeyboardShortcuts"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),s(this,l(a).apply(this,arguments))}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(a,t.default.Component),u=a,(p=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.default,null),t.default.createElement(o.default,null),t.default.createElement(r.default,null))}}])&&i(u.prototype,p),d&&i(u,d),a}()
e.default=u}),define("tco-app/components/react-bridge/debug/element-data/component",["exports","react","react-redux","tco-app/src/selectors/elements"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var o,r,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.PureComponent),o=n,(r=[{key:"render",value:function(){var e=this
return t.default.createElement("pre",{className:"cs-debug-module-data"},this.props.element&&Object.keys(this.props.element).reduce(function(t,n){return"".concat(t).concat(n,": ").concat(e.props.element[n],"\n")},""))}}])&&a(o.prototype,r),c&&a(o,c),n}(),p=(0,n.connect)((c=(0,o.makeGetElement)(),function(e){return e.inspector.inspecting?{element:c(e,{id:e.inspector.inspecting})}:{}}))(u)
e.default=p}),define("tco-app/components/react-bridge/dev-route/EmberData",["exports","react","tco-app/src/util/promise-hash"],function(e,t,n){var o,r
function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){v(e,t,n[t])})}return e}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function d(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?m(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var b=t.default.createContext("ember-data-store")
var y=function(e){function o(){var e,t
c(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return v(m(t=d(this,(e=f(o)).call.apply(e,[this].concat(r)))),"state",{modelUpdated:0,model:Ember.Object.create({})}),v(m(t),"modelHook",function(e,n){var o=t.makeObservableModel(e,n)
t.setState({error:null,loading:!0,modelHookFn:o,observe:n,model:Ember.Object.create({})}),t.doUpdate(o)}),v(m(t),"updateModel",function(){t.setState({updating:!0,error:null}),t.doUpdate(t.state.modelHookFn)}),t}return h(o,t.default.Component),p(o,[{key:"makeObservableModel",value:function(e,t){var o=this
return function(){return new Promise(function(r,a){var i=e(o.props.store),s=Object.keys(i).reduce(function(e,t){return e[t]=null,e},{});(0,n.default)(i).then(function(e){var n=Ember.Object.create(l({},s,e))
t.forEach(function(e){return n.addObserver(e,function(){return o.setState(function(e){return{modelUpdated:e.modelUpdated+1}})})}),r(n)},a)})}}},{key:"doUpdate",value:function(e){var t=this
e().then(function(e){return t.setState({model:e,updating:!1,loading:!1})},function(e){return t.setState({error:e,updating:!1,loading:!1})})}},{key:"render",value:function(){var e=this.state,t=(e.modelHookFn,e.observe,s(e,["modelHookFn","observe"]))
return this.props.children(l({modelHook:this.modelHook,updateModel:this.updateModel},t))}}]),o}()
var _,w=(r=o=function(e){function n(){return c(this,n),d(this,f(n).apply(this,arguments))}return h(n,t.default.Component),p(n,[{key:"componentDidMount",value:function(){this.props.modelHook(function(e){return{entries:e.findAll("content/entry")}},["entries.content.[]"])}},{key:"render",value:function(){return console.log("check",this.props.model.getWithDefault("entries",[]).map(function(e){return e.get("permalink")})),t.default.createElement("div",null,"Test")}}]),n}(),v(o,"defaultProps",{model:{}}),_=r,function(e){return t.default.createElement(b.Consumer,null,function(n){return t.default.createElement(y,{store:n},function(n){return t.default.createElement(_,a({},n,e))})})}),E=function(e,n){return function(o){return t.default.createElement(b.Provider,{value:n},t.default.createElement(e,o))}}(function(){return t.default.createElement(w,null)},window.cornerstoneApp.lookup("service:store"))
e.default=E}),define("tco-app/components/react-bridge/dev-route/Resizer",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ResizerHandle=e.ResizerLabel=void 0
var c=function(e){var n=e.show,o=void 0!==n&&n,r=e.width,a=void 0===r?"33.33%":r
return t.default.createElement("div",{className:o?"cs-resizer-label is-active":"cs-resizer-label"},t.default.createElement("span",null,a))}
e.ResizerLabel=c
var u=function(e){var n=e.linked,o=void 0!==n&&n,r=e.onMouseDown,a=void 0===r?function(){}:r,i=e.onMouseUp,s=void 0===i?function(){}:i,l=e.onMouseEnter,c=void 0===l?function(){}:l,u=e.onMouseLeave,p=void 0===u?function(){}:u
return t.default.createElement("div",{className:o?"cs-resizer-handle is-active":"cs-resizer-handle",onMouseDown:a,onMouseUp:s,onMouseEnter:c,onMouseLeave:p})}
e.ResizerHandle=u
var p=function(e){function p(){var e,t,r
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=this,r=a(p).call(this),e=!r||"object"!==n(r)&&"function"!=typeof r?i(t):r,l(i(e),"getLabels",function(){return e.state.labels}),l(i(e),"showLabels",function(){e.setState({labels:!0})}),l(i(e),"hideLabels",function(){e.setState({labels:!1})}),l(i(e),"toggleLabels",function(){e.setState({labels:!e.getLabels()})}),l(i(e),"getLinkedGroups",function(){return e.state.linkedGroups}),l(i(e),"addGroup",function(t){var n=o(e.getLinkedGroups())
n.push(t),e.setState({linkedGroups:n})}),l(i(e),"removeGroup",function(t){var n=e.getLinkedGroups(),r=n.findIndex(function(e){return e===t})
n=[].concat(o(n.slice(0,r)),o(n.slice(r+1))),e.setState({linkedGroups:n})}),l(i(e),"isGroupLinked",function(t){return e.getLinkedGroups().includes(t)}),e.state={labels:!1,linkedGroups:[]},e}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(p,t.default.Component),d=p,(f=[{key:"render",value:function(){var e=this
return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"dev-cells"},t.default.createElement("ul",{className:"dev-cells-inner"},t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium, nisi ut volutpat mollis."),t.default.createElement(c,{show:this.getLabels()})),t.default.createElement(u,{linked:this.isGroupLinked("a"),onMouseEnter:function(){return e.addGroup("a")},onMouseLeave:function(){return e.removeGroup("a")},onMouseDown:this.showLabels,onMouseUp:this.hideLabels}),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),t.default.createElement(c,{show:this.getLabels()})),t.default.createElement(u,{linked:this.isGroupLinked("b"),onMouseEnter:function(){return e.addGroup("b")},onMouseLeave:function(){return e.removeGroup("b")},onMouseDown:this.showLabels,onMouseUp:this.hideLabels}),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),t.default.createElement(c,{show:this.getLabels()})),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.")),t.default.createElement(u,{linked:this.isGroupLinked("a"),onMouseEnter:function(){return e.addGroup("a")},onMouseLeave:function(){return e.removeGroup("a")},onMouseDown:this.showLabels,onMouseUp:this.hideLabels}),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium, nisi ut volutpat mollis.")),t.default.createElement(u,{linked:this.isGroupLinked("b"),onMouseEnter:function(){return e.addGroup("b")},onMouseLeave:function(){return e.removeGroup("b")},onMouseDown:this.showLabels,onMouseUp:this.hideLabels}),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium, nisi ut volutpat mollis.")),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.")),t.default.createElement(u,{linked:this.isGroupLinked("a"),onMouseEnter:function(){return e.addGroup("a")},onMouseLeave:function(){return e.removeGroup("a")},onMouseDown:this.showLabels,onMouseUp:this.hideLabels}),t.default.createElement("li",{className:"dev-cell"},t.default.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.")))),t.default.createElement("style",null,".cs-canvas{overflow-x:hidden;overflow-y:scroll;background-color:#fff;}"))}}])&&r(d.prototype,f),m&&r(d,m),p}()
e.default=p}),define("tco-app/components/react-bridge/dev-route/component",["exports","react","tco-app/src/components/forms/GridTemplateInput"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function c(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,c)
for(var s=arguments.length,u=new Array(s),p=0;p<s;p++)u[p]=arguments[p]
return n=this,r=(e=a(c)).call.apply(e,[this].concat(u)),t=!r||"object"!==o(r)&&"function"!=typeof r?i(n):r,l(i(t),"state",{value:"2rem 25vw 1fr 2fr"}),l(i(t),"onInputChange",function(e){return t.setState({value:e})}),t}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(c,t.default.PureComponent),u=c,(p=[{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"cs-picker-modal cs-picker-floating-right cs-picker-floating",style:{display:"block",top:"40px",left:"380px",backgroundColor:"var(--c-bg)"}}),t.default.createElement("div",{className:"cs-workspace is-vertical"},t.default.createElement("div",{className:"cs-workspace-header"},t.default.createElement("h2",{className:"cs-workspace-title"},"Development")),t.default.createElement("div",{className:"cs-controls"},t.default.createElement("div",{className:"cs-control-group"},t.default.createElement("header",{className:"cs-control-group-header"},t.default.createElement("span",{className:"cs-control-group-label"},"Add New Post")),t.default.createElement("ul",{className:"cs-control-list"},t.default.createElement("li",{className:"cs-control"},t.default.createElement("div",{className:"cs-control-label"},t.default.createElement("span",null,"Template")),t.default.createElement("div",{className:"cs-control-inputs"},t.default.createElement(n.default,{value:this.state.value,onChange:this.onInputChange,emptyMessage:"Blank Placeholder"}))))))),t.default.createElement("div",{className:"cs-canvas is-vertical",style:{backgroundColor:"#ffffff"}}))}}])&&r(u.prototype,p),d&&r(u,d),c}()
e.default=c}),define("tco-app/components/react-bridge/navigation-bar/component",["exports","react","tco-app/src/components/workspace/NavigationBar"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return t.default.createElement(n.default,null)}}),define("tco-app/components/react-bridge/preview-builder/component",["exports","react","react-redux","tco-app/src/components/global/ElementCursor","tco-app/src/components/preview/StyleManager","tco-app/src/components/preview/RegionOutput","tco-app/src/components/builder/ElementContextMenu","tco-app/src/components/preview/BreakpointDetection","tco-app/src/components/preview/ElementObserver"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),p(this,d(n).apply(this,arguments))}var c,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.PureComponent),c=n,(m=[{key:"renderElementCursor",value:function(){return this.props.incomingElement&&this.props.incomingElement.type?t.default.createElement(o.default,{type:this.props.incomingElement.type,suspend:this.props.previewSuspendDrag}):this.props.liftedElement&&this.props.liftedElement.type?t.default.createElement(o.default,{type:this.props.liftedElement.type,suspend:this.props.previewSuspendDrag}):null}},{key:"render",value:function(){return this.props.ready?t.default.createElement(t.default.Fragment,null,t.default.createElement(a.default,{regions:this.props.regions}),t.default.createElement(r.default,null),this.props.allowContextMenu&&!this.props.hideWorkspace&&!this.props.inlineEditing&&t.default.createElement(i.default,{handle:"preview"}),this.renderElementCursor(),t.default.createElement(s.default,null),!this.props.hideWorkspace&&t.default.createElement(l.default,null)):t.default.createElement(t.default.Fragment,null)}}])&&u(c.prototype,m),h&&u(c,h),n}(),h=(0,n.connect)(function(e,t){return t.id,{ready:e.xfr.ready,liftedElement:e.ui.liftedElement,previewSuspendDrag:e.ui.previewSuspendDrag,contextMenu:e.ui.contextMenu,hideWorkspace:e.ui.hideWorkspace,inlineEditing:e.ui.inlineEditing,allowContextMenu:e.builder.preferences.contextMenu}})(m)
e.default=h}),define("tco-app/components/react-bridge/preview-manager/component",["exports","react","react-redux","tco-app/src/components/preview/PreviewUi","tco-app/src/components/preview/PreviewKeys"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var a,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.PureComponent),a=n,(u=[{key:"render",value:function(){return this.props.ready?t.default.createElement(t.default.Fragment,null,t.default.createElement(o.default,null),t.default.createElement(r.default,null)):t.default.createElement(t.default.Fragment,null)}}])&&i(a.prototype,u),p&&i(a,p),n}(),p=(0,n.connect)(function(e,t){return t.id,{ready:e.xfr.ready}})(u)
e.default=p}),define("tco-app/components/react-bridge/preview-switcher-button/component",["exports","react","react-redux","tco-app/src/lib/http","tco-app/src/lib/i18n","classnames","tco-app/src/components/common/Icon","tco-app/src/components/common/ScrollBox","react-select","tco-app/src/util/idle-callback"],function(e,t,n,o,r,a,i,s,l,c){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var g=function(e){function n(e){var t,r,a
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=this,a=d(n).call(this,e),t=!a||"object"!==u(a)&&"function"!=typeof a?f(r):a,h(f(t),"handleToggle",function(e){e.preventDefault(),t.props.togglePreview(!t.props.active)}),h(f(t),"handlePostSwitch",function(){var e=t.state.activePost,n=e.id,o=e.value,r="header"===t.props.builder?"controller:headers/header":"controller:footers/footer"
t.props.switchPage(o),t.props.togglePreview(n),t.setState({switcherOpen:!1}),window.cornerstoneApp.lookup(r).set("url",o)}),h(f(t),"handleSelect",function(e,n){t.setState({activePost:e})}),h(f(t),"handleSearch",function(e){e.currentTarget.value.length>=4&&e.currentTarget.value!=t.state.searched&&(t.setState({searched:e.currentTarget.value}),t.fetchData({limit:20,search:t.state.searched}))}),h(f(t),"fetchData",(0,c.debounceIdleCallback)(function(e){var n=e.limit,r=void 0===n?20:n,a=e.search,i=void 0===a||a
t.setState({searching:i}),(0,o.request)("preview_switcher::get_data",{limit:r,search:i}).then(function(e){if(e){var n=e
i&&(n=t.combineResults(e)),t.setState({data:n,loading:!1,searched:i,searching:!1})}})},300)),h(f(t),"combineResults",function(e){var n=t.state.data,o=[]
return 0!==e.length&&Object.keys(e).map(function(r){var a=t.filterPosts(n[r],e[r],r)
o[r]=a}),o}),h(f(t),"filterPosts",function(e,t,n){return e.concat(t).filter(function(e,t,n){return n.findIndex(function(t){return t.id===e.id})===t})}),h(f(t),"capitalize",function(e){return"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)}),t.state={activePost:null,switcherOpen:!1,loading:!0,error:null,searching:!1,searched:null,data:[]},t}var g,v,b
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(n,t.default.Component),g=n,(v=[{key:"componentDidMount",value:function(){void 0!==this.state.data&&0!=this.state.data.length||this.fetchData({limit:20,search:!1})}},{key:"componentWillUnmount",value:function(){this.fetchData.cancel()}},{key:"render",value:function(){var e=this,n=this.props,o=n.ready,c=n.active,u=n.builder,p=this.state,d=p.loading,f=p.switcherOpen,m=p.activePost,h=p.searching,g=p.data
if(!o||d)return t.default.createElement(t.default.Fragment,null)
var v=document.querySelector(".cs-hf-preview-switcher .cs-react-select__input input")
v&&v.addEventListener("keyup",function(t){return e.handleSearch(t)})
var b=(0,a.default)({"cs-bar-btn cs-hf-preview-switcher-button":!0,"cs-active":c}),y=(0,a.default)({"cs-bar-nav cs-hf-preview-switcher":!0,"cs-active":c}),_=Object.keys(g).map(function(t){return{label:"x-portfolio"==t?"portfolio":t.replace(/-/g," "),options:g[t].map(function(t){return{value:t.url,label:e.capitalize(t.title),id:t.id}})}}),w=!_,E=w?"Posts not found":(0,r.t)("app.search"),O=function(e){return t.default.createElement(t.default.Fragment,null,t.default.createElement(l.components.MenuList,e,t.default.createElement(s.default,null,e.children)))}
return t.default.createElement(t.default.Fragment,null,t.default.createElement("li",null,"header"===u||"footer"===u?t.default.createElement(t.default.Fragment,null,t.default.createElement("button",{className:b,onClick:function(t){return e.handleToggle(t)}},t.default.createElement(i.default,{icon:"fa-eye"}))):null,t.default.createElement("div",{className:y},t.default.createElement("div",{className:"cs-bar-nav-dropdown"},t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"cs-control-select-action"},t.default.createElement("div",{className:"cs-control-input cs-active"},t.default.createElement("ul",{className:"cs-control-input-list"},t.default.createElement("li",null,t.default.createElement("div",{className:"cs-control-input-list-input"},t.default.createElement(l.default,{grouped:!0,options:_,placeholder:E,value:m,noOptionsMessage:function(){return h?"Searching":"Posts not found"},onChange:function(t,n){return e.handleSelect(t,n)},onMenuOpen:function(){return e.setState({switcherOpen:!0})},onMenuClose:function(){return e.setState({switcherOpen:!1,data:g})},className:(0,a.default)("cs-react-select",{"cs-active":f}),classNamePrefix:"cs-react-select",isSearchable:!0,components:{MenuList:O}}),t.default.createElement("button",{className:(0,a.default)("cs-control-select-action-btn cs-control-preview-switcher-btn",{"cs-brbr-0":f}),disabled:w,onClick:e.handlePostSwitch},(0,r.t)("app.controls.link.preview"))))))))))))}}])&&p(g.prototype,v),b&&p(g,b),n}(),v=(0,n.connect)(function(e){return{ready:e.xfr.ready,active:e.builder.previewSwitcher,builder:e.builder.builder}},function(e){return{togglePreview:function(t){e({type:"BUILDER:PREVIEW_SWITCHER",payload:{active:t},xfr:!0})},switchPage:function(t){e({type:"UI:UPDATE",payload:{viewSiteURL:t}})}}})(g)
e.default=v}),define("tco-app/components/react-component",["exports","react","react-redux","react-dom"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.get,a=Ember.__loader.require("@ember/-internals/views").MUTABLE_CELL
var i=Ember.Component.extend({reactComponent:Ember.computed.reads("_reactComponent"),redux:Ember.inject.service(),classNameBindings:["emberClass"],attributeBindings:["style"],didRender:function(){this.renderReactComponent()},renderReactComponent:function(){var e,i,s=r(this,"reactComponent")
if("string"===Ember.typeOf(s)?(e=Ember.getOwner(this).resolveRegistration("react-component:".concat(s))).displayName=Ember.String.classify(s):e=s,!e)throw new Error("Could not find react component : ".concat(s))
try{var l=(i=r(this,"attrs"),Object.keys(i).reduce(function(e,t){var n
return e[t]=(n=i[t])&&n[a]?n.value:n,e},{}))
o.default.render(t.default.createElement(n.Provider,{store:this.get("redux").store},t.default.createElement(e,l)),r(this,"element"))}catch(c){console.warn(c)}},willDestroyElement:function(){o.default.unmountComponentAtNode(r(this,"element"))}})
i.reopenClass({positionalParams:["_reactComponent"]})
var s=i
e.default=s}),define("tco-app/components/template-manager/settings-modal-tab/component",["exports","tco-app/components/global/settings-modal/tab-base/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({validDefinitions:Ember.computed.filterBy("elementDefinitions","canSetDefault",!0),elements:Ember.computed("validDefinitions.[]","presetTemplateStubs.[]","presetTemplateStubs.@each.title",function(){var e={}
return this.getWithDefault("presetTemplateStubs",[]).forEach(function(t){var n=t.get("subtype")
Ember.isNone(e[n])&&(e[n]=Ember.A()),e[n].push(t)}),Ember.A(this.getWithDefault("validDefinitions",[]).map(function(t){var n=t.get("id"),o=Ember.A()
return Ember.isNone(e[n])||e[n].forEach(function(e){o.push({label:e.get("title"),value:e.get("id").toString()})}),o.unshift({label:"None",value:"none"}),{definition:t,options:o}}))}),sortedElements:Ember.computed.sort("elements",function(e,t){return Ember.compare(e.definition.get("title"),t.definition.get("title"))})})
e.default=n}),define("tco-app/components/template-manager/settings-modal-tab/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"yhD6S7cS",block:'{"symbols":["element"],"statements":[[4,"common/scroll-box",null,null,{"statements":[[7,"div"],[11,"class","cs-tab-modal-content-container"],[9],[0,"\\n  "],[7,"h3"],[9],[1,[27,"t",["app.templates.element-defaults.entity"],null],false],[10],[0,"\\n  "],[7,"p"],[9],[1,[27,"t",["app.templates.element-defaults.message"],null],false],[10],[0,"\\n  "],[7,"dl"],[9],[0,"\\n"],[4,"each",[[23,["sortedElements"]]],null,{"statements":[[0,"    "],[7,"dt"],[9],[1,[22,1,["definition","title"]],false],[10],[0,"\\n    "],[7,"dd"],[9],[0,"\\n      "],[1,[27,"forms/select-single",null,[["value","options","loadingPlaceholder","assignDefaultActive"],[[27,"mut",[[27,"get",[[22,0,[]],[27,"concat",["defaultPresets.",[22,1,["definition","id"]]],null]],null]],null],[22,1,["options"]],[27,"t",["app.loading"],null],false]]],false],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[1]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[7,"div"],[11,"class","cs-tab-modal-content-footer"],[9],[0,"\\n  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"save"],null]],[11,"class","cs-tab-modal-save cs-btn cs-btn-yep"],[9],[1,[27,"t",["app.save-thing"],[["context"],[[27,"t",["app.templates.element-defaults.entity"],null]]]],false],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/template-manager/settings-modal-tab/template.hbs"}})
e.default=t}),define("tco-app/components/template-manager/template-importer/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"form",classNames:["cs-tm-import"],classNameBindings:["draggingOver:cs-dragging","importing:cs-active"],importing:!1,draggingOver:!1,readyToImport:!0,importComplete:!1,importError:!1,didInsertElement:function(){var e=this
this.$().on("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault(),e.stopPropagation()}).on("dragover dragenter",function(){e.set("draggingOver",!0)}).on("dragleave dragend drop",function(){e.set("draggingOver",!1)}).on("drop",function(t){t.originalEvent.dataTransfer.files&&e.send("importFiles",t.originalEvent.dataTransfer.files)})
var t=this
this.$("#cs-tm-import-files")[0].onchange=function(){this.files&&this.files&&t.send("importFiles",this.files)}},resetImporter:function(){this.isDestroyed||(this.get("element").reset(),this.get("readyToImport",!0),this.set("importComplete",!1),this.set("importError",!1),this.set("importing",!1))},beginImport:function(){var e=this
this.get("readyToImport",!1),this.set("importing",!0)
var t=!1
setTimeout(function(){t=!0},3e3)
return function n(o){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3
if("abort"!==o){if(!t)return setTimeout(function(){n.call(e,o,r)},100)
e.set("importComplete",!0),o&&e.set("importError",!0),Ember.run.later(function(){e.resetImporter()},r)}else e.resetImporter()}},actions:{importStarterPack:function(){this.get("readyToImport")&&this.onImportStarterPack(this.beginImport())},importFiles:function(e){this.get("readyToImport")&&this.onNewSubmission(e,this.beginImport())}}})
e.default=t}),define("tco-app/components/template-manager/template-importer/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"5oR8sz6I",block:'{"symbols":[],"statements":[[7,"span"],[12,"onclick",[27,"action",[[22,0,[]],"importStarterPack"],null]],[11,"class","cs-tm-import-starter-pack-placeholder"],[11,"style","visibility: hidden;"],[9],[0," "],[10],[0,"\\n"],[7,"div"],[11,"class","cs-tm-import-welcome"],[9],[0,"\\n  "],[7,"input"],[11,"name","files[]"],[11,"id","cs-tm-import-files"],[11,"type","file"],[9],[10],[0,"\\n  "],[7,"label"],[11,"for","cs-tm-import-files"],[9],[0,"\\n    "],[1,[27,"icon",["index-choice-import"],null],false],[0,"\\n    "],[7,"span"],[9],[1,[27,"t",["app.templates.import.choose"],null],false],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"],[7,"span"],[12,"class",[28,["cs-tm-import-status ",[27,"unless",[[23,["importComplete"]],"cs-active"],null]]]],[9],[7,"span"],[11,"class","cs-tm-import-status-icon"],[9],[10],[1,[27,"t",["app.templates.import.imported"],null],false],[10],[0,"\\n"],[7,"span"],[12,"class",[28,["cs-tm-import-status ",[27,"if",[[27,"and",[[23,["importComplete"]],[27,"not",[[23,["importError"]]],null]],null],"cs-active"],null]]]],[9],[7,"span"],[11,"class","cs-tm-import-status-icon"],[9],[10],[1,[27,"t",["app.templates.import.done"],null],false],[10],[0,"\\n"],[7,"span"],[12,"class",[28,["cs-tm-import-status ",[27,"if",[[27,"and",[[23,["importComplete"]],[23,["importError"]]],null],"cs-active"],null]]]],[9],[7,"span"],[11,"class","cs-tm-import-status-icon"],[9],[10],[1,[27,"t",["app.templates.import.error"],null],false],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/template-manager/template-importer/template.hbs"}})
e.default=t}),define("tco-app/components/template-manager/template-manager/component",["exports","tco-app/util/search"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Component.extend({classNames:["cs-tm"],selection:Ember.A(),wpMedia:Ember.inject.service(),store:Ember.inject.service(),elementService:Ember.inject.service("element"),templateService:Ember.inject.service("template-manager"),typeFilters:Ember.computed("ui.isPro",function(){return this.get("ui.isPro")?["all","header","content","footer","preset"]:["all","content","preset"]}),modes:["my-templates","themeco-templates"],selectedTypeFilter:"all",sortBy:"name",sortAsc:!0,sortDirection:Ember.computed("sortAsc",function(){return this.get("sortAsc")?"down":"up"}),activeSortBy:Ember.computed("isSearching","sortBy",function(){return!this.get("isSearching")&&this.get("sortBy")}),showImportStarterPack:Ember.computed("hideImportStarterPack",function(){return!this.get("hideImportStarterPack")&&this.get("currentUser").can("templates.import")}),onInit:Ember.on("init",function(){var e=t.default.create()
e.set("name","template-manager"),this.set("searchData",e),e.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1},{name:"subtext",weight:.03}]}),this.updateSearchIndex()}),didInsertElement:function(){this.detectScrollbarVisible()},activeItems:Ember.computed.filterBy("myTemplates","isDeleted",!1),detectScrollbarVisible:function(){var e=this.$(".cs-tm-body")
this.set("showScrollbarPadding",e.height()<e[0].scrollHeight)},showScrollbarPadding:!1,scrollbarPadding:Ember.computed("ui.scrollBarWidthPaddingRightStyle","showScrollbarPadding",function(){return this.get("showScrollbarPadding")?this.get("ui.scrollBarWidthPaddingRightStyle"):""}),activeItemsObserver:Ember.observer("activeItems.[]",function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){e.detectScrollbarVisible()})}),searchableItems:Ember.computed.filter("activeItems",function(e){var t=this.get("selectedTypeFilter")
return"all"===this.get("selectedTypeFilter")||t===e.get("type")}).property("selectedTypeFilter","activeItems.[]"),sortedSearchableItems:Ember.computed("sortBy","sortAsc","searchableItems.[]",function(){return this.get(Ember.String.camelize("sortedSearchableItems-".concat(this.get("sortBy"))))}),sortedSearchableItemsName:Ember.computed.sort("searchableItems",function(e,t){if(!this.get("sortAsc")){var n=[t,e]
e=n[0],t=n[1]}return Ember.compare(e.get("title"),t.get("title"))}).property("sortAsc","searchableItems.[]"),sortedSearchableItemsType:Ember.computed.sort("sortedSearchableItemsName",function(e,t){if(!this.get("sortAsc")){var n=[t,e]
e=n[0],t=n[1]}return Ember.compare(e.get("unformattedSubTypeLabel"),t.get("unformattedSubTypeLabel"))}).property("sortAsc","searchableItems.[]"),sortedSearchableItemsPreview:Ember.computed.sort("sortedSearchableItemsName",function(e,t){if(!this.get("sortAsc")){var n=[t,e]
e=n[0],t=n[1]}return Ember.compare(t.get("preview"),e.get("preview"))}).property("sortAsc","searchableItems.[]"),sortedSearchableItemsHide:Ember.computed.sort("sortedSearchableItemsName",function(e,t){if(!this.get("sortAsc")){var n=[t,e]
e=n[0],t=n[1]}return Ember.compare(t.get("hidden"),e.get("hidden"))}).property("sortAsc","searchableItems.[]"),isSearching:Ember.computed.alias("searchData.isSearching"),filteredItems:Ember.computed("searchData.results","sortedSearchableItems.[]",function(){var e=this.get("searchData.results")
return this.get("isSearching")?this.get("sortedSearchableItems").filter(function(t){return e.includes(t.get("id"))}).sort(function(t,n){return Ember.compare(e.indexOf(t.get("id")).toString(),e.indexOf(n.get("id")).toString())}):this.get("sortedSearchableItems")}),resetSearchOnFilter:Ember.observer("selectedTypeFilter",function(){this.set("searchData.query","")}),updateSearchIndexObserver:Ember.observer("searchableItems.[]","searchableItems.@each.title",function(){this.updateSearchIndex()}),updateSearchIndex:function(){var e=this
this.get("searchData").updateIndex(this.getWithDefault("searchableItems",[]).map(function(t){var n=""
return"preset"===t.get("type")&&(n=e.get("elementService").getDefinitionByType(t.get("subtype")).get("title")),{id:t.get("id"),title:t.get("title"),subtext:n}}))},emptySearchResults:Ember.computed("searchData.results.length",function(){return this.get("isSearching")&&this.get("searchData.results.length")<=0}),downloadAllowed:Ember.computed(function(){return this.get("currentUser").can("templates.download")}),deleteAllowed:Ember.computed(function(){return this.get("currentUser").can("templates.delete")}),canMakeSelection:Ember.computed.or("downloadAllowed","deleteAllowed"),canDownloadSelection:Ember.computed.gt("downloadableSelections.length",0),canDeleteSelection:Ember.computed.gt("deleteableSelections.length",0),showFooter:Ember.computed("canDownloadSelection","canDeleteSelection",function(){return this.get("canDownloadSelection")||this.get("canDeleteSelection")}),showFooterObserver:Ember.observer("showFooter",function(){this.get("showFooter")||(this.set("showDownloadSelectionPopover",!1),this.set("showDeleteSelectionPopover",!1))}),disableDownloadSelection:Ember.computed.not("canDownloadSelection"),disableDeleteSelection:Ember.computed.not("canDeleteSelection"),downloadableSelections:Ember.computed.filter("selection",function(){return!0}),deleteableSelections:Ember.computed.filter("selection",function(){return!0}),downloadSelectionLabel:Ember.computed("downloadableSelections.length",function(){var e=this.getWithDefault("downloadableSelections.length",1)
return e<=1?this.get("i18n").t("app.templates.download-label.one"):this.get("i18n").t("app.templates.download-label.n",{count:e})}),deleteSelectionLabel:Ember.computed("deleteableSelections.length",function(){var e=this.getWithDefault("deleteableSelections.length",1)
return e<=1?this.get("i18n").t("app.templates.delete-label.one"):this.get("i18n").t("app.templates.delete-label.n",{count:e})}),deletePopoverMessage:Ember.computed("deleteableSelections.length",function(){var e=this.getWithDefault("deleteableSelections.length",1)
return e<1?this.get("i18n").t("app.templates.delete-popover.one"):this.get("i18n").t("app.templates.delete-popover.n",{count:e})}),deselectPreviousFilter:Ember.observer("filteredItems.[]",function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){var t=e.get("selection")
e.get("selection").filter(function(t){return!e.get("filteredItems").find(function(e){return t===e.get("id")})}).forEach(function(n){var o=t.indexOf(n);-1!==o&&e.get("selection").removeAt(o)}),e.notifyPropertyChange("selection")})}),allSelected:Ember.computed("selection.[]","filteredItems.[]",function(){var e=this.get("selection")
return 0===this.get("filteredItems").map(function(e){return e.id}).filter(function(t){return!e.includes(t)}).length}),downloadSelectionName:"",actions:{selectTypeFilter:function(e,t){t.preventDefault(),this.set("selectedTypeFilter",e)},openImportStarterPack:function(){this.get("isImporting")||this.set("showImportStarterPackPopover",!0)},closeImportStarterPack:function(){this.set("showImportStarterPackPopover",!1)},importStarterPack:function(){this.get("isImporting")||(this.set("showImportStarterPackPopover",!1),Ember.$(".cs-tm-import-starter-pack-placeholder").trigger("click"))},showDownloadSelection:function(){if(!this.get("isImporting"))if(this.set("showDownloadSelectionPopover",!this.get("showDownloadSelectionPopover")),this.get("showDownloadSelectionPopover")){if(""===this.get("downloadSelectionName"))if(this.get("selection.length")>1)this.set("downloadSelectionName","My Templates")
else{var e=this.get("store").peekRecord("template-manager/stub",this.get("selection.firstObject"))
this.set("downloadSelectionName",e.get("title"))}}else this.set("downloadSelectionName","")},showDeleteSelection:function(){this.get("isImporting")||this.set("showDeleteSelectionPopover",!this.get("showDeleteSelectionPopover"))},downloadSelection:function(){var e=this.get("ui"),t=this.get("downloadSelectionName")
if(!t)return e.notify("Your download must have a name.","error")
this.set("downloadSelectionName",""),this.set("showDownloadSelectionPopover",!1),e.notify("Starting download.","info"),e.beginSaveProgress(),this.get("templateService").downloadSelection(t,this.get("selection")).then(function(){e.endSaveProgress(),e.notify("Template Export Successful.","success")},function(t){console.warn(t),e.notify("Failed to export template.","error"),e.endSaveProgress()})},deleteSelection:function(){this.set("showDeleteSelectionPopover",!1)
var e=this.get("ui")
e.beginSaveProgress(),this.get("templateService").deleteSelection(this.get("selection")).then(function(){e.endSaveProgress(),e.notify("Selection deleted.","success")},function(t){e.notify("Failed to delete selection.",t),e.endSaveProgress()})},removePreview:function(e){this.send("updatePreview",e,"")},setPreview:function(e){var t=this
this.get("wpMedia").promise().then(function(n){t.send("updatePreview",e,n)})},updateTitle:function(e,t){var n=this,o=e.get("type"),r=e.get("title"),a=e.get("subtype")
t!==r&&(this.get("store").peekAll("template-manager/stub").find(function(e){return o===e.get("type")&&t===e.get("title")&&(!a||a===e.get("subtype"))})?this.get("ui").notify("Another template of this type already has that name.","error"):(this.get("ui").notify("Title saved!","success"),e.set("title",t),e.save().then(function(){},function(e){n.get("ui").notify("Unable to save new title.","error"),console.warn("Error updating template title",e)})))},updatePreview:function(e,t){var n=this,o=e.get("preview")
e.set("preview",t),t?this.get("ui").notify("Preview Added!","success"):this.get("ui").notify("Preview Removed!","success"),e.save().then(function(){},function(r){e.set("preview",o),t?n.get("ui").notify("Unable to save new preview.","error"):n.get("ui").notify("Unable to save removed preview.","error"),console.warn("Error toggling template hide",r)})},toggleHide:function(e){var t=this,n=e.get("hidden")
e.set("hidden",!n),e.get("hidden")?this.get("ui").notify("Template Hidden!","success"):this.get("ui").notify("Template Unhidden!","success"),e.save().then(function(){},function(o){e.set("hidden",n),e.get("hidden")?t.get("ui").notify("Unable to save hiding of template.","error"):t.get("ui").notify("Unable to save unhiding template.","error"),console.warn("Error toggling template hide",o)})},toggleSelectAll:function(){var e=this
Ember.run.scheduleOnce("afterRender",function(){e.get("allSelected")?e.get("selection").clear():e.get("filteredItems").map(function(e){return e.id}).forEach(function(t){e.get("selection").includes(t)||e.get("selection").pushObject(t)}),e.notifyPropertyChange("selection.[]")})},toggleSelected:function(e){var t=e.get("id"),n=this.get("selection").indexOf(t);-1!==n?this.get("selection").removeAt(n):this.get("selection").pushObject(t),this.notifyPropertyChange("selection")},sortBy:function(e){this.get("isSearching")||(e===this.get("sortBy")?this.set("sortAsc",!this.get("sortAsc")):this.set("sortBy",["name","type","preview","hide"].includes(e)?e:"name"))},idleCloseDownloadSelection:function(){this.set("showDownloadSelectionPopover",!1),this.set("downloadSelectionName","")},idleCloseDeleteSelection:function(){this.set("showDeleteSelectionPopover",!1)},dismissStarterPack:function(){this.get("isImporting")||this.onDismissStarterPack()}}})
e.default=n}),define("tco-app/components/template-manager/template-manager/template-item/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"tr",store:Ember.inject.service(),classNameBindings:["rowHidden:cs-is-hidden"],previewActive:!1,rowHidden:Ember.computed.alias("item.hidden"),selected:Ember.computed("selection.[]",function(){return this.get("selection").includes(this.get("item.id"))}),installedFromDesignCloud:Ember.computed("item.packageSignature",function(){return 0===this.getWithDefault("item.packageSignature","").indexOf("dc-")}),actions:{mouseEnterPreview:function(){this.set("previewActive",!0)},mouseLeavePreview:function(e){0===Ember.$(e.relatedTarget||e.toElement).closest(".cs-popover").length&&this.set("previewActive",!1)},doneEditing:function(e){this.onDoneEditingTitle(this.get("item"),e)}}})
e.default=t}),define("tco-app/components/template-manager/template-manager/template-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"wlwcEmwS",block:'{"symbols":[],"statements":[[4,"if",[[23,["canMakeSelection"]]],null,{"statements":[[7,"td"],[11,"class","cs-tm-table-cell-select"],[9],[0,"\\n  "],[7,"label"],[11,"class","cs-rc cs-rc-checkbox"],[9],[0,"\\n    "],[1,[27,"input",null,[["type","checked","change"],["checkbox",[23,["selected"]],[27,"action",[[22,0,[]],[23,["onToggleSelected"]]],null]]]],false],[0,"\\n    "],[7,"span"],[11,"class","cs-rc-indicator"],[9],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"td"],[11,"class","cs-tm-table-cell-name"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-tm-cell-content"],[9],[0,"\\n    "],[7,"span"],[11,"class","cs-tm-cell-content-text"],[9],[0,"\\n      "],[1,[27,"forms/inline-edit",null,[["enabled","value","onDoneEditing"],[[23,["canRename"]],[23,["item","title"]],[27,"action",[[22,0,[]],"doneEditing"],null]]]],false],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"],[7,"td"],[11,"class","cs-tm-table-cell-type"],[9],[1,[23,["item","typeLabel"]],false],[10],[0,"\\n"],[4,"if",[[23,["canUpdatePreviewImage"]]],null,{"statements":[[7,"td"],[11,"class","cs-tm-table-cell-preview"],[12,"onmouseenter",[27,"action",[[22,0,[]],"mouseEnterPreview"],null]],[12,"onmouseleave",[27,"action",[[22,0,[]],"mouseLeavePreview"],null]],[9],[0,"\\n"],[4,"if",[[23,["item","preview"]]],null,{"statements":[[0,"  "],[7,"span"],[11,"style","display: block; width: 1em; height: 1em; margin: 0 auto; position: relative;"],[9],[0,"\\n    "],[1,[27,"icon",["fa-image"],null],false],[0,"\\n"],[4,"common/cs-popover",null,[["active","side","fixed","onMouseLeave"],[[23,["previewActive"]],"left","true",[27,"action",[[22,0,[]],"mouseLeavePreview"],null]]],{"statements":[[0,"    "],[7,"div"],[11,"class","cs-popover-section is-ultra-compact"],[9],[0,"\\n      "],[7,"img"],[12,"src",[28,[[23,["item","preview"]]]]],[11,"alt","item.title"],[9],[10],[0,"\\n"],[4,"unless",[[23,["readOnly"]]],null,{"statements":[],"parameters":[]},null],[0,"    "],[10],[0,"\\n"],[4,"unless",[[23,["installedFromDesignCloud"]]],null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-popover-section is-footer"],[9],[0,"\\n      "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onRemovePreview"]]],null]],[11,"href",""],[11,"class","cs-popover-section-text-action"],[9],[1,[27,"t",["app.templates.remove-preview-image"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},{"statements":[[4,"unless",[[23,["readOnly"]]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[23,["onSetPreview"]]],null]],[11,"class","cs-tm-table-cell-preview-add"],[11,"href",""],[9],[1,[27,"icon",["fa-plus"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["canHide"]]],null,{"statements":[[7,"td"],[11,"class","cs-tm-table-cell-hide"],[9],[0,"\\n  "],[7,"label"],[11,"class","cs-rc cs-rc-checkbox"],[9],[0,"\\n    "],[1,[27,"input",null,[["type","checked","change"],["checkbox",[23,["item","hidden"]],[27,"action",[[22,0,[]],[23,["onToggleHide"]]],null]]]],false],[0,"\\n    "],[7,"span"],[11,"class","cs-rc-indicator"],[9],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/template-manager/template-manager/template-item/template.hbs"}})
e.default=t}),define("tco-app/components/template-manager/template-manager/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"4FimCn4X",block:'{"symbols":["item","filter"],"statements":[[7,"header"],[11,"class","cs-tm-header"],[9],[0,"\\n  "],[7,"section"],[9],[0,"\\n    "],[7,"div"],[11,"class","cs-tm-header-filters"],[9],[0,"\\n      "],[7,"ul"],[9],[0,"\\n"],[4,"each",[[23,["typeFilters"]]],null,{"statements":[[0,"        "],[7,"li"],[9],[0,"\\n          "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"selectTypeFilter",[22,2,[]]],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["selectedTypeFilter"]],[22,2,[]]],null],"cs-active"],null]]]],[11,"href",""],[9],[0,"\\n            "],[1,[27,"t",[[27,"concat",["app.templates.filter-",[22,2,[]]],null]],null],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[2]},null],[0,"      "],[10],[0,"\\n    "],[10],[0,"\\n    "],[1,[27,"common/search-bar",null,[["noFocus","query","placeholder"],[true,[23,["searchData","query"]],"Search Templates"]]],false],[0,"\\n  "],[10],[0,"\\n  "],[7,"section"],[12,"style",[21,"scrollbarPadding"]],[9],[0,"\\n    "],[7,"table"],[11,"class","cs-tm-table"],[9],[0,"\\n      "],[7,"thead"],[9],[0,"\\n        "],[7,"tr"],[9],[0,"\\n"],[4,"if",[[23,["canMakeSelection"]]],null,{"statements":[[0,"          "],[7,"th"],[11,"class","cs-tm-table-cell-select"],[9],[0,"\\n            "],[7,"label"],[11,"class","cs-rc cs-rc-checkbox"],[9],[0,"\\n              "],[1,[27,"input",null,[["type","checked","disabled","change"],["checkbox",[27,"and",[[23,["allSelected"]],[27,"not",[[23,["emptySearchResults"]]],null]],null],[23,["emptySearchResults"]],[27,"action",[[22,0,[]],"toggleSelectAll"],null]]]],false],[0,"\\n              "],[7,"span"],[11,"class","cs-rc-indicator"],[9],[10],[0,"\\n            "],[10],[0,"\\n          "],[10],[0,"\\n"]],"parameters":[]},null],[0,"          "],[7,"th"],[11,"title","Template Name"],[11,"class","cs-tm-table-cell-name"],[9],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"sortBy","name"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"name"],null],"cs-active"],null]]]],[9],[0,"Name\\n              "],[1,[27,"icon",[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"name"],null],[27,"concat",["fa-sort-",[23,["sortDirection"]]],null],"sort"],null]],null],false],[10],[10],[0,"\\n          "],[7,"th"],[11,"title","Template Type"],[11,"class","cs-tm-table-cell-type"],[9],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"sortBy","type"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"type"],null],"cs-active"],null]]]],[9],[0,"Type\\n              "],[1,[27,"icon",[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"type"],null],[27,"concat",["fa-sort-",[23,["sortDirection"]]],null],"sort"],null]],null],false],[10],[10],[0,"\\n"],[4,"if",[[27,"user-can",["templates.update_preview_image"],null]],null,{"statements":[[0,"          "],[7,"th"],[11,"title","Template Preview"],[11,"class","cs-tm-table-cell-preview"],[9],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"sortBy","preview"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"preview"],null],"cs-active"],null]]]],[9],[0,"Preview\\n              "],[1,[27,"icon",[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"preview"],null],[27,"concat",["fa-sort-",[23,["sortDirection"]]],null],"sort"],null]],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["templates.hide"],null]],null,{"statements":[[0,"          "],[7,"th"],[11,"title","Hide Template in Builders"],[11,"class","cs-tm-table-cell-hide"],[9],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"sortBy","hide"],null]],[12,"class",[28,[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"hide"],null],"cs-active"],null]]]],[9],[0,"Hide\\n              "],[1,[27,"icon",[[27,"if",[[27,"eq",[[23,["activeSortBy"]],"hide"],null],[27,"concat",["fa-sort-",[23,["sortDirection"]]],null],"sort"],null]],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[0,"        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n\\n"],[7,"main"],[11,"class","cs-tm-body cs-scroll-container"],[9],[0,"\\n  "],[7,"table"],[11,"class","cs-tm-table"],[9],[0,"\\n    "],[7,"tbody"],[9],[0,"\\n"],[4,"each",[[23,["filteredItems"]]],null,{"statements":[[0,"      "],[1,[27,"template-manager/template-manager/template-item",null,[["item","canMakeSelection","selection","canRename","canUpdatePreviewImage","canHide","onToggleHide","onToggleSelected","onSetPreview","onRemovePreview","onDoneEditingTitle"],[[22,1,[]],[23,["canMakeSelection"]],[23,["selection"]],[27,"user-can",["templates.rename"],null],[27,"user-can",["templates.update_preview_image"],null],[27,"user-can",["templates.hide"],null],[27,"action",[[22,0,[]],"toggleHide",[22,1,[]]],null],[27,"action",[[22,0,[]],"toggleSelected",[22,1,[]]],null],[27,"action",[[22,0,[]],"setPreview",[22,1,[]]],null],[27,"action",[[22,0,[]],"removePreview",[22,1,[]]],null],[27,"action",[[22,0,[]],"updateTitle"],null]]]],false],[0,"\\n"]],"parameters":[1]},{"statements":[[4,"if",[[23,["isSearching"]]],null,{"statements":[[4,"common/welcome-message",null,[["title"],["No results!"]],{"statements":[[0,"      "],[7,"p"],[9],[0,"No templates were found. Try searching for something else."],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]}],[4,"unless",[[23,["isSearching"]]],null,{"statements":[[4,"if",[[23,["showImportStarterPack"]]],null,{"statements":[[0,"      "],[7,"tr"],[11,"class","cs-tm-table-row-starter"],[9],[0,"\\n        "],[7,"td"],[11,"class","cs-tm-table-cell-starter"],[11,"colspan","5"],[9],[0,"\\n          "],[7,"h4"],[9],[0,"Get Starter Templates"],[10],[0,"\\n          "],[7,"p"],[9],[0,"Looking for some inspiration? Our Starter Pack is a collection of example templates."],[10],[0,"\\n          "],[7,"div"],[11,"style","display: inline-block; position: relative;"],[9],[0,"\\n            "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"openImportStarterPack"],null]],[11,"class","cs-btn cs-btn-sm"],[9],[0,"Import Starter Pack"],[10],[0,"\\n"],[4,"common/cs-popover",null,[["active","side","onOutsideClick"],[[23,["showImportStarterPackPopover"]],"top",[27,"action",[[22,0,[]],"closeImportStarterPack"],null]]],{"statements":[[0,"            "],[7,"div"],[11,"class","cs-popover-section"],[9],[0,"\\n              "],[7,"p"],[9],[0,"Would you like to import the collection of starter templates?"],[10],[0,"\\n            "],[10],[0,"\\n            "],[7,"div"],[11,"class","cs-popover-section is-footer"],[9],[0,"\\n              "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"importStarterPack"],null]],[11,"class","cs-btn cs-btn-sm cs-btn-nope"],[9],[0,"Yes, continue"],[10],[0,"\\n              "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"closeImportStarterPack"],null]],[11,"class","cs-btn cs-btn-sm"],[9],[0,"No thanks"],[10],[0,"\\n            "],[10],[0,"\\n"]],"parameters":[]},null],[0,"          "],[10],[0,"\\n          "],[7,"a"],[12,"onclick",[27,"action",[[22,0,[]],"dismissStarterPack"],null]],[9],[0,"Don\'t show me this anymore"],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"],[7,"footer"],[12,"class",[28,["cs-tm-footer ",[27,"if",[[23,["showFooter"]],"cs-active"],null]]]],[9],[0,"\\n\\n"],[4,"if",[[23,["downloadAllowed"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"style","position:relative;"],[9],[0,"\\n"],[4,"common/cs-popover",null,[["active","focusInput","side","onOutsideClick"],[[23,["showDownloadSelectionPopover"]],true,"top",[27,"action",[[22,0,[]],"idleCloseDownloadSelection"],null]]],{"statements":[[0,"    "],[7,"div"],[11,"class","cs-popover-section"],[9],[0,"\\n      "],[1,[27,"input",null,[["class","enter","placeholder","value"],["cs-tm-download-selection-name",[27,"action",[[22,0,[]],"downloadSelection"],null],"Name export package",[23,["downloadSelectionName"]]]]],false],[0,"\\n    "],[10],[0,"\\n    "],[7,"div"],[11,"class","cs-popover-section is-footer"],[9],[0,"\\n      "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"downloadSelection"],null]],[11,"class","cs-btn cs-btn-sm"],[9],[0,"Download"],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"showDownloadSelection"],null]],[12,"disabled",[21,"disableDownloadSelection"]],[11,"class","cs-btn cs-btn-sm"],[9],[1,[21,"downloadSelectionLabel"],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["deleteAllowed"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"style","position:relative;"],[9],[0,"\\n"],[4,"common/cs-popover",null,[["active","side","onOutsideClick"],[[23,["showDeleteSelectionPopover"]],"top",[27,"action",[[22,0,[]],"idleCloseDeleteSelection"],null]]],{"statements":[[0,"    "],[7,"div"],[11,"class","cs-popover-section"],[9],[0,"\\n      "],[7,"p"],[9],[1,[21,"deletePopoverMessage"],false],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"div"],[11,"class","cs-popover-section is-footer"],[9],[0,"\\n      "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"deleteSelection"],null]],[11,"class","cs-btn cs-btn-sm cs-btn-nope"],[9],[0,"Yes, delete"],[10],[0,"\\n      "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"showDeleteSelection"],null]],[11,"class","cs-btn cs-btn-sm"],[9],[0,"No thanks"],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"showDeleteSelection"],null]],[12,"disabled",[21,"disableDeleteSelection"]],[11,"class","cs-btn cs-btn-sm cs-btn-nope"],[9],[1,[21,"deleteSelectionLabel"],false],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/template-manager/template-manager/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/cs-workspace/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace"],classNameBindings:["name","ui.workspaceOrientationClass"]})
e.default=t}),define("tco-app/components/workspace/cs-workspace/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"AHtrRZoA",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/cs-workspace/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-actions/action-item/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"a",classNames:"cs-workspace-action-item",classNameBindings:["class"],click:function(e){e.stopPropagation(),this.onClick()}})
e.default=t}),define("tco-app/components/workspace/workspace-actions/action-item/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"D6puDnM2",block:'{"symbols":[],"statements":[[1,[21,"content"],true],[0,"\\n"],[4,"if",[[23,["quickConfirmLabel"]]],null,{"statements":[[0,"  "],[7,"span"],[11,"class","quick-confirm-label"],[9],[1,[21,"quickConfirmLabel"],false],[10],[0,"\\n"]],"parameters":[]},null],[7,"span"],[9],[1,[21,"label"],false],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-actions/action-item/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-actions/action-overlay/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:"cs-workspace-action-overlay",classNameBindings:["class","open:cs-active"],autoFocus:!0,openObserver:Ember.observer("open",function(){var e=this
this.get("open")&&this.get("autoFocus")&&Ember.run.scheduleOnce("afterRender",function(){e.$('input[type="text"]').focus()})}),actions:{close:function(){this.set("open",!1)}}})
e.default=t}),define("tco-app/components/workspace/workspace-actions/action-overlay/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"ktS6sCMD",block:'{"symbols":["&default"],"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"close"],null]],[11,"class","cs-workspace-actions-overlay-close"],[9],[0,"×"],[10],[0,"\\n"],[14,1]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-actions/action-overlay/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-actions/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:"cs-workspace-actions",classNameBindings:["divider:cs-workspace-actions","active:cs-active"],active:!1,divider:!0,isVisible:Ember.computed.or("hasVisibleItems","noItems"),hasVisibleItems:Ember.computed.gt("visibleItems.length",0),noItems:Ember.computed.not("items.length"),visibleItems:Ember.computed("items.[]",function(){return this.getWithDefault("items",[]).filter(function(e){return!1!==e.access})}),actions:{toggle:function(){this.set("active",!this.get("active"))}}})
e.default=t})
define("tco-app/components/workspace/workspace-actions/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"pFJK60k5",block:'{"symbols":["item","&default"],"statements":[[4,"each",[[23,["visibleItems"]]],null,{"statements":[[0,"  "],[1,[27,"workspace/workspace-actions/action-item",null,[["content","class","quickConfirmLabel","label","onClick"],[[22,1,["content"]],[22,1,["class"]],[22,1,["quickConfirmLabel"]],[22,1,["label"]],[22,1,["action"]]]]],false],[0,"\\n"]],"parameters":[1]},null],[4,"if",[[23,["hasToggle"]]],null,{"statements":[[0,"  "],[7,"button"],[11,"class","cs-workspace-actions-toggle"],[9],[0,"\\n    "],[7,"span"],[9],[0,"▼"],[10],[0,"\\n  "],[3,"action",[[22,0,[]],"toggle"]],[10],[0,"\\n"]],"parameters":[]},null],[14,2],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-actions/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-content/component",["exports","tco-app/components/common/scroll-box/component"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({classNames:["cs-workspace-content"]})
e.default=n}),define("tco-app/components/workspace/workspace-content/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"kM1Svm6Y",block:'{"symbols":["&default"],"statements":[[14,1,[[22,0,[]]]],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-content/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-expander/component",["exports","tco-app/src/lib/keybindings"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=function(e,t){return e&&e.contains&&e&&e.contains(t)},o=Ember.Component.extend({rootSelector:".cs-app",contentOpen:!1,hasToggle:!0,classNames:["cs-workspace-expander"],classNameBindings:["class","open:cs-active","noPreview:no-preview"],floatingSide:"right",scrollEvent:"ps-y-reach-start ps-scroll-y ps-y-reach-end ps-x-reach-start ps-scroll-x ps-x-reach-end",canExpandFull:!0,orientation:Ember.computed.alias("ui.workspaceOrientation"),expanded:Ember.computed.alias("ui.textEditorExpanded"),activeClass:!1,closeOnFocusLoss:!0,onStateChange:function(){},attrModalClass:Ember.computed("expanderClass","orientation","expanded","activeClass","canTransition",function(){var e=["cs-workspace-expander-content","cs-workspace-expander-content-".concat(this.get("orientation")),this.get("expanderClass")]
return this.get("expanded")&&this.get("canExpandFull")&&e.push("cs-expanded"),this.get("canTransition")||e.push("cs-no-transition"),this.get("activeClass")&&e.push("cs-active"),e.join(" ")}),onInit:Ember.on("init",function(){this.triggerExternalOpen()}),observeExternalOpen:Ember.observer("externalOpen",function(){this.triggerExternalOpen()}),triggerExternalOpen:function(){this.get("externalOpen")&&this.set("open",!0)},didInsertElement:function(){var e=this
this.set("hasRendered",!0),this.updatePositioning(),this.getWithDefault("unbindEsc",function(){})(),this.set("unbindEsc",(0,t.default)({esc:function(){return e.send("closeOnEsc")}}))},willDestroyElement:function(){this._super.apply(this,arguments),this.getWithDefault("unbindEsc",function(){})()},observeState:Ember.observer("open",function(){this.updatePositioning()}),canTransition:!1,updatePositioning:function(){var e=this
if(this.get("hasRendered")&&!this.isDestroyed){var t=this.get("open")
this.set("contentOpen",t),t?(this.set("canTransition",!0),Ember.run.cancel(this.get("transitionTimer"))):this.set("transitionTimer",Ember.run.later(function(){return e.set("canTransition",!1)},700))}else this.set("contentOpen",!1)},observeContentOpen:Ember.observer("contentOpen",function(){var e=this,t=Ember.$("body"),o=this.$(".cs-workspace-expander-content")
this.set("expandedContent",o)
var r=function r(a){var i=e.get("element")
e.isDestroyed||i!==a.currentTarget&&o[0]!==a.currentTarget&&!n(i,a.currentTarget)&&n(Ember.$(e.get("rootSelector"))[0],a.currentTarget)&&!n(o[0],a.currentTarget)?(e.get("closeOnFocusLoss")&&(t.off("focus","*",r),t.off("click","*",r)),!e.isDestroyed&&o[0]&&(e.set("open",!1),e.onStateChange(!1))):a.stopPropagation()}
this.get("contentOpen")?(o.removeClass("cs-active"),o.detach().appendTo(this.get("rootSelector")),this.get("closeOnFocusLoss")&&(t.on("focus","*",r),t.on("click","*",r)),Ember.run.later(function(){e.get("contentOpen")&&!e.isDestroyed&&e.set("activeClass",!0)},5)):(this.set("activeClass",!1),Ember.run.later(function(){e.get("contentOpen")||e.isDestroyed||o.detach().appendTo(e.$())},500))}),willDestroy:function(){this._super.apply(this,arguments)
var e=this.get("expandedContent")
e&&e.remove()},actions:{toggle:function(){this.set("open",!this.get("open")),this.onStateChange(this.get("open"))},close:function(){this.set("open",!1),this.onStateChange(this.get("open"))},expand:function(){this.set("expanded",!0)},collapse:function(){this.set("expanded",!1)},closeOnEsc:function(){this.get("closeOnEsc")&&this.send("close")}}})
e.default=o}),define("tco-app/components/workspace/workspace-expander/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"TTEd4DXR",block:'{"symbols":["btn","&default"],"statements":[[4,"if",[[23,["hasToggle"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-workspace-expander-toggle"],[11,"tabindex","-1"],[12,"onclick",[27,"action",[[22,0,[]],"toggle"],null]],[9],[0,"\\n"],[4,"if",[[23,["label"]]],null,{"statements":[[0,"      "],[7,"span"],[9],[1,[21,"label"],true],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[1,[21,"content"],false],[0,"\\n"],[4,"if",[[23,["contentComponent"]]],null,{"statements":[[0,"      "],[1,[27,"component",[[23,["contentComponent"]]],[["expander"],[[22,0,[]]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"div"],[12,"class",[21,"attrModalClass"]],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-workspace-expander-head"],[9],[0,"\\n\\n"],[4,"if",[[23,["headerActionsComponent"]]],null,{"statements":[[0,"      "],[1,[27,"component",[[23,["headerActionsComponent"]]],[["classNames","expander"],[[27,"array",["cs-workspace-expander-head-actions"],null],[22,0,[]]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["headerActions"]]],null,{"statements":[[0,"      "],[7,"div"],[11,"class","cs-workspace-expander-head-actions"],[9],[0,"\\n        "],[1,[21,"headerActions"],false],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["headerLabel"]]],null,{"statements":[[0,"      "],[7,"div"],[11,"class","cs-workspace-expander-head-label"],[9],[0,"\\n        "],[7,"span"],[9],[1,[21,"headerLabel"],false],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[7,"div"],[11,"class","cs-workspace-expander-head-actions"],[9],[0,"\\n"],[4,"each",[[23,["beforeButtons"]]],null,{"statements":[[0,"        "],[7,"button"],[12,"class",[28,[[22,1,["class"]]]]],[12,"onclick",[27,"action",[[22,0,[]],[22,1,["action"]]],null]],[9],[1,[22,1,["label"]],true],[10],[0,"\\n"]],"parameters":[1]},null],[0,"      "],[7,"button"],[11,"class","cs-close"],[12,"onclick",[27,"action",[[22,0,[]],"close"],null]],[9],[7,"span"],[11,"class","cs-visually-hidden"],[9],[0,"Close"],[10],[10],[0,"\\n"],[4,"if",[[23,["canExpandFull"]]],null,{"statements":[[0,"        "],[7,"button"],[11,"class","cs-expand"],[12,"onclick",[27,"action",[[22,0,[]],"expand"],null]],[9],[7,"span"],[11,"class","cs-visually-hidden"],[9],[0,"Expand"],[10],[10],[0,"\\n        "],[7,"button"],[11,"class","cs-collapse"],[12,"onclick",[27,"action",[[22,0,[]],"collapse"],null]],[9],[7,"span"],[11,"class","cs-visually-hidden"],[9],[0,"Collapse"],[10],[10],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n  "],[7,"div"],[11,"class","cs-workspace-expander-body"],[9],[0,"\\n"],[4,"if",[[23,["contentOpen"]]],null,{"statements":[[0,"      "],[14,2,[[27,"hash",null,[["open"],[[23,["open"]]]]]]],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-expander/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-full-button/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"button",classNames:["cs-workspace-full-button"],classNameBindings:["isDisabled"],attributeBindings:["style"],isDisabled:Ember.computed("disabled","action",function(){return this.get("disabled")||!this.get("action")}),iconOutput:Ember.computed.alias("icon"),click:function(){this.onClick("action")}})
e.default=t}),define("tco-app/components/workspace/workspace-full-button/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"rlapwAWe",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["icon"]]],null,{"statements":[[0,"  "],[1,[21,"iconOutput"],true],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["message"]]],null,{"statements":[[0,"  "],[7,"span"],[9],[1,[21,"message"],false],[10],[0,"\\n"]],"parameters":[]},null],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-full-button/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-header/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace-header"]})
e.default=t}),define("tco-app/components/workspace/workspace-header/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"pb+YJ6QJ",block:'{"symbols":["&default"],"statements":[[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-header/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-message/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace-message"],classNameBindings:["small:small"]})
e.default=t}),define("tco-app/components/workspace/workspace-message/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"jPCY0TJD",block:'{"symbols":["&default"],"statements":[[4,"if",[[23,["before"]]],null,{"statements":[[1,[21,"before"],true]],"parameters":[]},null],[0,"\\n"],[4,"if",[[23,["title"]]],null,{"statements":[[0,"  "],[7,"h3"],[9],[1,[21,"title"],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["message"]]],null,{"statements":[[0,"  "],[7,"p"],[9],[1,[21,"message"],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["after"]]],null,{"statements":[[1,[21,"after"],true]],"parameters":[]},null],[0,"\\n"],[14,1],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-message/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-nav/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({classNames:["cs-workspace-nav"],tagName:"nav"})
e.default=t}),define("tco-app/components/workspace/workspace-nav/nav-list/component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Component.extend({tagName:"ul",isVisible:Ember.computed.gt("visibleItems.length",0),visibleItems:Ember.computed("items.[]",function(){return this.getWithDefault("items",[]).filter(function(e){return!1!==Ember.get(e,"show")})})})
e.default=t}),define("tco-app/components/workspace/workspace-nav/nav-list/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"5ts8qLqu",block:'{"symbols":["item"],"statements":[[4,"each",[[23,["visibleItems"]]],null,{"statements":[[0,"  "],[7,"li"],[9],[4,"link-to",[[22,1,["route"]]],[["class"],[[22,1,["class"]]]],{"statements":[[7,"span"],[9],[1,[22,1,["label"]],false],[10]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[1]},null]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-nav/nav-list/template.hbs"}})
e.default=t}),define("tco-app/components/workspace/workspace-nav/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"MYK1XKJF",block:'{"symbols":[],"statements":[[1,[27,"workspace/workspace-nav/nav-list",null,[["items"],[[27,"if",[[23,["builderItems"]],[27,"array",[[27,"hash",null,[["route","label","class","show"],[[23,["homeRoute"]],[23,["routeTitle"]],"cs-workspace-nav-divider home",[27,"eq",["horizontal",[23,["ui","workspaceOrientation"]]],null]]]],[27,"hash",null,[["route","label","class","show"],[[27,"concat",[[23,["builderRoute"]],".layout"],null],[27,"t",["app.layout.title"],null],"layout",[27,"user-can",[[27,"concat",[[23,["context"]],".manage_layout"],null]],null]]]],[27,"hash",null,[["route","label","class","show"],[[27,"concat",[[23,["builderRoute"]],".elements"],null],[27,"t",["app.elements.title"],null],"elements",[27,"user-can",[[27,"concat",[[23,["context"]],".elements_create"],null]],null]]]],[27,"hash",null,[["route","label","class","show"],[[27,"concat",[[23,["builderRoute"]],".inspector"],null],[27,"t",["app.inspector.title"],null],"inspector",[27,"user-can",[[27,"concat",[[23,["context"]],".elements_inspect"],null]],null]]]]],null],[23,["items"]]],null]]]],false],[0,"\\n\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/components/workspace/workspace-nav/template.hbs"}})
e.default=t}),define("tco-app/content/builder/controller",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),config:Ember.inject.service(),colorManager:Ember.inject.service(),fontManager:Ember.inject.service(),previewURL:Ember.computed("model.content.permalink",function(){return this.get("model.content.permalink")}),previewInc:0,previewState:Ember.computed("model.content.id","previewInc","lang","colorManager.saved","fontManager.saved",function(){return this.get("colorManager.saved"),this.get("fontManager.saved"),{route:"content",mode:"content",custom_js:{"cs-content-custom-scripts":this.get("model.content.settings.general.custom_js")},post_id:this.get("model.content.id"),post_type:this.get("model.content.postType"),inc:this.get("previewInc"),settings:this.get("model.content.settings")}}),responsiveTextItems:Ember.computed("model.content.responsiveTextItems","model.content.responsiveTextItems.@each.min_size","model.content.responsiveTextItems.@each.max_size","model.content.responsiveTextItems.@each.selector","model.content.responsiveTextItems.@each.compress",function(){return this.getWithDefault("model.content.responsiveTextItems",[]).map(function(e){var t=e.selector,n=e.compression
return{minSize:e.min_size,maxSize:e.max_size,selector:t,compression:n}})}),actions:{refreshPreview:function(){this.get("ui").notify((0,t.t)("app.notification-refreshing-preview-save-reminder")),this.incrementProperty("previewInc")},runCustomJs:function(){this.get("ui").notify((0,t.t)("app.notification-refreshing-preview")),this.incrementProperty("previewState.inc")}}})
e.default=n}),define("tco-app/content/builder/route",["exports","tco-app/mixins/route-authorization","tco-app/src/lib/http"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Route.extend(t.default,{xfr:Ember.inject.service(),router:Ember.inject.service(),preview:Ember.inject.service(),acl:["canUseBuilder"],routeUI:{bar:["orientation","preview-sizer","view-site","cheatsheet","save"],orientation:"preference"},queryParams:{lang:{refreshModel:!0}},deactivate:function(){this.store.unloadAll("content/template-entry")},beforeModel:function(){this.permissionCheck()},model:function(e){var t=this,o=e.post_id,r=e.lang
return new Ember.RSVP.Promise(function(e,a){var i=t.store.findAll("element/definition"),s=t.store.query("element/preset",{isDefault:!0}),l=t.store.findAll("content/template-entry"),c=t.store.findAll("font-manager/selection"),u=(0,n.request)("content-settings::settings_sections",{post_id:o})
new Ember.RSVP.Promise(function(e,n){t.store.findRecord("content/content",o).then(function(t){if(!Ember.isEmpty(window.csAppData.wpmlLanguages)&&window.csAppData.wpmlTranslateableTypes.includes(t.get("postType"))&&(r||window.csAppData.wpmlDefault)!==t.get("language.code"))return e({reroute:"translate",content:t})
e(t)},n)}).then(function(n){if("translate"!==n.reroute)return t.permissionCheck(["content.".concat(n.get("postType"))])?void Ember.RSVP.hash({library:i,defaultPresets:s,templates:l,content:n,fontSelections:c,settingsSections:u}).then(function(t){return e(t)},a):a()
e(n)},a)})},afterModel:function(e,t){if(this.set("ui.unsavedData",!1),"translate"!==e.reroute){var n=Ember.Object.create(e.settingsSections.data)
e.content.set("settings",n)
var o=Ember.A()
e.content.getWithDefault("settings.responsive-text.elements",[]).forEach(function(e){o.push(e)}),e.content.set("responsiveTextItems",o)
var r=this.get("ui.search").getTarget("element-library")
r.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),r.updateIndex(e.library.map(function(e){return{id:e.get("id"),title:e.get("title")}})),e.defaultPresets.forEach(function(e){e.get("element").set("defaultPreset",e)})}else{var a=Ember.get(t.to,"queryParams.lang")
if(a){var i=e.content.get("language.translations.".concat(a))
i&&this.transitionTo("content.builder",i,{queryParams:{lang:a}})}else this.transitionTo("content.builder",e.content.get("id"),{queryParams:{lang:e.content.get("language.code")}})}},setupController:function(e,t){this._super(e,t),this.set("routeUI.viewSiteURL",t.content.get("permalink")),this.get("ui").setRouteUI(this),this.set("ui.routeDashboardUrl",t.content.get("editUrl")),e.set("noTranslation","translate"===t.reroute),t.content&&t.content.setupElements()
var n=this.get("currentUser").can("content.".concat(t.content.get("postType"),".insert_templates"))
e.set("templates",n&&t.templates?t.templates.toArray():[])},renderTemplate:function(e){e.get("noTranslation")||(this.render("partials/bar/content",{outlet:"bar",into:"application"}),this.render("partials/global/content",{outlet:"global",into:"application"}),this.render("partials/settings/content",{outlet:"settings",into:"application"})),this._super(this,arguments)},actions:{willTransition:function(e){var t=this
!this.get("ui.unsavedData")||e.targetName.includes("content.builder")&&Ember.getWithDefault(e.to.queryParams,"lang",null)===this.controllerFor(this.routeName).getWithDefault("lang",null)||(e.abort(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.set("ui.unsavedData",!1),e.retry()},acceptClass:"sad"}))},error:function(e){return!e||(console.log(e),this.transitionTo("content"))},save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress()
var n=t.get("refreshPreviewAfterSave")
this.modelFor(this.routeName).content.updateElements().updateSettings().save().then(function(o){console.log("Saving Content",o),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.content.entity")}),"success"),e.set("ui.unsavedData",!1)
var r=e.controllerFor(e.routeName)
r.set("lastSave",new Date),n&&r.incrementProperty("previewInc"),t.set("refreshPreviewAfterSave",!1)}).catch(function(n){console.warn(n),t.notify(e.get("i18n").t("app.notify.failed-to-save",{context:e.get("i18n").t("common.content.entity")}),"error"),t.endSaveProgress()})},toggleSkeletonMode:function(){this.set("ui.skeletonModeActive",!this.get("ui.skeletonModeActive")),this.get("ui.skeletonModeActive")&&this.set("ui.showPreviewSizer",!1)},handleRemoteAction:function(e){this.send.apply(this,[e.action].concat(o(e.params)))},navigate:function(e){this.transitionTo(e)},selectLanguage:function(e){var t=this.modelFor(this.routeName)
if(e!==this.controllerFor(this.routeName).get("lang")){var n=t.content.get("language.translations.".concat(e))
Ember.isNone(n)&&(n=t.content.get("language.source")),Ember.isNone(n)&&(n=t.content.get("id")),this.transitionTo("content.builder",n,{queryParams:{lang:e}})}},createTranslation:function(e){var t=this,o=e.source,r=e.lang,a=e.copyFrom,i=this.get("ui")
i.beginSaveProgress()
var s=this.get("i18n").t("app.translation.entity");(0,n.request)("translation::create",{source:o,lang:r,copyFrom:a}).then(function(e){i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.created",{context:s}),"success"),t.store.unloadAll("content/content"),t.transitionTo("content.builder",e.id,{queryParams:{lang:r}})},function(e){return console.warn("Error creating translation",e),i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.failed-to-create",{context:s}),"error")})},observerNav:function(e){var t=this,n=e.id,o=e.route,r=e.context,a=[o]
n&&a.push(n)
var i=this.get("ui.unsavedData")
this.get("ui").confirm({noSkip:!0,message:i?this.get("i18n").t("app.streamline-nav-unsaved",{context:r}):this.get("i18n").t("app.streamline-nav",{context:r}),accept:function(){t.set("ui.unsavedData",!1),t.transitionTo.apply(t,a)},acceptClass:"sad"})}}})
e.default=r}),define("tco-app/content/builder/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"TcT1xDqI",block:'{"symbols":[],"statements":[[1,[21,"react-bridge/navigation-bar"],false],[0,"\\n\\n"],[4,"global/cs-window",null,[["screen"],["content-builder"]],{"statements":[[0,"\\n"],[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[4,"cs-dock",null,[["isUndocked","isHorizontal"],[[23,["ui","workspaceIsUndocked"]],[23,["ui","workspaceIsHorizontal"]]]],{"statements":[[1,[27,"react-bridge/builder-workspace",null,[["emberClass"],[[27,"concat",["cs-workspace ",[27,"if",[[23,["ui","workspaceIsHorizontal"]],"is-horizontal","is-vertical"],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[0,"\\n"],[1,[27,"common/preview-frame",null,[["src","state","requestParams","content","preloader","allowPreviewSizer","package","onRemoteAction","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],[23,["requestParams"]],"builder","content",true,[27,"hash",null,[["customCSS","responsiveTextItems"],[[23,["model","content","settings","general","custom_css"]],[23,["responsiveTextItems"]]]]],[27,"route-action",["handleRemoteAction"],null],[27,"route-action",["observerNav"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],["Translate"]],{"statements":[[1,[27,"common/create-translation",null,[["targetLang","model","onCreateTranslation","contextLabel"],[[23,["activeLanguage"]],[23,["model","content"]],[27,"route-action",["createTranslation"],null],[27,"t",["common.content.entity"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[23,["ui","wpmlLanguages"]]],null,{"statements":[[4,"if",[[23,["model","content","translateable"]]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/content/builder/template.hbs"}})
e.default=t}),define("tco-app/content/content/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/content/content/model",["exports","ember-data/model","ember-data/attr","tco-app/src/reducers/helpers"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({redux:Ember.inject.service(),title:(0,n.default)(),permalink:(0,n.default)(),editUrl:(0,n.default)(),language:(0,n.default)(),modified:(0,n.default)(),postStatus:(0,n.default)(),postName:(0,n.default)(),postType:(0,n.default)(),postTypeLabel:(0,n.default)(),translateable:Ember.computed("postType",function(){return window.csAppData.wpmlTranslateableTypes.includes(this.get("postType"))}),elements:(0,n.default)({defaultValue:function(){return{}}}),settings:(0,n.default)({defaultValue:function(){return{}}}),setupElements:function(){var e=JSON.parse(JSON.stringify(this.get("elements")))
return this.get("redux").dispatch({type:"BUILDER:SET_CONTEXT",payload:{builder:"content",renderContext:{mode:"content",data:{post_id:this.get("id")}},permissionContext:"content.".concat(this.get("postType")),homeRoute:"content",routePrefix:"content.builder"}}),this.get("redux").dispatch({type:"ELEMENT_RESET",payload:{_type:"root",_modules:[{_type:"region",_region:"content",_modules:e.data}]}}),this},updateElements:function(){var e=((0,o.toTreeFromRoot)(this.get("redux").store.getState().elements)._modules||[])[0]||{}
return this.set("elements",null),this.set("elements",e._modules||{}),this},updateSettings:function(){var e=[]
return this.getWithDefault("responsiveTextItems",[]).forEach(function(t){return e.push(t)}),this.set("settings.responsive-text.elements",e),this}})
e.default=r}),define("tco-app/content/controller",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),isSearching:Ember.computed.alias("searchData.isSearching"),sortedEntriesByTitle:Ember.computed.sort("model.entries",function(e,t){var n=e.getWithDefault("postTypeLabel","").localeCompare(t.get("postTypeLabel"))
return 0===n?e.get("title").localeCompare(t.get("title")):n}),sortedEntries:Ember.computed.sort("sortedEntriesByTitle",function(e,t){return e.get("isNew")?-1:t.get("isNew")?1:0}),searchResults:Ember.computed("searchData.results","activeLanguage","sortedEntries",function(){var e=this.get("searchData.results"),t=this.get("isSearching"),n=this.get("ui.wpmlLanguages").length>0,o=this.get("activeLanguage")
return this.get("sortedEntries").filter(function(r){return!(n&&o!==r.get("language.code")&&!r.getWithDefault("language.fallback",[]).includes(o))&&(!t||e.includes("".concat(r.get("id"))))})}),init:function(){this._super.apply(this,arguments),this.set("searchData",this.get("ui.search").getTarget("builder-index"))},resetSelected:Ember.observer("activeLanguage",function(){var e=this.get("activeLanguage"),t=this.get("selectedEntry"),n=this.getWithDefault("filteredSearchResults",[]).find(function(n){return e===n.get("language.code")&&t&&(t.get("id")==="".concat(n.get("language.source"))||"".concat(t.get("language.source"))===n.get("id"))})
this.set("selectedEntry",n||null)}),previewURL:Ember.computed("selectedEntry.permalink",function(){return this.getWithDefault("selectedEntry.permalink",!1)}),previewState:Ember.computed("lang",function(){return{lang:this.get("lang")}}),addNewContext:Ember.computed("creatablePostTypes",function(){var e=this.get("creatablePostTypes")
return 1===e.length?e[0].label:(0,t.t)("common.content.entity")}),creatablePostTypes:Ember.computed(function(){return window.csAppData.creatablePostTypes.map(function(e){return{value:e.type,label:e.name}})}),availablePostStatuses:Ember.computed(function(){return[{value:"publish",label:(0,t.t)("app.status.publish")},{value:"draft",label:(0,t.t)("app.status.draft")}]}),addNewSlugPlaceholder:Ember.computed("addNewTitle",function(){return Ember.String.dasherize(this.get("addNewTitle").trim())}),pageTemplateOptions:Ember.computed(function(){return window.csAppData.pageTemplates}),actions:{openAddNew:function(){this.set("addNewTitle",""),this.set("addNewPostType",this.get("creatablePostTypes")[0].value),this.set("addNewPageTemplate",window.csAppData.defaultPageTemplate||"default"),this.set("addNewStatus","publish"),this.set("addNewSlug",""),this.set("showAddNew",!0)},closeAddNew:function(){this.set("showAddNew",!1)},selectEntry:function(e){e.get("id")&&e.get("id")!==this.get("selectedEntry.id")?this.set("selectedEntry",e):this.set("selectedEntry",!1)}}})
e.default=n}),define("tco-app/content/entry/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),postType:(0,n.default)(),postStatus:(0,n.default)(),postTypeLabel:(0,n.default)(),modified:(0,n.default)(),permalink:(0,n.default)(),language:(0,n.default)(),ui:Ember.inject.service(),meta:Ember.computed("postType","modified","postStatus",function(){var e=[]
e.push(this.get("postTypeLabel"))
var t=this.get("postStatus")
return"publish"!==t&&window.csAppData.postStatuses[t]&&e.push(window.csAppData.postStatuses[t]),e.push(this.get("modified")),this.get("ui.isRTL")&&e.reverse(),e.join(" &bull; ")}),selected:Ember.computed("ui.builderIndexSelectedEntry",function(){return this.get("ui.builderIndexSelectedEntry.id")===this.get("id")})})
e.default=o}),define("tco-app/content/route",["exports","tco-app/mixins/route-authorization"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Route.extend(t.default,{acl:["canUseBuilder"],routeUI:{bar:["collapse","preview-sizer","cheatsheet"],orientation:"vertical"},beforeModel:function(e){this.permissionCheck()
var t=Ember.get(e.to,"queryParams.lang")
t&&!Object.keys(window.csAppData.wpmlLanguages).includes(t)&&this.transitionTo({queryParams:{lang:window.csAppData.wpmlDefault}})},model:function(){return Ember.RSVP.hash({entries:this.store.findAll("content/entry")})},updateSearch:function(e){var t=this.get("ui.search").getTarget("builder-index")
t.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),t.updateIndex(e.map(function(e){return{id:e.get("id"),title:e.get("title")}}))},afterModel:function(e){this.updateSearch(e.entries)},setupController:function(e,t){this._super(e,t),this.get("ui").setRouteUI(this),this.set("ui.wpmlActiveLanguage",e.get("lang")),e.set("selectedEntry",null)},actions:{addNew:function(){var e=this,t=this.get("i18n").t("common.content.entity"),n=this.controllerFor(this.routeName),o=n.get("addNewTitle")
if(!o)return this.get("ui").notify(this.get("i18n").t("app.notify.title-required",{context:t}),"error")
var r=n.get("addNewStatus"),a=n.get("addNewPostType"),i=n.get("addNewSlug")||Ember.String.dasherize(o.trim())
n.set("showAddNew",!1),n.set("selectedEntry",null),this.get("ui").beginSaveProgress()
var s=this.store.createRecord("content/content",{title:o,postStatus:r,postName:i,postType:a}),l=this.store.createRecord("content/entry",{title:o,modified:window.csAppData.today})
"page"===a&&s.set("settings.general",{post_title:o,post_status:r,page_template:n.get("addNewPageTemplate")}),s.save().then(function(n){l.set("id",n.get("id")),l.set("title",n.get("title")),l.set("postStatus",n.get("postStatus")),l.set("postType",n.get("postType")),l.set("postTypeLabel",n.get("postTypeLabel")),l.set("language",n.get("language")),l.set("modified",n.get("modified")),l.set("permalink",n.get("permalink")),l.save(),e.updateSearch(e.store.peekAll("content/entry")),e.get("ui").endSaveProgress(),e.get("ui").notify(e.get("i18n").t("app.notify.created",{context:t}),"success")}).catch(function(n){console.warn("Could not create new content",n),e.get("ui").endSaveProgress(),e.get("ui").notify(e.get("i18n").t("app.notify.failed-to-create",{context:t}),"error")})}}})
e.default=n}),define("tco-app/content/template-entry/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)()})
e.default=o}),define("tco-app/content/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"G/wok7WB",block:'{"symbols":["entry"],"statements":[[4,"global/cs-window",null,[["screen"],["content"]],{"statements":[[4,"workspace/cs-workspace",null,null,{"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[7,"h2"],[11,"class","cs-workspace-title"],[9],[1,[27,"t",["common.title.content"],null],false],[10],[0,"\\n"],[7,"div"],[11,"class","cs-workspace-search"],[9],[0,"\\n"],[4,"unless",[[23,["showAddNew"]]],null,{"statements":[[0,"  "],[1,[27,"common/search-bar",null,[["target","placeholder","autoFocus"],["builder-index",[27,"t",["app.search"],null],true]]],false],[0,"\\n"],[4,"if",[[27,"gt",[[23,["creatablePostTypes","length"]],0],null]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"openAddNew"],null]],[9],[1,[27,"icon",["fa-plus"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"if",[[23,["showAddNew"]]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"closeAddNew"],null]],[9],[1,[27,"icon",["fa-arrow-alt-left-fas"],null],false],[7,"span"],[9],[1,[27,"t",["app.back"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["showAddNew"]]],null,{"statements":[[4,"workspace/workspace-content",null,null,{"statements":[[7,"div"],[11,"class","cs-controls"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-control-group"],[9],[0,"\\n    "],[7,"header"],[11,"class","cs-control-group-header"],[9],[7,"span"],[11,"class","cs-control-group-label"],[9],[1,[27,"t",["app.create-thing"],[["context"],[[23,["addNewContext"]]]]],false],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.title"],null],false],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"input",null,[["value","placeholder"],[[23,["addNewTitle"]],[27,"t",["app.thing-title"],[["context"],[[23,["addNewContext"]]]]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"],[4,"if",[[27,"gt",[[23,["creatablePostTypes","length"]],1],null]],null,{"statements":[[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.post-type"],null],false],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"forms/styled-select",null,[["value","options"],[[23,["addNewPostType"]],[23,["creatablePostTypes"]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.status"],null],false],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"forms/styled-select",null,[["value","options"],[[23,["addNewStatus"]],[23,["availablePostStatuses"]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n\\n"],[4,"if",[[27,"eq",[[23,["addNewPostType"]],"page"],null]],null,{"statements":[[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[0,"Page Template"],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"forms/styled-select",null,[["value","options"],[[23,["addNewPageTemplate"]],[23,["pageTemplateOptions"]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n"]],"parameters":[]},null],[0,"      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[0,"Slug"],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[1,[27,"input",null,[["value","placeholder"],[[23,["addNewSlug"]],[23,["addNewSlugPlaceholder"]]]]],false],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[0," "],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[7,"button"],[11,"class","cs-btn"],[12,"onclick",[27,"action",[[22,0,[]],[27,"route-action",["addNew",[23,["addNewTitle"]]],null]],null]],[9],[1,[27,"t",["app.create"],null],false],[10],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[4,"workspace/workspace-content",null,[["name","linkedSearch"],["search-results","builder-index"]],{"statements":[[0,"\\n"],[4,"each",[[27,"filter-by",["isDeleted",false,[23,["searchResults"]]],null]],null,{"statements":[[4,"common/index-entry",null,[["onClick","title","meta","canEdit","isNew","selected"],[[27,"action",[[22,0,[]],"selectEntry",[22,1,[]]],null],[22,1,["title"]],[22,1,["meta"]],false,[22,1,["isNew"]],[27,"eq",[[22,1,["id"]],[23,["selectedEntry","id"]]],null]]],{"statements":[[4,"if",[[27,"and",[[27,"contains",[[23,["activeLanguage"]],[22,1,["language","fallback"]]],null],[27,"contains",[[22,1,["postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[4,"link-to",["content.builder",[22,1,["id"]],[27,"query-params",null,[["lang"],[[23,["activeLanguage"]]]]]],null,{"statements":[[1,[27,"t",["app.translate"],null],false]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},{"statements":[[4,"link-to",["content.builder",[22,1,["id"]]],null,{"statements":[[1,[27,"t",["app.edit"],null],false]],"parameters":[]},null],[0,"\\n"]],"parameters":[]}]],"parameters":[]},null]],"parameters":[1]},{"statements":[[4,"workspace/workspace-message",null,[["title"],[[27,"t",["app.no-things-found"],[["context"],[[27,"t",["common.content.entity"],null]]]]]],{"statements":[[7,"p"],[9],[1,[27,"t",["app.refine-search"],[["context"],[[27,"t",["common.content.entity"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[1,[21,"outlet"],false],[0,"\\n\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[4,"if",[[23,["previewURL"]]],null,{"statements":[[4,"unless",[[27,"and",[[27,"contains",[[23,["activeLanguage"]],[23,["selectedEntry","language","fallback"]]],null],[27,"contains",[[23,["selectedEntry","postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[1,[27,"common/preview-frame",null,[["src","state","preloader","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],"content",[27,"route-action",["observerNav"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.translate"],null]]],{"statements":[[7,"p"],[9],[1,[27,"t",["app.translation.blank"],[["context"],[[27,"t",["common.content.entity"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,null,{"statements":[[7,"div"],[11,"class","cs-welcome-icon cs-welcome-icon-cs-logo"],[9],[0,"\\n  "],[1,[27,"icon",[[23,["ui","contentLogoPath"]]],null],false],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[23,["ui","wpmlLanguages"]]],null,{"statements":[[4,"if",[[27,"or",[[27,"not",[[23,["selectedEntry"]]],null],[27,"contains",[[23,["selectedEntry","postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/content/template.hbs"}})
e.default=t}),define("tco-app/content/template/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/content/template/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),elements:(0,n.default)()})
e.default=o}),define("tco-app/controls/service",["exports","tco-app/src/lib/http"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({store:Ember.inject.service(),i18n:Ember.inject.service(),postOptionCache:Ember.Object.create(),fontManager:Ember.inject.service(),getOptionList:function(e){var t=this.getChoiceList(e),n=[]
for(var o in t)t.hasOwnProperty(o)&&n.push({value:o,label:t[o]})
return n},getChoiceList:function(e){return"fonts"===e?this.get("fontChoices"):"font-weights"===e?this.get("normalizedFontWeights"):[]},controlFilter:function(e,t){if("font-weights"===e){var n=this.get("normalizedFonts")[t]
if(n)return this.getOptionList("font-weights").filter(function(e){return n.weights.includes(e.value)})}},normalizedFonts:Ember.computed(function(){var e={},t=this.get("config.global.font_data")
for(var n in t)e[t[n].family]=t[n]
return e}),fontChoices:Ember.computed(function(){var e=this.get("normalizedFonts"),t={}
for(var n in e)t[n]=this.get("i18n").t("app.controls.font-family.select",{family:n,source:Ember.String.capitalize(e[n].source)}).toString()
return t}),normalizedFontWeights:Ember.computed("fontManager.allWeights",function(){var e=this,t={}
return this.get("fontManager.allWeights").forEach(function(n){n.includes("i")&&(n+="talic"),t[n]=e.get("i18n").t("app.font-weight.".concat(n)).toString()}),t}),getPostOptions:function(e){var n=this
return new Ember.RSVP.Promise(function(o,r){var a=n.get("postOptionCache.".concat(e,".timestamp")),i=n.get("postOptionCache.".concat(e,".options")),s=Date.now(),l=new Date(s-6e4)
if(i&&a&&a>l)return o(i);(0,t.requestOne)("dynamic-options::post_picker",{post_type:e}).then(function(t){var r=t.options
n.set("postOptionCache.".concat(e),{timestamp:s,options:r}),o(r)},r)})}})
e.default=n}),define("tco-app/design-cloud/item/adapter",["exports","ember-data/adapters/json-api","tco-app/src/lib/http"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({initialLoad:!1,noCache:!1,findAll:function(){return new Ember.RSVP.Promise(function(e,t){var o="".concat(window.csAppData.designCloudApiUrl,"/index");(0,n.downloadFile)(o,{responseType:"json"}).then(function(t){var n=t.response
e(n||[])},t)})},findRecord:function(e,t,n){var o=this
return new Ember.RSVP.Promise(function(e,t){o.findAll().then(function(t){e(t.find(function(e){return n===e.get("id")}))},t)})},query:function(){return this.findAll()},shouldBackgroundReloadAll:function(){return!1},shouldReloadAll:function(){return!0},shouldReloadRecord:function(){return!1},shouldBackgroundReloadRecord:function(){return!1},createRecord:function(){return Ember.RSVP.resolve(void 0)},updateRecord:function(){return Ember.RSVP.resolve(void 0)},deleteRecord:function(){return Ember.RSVP.resolve(void 0)}})
e.default=o}),define("tco-app/design-cloud/item/model",["exports","ember-data","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.Model.extend({title:(0,n.default)(),demoUrl:(0,n.default)(),thumbnailUrl:(0,n.default)(),status:(0,n.default)(),assetType:(0,n.default)(),authorName:(0,n.default)(),authorUrl:(0,n.default)(),createdAt:(0,n.default)(),proOnly:(0,n.default)(),packageSignature:(0,n.default)(),popularity:(0,n.default)(),isInstalled:!1,checkInstalled:function(){var e=this
this.set("isInstalled",!1),this.get("packageSignature")&&this.get("store").peekAll("template-manager/stub").find(function(t){return!t.get("isDeleted")&&"dc-".concat(e.get("packageSignature"))===t.get("packageSignature")})&&this.set("isInstalled",!0)}})
e.default=o})
define("tco-app/design-cloud/item/serializer",["exports","ember-data/serializers/json-api","uuid/v4"],function(e,t,n){function o(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({normalizeKey:function(e){return Ember.String.camelize(e.replace(/\d+\.\s+/,""))},normalizeResponse:function(e,t,n){var r=this
return{data:n.map(function(e){var n=e.id,a=o(e,["id"])
return{id:n,type:t.modelName,attributes:Object.keys(a).reduce(function(e,t){return e[r.normalizeKey(t)]=a[t],e},{})}})}}})
e.default=r}),define("tco-app/design-cloud/route",["exports","uuid/v4","tco-app/mixins/route-authorization","tco-app/src/lib/i18n"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Route.extend(n.default,{templateService:Ember.inject.service("template-manager"),designCloud:Ember.inject.service("design-cloud"),acl:["templates.design_cloud"],routeUI:{bar:["cheatsheet"]},beforeModel:function(){this.permissionCheck()},model:function(){return Ember.RSVP.hash({elementDefinitions:this.store.findAll("element/definition"),templateStubs:this.store.findAll("template-manager/stub"),colors:this.store.findAll("color-manager/selection"),fonts:this.store.findAll("font-manager/selection"),config:this.get("config").fetch("template-manager"),items:this.store.findAll("design-cloud/item"),validation:this.get("designCloud").validation()})},afterModel:function(e){e.items.forEach(function(e){return e.checkInstalled()})},activate:function(){this.modelFor(this.routeName).items.forEach(function(e){return e.checkInstalled()})},setupController:function(e,t){this._super.apply(this,arguments),this.get("ui").setRouteUI(this),e.set("templateStubs",t.templateStubs)},actions:{installItem:function(e){var t=this
if(!e.get("isInstalling")&&!e.get("isInstalled"))if(this.controllerFor(this.routeName).get("model.validation")){var n=e.get("title"),r=function(){e.set("isInstalling",!0),t.get("designCloud").installDesignAsset(e).then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.installed",{context:n}),"success"),e.set("isInstalling",!1),e.set("isInstalled",!0)},function(o){console.warn("Failed to install asset",o),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-install",{context:n}),"error"),e.set("isInstalling",!1)})}
e.get("assetType").includes("site")?this.get("ui").confirm({noSkip:!0,message:window.csAppData.siteConfirmMessage,accept:function(){return r()},acceptClass:"sad"}):(this.get("ui").notify(this.get("i18n").t("app.notify.installing",{context:n})),r())}else this.get("ui").confirm({message:(0,o.t)("app.design-cloud.validate.confirm"),acceptBtn:(0,o.t)("app.go-validate"),back:!0,acceptUrl:this.get("ui.validationUrl")})}}})
e.default=r}),define("tco-app/design-cloud/service",["exports","tco-app/src/lib/http","tco-app/src/util/base64","tco-app/design-cloud/site-importer"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Service.extend({ui:Ember.inject.service(),templateManagerService:Ember.inject.service("template-manager"),installQueueTail:Ember.RSVP.Promise.resolve(),installQueueAdd:function(e){var t=this.get("installQueueTail"),n=new Ember.RSVP.Promise(function(n,o){var r=function(){e().then(n,o)}
t.then(r,r)})
return this.set("installQueueTail",n),n},installDesignAsset:function(e){var r=this
return this.installQueueAdd(function(){return new Ember.RSVP.Promise(function(a,i){var s=(0,n.base64Encode)("".concat(window.csAppData.env.productKey,"| ").concat(window.csAppData.siteUrl)),l="".concat(window.csAppData.designCloudApiUrl,"/asset/").concat(e.get("id"),"?credentials=").concat(s);(0,t.downloadFile)(l,{responseType:"json"}).then(function(t){var n=t.response
if("template"===n.type)n.package&&n.package.url?r.get("templateManagerService").remoteImport(n.package.url,"dc-".concat(e.get("packageSignature"))).then(a,i):i()
else if("site-install"===n.type){var s=n.package||{},l=s.site,c=s.sliders;(0,o.default)(l,c).then(a,i)}else i()},i)})})},validationCache:!1,validation:function(){var e=this
if(!window.csAppData.env.productKey)return Ember.RSVP.resolve(!1)
var n=this.get("validationCache")
if(n)return Ember.RSVP.resolve(n)
var o="https://theme.co/apex/api-v2/lookup/".concat(window.csAppData.env.productKey,"?siteurl=").concat(window.csAppData.siteUrl)
return new Ember.RSVP.Promise(function(n,r){(0,t.downloadFile)(o,{responseType:"json"}).then(function(t){var o=t.response,r={}
Object.keys(o).forEach(function(e){r[Ember.String.camelize(e)]=o[e]}),e.set("validationCache",r),n(r)},r)})}})
e.default=r}),define("tco-app/design-cloud/site-importer",["exports","tco-app/src/lib/i18n","tco-app/src/lib/http"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,o){return new Ember.RSVP.Promise(function(r,a){var i=function(){this.$el=Ember.$(this.markup),this.$message=this.$el.find(".cs-progress-title"),this.$bar=this.$el.find(".cs-progress-bar-inner")}
Ember.$.extend(i.prototype,{markup:"".concat('<div class="cs-action-modal-outer"><div class="cs-action-modal-inner"><div class="cs-progress"><div class="cs-progress-title"></div><div class="cs-progress-bar-outer"><div class="cs-progress-bar-inner"></div></div></div><div class="cs-progress-complete"><div class="cs-progress-complete-icon dashicons dashicons-yes"></div><div class="cs-progress-complete-title">').concat((0,t.t)("app.design-cloud.site-import.complete"),"</div>")+"</div></div></div>",start:function(){var e=this
this.message((0,t.t)("app.design-cloud.site-import.start")),this.$el.addClass("cs-processing"),this.$el.appendTo("body"),setTimeout(function(){e.$el.addClass("cs-active")},0),this.setProgress(0)},message:function(e){this.$message.html(e)},setProgress:function(e){this.$bar.css("width","".concat(Math.round(100*(.9*e+.1)),"%"))},simulateProgress:function(){this.message((0,t.t)("app.design-cloud.site-import.simulated")),this.$bar.animate({width:"80%"},250)},complete:function(){var e=this
this.message("&nbsp;"),this.$bar.animate({width:"100%"},250),setTimeout(function(){e.$el.removeClass("cs-processing"),e.close(r)},400)},fail:function(e){e&&this.message(e),this.close(a)},close:function(e){var t=this
setTimeout(function(){t.$el.removeClass("cs-active")},1500),setTimeout(function(){t.$el.detach(),t.setProgress(0),t.message(""),e()},2e3)}})
var s=new i,l=function(){}
Ember.$.extend(l.prototype,{init:function(e){this.demoData=e,this.demoData.attempts=1,this.demoData.session="s_".concat(Math.round((new Date).getTime()+100*Math.random())),s.start(),this.acknowledge({data:{},first:!0})},acknowledge:function(e){var o=this
if(e.data||e.first){if(this.demoData.attempts=0,e.data.debug_message&&console.log("X Demo Debug",e.data.debug_message,e.data.debug||null),!1===e.success)return this.failure(e.data.message,e.data)
if(e.data.message&&s.message(e.data.message),e.data.completion&&!0===e.data.completion)return e.data.debug&&console.log(e.data.debug),this.complete()
e.data.completion&&s.setProgress(e.data.completion.ratio)}else if(s.message(this.timeOutMessage(this.demoData.attempts++)),this.demoData.attempts>25)return this.failure((0,t.t)("app.design-cloud.site-import.failure"),e)
setTimeout(function(){(0,n.request)("design-cloud::import_site",o.demoData).then(function(e){o.acknowledge(e)},function(e){return o.failure()})},40*this.demoData.attempts)},complete:function(){s.complete()},failure:function(e,t){s.fail(e),console.error("X Demo Importer failure",t||{})},timeOutMessage:function(e){return e>20?(0,t.t)("app.design-cloud.site-import.timeout3"):e>10?(0,t.t)("app.design-cloud.site-import.timeout2"):(0,t.t)("app.design-cloud.site-import.timeout1")}})
var c=new l
c.init({site:e,sliders:o})})}}),define("tco-app/design-cloud/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"uGuZG/54",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["design-cloud"]],{"statements":[[0,"\\n"],[4,"workspace/cs-workspace",null,null,{"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[7,"h2"],[11,"class","cs-workspace-title"],[9],[1,[27,"t",["app.design-cloud.title"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-content",null,null,{"statements":[[1,[27,"design-cloud/dc-workspace",null,[["templateStubs","validation"],[[23,["templateStubs"]],[23,["model","validation"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[1,[27,"design-cloud/dc-canvas",null,[["items","validation","onInstallItem"],[[23,["model","items"]],[23,["model","validation"]],[27,"route-action",["installItem"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/design-cloud/template.hbs"}})
e.default=t}),define("tco-app/dev/route",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({})
e.default=t}),define("tco-app/dev/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"UnWKMbcn",block:'{"symbols":[],"statements":[[1,[27,"react-bridge/dev-route",null,[["emberClass"],["cs-window"]]],false]],"hasEval":false}',meta:{moduleName:"tco-app/dev/template.hbs"}})
e.default=t}),define("tco-app/element/definition/adapter",["exports","tco-app/adapters/cs-client-side-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/element/definition/model",["exports","ember-data/model","ember-data/attr","ember-data/relationships"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=["undefined","root","region","bar","container","section","column"],a=["undefined","root","region"],i=t.default.extend({title:(0,n.default)(),values:(0,n.default)(),style:(0,n.default)(),options:(0,n.default)(),active:(0,n.default)(),controlsStd:(0,n.default)(),controlGroups:(0,n.default)(),controls:(0,n.default)(),currentUser:Ember.inject.service(),icon:(0,n.default)({defaultValue:function(){return"nav-elements-line"}}),presets:(0,o.hasMany)("element/presets"),defaults:Ember.computed("values",function(){var e=this.get("values"),t={}
for(var n in e)e.hasOwnProperty(n)&&(t[n]=Ember.isNone(e[n].default)?null:e[n].default)
return t}),iconPath:Ember.computed("icon",function(){var e=this.get("icon")
return"native"===e?"elements/".concat(this.get("id")):e}),canSetDefault:Ember.computed(function(){var e=this.get("id")
return!e.includes("classic:")&&!a.includes(e)}),showInLibrary:Ember.computed("options.classic.child",function(){return!(!this.get("active")||this.get("options.classic.child"))&&(!1!==this.get("options.library")&&!r.includes(this.getWithDefault("id","").replace("classic:","")))})})
e.default=i}),define("tco-app/element/preset/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/element/preset/model",["exports","ember-data","ember-data/attr","ember-data/relationships"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.Model.extend({title:(0,n.default)(),element:(0,o.belongsTo)("element/definition"),atts:(0,n.default)(),readonly:(0,n.default)({defaultValue:!1}),internal:(0,n.default)({defaultValue:!1}),values:Ember.computed("atts","element",function(){var e=this.get("atts")
return"string"==typeof e&&(e=JSON.parse(e)),Object.assign({},this.get("element.defaults"),e)})})
e.default=r}),define("tco-app/element/service",["exports","tco-app/src/actions/elements"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend(Ember.Evented,{ui:Ember.inject.service(),redux:Ember.inject.service(),preview:Ember.inject.service(),store:Ember.inject.service(),i18n:Ember.inject.service(),getDefinition:function(e){return this.getDefinitionByType(this.get("redux").getState().elements[e]._type)},getDefinitionByType:function(e){try{if(e){var t=this.get("store").peekRecord("element/definition",e)
if(t)return t}}catch(n){console.warn("Unable to locate element definition",n)}return this.get("store").peekRecord("element/definition","undefined")},getTitle:function(e){var t=this.getDefinition(e)
return t?t.get("title"):"Element"}})
e.default=n}),define("tco-app/enhancers/index",["exports","ember-redux/enhancers/index"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/flash/object",["exports","ember-cli-flash/flash/object"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/font-manager/selection/adapter",["exports","tco-app/adapters/cs-option-list-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({option:"cornerstone_font_items"})
e.default=n}),define("tco-app/font-manager/selection/model",["exports","ember-data","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.Model.extend({title:(0,n.default)(),family:(0,n.default)(),stack:(0,n.default)(),source:(0,n.default)(),order:(0,n.default)(),ready:function(){var e=this.get("weights")
e.addObject||this.set("weights",Ember.A(e))},weights:(0,n.default)({defaultValue:function(){return Ember.A()}}),selectable:Ember.computed("title","weights.[]",function(){return!this.get("isDeleted")&&this.get("title")&&this.get("weights.length")>0}),_id:Ember.computed.alias("id"),sortableTitle:Ember.computed("title","order",function(){return"".concat(this.get("order")," ").concat(this.get("title"))})})
e.default=o}),define("tco-app/font-manager/selection/serializer",["exports","ember-data/serializers/json-api","uuid/v4"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({normalizeResponse:function(e,t,o){var r=0
return{data:o.map(function(e){return e.order=r++,{id:e._id?e._id:(0,n.default)(),type:t.modelName,attributes:e}})}},serialize:function(){var e=this._super.apply(this,arguments)
return e.data.attributes._id=e.data.id,e.data.attributes}})
e.default=o}),define("tco-app/font-manager/service",["exports","webfontloader","debounce-promise"],function(e,t,n){function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=["woff2","woff","ttf","svg","eot"].reverse(),a=Ember.Service.extend({store:Ember.inject.service(),preview:Ember.inject.service(),config:Ember.inject.service(),allWeights:["100","100i","200","200i","300","300i","400","400i","500","500i","600","600i","700","700i","800","800i","900","900i"],loadQueue:{},saved:0,activeItems:Ember.computed.filterBy("items","selectable",!0),fontItems:Ember.computed.sort("activeItems","orderSort"),orderSort:["order"],init:function(){this.set("flushQueue",(0,n.default)(this.get("_flushQueue")),350)},setup:function(e,t){this.set("items",e),t.set("value.typekitItems",Ember.A(t.get("value.typekitItems"))),t.set("value.googleSubsets",Ember.A(t.get("value.googleSubsets"))),t.set("value.customFontItems",Ember.A(t.get("value.customFontItems"))),this.set("fontConfig",t)},fallbackFont:Ember.computed(function(){return Ember.assign({},this.get("config.global.fallbackFont"))}),locateFont:function(e){var t=this.get("activeItems").find(function(t){return e===Ember.get(t,"_id")})
return t||(t={family:"inherit",stack:"inherit",weights:["inherit"],source:"system"}),t},normalizeWeight:function(e){return e?e.indexOf(":")?e:"inherit:".concat(e):"inherit:inherit"},resolveFontWeight:function(e){var t=this.normalizeWeight(e).split(":")
if("inherit"===t[0])return t[1]
var n=this.locateFont(t[0])
return Ember.get(n,"weights").includes(t[1])?t[1]:Ember.get(n,"weights")[0]},processQueue:function(e){var n=this
return new Promise(function(o){var r=Ember.run.later(n,function(){o()},5e3)
t.default.load(Ember.assign({active:function(){Ember.run.cancel(r),o()},inactive:function(e){Ember.run.cancel(r),console.warn("Unable to load custom fonts",e),o()}},e))})},resolveFontFamilyStack:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]
if("inherit"===e)return"inherit"
var n=this.locateFont(e)
return t&&this.loadFont(n),Ember.get(n,"stack")},_flushQueue:function(){var e=this,t=new Ember.RSVP.Promise(function(t){var n=e.get("loadQueue")
window.csAppData.isPreview||e.get("preview.xfr").message("preview:font-sync",n),Ember.isEmpty(Object.keys(n))?t():Ember.run.next(function(){return e.processQueue(n).then(t)})}),n=function(){e.set("loadQueue",{})}
return t.then(n,n),t},loadFont:function(e){"string"===Ember.typeOf(e)&&(e=this.locateFont(e))
var t=Ember.get(e,"source")
return"typekit"===t&&this.set("loadQueue.typekit",{id:this.get("fontConfig.value.typekitKitID")}),"google"===t&&window.csAppData.load_google_fonts&&this.addGoogleFont(e,this.getWithDefault("fontConfig.value.googleSubsets",[])),"custom"===t&&this.addCustomFont(e.stack),this.flushQueue()},constructGoogleFontFamily:function(e,t){var n="".concat(Ember.get(e,"family"),":").concat(Ember.get(e,"weights").join(","),":latin,latin-ext")
return Ember.isEmpty(t)||(n+=",".concat(t.join(","))),n},addGoogleFont:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.getWithDefault("loadQueue.google",{})
n.families||(n.families=[])
var o=this.constructGoogleFontFamily(e,t)
n.families.includes(o)||n.families.push(o),this.set("loadQueue.google",n)},addCustomFont:function(e){var t=this.getWithDefault("loadQueue.custom",{})
t.families||(t.families=[]),t.families.includes(e)||t.families.push(e),this.set("loadQueue.custom",t)},updateCustomFonts:function(){var e=this
this.getWithDefault("fontConfig.value.customFontItems",[]).forEach(function(t){return e.generateFontFace(t)})
var t=this.getWithDefault("fontConfig.value.customFontItems",[]).map(function(e){return Ember.get(e,"css")}).join(" ")
this.updateStyleTag("cs-custom-fonts",t)},didReceiveAttrs:function(){this.generateFontFace()},generateFontFace:function(e){var t=Ember.get(e,"files").reduce(function(e,t){var n=t.weight,o=t.style,r=t.url,a="".concat(n,"|").concat(o)
return e[a]||(e[a]=[]),e[a].push(r),e},{}),n=Object.keys(t).map(function(n){var a=o(n.split("|"),2),i=a[0],s=a[1],l=t[n].sort(function(e,t){return Ember.compare(r.indexOf(t.split(".").pop()),r.indexOf(e.split(".").pop()))}).map(function(e){return'url("'.concat(e,'") ').concat((t=e.split(".").pop(),(n={woff:"woff",woff2:"woff2",ttf:"truetype"})[t]?"format('".concat(n[t],"')"):""))
var t,n})
return'@font-face { font-family: "'.concat(Ember.get(e,"family"),'"; src: ').concat(l.join(","),";")+"font-weight: ".concat(i,"; font-style: ").concat(s,"; }")}).join(" ")
Ember.set(e,"css",n)},updateStyleTag:function(e,t){var n=window.document.getElementById(e)
n&&n.remove()
var o=document.createElement("style")
o.type="text/css",o.id=e,o.styleSheet?o.styleSheet.cssText=t:o.appendChild(window.document.createTextNode(t)),window.document.head.appendChild(o)}})
e.default=a}),define("tco-app/footers/controller",["exports","tco-app/util/flatten-assignments"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),previewState:{route:"regions-index",inc:0},templateOptions:Ember.computed("templates.[]",function(){return this.getWithDefault("templates",[]).sortBy("title").map(function(e){return{value:e.get("id"),label:e.get("title")}})}),previewing:Ember.computed("selectedTemplate","selected","defaultSelected",function(){return this.get("selectedTemplate")?"footer-template:".concat(this.get("selectedTemplate")):this.get("selected.id")?"footer:".concat(this.get("selected.id")):this.get("defaultSelected")?"footer-template:".concat(this.get("model.defaultTemplate")):"off"}),previewUpdate:Ember.observer("previewing",function(){Ember.run.debounce(this,function(){this.incrementProperty("previewState.inc"),this.set("previewState.previewing",this.get("previewing"))}.bind(this),5)}),previewURL:Ember.computed("url","selectedUrl",function(){var e=this.get("url")
return e||(this.get("selectedUrl")?this.get("selectedUrl"):this.get("ui.defaultPreviewUrl"))}),resetSelected:Ember.observer("activeLanguage",function(){var e=this.get("activeLanguage"),t=this.get("selected"),n=this.get("model.entries").find(function(n){return e===n.get("language.code")&&t&&(t.get("id")==="".concat(n.get("language.source"))||"".concat(t.get("language.source"))===n.get("id"))})
this.set("selected",n||null)}),selectedAssignment:Ember.computed("selected","model.assignments.value","flattenedAssignContexts",function(){var e=this.get("model.assignments.value"),t=this.get("flattenedAssignContexts"),n=this.get("selected.language.source")
for(var o in n||(n=this.get("selected.id")),n&&(n=String(n)),e)if(e.hasOwnProperty(o)&&"".concat(n)===e[o]){if("global"===o)return"global"
if(t[o])return t[o]}return null}),selectedUrl:Ember.computed("selectedAssignment",function(){var e=this.get("selectedAssignment")
return"global"===e?this.get("ui.defaultPreviewUrl"):e&&e.url?e.url:null}),assignContexts:Ember.computed.alias("model.config.assign_contexts"),flattenedAssignContexts:Ember.computed("assignContexts",function(){return(0,t.default)(this.get("assignContexts"))})})
e.default=n}),define("tco-app/footers/entry/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),language:(0,n.default)({defaultValue:function(){return{code:window.csAppData.wpmlDefault,source:null,fallback:Object.keys(window.csAppData.wpmlLanguages).filter(function(e){return e!==window.csAppData.wpmlDefault})}}}),titleObserver:Ember.observer("title",function(){this.get("title")||this.set("title",this.get("i18n").t("common.untitled"))}),modified:(0,n.default)({defaultValue:function(){return""}}),ui:Ember.inject.service(),meta:Ember.computed("assignments",function(){var e=this.get("assignments")
return e&&e.length||(e=[{label:this.get("i18n").t("app.unassigned")}]),e.map(function(e){return e.label}).join(" &bull; ")})})
e.default=o}),define("tco-app/footers/footer/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/footers/footer/controller",["exports","tco-app/util/flatten-assignments","tco-app/src/lib/i18n"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Controller.extend({colorManager:Ember.inject.service(),fontManager:Ember.inject.service(),config:Ember.inject.service(),url:null,queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),previewInc:0,previewState:Ember.computed("model.footer.id","previewInc","lang","colorManager.saved","fontManager.saved",function(){return this.get("colorManager.saved"),this.get("fontManager.saved"),{route:"footer",mode:"footers",custom_js:{"x-footer-custom-scripts":this.get("model.footer.settings.customJS")}}}),previewURL:Ember.computed("url","assignedUrl",function(){var e=this.get("url")
if(e)return e
var t=this.get("assignedUrl")
return t||this.get("ui.defaultPreviewUrl")}),assignedContext:Ember.computed("model.footer","model.assignments.value","flattenedAssignContexts",function(){var e=this.get("model.assignments.value"),t=this.get("flattenedAssignContexts"),n=this.get("model.footer.id")
for(var o in e)if(e.hasOwnProperty(o)&&"".concat(n)===e[o]){if("global"===o)return"global"
if(t[o])return t[o]}return null}),assignedUrl:Ember.computed("assignedContext",function(){var e=this.get("assignedContext")
return"global"===e?this.get("ui.defaultPreviewUrl"):e&&e.url?e.url:null}),assignContexts:Ember.computed.alias("model.config.assign_contexts"),flattenedAssignContexts:Ember.computed("assignContexts",function(){var e=this.get("assignContexts")
return Ember.isArray(e)?(0,t.default)(e):[]}),customScriptObserver:Ember.observer("model.footer.settings.customJS",function(){var e=this.get("model.footer.settings.customJS")
this.set("previewState.custom_js.x-footer-custom-scripts",e||null)}),actions:{runCustomJs:function(){this.get("ui").notify((0,n.t)("app.notification-refreshing-preview")),this.incrementProperty("previewState.inc")}}})
e.default=o}),define("tco-app/footers/footer/model",["exports","ember-data/model","ember-data/attr","tco-app/src/reducers/helpers"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({redux:Ember.inject.service("element"),availableRegions:["footer"],title:(0,n.default)(),language:(0,n.default)(),postType:(0,n.default)(),translateable:Ember.computed("postType",function(){return window.csAppData.wpmlTranslateableTypes.includes(this.get("postType"))}),regions:(0,n.default)({defaultValue:function(){return{}}}),settings:(0,n.default)({defaultValue:function(){return{}}}),setupElements:function(){var e=JSON.parse(JSON.stringify(this.get("regions"))),t=this.get("availableRegions").map(function(t){return{_type:"region",_region:t,_modules:Ember.isNone(e[t])?[]:e[t]}})
return this.get("redux").dispatch({type:"BUILDER:SET_CONTEXT",payload:{builder:"footer",renderContext:{mode:"regions",data:{post_id:this.get("id"),mode:"footer"}},permissionContext:"footers",homeRoute:"footers",routePrefix:"footers.footer"}}),this.get("redux").dispatch({type:"ELEMENT_RESET",payload:{_type:"root",_modules:t}}),this},meta:Ember.computed("assignments",function(){var e=this.get("assignments")
return e&&e.length||(e=[{label:this.get("i18n").t("app.unassigned")}]),e.map(function(e){return e.label}).join(" &bull; ")}),updateRegions:function(){var e={}
return((0,o.toTreeFromRoot)(this.get("redux").store.getState().elements)._modules||[]).forEach(function(t){t._modules&&(e[t._region]=t._modules)}),this.set("regions",null),this.set("regions",e),this}})
e.default=r}),define("tco-app/footers/footer/route",["exports","ember-copy","tco-app/mixins/route-authorization","tco-app/src/lib/http"],function(e,t,n,o){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=Ember.Route.extend(n.default,{router:Ember.inject.service(),service:Ember.inject.service("footers"),preview:Ember.inject.service(),acl:["canUseFooters"],routeUI:{bar:["orientation","preview-sizer","view-site","cheatsheet","save"],orientation:"preference"},queryParams:{lang:{refreshModel:!0}},beforeModel:function(e){this.permissionCheck()
var t=Ember.get(e.to,"queryParams.lang")
t&&!Object.keys(window.csAppData.wpmlLanguages).includes(t)&&this.transitionTo({queryParams:{lang:window.csAppData.wpmlDefault}})},model:function(e){var t=this,n=e.footer_id,o=e.lang
return new Ember.RSVP.Promise(function(e,r){var a=t.get("config").fetch("footer-builder"),i=t.store.findAll("element/definition"),s=t.store.query("element/preset",{isDefault:!0}),l=t.store.findRecord("option","cornerstone_footer_assignments"),c=t.store.findAll("font-manager/selection")
new Ember.RSVP.Promise(function(e,r){t.store.findRecord("footers/footer",n).then(function(t){if(!Ember.isEmpty(window.csAppData.wpmlLanguages)&&(o||window.csAppData.wpmlDefault)!==t.getWithDefault("language.code",window.csAppData.wpmlDefault))return e({reroute:"translate",footer:t})
e(t)},r)}).then(function(t){"translate"!==t.reroute?Ember.RSVP.hash({config:a,library:i,defaultPresets:s,assignments:l,footer:t,fontSelections:c}).then(function(t){return e(t)},r):e(t)},r)})},afterModel:function(e,t){if(this.set("ui.unsavedData",!1),"translate"!==e.reroute){var n=this.get("ui.search").getTarget("element-library")
n.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),n.updateIndex(e.library.map(function(e){return{id:e.get("id"),title:e.get("title")}})),e.defaultPresets.forEach(function(e){e.get("element").set("defaultPreset",e)})}else{var o=Ember.get(t.to,"queryParams.lang")
if(o){var r=e.footer.get("language.translations.".concat(o))
r&&this.transitionTo("footers.footer",r,{queryParams:{lang:o}})}else this.transitionTo("footers.footer",e.footer.get("id"),{queryParams:{lang:e.footer.get("language.code")}})}},setupController:function(e,t){if(this._super.apply(this,arguments),this.set("routeUI.viewSiteURL",e.get("assignedUrl")),this.get("ui").setRouteUI(this),this.setActivePane(),e.set("noTranslation","translate"===t.reroute),t.footer){var n=t.footer.get("settings.customJS")
e.set("previewState.custom_js.x-footer-custom-scripts",n||null),t.footer.setupElements()}},renderTemplate:function(){this.render("partials/bar/footer",{outlet:"bar",into:"application"}),this.render("partials/global/footer",{outlet:"global",into:"application"}),this._super(this,arguments)},setActivePane:function(){var e=this
Object.keys(this.getWithDefault("router.router.state.params",{})).forEach(function(t){t.includes("footers.footer.")&&e.set("controller.activePane",t.replace("footers.footer.",""))})},actions:{error:function(e){return!e||(console.log(e),this.transitionTo("footers"))},willTransition:function(e){var t=this
!this.get("ui.unsavedData")||e.targetName.includes("footers.footer")&&Ember.getWithDefault(e.to.queryParams,"lang",null)===this.controllerFor(this.routeName).getWithDefault("lang",null)||(e.abort(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.set("ui.unsavedData",!1),e.retry()},acceptClass:"sad"}))},save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress(),this.modelFor(this.routeName).footer.updateRegions().save().then(function(n){console.log("Saving Footer",n),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.footers.entity")}),"success"),e.set("ui.unsavedData",!1),e.controllerFor(e.routeName).set("lastSave",new Date)}).catch(function(e){console.warn(e),t.notify(this.get("i18n").t("app.notify.failed-to-save",{context:this.get("i18n").t("common.footers.entity")}),"error"),t.endSaveProgress()})},didTransition:function(){return this.setActivePane(),!0},newElement:function(e){"bar"===e.get("atts._type")&&this.send("scrollToBottom")},scrollToBottom:function(){this.get("preview").scrollToBottomAfterRender()},layoutFirstOpen:function(){},selectLanguage:function(e){var t=this.modelFor(this.routeName)
if(e!==this.controllerFor(this.routeName).get("lang")){var n=t.footer.get("language.translations.".concat(e))
Ember.isNone(n)&&(n=t.footer.get("language.source")),Ember.isNone(n)&&(n=t.footer.get("id")),this.transitionTo("footers.footer",n,{queryParams:{lang:e}})}},createTranslation:function(e){var t=this,n=e.source,r=e.lang,a=e.copyFrom,i=this.get("ui")
i.beginSaveProgress()
var s=this.get("i18n").t("app.translation.entity");(0,o.request)("translation::create",{source:n,lang:r,copyFrom:a}).then(function(e){i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.created",{context:s}),"success"),t.store.unloadAll("footers/footer"),t.transitionTo("footers.footer",e.id,{queryParams:{lang:r}})},function(e){return console.warn("Error creating translation",e),i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.failed-to-create",{context:s}),"error")})},handleRemoteAction:function(e){this.send.apply(this,[e.action].concat(r(e.params)))},observerNav:function(e){var t=this,n=e.id,o=e.route,r=e.context,a=[o]
n&&a.push(n)
var i=this.get("ui.unsavedData")
this.get("ui").confirm({noSkip:!0,message:i?this.get("i18n").t("app.streamline-nav-unsaved",{context:r}):this.get("i18n").t("app.streamline-nav",{context:r}),accept:function(){t.set("ui.unsavedData",!1),t.transitionTo.apply(t,a)},acceptClass:"sad"})},toggleSkeletonMode:function(){this.set("ui.skeletonModeActive",!this.get("ui.skeletonModeActive")),this.get("ui.skeletonModeActive")&&this.set("ui.showPreviewSizer",!1)}}})
e.default=a}),define("tco-app/footers/footer/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"kqTFij90",block:'{"symbols":[],"statements":[[1,[21,"react-bridge/navigation-bar"],false],[0,"\\n\\n"],[4,"global/cs-window",null,[["screen"],["footers-footer"]],{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[4,"cs-dock",null,[["isUndocked","isHorizontal"],[[23,["ui","workspaceIsUndocked"]],[23,["ui","workspaceIsHorizontal"]]]],{"statements":[[1,[27,"react-bridge/builder-workspace",null,[["emberClass"],[[27,"concat",["cs-workspace ",[27,"if",[[23,["ui","workspaceIsHorizontal"]],"is-horizontal","is-vertical"],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[0,"\\n"],[1,[27,"common/preview-frame",null,[["src","state","preloader","package","onRemoteAction","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],"footers",[27,"hash",null,[["customCSS"],[[23,["model","footer","settings","customCSS"]]]]],[27,"route-action",["handleRemoteAction"],null],[27,"route-action",["observerNav"],null]]]],false],[0,"\\n\\n"]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.translate"],null]]],{"statements":[[1,[27,"common/create-translation",null,[["targetLang","model","onCreateTranslation","contextLabel"],[[23,["activeLanguage"]],[23,["model","footer"]],[27,"route-action",["createTranslation"],null],[27,"t",["common.footers.entity"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[4,"if",[[27,"and",[[23,["ui","wpmlLanguages"]],[27,"contains",["cs_footer",[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage","top"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null],true]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/footers/footer/template.hbs"}})
e.default=t}),define("tco-app/footers/footer/template/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/footers/footer/template/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),meta:(0,n.default)({defaultValue:function(){return{}}})})
e.default=o}),define("tco-app/footers/route",["exports","tco-app/mixins/route-authorization"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Route.extend(t.default,{acl:["canUseFooters"],routeUI:{bar:["collapse","preview-sizer","cheatsheet"],orientation:"horizontal"},beforeModel:function(){this.store.unloadAll("footers/entry"),this.store.unloadAll("footers/footer/template"),this.permissionCheck()},model:function(){return Ember.RSVP.hash({config:this.get("config").fetch("footer-builder"),templates:this.store.findAll("footers/footer/template"),library:this.store.findAll("element/definition"),entries:this.store.findAll("footers/entry"),assignments:this.store.findRecord("option","cornerstone_footer_assignments"),newFooter:{title:"",template:""},defaultTemplate:"footer:footer-default"})},afterModel:function(e){var t=e.assignments.get("value")
t&&!Ember.isEmpty(t)||e.assignments.set("value",{})},setupController:function(e,t){this._super(e,t),this.get("ui").setRouteUI(this),e.set("activeModal",!1),e.set("selectedTemplate",null),e.set("selected",null),e.set("templates",t.templates?t.templates.toArray():[])},actions:{doEntryAction:function(){this.send.apply(this,arguments)},createDefault:function(){var e=this.get("i18n").t("common.footers.entity"),t=this.get("i18n").t("app.default-thing",{context:e})
this.send("createNew",t,this.modelFor(this.routeName).defaultTemplate,!0)},createNew:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.get("i18n").t("common.footers.entity")
if(!e)return this.get("ui").notify(this.get("i18n").t("app.notify.title-required",{context:r}),"error")
var a={}
if(t){var i=this.store.peekRecord("footers/footer/template",t)
i&&(a._template=i.get("id"))}var s=this.store.createRecord("footers/entry",{title:e}),l=this.store.createRecord("footers/footer",{title:e,settings:a})
this.controllerFor("footers").set("selectedTemplate",null),this.get("ui").beginSaveProgress(),l.save().then(function(e){e.set("settings._template",null),s.set("id",e.id),s.save(),n.get("ui").endSaveProgress(),o?n.transitionTo("footers.footer",e.id):n.get("ui").notify(n.get("i18n").t("app.notify.created",{context:r}),"success")}).catch(function(e){console.warn("Could not create new footer",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-create",{context:r}),"error")})},entryDuplicate:function(e){var t=this
this.get("store").findRecord("footers/footer",e.get("id")).then(function(e){var n=e.serialize(),o=t.get("i18n").t("app.copy-of",{title:n.data.attributes.title}).toString(),r=t.store.createRecord("footers/entry",{title:o}),a=t.store.createRecord("footers/footer",{title:o,regions:n.data.attributes.regions,settings:n.data.attributes.settings}),i=t.get("i18n").t("common.footers.entity")
t.get("ui").beginSaveProgress(),a.save().then(function(e){r.set("id",e.id),r.save(),t.get("ui").notify(t.get("i18n").t("app.notify.duplicated",{context:i})),t.get("ui").endSaveProgress()}).catch(function(e){console.warn("Could not create new footer",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-duplicate",{context:i}),"error"),t.get("ui").endSaveProgress()})})},entryDelete:function(e){var t=this,n=this.get("i18n").t("common.footers.entity")
this.get("ui").confirm({message:this.get("i18n").t("app.notify.delete-confirm-perm",{context:n}),acceptClass:"sad",accept:function(){t.get("store").findRecord("footers/footer",e.get("id")).then(function(o){t.controllerFor("footers").set("selected",null),e.destroyRecord(),o.destroyRecord().then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.deleted",{context:n})),t.modelFor(t.routeName).assignments.reload()},function(e){console.warn("Could not delete footer",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-delete",{context:n}),"error")})})}})},entryTitleUpdate:function(e){var t=this
this.get("store").findRecord("footers/footer",e.get("id")).then(function(n){n.set("title",e.get("title")),t.get("ui").beginSaveProgress(),n.save().then(function(){t.get("ui").endSaveProgress()},function(e){console.warn("Could not update footer title",e)
var n=t.get("i18n").t("common.footers.entity")
t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-update-title",{context:n}),"error")})})},saveTemplate:function(e,t){var n=this,o=this.get("i18n").t("app.footers.template-entity")
if(!t)return this.get("ui").notify(this.get("i18n").t("app.notify.name-required",{context:o}),"error")
var r=this.get("store").peekAll("footers/footer/template").find(function(e){return t===e.get("title")})
r?this.get("ui").confirm({message:this.get("i18n").t("app.notify.name-overwrite-confirm",{context:o}),acceptClass:"sad",accept:function(){n.get("ui").beginSaveProgress(),r.set("meta",{footerId:e.get("id")}),r.save().then(function(){n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.updated",{context:o}),"success")},function(e){n.get("ui").endSaveProgress(),console.warn("Unable to save Footer template",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-update",{context:o}),"error")})}}):(this.get("ui").beginSaveProgress(),this.store.createRecord("footers/footer/template",{meta:{footerId:e.get("id")},title:t}).save().then(function(e){n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.saved",{context:o}),"success"),n.controllerFor("footers").get("templates").pushObject(e)},function(e){n.get("ui").endSaveProgress(),console.warn("Could not update footer title",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-save",{context:o}),"error")}))}}})
e.default=n}),define("tco-app/footers/service",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({selected:null,inspect:function(e,t){this.set("selected",e),t&&t.call()}})
e.default=t}),define("tco-app/footers/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"i7eJgjfT",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["footers"]],{"statements":[[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[27,"eq",["off",[23,["previewing"]]],null]],null,{"statements":[[4,"if",[[27,"eq",["blank",[23,["selectedTemplate"]]],null]],null,{"statements":[[0,"        "],[1,[27,"common/welcome-message",null,[["title"],[[27,"t",["app.templates.blank-welcome"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"common/preview-frame",null,[["src","state","preloader","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],"footers",[27,"route-action",["observerNav"],null]]],{"statements":[],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,null,{"statements":[[0,"        "],[7,"div"],[11,"class","cs-welcome-icon cs-welcome-icon-cs-logo"],[9],[0,"\\n          "],[1,[27,"icon",["logo-pro-inherit"],null],false],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[4,"if",[[27,"and",[[23,["ui","wpmlLanguages"]],[27,"contains",["cs_footer",[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[0,"      "],[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage","top"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null],true]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"workspace/cs-workspace",null,null,{"statements":[[0,"    "],[1,[27,"hf-index",null,[["context","assignContexts","assignments","entries","selected","selectedTemplate","defaultSelected","templateOptions","onAction","activeLanguage","editRoute","onCreate","onSaveTemplate","onTitleUpdate"],["footers",[23,["flattenedAssignContexts"]],[23,["model","assignments"]],[23,["model","entries"]],[23,["selected"]],[23,["selectedTemplate"]],[23,["defaultSelected"]],[23,["templateOptions"]],[27,"route-action",["doEntryAction"],null],[23,["activeLanguage"]],"footers.footer",[27,"route-action",["createNew"],null],[27,"route-action",["saveTemplate"],null],[27,"route-action",["entryTitleUpdate"],null]]]],false],[0,"\\n    "],[1,[21,"outlet"],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/footers/template.hbs"}})
e.default=t})
define("tco-app/fragment/adapter",["exports","tco-app/adapters/cs-longevity-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({csBackgroundReloadRefreshRate:15e4})
e.default=n}),define("tco-app/fragment/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({value:(0,n.default)(),loadedAt:Ember.on("didLoad",function(){this.set("loadedAt",new Date)})})
e.default=o}),define("tco-app/global-blocks/builder/controller",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),config:Ember.inject.service(),colorManager:Ember.inject.service(),fontManager:Ember.inject.service(),previewURL:Ember.computed("model.content",function(){return this.get("model.content.permalink")}),previewInc:0,previewState:Ember.computed("model.content.id","previewInc","lang","colorManager.saved","fontManager.saved",function(){return this.get("colorManager.saved"),this.get("fontManager.saved"),{global_block_preview_id:this.get("model.content.id"),route:"content",mode:"content",custom_js:{"cs-content-custom-scripts":this.get("model.content.settings.general.custom_js")},post_id:this.get("model.content.id"),post_type:this.get("model.content.postType"),inc:this.get("previewInc"),settings:this.get("model.content.settings")}}),responsiveTextItems:Ember.computed("model.content.responsiveTextItems","model.content.responsiveTextItems.@each.min_size","model.content.responsiveTextItems.@each.max_size","model.content.responsiveTextItems.@each.selector","model.content.responsiveTextItems.@each.compress",function(){return this.getWithDefault("model.content.responsiveTextItems",[]).map(function(e){var t=e.selector,n=e.compression
return{minSize:e.min_size,maxSize:e.max_size,selector:t,compression:n}})}),actions:{refreshPreview:function(){this.get("ui").notify((0,t.t)("app.notification-refreshing-preview-save-reminder")),this.incrementProperty("previewInc")},runCustomJs:function(){this.get("ui").notify((0,t.t)("app.notification-refreshing-preview")),this.incrementProperty("previewState.inc")}}})
e.default=n}),define("tco-app/global-blocks/builder/route",["exports","tco-app/mixins/route-authorization","tco-app/src/lib/http"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=Ember.Route.extend(t.default,{router:Ember.inject.service(),xfr:Ember.inject.service(),preview:Ember.inject.service(),acl:["content.cs_global_block"],routeUI:{bar:["orientation","preview-sizer","cheatsheet","save"],orientation:"preference"},queryParams:{lang:{refreshModel:!0}},deactivate:function(){this.store.unloadAll("content/template-entry")},beforeModel:function(){this.permissionCheck()},model:function(e){var t=this,o=e.post_id,r=e.lang
return new Ember.RSVP.Promise(function(e,a){var i=t.store.findAll("element/definition"),s=t.store.query("element/preset",{isDefault:!0}),l=t.store.findAll("font-manager/selection"),c=(0,n.request)("content-settings::settings_sections",{post_id:o})
new Ember.RSVP.Promise(function(e,n){t.store.findRecord("global-blocks/content",o).then(function(t){if(!Ember.isEmpty(window.csAppData.wpmlLanguages)&&window.csAppData.wpmlTranslateableTypes.includes(t.get("postType"))&&(r||window.csAppData.wpmlDefault)!==t.get("language.code"))return e({reroute:"translate",content:t})
e(t)},n)}).then(function(n){if("translate"!==n.reroute)return t.permissionCheck(["content.".concat(n.get("postType"))])?void Ember.RSVP.hash({library:i,defaultPresets:s,content:n,fontSelections:l,settingsSections:c}).then(function(t){return e(t)},a):a()
e(n)},a)})},afterModel:function(e,t){if(this.set("ui.unsavedData",!1),"translate"!==e.reroute){var n=Ember.Object.create(e.settingsSections.data)
e.content.set("settings",n)
var o=Ember.A()
e.content.getWithDefault("settings.responsive-text.elements",[]).forEach(function(e){o.push(e)}),e.content.set("responsiveTextItems",o)
var r=this.get("ui.search").getTarget("element-library")
r.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),r.updateIndex(e.library.map(function(e){return{id:e.get("id"),title:e.get("title")}})),e.defaultPresets.forEach(function(e){e.get("element").set("defaultPreset",e)})}else{var a=Ember.get(t.to,"queryParams.lang")
if(a){var i=e.content.get("language.translations.".concat(a))
i&&this.transitionTo("global-blocks.builder",i,{queryParams:{lang:a}})}else this.transitionTo("global-blocks.builder",e.content.get("id"),{queryParams:{lang:e.content.get("language.code")}})}},setupController:function(e,t){this._super(e,t),this.set("routeUI.viewSiteURL",t.content.get("permalink")),this.get("ui").setRouteUI(this),e.set("noTranslation","translate"===t.reroute),t.content&&t.content.setupElements()},renderTemplate:function(e){e.get("noTranslation")||(this.render("partials/bar/global-blocks",{outlet:"bar",into:"application"}),this.render("partials/global/global-blocks",{outlet:"global",into:"application"})),this._super(this,arguments)},actions:{willTransition:function(e){var t=this
!this.get("ui.unsavedData")||e.targetName.includes("global-blocks.builder")&&Ember.getWithDefault(e.to.queryParams,"lang",null)===this.controllerFor(this.routeName).getWithDefault("lang",null)||(e.abort(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.set("ui.unsavedData",!1),e.retry()},acceptClass:"sad"}))},error:function(e){return!e||(console.log(e),this.transitionTo("global-blocks"))},save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress(),this.modelFor(this.routeName).content.updateElements().updateSettings().save().then(function(n){console.log("Saving Content",n),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.global-blocks.entity")}),"success"),e.set("ui.unsavedData",!1),e.controllerFor(e.routeName).set("lastSave",new Date)}).catch(function(n){console.warn(n),t.notify(e.get("i18n").t("app.notify.failed-to-save",{context:e.get("i18n").t("common.global-blocks.entity")}),"error"),t.endSaveProgress()})},toggleSkeletonMode:function(){this.set("ui.skeletonModeActive",!this.get("ui.skeletonModeActive")),this.get("ui.skeletonModeActive")&&this.set("ui.showPreviewSizer",!1)},addSiblingElement:function(e,t,n,o){t||(t={}),t._type||(t._type=e.get("definition.id"))
var r=e.get("order")
return n&&r++,this.send("addElement",e.get("parent"),t,r,o)},handleRemoteAction:function(e){this.send.apply(this,[e.action].concat(o(e.params)))},navigate:function(e){this.transitionTo(e)},selectLanguage:function(e){var t=this.modelFor(this.routeName)
if(e!==this.controllerFor(this.routeName).get("lang")){var n=t.content.get("language.translations.".concat(e))
Ember.isNone(n)&&(n=t.content.get("language.source")),Ember.isNone(n)&&(n=t.content.get("id")),this.transitionTo("global-blocks.builder",n,{queryParams:{lang:e}})}},createTranslation:function(e){var t=this,o=e.source,r=e.lang,a=e.copyFrom,i=this.get("ui")
i.beginSaveProgress()
var s=this.get("i18n").t("app.translation.entity");(0,n.request)("translation::create",{source:o,lang:r,copyFrom:a}).then(function(e){i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.created",{context:s}),"success"),t.store.unloadAll("global-blocks/content"),t.transitionTo("global-blocks.builder",e.id,{queryParams:{lang:r}})},function(e){return console.warn("Error creating translation",e),i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.failed-to-create",{context:s}),"error")})},observerNav:function(e){var t=this,n=e.id,o=e.route,r=e.context,a=[o]
n&&a.push(n)
var i=this.get("ui.unsavedData")
this.get("ui").confirm({noSkip:!0,message:i?this.get("i18n").t("app.streamline-nav-unsaved",{context:r}):this.get("i18n").t("app.streamline-nav",{context:r}),accept:function(){t.set("ui.unsavedData",!1),t.transitionTo.apply(t,a)},acceptClass:"sad"})}}})
e.default=r}),define("tco-app/global-blocks/builder/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"mP6Y9Rcp",block:'{"symbols":[],"statements":[[1,[21,"react-bridge/navigation-bar"],false],[0,"\\n\\n"],[4,"global/cs-window",null,[["screen"],["global-blocks-builder"]],{"statements":[[0,"\\n"],[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[4,"cs-dock",null,[["isUndocked","isHorizontal"],[[23,["ui","workspaceIsUndocked"]],[23,["ui","workspaceIsHorizontal"]]]],{"statements":[[1,[27,"react-bridge/builder-workspace",null,[["emberClass"],[[27,"concat",["cs-workspace ",[27,"if",[[23,["ui","workspaceIsHorizontal"]],"is-horizontal","is-vertical"],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"],[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[1,[27,"common/preview-frame",null,[["src","state","requestParams","content","preloader","allowPreviewSizer","package","onRemoteAction","onObserverNav"],[[23,["ui","defaultPreviewUrl"]],[23,["previewState"]],[23,["requestParams"]],"builder","content",true,[27,"hash",null,[["customCSS","responsiveTextItems"],[[23,["model","content","settings","general","custom_css"]],[23,["responsiveTextItems"]]]]],[27,"route-action",["handleRemoteAction"],null],[27,"route-action",["observerNav"],null]]]],false],[0,"\\n\\n"]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.translate"],null]]],{"statements":[[1,[27,"common/create-translation",null,[["targetLang","model","onCreateTranslation","contextLabel"],[[23,["activeLanguage"]],[23,["model","content"]],[27,"route-action",["createTranslation"],null],[27,"t",["common.content.entity"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[23,["ui","wpmlLanguages"]]],null,{"statements":[[4,"if",[[23,["model","content","translateable"]]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/global-blocks/builder/template.hbs"}})
e.default=t}),define("tco-app/global-blocks/content/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/global-blocks/content/model",["exports","ember-data/model","ember-data/attr","tco-app/src/reducers/helpers"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({redux:Ember.inject.service("element"),title:(0,n.default)(),permalink:(0,n.default)(),language:(0,n.default)(),modified:(0,n.default)(),postType:(0,n.default)({defaultValue:function(){return"cs_global_block"}}),translateable:Ember.computed("postType",function(){return window.csAppData.wpmlTranslateableTypes.includes(this.get("postType"))}),elements:(0,n.default)({defaultValue:function(){return{}}}),settings:(0,n.default)({defaultValue:function(){return{}}}),setupElements:function(){var e=JSON.parse(JSON.stringify(this.get("elements")))
return this.get("redux").dispatch({type:"BUILDER:SET_CONTEXT",payload:{builder:"globalBlocks",renderContext:{mode:"content",data:{post_id:this.get("id")}},permissionContext:"content.cs_global_block",homeRoute:"global-blocks",routePrefix:"global-blocks.builder"}}),this.get("redux").dispatch({type:"ELEMENT_RESET",payload:{_type:"root",_modules:[{_type:"region",_region:"content",_modules:e.data}]}}),this},updateElements:function(){var e=((0,o.toTreeFromRoot)(this.get("redux").store.getState().elements)._modules||[])[0]||{}
return this.set("elements",null),this.set("elements",e._modules||{}),this},updateSettings:function(){var e=[]
return this.getWithDefault("responsiveTextItems",[]).forEach(function(t){return e.push(t)}),this.set("settings.responsive-text.elements",e),this}})
e.default=r}),define("tco-app/global-blocks/controller",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),isSearching:Ember.computed.alias("searchData.isSearching"),sortedEntries:Ember.computed.sort("model.entries",function(e,t){return e.get("isNew")&&!e.get("isDuplicate")?-1:t.get("isNew")&&!t.get("isDuplicate")?1:e.get("title").localeCompare(t.get("title"))}),searchResults:Ember.computed("searchData.results","activeLanguage","sortedEntries.[]",function(){var e=this.get("searchData.results"),t=this.get("isSearching"),n=this.get("ui.wpmlLanguages").length>0,o=this.get("activeLanguage")
return this.get("sortedEntries").filter(function(r){return!(n&&o!==r.get("language.code")&&!r.getWithDefault("language.fallback",[]).includes(o))&&(!t||e.includes(r.get("id").toString()))})}),init:function(){this._super.apply(this,arguments),this.set("searchData",this.get("ui.search").getTarget("global-blocks-index"))},resetSelected:Ember.observer("activeLanguage",function(){var e=this.get("activeLanguage"),t=this.get("selectedEntry"),n=this.getWithDefault("filteredSearchResults",[]).find(function(n){return e===n.get("language.code")&&t&&(t.get("id")==="".concat(n.get("language.source"))||"".concat(t.get("language.source"))===n.get("id"))})
this.set("selectedEntry",n||null)}),entryHasPreview:Ember.computed("selectedEntry.id",function(){return window.thatEntry=this.get("selectedEntry"),console.log("window.thatEntry",window.thatEntry),!1}),previewState:Ember.computed("lang","selectedEntry.id",function(){return{route:"global-blocks-index",lang:this.get("lang"),global_block_preview_id:this.get("selectedEntry.id")}}),actions:{selectEntry:function(e){e.get("id")&&e.get("id")!==this.get("selectedEntry.id")?this.set("selectedEntry",e):this.set("selectedEntry",!1)},openAddNew:function(){this.set("addNewTitle",""),this.set("showAddNew",!0)},closeAddNew:function(){this.set("showAddNew",!1)},idleClosePopover:function(){this.set("showAddNew",!1)}}})
e.default=t}),define("tco-app/global-blocks/entry/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),postType:(0,n.default)(),postTypeLabel:(0,n.default)(),modified:(0,n.default)(),permalink:(0,n.default)(),language:(0,n.default)(),hasContent:(0,n.default)(),ui:Ember.inject.service(),meta:Ember.computed("postType","modified",function(){var e=[]
return e.push(this.get("modified")),this.get("ui.isRTL")&&e.reverse(),e.join(" &bull; ")}),selected:Ember.computed("ui.builderIndexSelectedEntry",function(){return this.get("ui.builderIndexSelectedEntry.id")===this.get("id")})})
e.default=o}),define("tco-app/global-blocks/route",["exports","tco-app/mixins/route-authorization"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Route.extend(t.default,{acl:["content.cs_global_block"],routeUI:{bar:["collapse","preview-sizer","cheatsheet"],orientation:"vertical"},beforeModel:function(e){this.store.unloadAll("global-blocks/entry"),this.permissionCheck()
var t=Ember.get(e.to,"queryParams.lang")
t&&!Object.keys(window.csAppData.wpmlLanguages).includes(t)&&this.transitionTo({queryParams:{lang:window.csAppData.wpmlDefault}})},model:function(){return Ember.RSVP.hash({entries:this.store.findAll("global-blocks/entry")})},updateSearch:function(e){var t=this.get("ui.search").getTarget("global-blocks-index")
t.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),t.updateIndex(e.map(function(e){return{id:e.get("id"),title:e.get("title")}}))},afterModel:function(e){this.updateSearch(e.entries)},setupController:function(e,t){this._super(e,t),this.get("ui").setRouteUI(this),this.set("ui.wpmlActiveLanguage",e.get("lang")),e.set("selectedEntry",null),e.set("addNewTitle","")},actions:{addNew:function(e){var t=this,n=this.get("i18n").t("common.global-blocks.entity")
if(!e)return this.get("ui").notify(this.get("i18n").t("app.notify.title-required",{context:n}),"error")
var o=this.controllerFor(this.routeName)
o.set("showAddNew",!1),o.set("selectedEntry",null),this.get("ui").beginSaveProgress()
var r=this.store.createRecord("global-blocks/entry",{title:e,modified:window.csAppData.today})
this.store.createRecord("global-blocks/content",{title:e}).save().then(function(e){r.set("id",e.get("id")),r.set("modified",e.get("modified")),r.save(),t.updateSearch(t.store.peekAll("global-blocks/entry")),t.get("ui").endSaveProgress(),t.get("ui").notify(t.get("i18n").t("app.notify.created",{context:n}),"success")}).catch(function(e){console.warn("Could not create new Global Block",e),t.get("ui").endSaveProgress(),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-create",{context:n}),"error")})},entryDuplicate:function(e){var t=this,n=e.get("id"),o=e.get("hasContent")
this.get("store").findRecord("global-blocks/content",n).then(function(e){for(var r=e.serialize().data.attributes.title,a=1,i=r,s=t.get("store").peekAll("global-blocks/entry").filter(function(e){return!e.get("isDeleted")}).map(function(e){return e.get("title")});s.includes(i);)i=t.get("i18n").t("app.copy-of-numeric",{title:r,index:a++}).string
var l=t.store.createRecord("global-blocks/entry",{title:i,hasContent:o})
l.set("isDuplicate",!0)
var c=t.store.createRecord("global-blocks/content",{title:i,elements:{_clone:n}}),u=t.get("i18n").t("common.global-blocks.entity")
t.get("ui").beginSaveProgress(),c.save().then(function(e){l.set("id",e.id),l.save(),t.get("ui").notify(t.get("i18n").t("app.notify.duplicated",{context:u})),t.get("ui").endSaveProgress()}).catch(function(e){console.warn("Could not duplicate Global Block",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-duplicate",{context:u}),"error"),t.get("ui").endSaveProgress()})})},entryDelete:function(e){var t=this,n=this.get("i18n").t("common.global-blocks.entity")
this.get("ui").confirm({message:this.get("i18n").t("app.notify.delete-confirm-perm",{context:n}),acceptClass:"sad",accept:function(){t.get("store").findRecord("global-blocks/content",e.get("id")).then(function(o){t.controllerFor("global-blocks").set("selected",null),e.destroyRecord(),o.destroyRecord().then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.deleted",{context:n}))},function(e){console.warn("Could not delete Global Block",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-delete",{context:n}),"error")})})}})},entryTitleUpdate:function(e){var t=this
this.get("store").findRecord("global-blocks/content",e.get("id")).then(function(n){n.set("title",e.get("title")),n.set("elements",null),n.set("settings",null),t.get("ui").beginSaveProgress(),n.save().then(function(){t.get("ui").endSaveProgress()},function(e){console.warn("Could not update Global Block title",e)
var n=t.get("i18n").t("common.global-blocks.entity")
t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-update-title",{context:n}),"error")})})}}})
e.default=n}),define("tco-app/global-blocks/service",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({})
e.default=t}),define("tco-app/global-blocks/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"piXMYl5U",block:'{"symbols":["entry"],"statements":[[4,"global/cs-window",null,[["screen"],["global-blocks"]],{"statements":[[4,"workspace/cs-workspace",null,null,{"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[7,"h2"],[11,"class","cs-workspace-title"],[9],[1,[27,"t",["common.title.global-blocks"],null],false],[10],[0,"\\n"],[7,"div"],[11,"class","cs-workspace-search"],[9],[0,"\\n"],[4,"unless",[[23,["showAddNew"]]],null,{"statements":[[0,"  "],[1,[27,"common/search-bar",null,[["target","placeholder","autoFocus"],["global-blocks-index",[27,"t",["app.search"],null],true]]],false],[0,"\\n"],[4,"if",[[27,"user-can",["content.cs_global_block.create"],null]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"openAddNew"],null]],[9],[1,[27,"icon",["fa-plus"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"if",[[23,["showAddNew"]]],null,{"statements":[[0,"  "],[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],"closeAddNew"],null]],[9],[1,[27,"icon",["fa-arrow-alt-left-fas"],null],false],[7,"span"],[9],[1,[27,"t",["app.back"],null],false],[10],[10],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[23,["showAddNew"]]],null,{"statements":[[4,"workspace/workspace-content",null,null,{"statements":[[7,"div"],[11,"class","cs-controls"],[9],[0,"\\n  "],[7,"div"],[11,"class","cs-control-group"],[9],[0,"\\n    "],[7,"header"],[11,"class","cs-control-group-header"],[9],[7,"span"],[11,"class","cs-control-group-label"],[9],[1,[27,"t",["app.create-thing"],[["context"],[[27,"t",[[27,"concat",["common.global-blocks.entity"],null]],null]]]],false],[10],[0,"\\n    "],[10],[0,"\\n    "],[7,"ul"],[11,"class","cs-control-list"],[9],[0,"\\n      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[1,[27,"t",["app.title"],null],false],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[0,"\\n            "],[1,[27,"input",null,[["value","enter","placeholder"],[[23,["addNewTitle"]],[27,"route-action",["addNew",[23,["addNewTitle"]]],null],[27,"t",["app.thing-title"],[["context"],[[27,"t",["common.global-blocks.entity"],null]]]]]]],false],[0,"\\n          "],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n      "],[7,"li"],[11,"class","cs-control"],[9],[0,"\\n        "],[7,"div"],[11,"class","cs-control-label"],[9],[7,"span"],[9],[0," "],[10],[10],[0,"\\n        "],[7,"div"],[11,"class","cs-control-inputs"],[9],[0,"\\n          "],[7,"div"],[11,"class","cs-control-input"],[9],[7,"button"],[11,"class","cs-btn"],[12,"onclick",[27,"action",[[22,0,[]],[27,"route-action",["addNew",[23,["addNewTitle"]]],null]],null]],[9],[1,[27,"t",["app.create"],null],false],[10],[10],[0,"\\n        "],[10],[0,"\\n      "],[10],[0,"\\n    "],[10],[0,"\\n  "],[10],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[4,"workspace/workspace-content",null,[["name","linkedSearch"],["search-results","global-blocks-index"]],{"statements":[[0,"\\n"],[4,"each",[[27,"filter-by",["isDeleted",false,[23,["searchResults"]]],null]],null,{"statements":[[4,"common/index-entry",null,[["onClick","title","canEdit","titleUpdate","compact","isNew","selected","before"],[[27,"action",[[22,0,[]],"selectEntry",[22,1,[]]],null],[22,1,["title"]],[27,"user-can",["content.cs_global_block.rename"],null],[27,"route-action",["entryTitleUpdate",[22,1,[]]],null],true,[22,1,["isNew"]],[27,"eq",[[22,1,["id"]],[23,["selectedEntry","id"]]],null],[27,"concat",[[27,"concat",["<input class=\\"cs-index-entry-info-readonly-input-pre\\" readonly value=\\"[cs_gb id=",[22,1,["id"]]],null],"]\\">"],null]]],{"statements":[[4,"if",[[27,"and",[[27,"contains",[[23,["activeLanguage"]],[22,1,["language","fallback"]]],null],[27,"contains",[[22,1,["postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[4,"link-to",["global-blocks.builder",[22,1,["id"]],[27,"query-params",null,[["lang"],[[23,["activeLanguage"]]]]]],null,{"statements":[[1,[27,"t",["app.translate"],null],false]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},{"statements":[[4,"link-to",["global-blocks.builder",[22,1,["id"]]],null,{"statements":[[1,[27,"icon",["fa-pencil-alt"],null],false]],"parameters":[]},null],[0,"\\n"],[4,"if",[[27,"user-can",["content.cs_global_block.create"],null]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[27,"route-action",["entryDuplicate",[22,1,[]]],null]],[["bubbles"],[false]]]],[9],[1,[27,"icon",["fa-copy"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["content.cs_global_block.delete"],null]],null,{"statements":[[7,"button"],[12,"onclick",[27,"action",[[22,0,[]],[27,"route-action",["entryDelete",[22,1,[]]],null]],[["allowedKeys","bubbles"],["shift",false]]]],[12,"class",[28,[[27,"if",[[23,["ui","deleteConfirm"]],"cs-danger"],null]]]],[9],[1,[27,"icon",["fa-trash-alt"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null]],"parameters":[1]},{"statements":[[4,"if",[[23,["isSearching"]]],null,{"statements":[[4,"workspace/workspace-message",null,[["title"],[[27,"t",["app.no-things-found"],[["context"],[[27,"t",["app.global-blocks.entities"],null]]]]]],{"statements":[[7,"p"],[9],[1,[27,"t",["app.refine-search"],[["context"],[[27,"t",["common.global-blocks.entity"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[4,"workspace/workspace-message",null,[["title"],[[27,"t",["app.no-things"],[["context"],[[27,"t",["app.global-blocks.entities"],null]]]]]],{"statements":[[7,"p"],[9],[1,[27,"t",["app.global-blocks.blank"],null],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]}],[0,"\\n"],[1,[21,"outlet"],false],[0,"\\n\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[4,"if",[[23,["selectedEntry"]]],null,{"statements":[[4,"unless",[[27,"and",[[27,"contains",[[23,["activeLanguage"]],[23,["selectedEntry","language","fallback"]]],null],[27,"contains",[[23,["selectedEntry","postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[0,"\\n"],[4,"if",[[23,["selectedEntry","hasContent"]]],null,{"statements":[[4,"common/preview-frame",null,[["src","state","preloader","onObserverNav"],[[23,["ui","defaultPreviewUrl"]],[23,["previewState"]],"content",[27,"route-action",["observerNav"],null]]],{"statements":[],"parameters":[]},null]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.global-blocks.no-preview-available"],null]]],{"statements":[[7,"p"],[11,"style","text-transform:uppercase;"],[9],[1,[27,"t",["app.global-blocks.click-to-edit"],[["icon"],[[27,"icon",["fa-pencil-alt"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.translate"],null]]],{"statements":[[7,"p"],[9],[1,[27,"t",["app.translation.blank"],[["context"],[[27,"t",["common.global-blocks.entity"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,null,{"statements":[[7,"div"],[11,"class","cs-welcome-icon cs-welcome-icon-cs-logo"],[9],[0,"\\n  "],[1,[27,"icon",[[23,["ui","contentLogoPath"]]],null],false],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[23,["ui","wpmlLanguages"]]],null,{"statements":[[4,"if",[[27,"or",[[27,"not",[[23,["selectedEntry"]]],null],[27,"contains",[[23,["selectedEntry","postType"]],[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/global-blocks/template.hbs"}})
e.default=t}),define("tco-app/headers/controller",["exports","tco-app/util/flatten-assignments"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),previewState:{route:"regions-index",inc:0},templateOptions:Ember.computed("templates.[]",function(){return this.getWithDefault("templates",[]).sortBy("title").map(function(e){return{value:e.get("id"),label:e.get("title")}})}),previewing:Ember.computed("selectedTemplate","selected","defaultSelected",function(){return this.get("selectedTemplate")?"header-template:".concat(this.get("selectedTemplate")):this.get("selected.id")?"header:".concat(this.get("selected.id")):this.get("defaultSelected")?"header-template:".concat(this.get("model.defaultTemplate")):"off"}),previewUpdate:Ember.observer("previewing",function(){Ember.run.debounce(this,function(){this.incrementProperty("previewState.inc"),this.set("previewState.previewing",this.get("previewing"))}.bind(this),5)}),previewURL:Ember.computed("url","selectedUrl",function(){var e=this.get("url")
return e||(this.get("selectedUrl")?this.get("selectedUrl"):this.get("ui.defaultPreviewUrl"))}),resetSelected:Ember.observer("activeLanguage",function(){var e=this.get("activeLanguage"),t=this.get("selected"),n=this.get("model.entries").find(function(n){return e===n.get("language.code")&&t&&(t.get("id")==="".concat(n.get("language.source"))||"".concat(t.get("language.source"))===n.get("id"))})
this.set("selected",n||null)}),selectedAssignment:Ember.computed("selected","model.assignments.value","flattenedAssignContexts",function(){var e=this.get("model.assignments.value"),t=this.get("flattenedAssignContexts"),n=this.get("selected.language.source")
for(var o in n||(n=this.get("selected.id")),n&&(n=String(n)),e)if(e.hasOwnProperty(o)&&"".concat(n)===e[o]){if("global"===o)return"global"
if(t[o])return t[o]}return null}),selectedUrl:Ember.computed("selectedAssignment",function(){var e=this.get("selectedAssignment")
return"global"===e?this.get("ui.defaultPreviewUrl"):e&&e.url?e.url:null}),assignContexts:Ember.computed.alias("model.config.assign_contexts"),flattenedAssignContexts:Ember.computed("assignContexts",function(){return(0,t.default)(this.get("assignContexts"))})})
e.default=n}),define("tco-app/headers/entry/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),language:(0,n.default)({defaultValue:function(){return{code:window.csAppData.wpmlDefault,source:null,fallback:Object.keys(window.csAppData.wpmlLanguages).filter(function(e){return e!==window.csAppData.wpmlDefault})}}}),titleObserver:Ember.observer("title",function(){this.get("title")||this.set("title",this.get("i18n").t("common.untitled"))}),modified:(0,n.default)({defaultValue:function(){return""}}),ui:Ember.inject.service(),meta:Ember.computed("assignments",function(){var e=this.get("assignments")
return e&&e.length||(e=[{label:this.get("i18n").t("app.unassigned")}]),e.map(function(e){return e.label}).join(" &bull; ")})})
e.default=o}),define("tco-app/headers/header/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/headers/header/controller",["exports","tco-app/util/flatten-assignments","tco-app/src/lib/i18n"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Controller.extend({config:Ember.inject.service(),colorManager:Ember.inject.service(),fontManager:Ember.inject.service(),url:null,queryParams:["lang"],lang:null,activeLanguage:Ember.computed("lang",{get:function(){var e=this.get("lang")
return Ember.isNone(e)?window.csAppData.wpmlDefault:e},set:function(e,t){return this.set("lang",t),t||window.csAppData.wpmlDefault}}),previewInc:0,previewState:Ember.computed("model.header.id","previewInc","lang","colorManager.saved","fontManager.saved",function(){return this.get("colorManager.saved"),this.get("fontManager.saved"),{route:"header",mode:"headers",custom_js:{"x-header-custom-scripts":this.get("model.header.settings.customJS")}}}),previewURL:Ember.computed("url","assignedUrl",function(){var e=this.get("url")
if(e)return e
var t=this.get("assignedUrl")
return t||this.get("ui.defaultPreviewUrl")}),assignedContext:Ember.computed("model.header","model.assignments.value","flattenedAssignContexts",function(){var e=this.get("model.assignments.value"),t=this.get("flattenedAssignContexts"),n=this.get("model.header.id")
for(var o in e)if(e.hasOwnProperty(o)&&"".concat(n)===e[o]){if("global"===o)return"global"
if(t[o])return t[o]}return null}),assignedUrl:Ember.computed("assignedContext",function(){var e=this.get("assignedContext")
return"global"===e?this.get("ui.defaultPreviewUrl"):e&&e.url?e.url:null}),assignContexts:Ember.computed.alias("model.config.assign_contexts"),flattenedAssignContexts:Ember.computed("assignContexts",function(){var e=this.get("assignContexts")
return Ember.isArray(e)?(0,t.default)(e):[]}),customScriptObserver:Ember.observer("model.header.settings.customJS",function(){var e=this.get("model.header.settings.customJS")
this.set("previewState.custom_js.x-header-custom-scripts",e||null)}),actions:{runCustomJs:function(){this.get("ui").notify((0,n.t)("app.notification-refreshing-preview")),this.incrementProperty("previewState.inc")}}})
e.default=o}),define("tco-app/headers/header/model",["exports","ember-data/model","ember-data/attr","tco-app/src/reducers/helpers"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=t.default.extend({redux:Ember.inject.service("element"),availableRegions:["top","left","bottom","right"],title:(0,n.default)(),language:(0,n.default)(),postType:(0,n.default)(),translateable:Ember.computed("postType",function(){return window.csAppData.wpmlTranslateableTypes.includes(this.get("postType"))}),regions:(0,n.default)({defaultValue:function(){return{}}}),settings:(0,n.default)({defaultValue:function(){return{}}}),setupElements:function(){var e=JSON.parse(JSON.stringify(this.get("regions"))),t=this.get("availableRegions").map(function(t){return{_type:"region",_region:t,_modules:Ember.isNone(e[t])?[]:e[t]}})
return this.get("redux").dispatch({type:"BUILDER:SET_CONTEXT",payload:{builder:"header",renderContext:{mode:"regions",data:{post_id:this.get("id"),mode:"header"}},permissionContext:"headers",homeRoute:"headers",routePrefix:"headers.header"}}),this.get("redux").dispatch({type:"ELEMENT_RESET",payload:{_type:"root",_modules:t}}),this},updateRegions:function(){var e={}
return((0,o.toTreeFromRoot)(this.get("redux").store.getState().elements)._modules||[]).forEach(function(t){t._modules&&(e[t._region]=t._modules)}),this.set("regions",null),this.set("regions",e),this}})
e.default=r}),define("tco-app/headers/header/route",["exports","ember-copy","tco-app/mixins/route-authorization","tco-app/src/lib/http"],function(e,t,n,o){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=Ember.Route.extend(n.default,{router:Ember.inject.service(),service:Ember.inject.service("headers"),acl:["canUseHeaders"],routeUI:{bar:["orientation","preview-sizer","view-site","cheatsheet","save"],orientation:"preference"},queryParams:{lang:{refreshModel:!0}},beforeModel:function(e){this.permissionCheck()
var t=Ember.get(e.to,"queryParams.lang")
t&&!Object.keys(window.csAppData.wpmlLanguages).includes(t)&&this.transitionTo({queryParams:{lang:window.csAppData.wpmlDefault}})},model:function(e){var t=this,n=e.header_id,o=e.lang
return new Ember.RSVP.Promise(function(e,r){var a=t.get("config").fetch("header-builder"),i=t.store.findAll("element/definition"),s=t.store.query("element/preset",{isDefault:!0}),l=t.store.findRecord("option","cornerstone_header_assignments"),c=t.store.findAll("font-manager/selection")
new Ember.RSVP.Promise(function(e,r){t.store.findRecord("headers/header",n).then(function(t){if(!Ember.isEmpty(window.csAppData.wpmlLanguages)&&(o||window.csAppData.wpmlDefault)!==t.getWithDefault("language.code",window.csAppData.wpmlDefault))return e({reroute:"translate",header:t})
e(t)},r)}).then(function(t){"translate"!==t.reroute?Ember.RSVP.hash({config:a,library:i,defaultPresets:s,assignments:l,header:t,fontSelections:c}).then(function(t){return e(t)},r):e(t)},r)})},afterModel:function(e,t){if(this.set("ui.unsavedData",!1),"translate"!==e.reroute){var n=this.get("ui.search").getTarget("element-library")
n.setOptions({id:"id",threshold:.15,distance:50,tokenize:!0,keys:[{name:"title",weight:.1}]}),n.updateIndex(e.library.map(function(e){return{id:e.get("id"),title:e.get("title")}})),e.defaultPresets.forEach(function(e){e.get("element").set("defaultPreset",e)})}else{var o=Ember.get(t.to,"queryParams.lang")
if(o){var r=e.header.get("language.translations.".concat(o))
r&&this.transitionTo("headers.header",r,{queryParams:{lang:o}})}else this.transitionTo("headers.header",e.header.get("id"),{queryParams:{lang:e.header.get("language.code")}})}},setupController:function(e,t){if(this._super.apply(this,arguments),this.set("routeUI.viewSiteURL",e.get("assignedUrl")),this.get("ui").setRouteUI(this),this.setActivePane(),e.set("noTranslation","translate"===t.reroute),t.header){var n=t.header.get("settings.customJS")
e.set("previewState.custom_js.x-header-custom-scripts",n||null),t.header.setupElements()}},renderTemplate:function(){this.render("partials/bar/header",{outlet:"bar",into:"application"}),this.render("partials/global/header",{outlet:"global",into:"application"}),this._super(this,arguments)},setActivePane:function(){var e=this
Object.keys(this.getWithDefault("router.router.state.params",{})).forEach(function(t){t.includes("headers.header.")&&e.set("controller.activePane",t.replace("headers.header.",""))})},actions:{error:function(e){return!e||(console.log(e),this.transitionTo("headers"))},save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress(),this.modelFor(this.routeName).header.updateRegions().save().then(function(n){console.log("Saving Header",n),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.saved",{context:e.get("i18n").t("common.headers.entity")}),"success"),e.set("ui.unsavedData",!1),e.controllerFor(e.routeName).set("lastSave",new Date)}).catch(function(n){console.warn(n),t.notify(e.get("i18n").t("app.notify.failed-to-save",{context:e.get("i18n").t("common.headers.entity")}),"error"),t.endSaveProgress()})},willTransition:function(e){var t=this
!this.get("ui.unsavedData")||e.targetName.includes("headers.header")&&Ember.getWithDefault(e.to.queryParams,"lang",null)===this.controllerFor(this.routeName).getWithDefault("lang",null)||(e.abort(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.set("ui.unsavedData",!1),e.retry()},acceptClass:"sad"}))},didTransition:function(){return this.setActivePane(),!0},newElement:function(){},layoutFirstOpen:function(){},selectLanguage:function(e){var t=this.modelFor(this.routeName)
if(e!==this.controllerFor(this.routeName).get("lang")){var n=t.header.get("language.translations.".concat(e))
Ember.isNone(n)&&(n=t.header.get("language.source")),Ember.isNone(n)&&(n=t.header.get("id")),this.transitionTo("headers.header",n,{queryParams:{lang:e}})}},createTranslation:function(e){var t=this,n=e.source,r=e.lang,a=e.copyFrom,i=this.get("ui")
i.beginSaveProgress()
var s=this.get("i18n").t("app.translation.entity");(0,o.request)("translation::create",{source:n,lang:r,copyFrom:a}).then(function(e){i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.created",{context:s}),"success"),t.store.unloadAll("headers/header"),t.transitionTo("headers.header",e.id,{queryParams:{lang:r}})},function(e){return console.warn("Error creating translation",e),i.endSaveProgress(),i.notify(t.get("i18n").t("app.notify.failed-to-create",{context:s}),"error")})},handleRemoteAction:function(e){this.send.apply(this,[e.action].concat(r(e.params)))},observerNav:function(e){var t=this,n=e.id,o=e.route,r=e.context,a=[o]
n&&a.push(n)
var i=this.get("ui.unsavedData")
this.get("ui").confirm({noSkip:!0,message:i?this.get("i18n").t("app.streamline-nav-unsaved",{context:r}):this.get("i18n").t("app.streamline-nav",{context:r}),accept:function(){t.set("ui.unsavedData",!1),t.transitionTo.apply(t,a)},acceptClass:"sad"})},toggleSkeletonMode:function(){this.set("ui.skeletonModeActive",!this.get("ui.skeletonModeActive")),this.get("ui.skeletonModeActive")&&this.set("ui.showPreviewSizer",!1)}}})
e.default=a}),define("tco-app/headers/header/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Dm4pelbJ",block:'{"symbols":[],"statements":[[1,[21,"react-bridge/navigation-bar"],false],[0,"\\n\\n"],[4,"global/cs-window",null,[["screen"],["headers-header"]],{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[4,"cs-dock",null,[["isUndocked","isHorizontal"],[[23,["ui","workspaceIsUndocked"]],[23,["ui","workspaceIsHorizontal"]]]],{"statements":[[1,[27,"react-bridge/builder-workspace",null,[["emberClass"],[[27,"concat",["cs-workspace ",[27,"if",[[23,["ui","workspaceIsHorizontal"]],"is-horizontal","is-vertical"],null]],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[0,"\\n"],[1,[27,"common/preview-frame",null,[["src","state","preloader","package","onRemoteAction","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],"headers",[27,"hash",null,[["customCSS"],[[23,["model","header","settings","customCSS"]]]]],[27,"route-action",["handleRemoteAction"],null],[27,"route-action",["observerNav"],null]]]],false],[0,"\\n\\n"]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,[["title"],[[27,"t",["app.translate"],null]]],{"statements":[[1,[27,"common/create-translation",null,[["targetLang","model","onCreateTranslation","contextLabel"],[[23,["activeLanguage"]],[23,["model","header"]],[27,"route-action",["createTranslation"],null],[27,"t",["common.headers.entity"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[4,"if",[[27,"and",[[23,["ui","wpmlLanguages"]],[27,"contains",["cs_header",[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/headers/header/template.hbs"}})
e.default=t}),define("tco-app/headers/header/template/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/headers/header/template/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({title:(0,n.default)(),meta:(0,n.default)({defaultValue:function(){return{}}})})
e.default=o}),define("tco-app/headers/route",["exports","tco-app/mixins/route-authorization"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Route.extend(t.default,{acl:["canUseHeaders"],routeUI:{bar:["collapse","preview-sizer","cheatsheet"],orientation:"horizontal"},beforeModel:function(){this.store.unloadAll("headers/entry"),this.store.unloadAll("headers/header/template"),this.permissionCheck()},model:function(){return Ember.RSVP.hash({config:this.get("config").fetch("header-builder"),templates:this.store.findAll("headers/header/template"),library:this.store.findAll("element/definition"),entries:this.store.findAll("headers/entry"),assignments:this.store.findRecord("option","cornerstone_header_assignments"),newHeader:{title:"",template:""},defaultTemplate:"header:header-default"})},afterModel:function(e){var t=e.assignments.get("value")
t&&!Ember.isEmpty(t)||e.assignments.set("value",{})},setupController:function(e,t){this._super(e,t),this.get("ui").setRouteUI(this),e.set("activeModal",!1),e.set("selectedTemplate",null),e.set("selected",null),e.set("templates",t.templates.toArray())},actions:{doEntryAction:function(){this.send.apply(this,arguments)},createDefault:function(){var e=this.get("i18n").t("common.headers.entity"),t=this.get("i18n").t("app.default-thing",{context:e})
this.send("createNew",t,this.modelFor(this.routeName).defaultTemplate,!0)},createNew:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.get("i18n").t("common.headers.entity")
if(!e)return this.get("ui").notify(this.get("i18n").t("app.notify.title-required",{context:r}),"error")
var a={}
if(t){var i=this.store.peekRecord("headers/header/template",t)
i&&(a._template=i.get("id"))}var s=this.store.createRecord("headers/entry",{title:e}),l=this.store.createRecord("headers/header",{title:e,settings:a})
this.controllerFor("headers").set("selectedTemplate",null),this.get("ui").beginSaveProgress(),l.save().then(function(e){e.set("settings._template",null),s.set("id",e.id),s.save(),n.get("ui").endSaveProgress(),o?n.transitionTo("headers.header",e.id):n.get("ui").notify(n.get("i18n").t("app.notify.created",{context:r}),"success")}).catch(function(e){console.warn("Could not create new header",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-create",{context:r}),"error")})},entryDuplicate:function(e){var t=this
this.get("store").findRecord("headers/header",e.get("id")).then(function(e){var n=e.serialize(),o=t.get("i18n").t("app.copy-of",{title:n.data.attributes.title}).toString(),r=t.store.createRecord("headers/entry",{title:o}),a=t.store.createRecord("headers/header",{title:o,regions:n.data.attributes.regions,settings:n.data.attributes.settings}),i=t.get("i18n").t("common.headers.entity")
t.get("ui").beginSaveProgress(),a.save().then(function(e){r.set("id",e.id),r.save(),t.get("ui").notify(t.get("i18n").t("app.notify.duplicated",{context:i})),t.get("ui").endSaveProgress()}).catch(function(e){console.warn("Could not create new header",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-duplicate",{context:i}),"error"),t.get("ui").endSaveProgress()})})},entryDelete:function(e){var t=this,n=this.get("i18n").t("common.headers.entity")
this.get("ui").confirm({message:this.get("i18n").t("app.notify.delete-confirm-perm",{context:n}),acceptClass:"sad",accept:function(){t.get("store").findRecord("headers/header",e.get("id")).then(function(o){t.controllerFor("headers").set("selected",null),e.destroyRecord(),o.destroyRecord().then(function(){t.get("ui").notify(t.get("i18n").t("app.notify.deleted",{context:n})),t.modelFor(t.routeName).assignments.reload()},function(e){console.warn("Could not delete header",e),t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-delete",{context:n}),"error")})})}})},entryTitleUpdate:function(e){var t=this
this.get("store").findRecord("headers/header",e.get("id")).then(function(n){n.set("title",e.get("title")),t.get("ui").beginSaveProgress(),n.save().then(function(){t.get("ui").endSaveProgress()},function(e){console.warn("Could not update header title",e)
var n=t.get("i18n").t("common.headers.entity")
t.get("ui").notify(t.get("i18n").t("app.notify.failed-to-update-title",{context:n}),"error")})})},saveTemplate:function(e,t){var n=this,o=this.get("i18n").t("app.headers.template-entity")
if(!t)return this.get("ui").notify(this.get("i18n").t("app.notify.name-required",{context:o}),"error")
var r=this.get("store").peekAll("headers/header/template").find(function(e){return t===e.get("title")})
r?this.get("ui").confirm({message:this.get("i18n").t("app.notify.name-overwrite-confirm",{context:o}),acceptClass:"sad",accept:function(){n.get("ui").beginSaveProgress(),r.set("meta",{headerId:e.get("id")}),r.save().then(function(){n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.updated",{context:o}),"success")},function(e){n.get("ui").endSaveProgress(),console.warn("Unable to save Header template",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-update",{context:o}),"error")})}}):(this.get("ui").beginSaveProgress(),this.store.createRecord("headers/header/template",{title:t,meta:{headerId:e.get("id")}}).save().then(function(e){n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.saved",{context:o}),"success"),n.controllerFor("headers").get("templates").pushObject(e)},function(e){n.get("ui").endSaveProgress(),console.warn("Could not update header title",e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-save",{context:o}),"error")}))}}})
e.default=n}),define("tco-app/headers/service",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({selected:null})
e.default=t}),define("tco-app/headers/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Jr3kIHj6",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["headers"]],{"statements":[[4,"global/cs-canvas",null,null,{"statements":[[4,"unless",[[27,"eq",["off",[23,["previewing"]]],null]],null,{"statements":[[4,"if",[[27,"eq",["blank",[23,["selectedTemplate"]]],null]],null,{"statements":[[0,"        "],[1,[27,"common/welcome-message",null,[["title"],[[27,"t",["app.templates.blank-welcome"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[4,"common/preview-frame",null,[["src","state","preloader","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],"headers",[27,"route-action",["observerNav"],null]]],{"statements":[],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"common/welcome-message",null,null,{"statements":[[0,"        "],[7,"div"],[11,"class","cs-welcome-icon cs-welcome-icon-cs-logo"],[9],[0,"\\n          "],[1,[27,"icon",["logo-pro-inherit"],null],false],[0,"\\n        "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}],[0,"\\n"],[4,"if",[[27,"and",[[23,["ui","wpmlLanguages"]],[27,"contains",["cs_header",[23,["ui","wpmlTranslateableTypes"]]],null]],null]],null,{"statements":[[0,"      "],[1,[27,"common/language-picker",null,[["activeLanguage","onSelectLanguage"],[[23,["activeLanguage"]],[27,"route-action",["selectLanguage"],null]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null],[4,"workspace/cs-workspace",null,null,{"statements":[[0,"    "],[1,[27,"hf-index",null,[["context","assignContexts","assignments","entries","selected","selectedTemplate","defaultSelected","templateOptions","activeLanguage","editRoute","onAction","onCreate","onSaveTemplate","onTitleUpdate"],["headers",[23,["flattenedAssignContexts"]],[23,["model","assignments"]],[23,["model","entries"]],[23,["selected"]],[23,["selectedTemplate"]],[23,["defaultSelected"]],[23,["templateOptions"]],[23,["activeLanguage"]],"headers.header",[27,"route-action",["doEntryAction"],null],[27,"route-action",["createNew"],null],[27,"route-action",["saveTemplate"],null],[27,"route-action",["entryTitleUpdate"],null]]]],false],[0,"\\n    "],[1,[21,"outlet"],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/headers/template.hbs"}})
e.default=t}),define("tco-app/helpers/and",["exports"],function(e){function t(e){return e.reduce(function(e,t){return!!e&&t})}Object.defineProperty(e,"__esModule",{value:!0}),e.and=t,e.default=void 0
var n=Ember.Helper.helper(t)
e.default=n}),define("tco-app/helpers/app-version",["exports","tco-app/config/environment","ember-cli-app-version/utils/regexp"],function(e,t,n){function o(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.default.APP.version,a=o.versionOnly||o.hideSha,i=o.shaOnly||o.hideVersion,s=null
return a&&(o.showExtended&&(s=r.match(n.versionExtendedRegExp)),s||(s=r.match(n.versionRegExp))),i&&(s=r.match(n.shaRegExp)),s?s[0]:r}Object.defineProperty(e,"__esModule",{value:!0}),e.appVersion=o,e.default=void 0
var r=Ember.Helper.helper(o)
e.default=r}),define("tco-app/helpers/append",["exports","ember-composable-helpers/helpers/append"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"append",{enumerable:!0,get:function(){return t.append}})}),define("tco-app/helpers/array",["exports"],function(e){function t(e){return e}Object.defineProperty(e,"__esModule",{value:!0}),e.array=t,e.default=void 0
var n=Ember.Helper.helper(t)
e.default=n}),define("tco-app/helpers/chunk",["exports","ember-composable-helpers/helpers/chunk"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"chunk",{enumerable:!0,get:function(){return t.chunk}})}),define("tco-app/helpers/compact",["exports","ember-composable-helpers/helpers/compact"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})
define("tco-app/helpers/compute",["exports","ember-composable-helpers/helpers/compute"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"compute",{enumerable:!0,get:function(){return t.compute}})}),define("tco-app/helpers/contains",["exports","ember-composable-helpers/helpers/contains"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"contains",{enumerable:!0,get:function(){return t.contains}})}),define("tco-app/helpers/cs-icon",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({compute:function(e){if(!e[0])return Ember.String.htmlSafe("")
var t=e[0].split("/"),n="ui"
t.length>1&&(n=t[0],t.shift())
var o=t.join("-"),r=this.get("config.global.iconMaps")
if(!r||!r[n])return Ember.String.htmlSafe("")
var a=e[1]?e[1]:""
return Ember.String.htmlSafe('<svg role="img" class="cs-svg-'.concat("ui"===n?"ui":"elements",'">').concat(a,'<use xlink:href="').concat(r[n],"#").concat(o,'"></use></svg>'))}})
e.default=t}),define("tco-app/helpers/dec",["exports","ember-composable-helpers/helpers/dec"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"dec",{enumerable:!0,get:function(){return t.dec}})}),define("tco-app/helpers/drop",["exports","ember-composable-helpers/helpers/drop"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/eq",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]===n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.eq=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/fa-prefix",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.faPrefix=o,e.default=void 0
var n=["copy","trash-alt"]
function o(e){var o=t(e,1)[0]
return n.includes(o)?"far":"fas"}var r=Ember.Helper.helper(o)
e.default=r}),define("tco-app/helpers/filter-by",["exports","ember-composable-helpers/helpers/filter-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/filter",["exports","ember-composable-helpers/helpers/filter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/find-by",["exports","ember-composable-helpers/helpers/find-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/flatten",["exports","ember-composable-helpers/helpers/flatten"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"flatten",{enumerable:!0,get:function(){return t.flatten}})}),define("tco-app/helpers/group-by",["exports","ember-composable-helpers/helpers/group-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/gt",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]>n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.gt=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/gte",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]>=n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.gte=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/has-next",["exports","ember-composable-helpers/helpers/has-next"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"hasNext",{enumerable:!0,get:function(){return t.hasNext}})}),define("tco-app/helpers/has-previous",["exports","ember-composable-helpers/helpers/has-previous"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"hasPrevious",{enumerable:!0,get:function(){return t.hasPrevious}})}),define("tco-app/helpers/hs",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,1)[0]
return Ember.String.htmlSafe(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.hs=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/icon",["exports","tco-app/helpers/cs-icon"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({config:Ember.inject.service(),compute:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]
var t=this._super(e)
return Ember.isNone(t)?(console.warn("getIcon failure",e,t),Ember.String.htmlSafe("")):Ember.String.htmlSafe(t)}})
e.default=n}),define("tco-app/helpers/inc",["exports","ember-composable-helpers/helpers/inc"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"inc",{enumerable:!0,get:function(){return t.inc}})}),define("tco-app/helpers/intersect",["exports","ember-composable-helpers/helpers/intersect"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/invoke",["exports","ember-composable-helpers/helpers/invoke"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"invoke",{enumerable:!0,get:function(){return t.invoke}})}),define("tco-app/helpers/join",["exports","ember-composable-helpers/helpers/join"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/locate-component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({compute:function(e){return Ember.getOwner(this).hasRegistration("component:".concat(e[0]))?e[0]:e[1]}})
e.default=t}),define("tco-app/helpers/lt",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]<n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.lt=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/lte",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]<=n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.lte=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/map-by",["exports","ember-composable-helpers/helpers/map-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/map",["exports","ember-composable-helpers/helpers/map"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/next",["exports","ember-composable-helpers/helpers/next"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"next",{enumerable:!0,get:function(){return t.next}})}),define("tco-app/helpers/not-eq",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){var n=t(e,2)
return n[0]!==n[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.notEq=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o}),define("tco-app/helpers/not",["exports"],function(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){return!t(e,1)[0]}Object.defineProperty(e,"__esModule",{value:!0}),e.not=n,e.default=void 0
var o=Ember.Helper.helper(n)
e.default=o})
define("tco-app/helpers/object-at",["exports","ember-composable-helpers/helpers/object-at"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"objectAt",{enumerable:!0,get:function(){return t.objectAt}})}),define("tco-app/helpers/optional",["exports","ember-composable-helpers/helpers/optional"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return t.optional}})}),define("tco-app/helpers/or",["exports"],function(e){function t(e){return e.reduce(function(e,t){return!!e||t})}Object.defineProperty(e,"__esModule",{value:!0}),e.or=t,e.default=void 0
var n=Ember.Helper.helper(t)
e.default=n}),define("tco-app/helpers/pipe-action",["exports","ember-composable-helpers/helpers/pipe-action"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/pipe",["exports","ember-composable-helpers/helpers/pipe"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return t.pipe}})}),define("tco-app/helpers/pluralize",["exports","ember-inflector/lib/helpers/pluralize"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default
e.default=n}),define("tco-app/helpers/previous",["exports","ember-composable-helpers/helpers/previous"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"previous",{enumerable:!0,get:function(){return t.previous}})}),define("tco-app/helpers/queue",["exports","ember-composable-helpers/helpers/queue"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"queue",{enumerable:!0,get:function(){return t.queue}})}),define("tco-app/helpers/range",["exports","ember-composable-helpers/helpers/range"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"range",{enumerable:!0,get:function(){return t.range}})}),define("tco-app/helpers/reduce",["exports","ember-composable-helpers/helpers/reduce"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/reject-by",["exports","ember-composable-helpers/helpers/reject-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/repeat",["exports","ember-composable-helpers/helpers/repeat"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return t.repeat}})}),define("tco-app/helpers/resolve-icon-alias",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({fontAwesome:Ember.inject.service(),compute:function(e){return this.get("fontAwesome").resolveAlias(e[0])}})
e.default=t}),define("tco-app/helpers/resolve-icon-prefix",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({fontAwesome:Ember.inject.service(),compute:function(e){return this.get("fontAwesome").resolveIconPrefix(e[0])}})
e.default=t}),define("tco-app/helpers/resolve-icon",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({fontAwesome:Ember.inject.service(),compute:function(e){return this.get("fontAwesome").resolveIcon(e[0])}})
e.default=t}),define("tco-app/helpers/reverse",["exports","ember-composable-helpers/helpers/reverse"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/route-action",["exports","ember-route-action-helper/helpers/route-action"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/shuffle",["exports","ember-composable-helpers/helpers/shuffle"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"shuffle",{enumerable:!0,get:function(){return t.shuffle}})}),define("tco-app/helpers/singularize",["exports","ember-inflector/lib/helpers/singularize"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default
e.default=n}),define("tco-app/helpers/slice",["exports","ember-composable-helpers/helpers/slice"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/sort-by",["exports","ember-composable-helpers/helpers/sort-by"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/t",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({i18n:Ember.inject.service(),compute:function(e,t){return e[0]?this.get("i18n").t(e[0],t||{}):Ember.String.htmlSafe("")}})
e.default=t}),define("tco-app/helpers/take",["exports","ember-composable-helpers/helpers/take"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/toggle-action",["exports","ember-composable-helpers/helpers/toggle-action"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/toggle",["exports","ember-composable-helpers/helpers/toggle"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"toggle",{enumerable:!0,get:function(){return t.toggle}})}),define("tco-app/helpers/union",["exports","ember-composable-helpers/helpers/union"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/helpers/user-can",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Helper.extend({currentUser:Ember.inject.service(),compute:function(e){return!(!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).passEmpty||!Ember.isNone(e[0]))||this.get("currentUser").can(e[0])}})
e.default=t}),define("tco-app/helpers/without",["exports","ember-composable-helpers/helpers/without"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"without",{enumerable:!0,get:function(){return t.without}})}),define("tco-app/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","tco-app/config/environment"],function(e,t,n){var o,r
Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n.default.APP&&(o=n.default.APP.name,r=n.default.APP.version)
var a={name:"App Version",initialize:(0,t.default)(o,r)}
e.default=a}),define("tco-app/initializers/container-debug-adapter",["exports","ember-resolver/resolvers/classic/container-debug-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0]
e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}}
e.default=n})
define("tco-app/initializers/ember-data",["exports","ember-data/setup-container","ember-data"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o={name:"ember-data",initialize:t.default}
e.default=o}),define("tco-app/initializers/export-application-global",["exports","tco-app/config/environment"],function(e,t){function n(){var e=arguments[1]||arguments[0]
if(!1!==t.default.exportApplicationGlobal){var n
if("undefined"!=typeof window)n=window
else if("undefined"!=typeof global)n=global
else{if("undefined"==typeof self)return
n=self}var o,r=t.default.exportApplicationGlobal
o="string"==typeof r?r:Ember.String.classify(t.default.modulePrefix),n[o]||(n[o]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete n[o]}}))}}Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=n,e.default=void 0
var o={name:"export-application-global",initialize:n}
e.default=o}),define("tco-app/initializers/flash-messages",["exports","tco-app/config/environment","ember-cli-flash/utils/flash-message-options"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=a,e.default=void 0
var o=Ember.deprecate,r="[ember-cli-flash] Future versions of ember-cli-flash will no longer inject the service automatically. Instead, you should explicitly inject it into your Route, Controller or Component with `Ember.inject.service`."
function a(){var e=arguments[1]||arguments[0],a=(t.default||{}).flashMessageDefaults,i=(a||[]).injectionFactories,s=(0,n.default)(a),l=!(i&&i.length)
o(r,l,{id:"ember-cli-flash.deprecate-injection-factories",until:"2.0.0"}),s.injectionFactories.forEach(function(t){e.inject(t,"flashMessages","service:flash-messages")})}var i={name:"flash-messages",initialize:a}
e.default=i}),define("tco-app/instance-initializers/ember-data",["exports","ember-data/initialize-store-service"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n={name:"ember-data",initialize:t.default}
e.default=n}),define("tco-app/instance-initializers/head-browser",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
e.default={name:"head-browser",initialize:function(){}}}),define("tco-app/middleware/index",["exports","redux-thunk"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=[t.default]
e.default=n}),define("tco-app/mixins/click-outside",["exports","ember-click-outside/mixin"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/mixins/controls/placeholder",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({placeholder:Ember.computed("control.options",function(){var e=this.get("control.options.placeholder")
return e||""})})
e.default=t}),define("tco-app/mixins/dragula-events",["exports","lodash"],function(e,t){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=["dragula-drag","dragula-dragend","dragula-drop","dragula-cancel","dragula-remove","dragula-shadow","dragula-over","dragula-out","dragula-cloned","dragula-cloned-original","dragula-copy","dragula-copy-original","dragula-mirror","dragula-mirror-original"],r=["dragula-dragend","dragula-drop","dragula-cancel","dragula-remove","dragula-shadow","dragula-over","dragula-out"],a=["dragula-drag-lift","dragula-drop-into","dragula-drop-from","dragula-cancel-container","dragula-cancel-source","dragula-remove-container","dragula-remove-source","dragula-shadow-container","dragula-shadow-source","dragula-over-container","dragula-over-source","dragula-out-container","dragula-out-source"],i=Ember.Mixin.create({ui:Ember.inject.service(),dragulaEvents:[],dragulaElementEl:Ember.computed(function(){var e=this.get("dragulaElementSelector")
if(e){var t=this.$().find(e)[0]
if(t)return t}return this.get("element")}),dragulaContainerEl:Ember.computed(function(){var e=this.get("dragulaContainerSelector")
if(e){var t=this.$().find(e)[0]
if(t)return t}return this.get("element")}),dragulaDidInsertElement:Ember.on("didInsertElement",function(){this.dragulaSetupInitialHandlers({events:this.get("dragulaEvents"),elementEl:this.get("dragulaElementEl"),containerEl:this.get("dragulaContainerEl")})}),dragulaElementDestroy:Ember.on("willDestroyElement",function(){this.dragulaTeardown()}),dragulaSetupInitialHandlers:function(e){var t=e.events,n=e.elementEl,r=e.containerEl
this.dragulaTeardown()
var i=[].concat(this.getWithDefault("dragulaHandlers",[]))
t.includes("element")&&n&&(i=i.concat(this.dragulaSetupEvents(n,o))),t.includes("container")&&r&&(i=i.concat(this.dragulaSetupEvents(r,a))),i.length>0&&this.set("dragulaHandlers",i)},dragulaSetupEvents:function(e,o,r){var a=this
if(e){var i=[]
return o.forEach(function(o){return function t(o,r){0!==r.indexOf("_")&&t(o,"_".concat(r))
var s=a[r]
if("function"==typeof s){var l=function(e){return s.apply(a,[e].concat(n(e.detail.args)))}
e.addEventListener(o,l),i.push({event:o,handler:l,el:e})}}(o,(0,t.camelCase)(r?o+"-"+r:o))}),i}},dragulaTeardown:function(){this.dragulaTeardownHandlers(this.get("dragulaHandlers"))},dragulaTeardownHandlers:function(e){e&&e.forEach(function(e){var t=e.el,n=e.event,o=e.handler
return t.removeEventListener(n,o)})},dragulaCloned:function(e,n,o,a){var i=(0,t.camelCase)("dragula-".concat(a,"-handlers"))
this.set(i,this.dragulaSetupEvents(n,r,a))},_dragulaDragendMirror:function(){var e=this
Ember.run.next(function(){return e.dragulaTeardownHandlers(e.get("dragulaMirrorHandlers"))})},_dragulaDragendCopy:function(){var e=this
Ember.run.next(function(){return e.dragulaTeardownHandlers(e.get("dragulaCopyHandlers"))})}})
e.default=i}),define("tco-app/mixins/fadeable",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({showing:!0,complete:!1,incomplete:Ember.computed("complete",function(){return!this.get("complete")}),completeChanged:Ember.observer("complete",function(){this.debounceFade=Ember.run.debounce(this,this.updateFade,1e3)}),willDestroyElement:function(){Ember.run.cancel(this.debounceFade)},updateFade:function(){this.set("showing",!this.get("complete")),this.get("onComplete")()}})
e.default=t}),define("tco-app/mixins/forms/assign-default",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({assignDefaultActive:!0,assignDefaultMulti:!1,assignDefaultMultiDelimeter:" ",assignDefaultOptionsPath:"options",assignDefaultValuePath:"value",assignDefaultLocator:null,actions:{assignDefaultOption:function(){var e=this
if(!this.isDestroyed&&this.get("assignDefaultActive")){var t=this.get("value")
this.get("assignDefaultMulti")&&"string"===Ember.typeOf(t)&&(t=t.split(this.get("assignDefaultMultiDelimeter"))),Ember.isArray(t)||!Ember.isNone(t)&&Ember.isPresent(this.get(this.get("assignDefaultOptionsPath")).find(function(e){return t===e.value||t===e}))||this.set("value",function(){var n=e.get("assignDefaultLocator")
if(!Ember.isNone(n)){var o=e.get(e.get("assignDefaultOptionsPath")).find(function(e){return n(t,e)})
if(!Ember.isNone(o))return o.value?o.value:o}var r=e.get("assignDefaultSourcePath")
if(!Ember.isNone(r))return e.get(r)
var a="".concat(e.get("assignDefaultOptionsPath"),".firstObject")
return e.getWithDefault("".concat(a,".").concat(e.get("assignDefaultValuePath")),e.get(a))}())}}}})
e.default=t}),define("tco-app/mixins/forms/visibility-observation",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({didInsertElement:function(){Ember.isPresent("visibilityObservation")&&this.visibilityCheck()},observeVisibility:Ember.observer("visibilityObservation",function(){this.visibilityCheck()}),observeVisibilityShouldUpdate:function(){return!1===this.get("visibilityObservation")},visibilityCheck:function(){Ember.run.scheduleOnce("afterRender",function(){this.observeVisibilityShouldUpdate()?this.send("isVisible"):this.send("isNotVisible")}.bind(this))},actions:{isVisible:function(){},isNotVisible:function(){}}})
e.default=t}),define("tco-app/mixins/hover-state",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({classNameBindings:["isHovering:cs-hover"],isHovering:!1,mouseEnter:function(){this.set("isHovering",!0)},mouseLeave:function(){this.set("isHovering",!1)}})
e.default=t}),define("tco-app/mixins/link-to",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({activeClass:"cs-active",_sendInvokeAction:function(){this.invokeAction()},init:function(){this._super.apply(this,arguments)
var e=this.get("eventName")
this.get("invokeAction")&&this.on(e,this,this._sendInvokeAction)},willDestroyElement:function(){this.get("invokeAction")&&this.off(this.get("eventName"),this,this._sendInvokeAction)}})
e.default=t}),define("tco-app/mixins/options/model-condition",["exports","tco-app/src/util/control-conditions"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Mixin.create({optionService:Ember.inject.service("options"),virtualValues:Ember.computed.alias("optionService.virtualValues"),conditionIndex:{},conditionStates:!1,conditionsLoad:function(){!1===this.get("conditionStates")&&(this.set("conditionStates",{}),this.notifyPropertyChange("conditions"))},conditionsHaveUpdated:Ember.observer("conditions",function(){var e=this
this.conditionsClearObservers()
var n={}
this.set("conditionStates",{})
var o=this.get("conditions")
Ember.isArray(o)&&o.forEach(function(o){var r=(0,t.normalizeControlCondition)(o)
if(r.key&&!Ember.isNone(r.value)&&r.op){var a=!1
0===r.key.indexOf("virtual:")&&(a=!0,r.key=Ember.String.camelize(r.key.replace("virtual:","")))
var i={listener:e,listenerKey:"conditionStates",condition:r,target:a?e:e.store.peekRecord("options/value",r.key),targetKey:a?"virtualValues.".concat(r.key):"value",callback:function(){this.listener.set("".concat(this.listenerKey,".").concat(this.condition.key),(0,t.checkCondition)(this.condition.value,Ember.get(this.target,this.targetKey),this.condition.op)),this.listener.notifyPropertyChange(this.listenerKey)}}
n[r.key]=i,i.callback.call(i),Ember.addObserver(i.target,i.targetKey,i,i.callback)}}),this.set("conditionIndex",n)}),visibilityConditionsMet:Ember.computed("conditionStates",function(){var e=!0,t=this.get("conditionStates")
for(var n in t)e=e&&t[n]
return e}),conditionsClearObservers:function(){var e=this.get("conditionIndex")||{}
for(var t in e){var n=e[t]
Ember.removeObserver(n.target,n.targetKey,n,n.callback)}}})
e.default=n}),define("tco-app/mixins/preview-listener",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({xfr:Ember.inject.service(),_listenToRegistrations:{},componentListenTo:function(e,t){this.listenTo(e,function(){this.isDestroyed||t.apply(this,arguments)}.bind(this))},listenTo:function(e,t){this.get("xfr").on(e,this,t),this.set("_listenToRegistrations.".concat(e),t)},willDestroy:function(){var e=this,t=this.get("_listenToRegistrations"),n=this.get("xfr")
Object.keys(t).forEach(function(o){"function"==typeof t[o]&&(n.off(o,e,t[o]),e.set("_listenToRegistrations.".concat(o),null))})}})
e.default=t}),define("tco-app/mixins/route-authorization",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({acl:[],permissionCheck:function(e){var t=this.get("currentUser")
e||(e=this.get("acl"))
var n=e.reduce(function(e,n){var o=t.get(n)
return Ember.isNone(o)&&(o=t.can(n)),e&&o},!0)
return n||this.transitionTo("unauthorized"),n}})
e.default=t}),define("tco-app/option/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/option/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({value:(0,n.default)()})
e.default=o}),define("tco-app/options/control/adapter",["exports","tco-app/adapters/cs-longevity-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/options/control/model",["exports","ember-data/model","ember-data/attr","tco-app/mixins/options/model-condition","ember-data/relationships"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=t.default.extend(o.default,{service:Ember.inject.service("controls"),title:(0,n.default)(),label:Ember.computed.alias("title"),type:(0,n.default)(),options:(0,n.default)({defaultValue:function(){return{}}}),conditions:(0,n.default)(),section:(0,r.belongsTo)("options/section"),values:(0,r.hasMany)("options/value",{inverse:null}),keyValue:Ember.computed.alias("values.firstObject.value"),loadedAt:Ember.on("didLoad",function(){this.set("loadedAt",new Date),this.conditionsLoad()}),searchable:Ember.computed("section",function(){var e={title:this.get("title")},t=this.get("section")
if("root"!==t.get("id")){e.parent=t.get("title")
var n=t.get("parent")
n&&"root"!==n.get("id")&&(e.grandparent=n.get("title"))}return e}),isHidden:Ember.computed.not("visibilityConditionsMet"),choices:Ember.computed("options.choices.[]","filteredChoices",function(){var e=this.get("filteredChoices")
return e||this.get("options.choices")}),init:function(){this._super.apply(this,arguments),this.setupReferences(),this.setupControlFilter()},setupReferences:function(){var e=this
this.getWithDefault("options.references",[]).forEach(function(t){var n=Ember.String.camelize("key-".concat(t.key)),o=e.store.peekRecord("options/value",t.source),r=e
e.set(n,o.get("value")),Ember.addObserver(o,"value",function(){r.set(n,this.get("value"))})})},updateControlFiltering:Ember.observer("options.filter",function(){this.setupControlFilter()}),setupControlFilter:function(e){if(e=e||{},this.controlFilter&&Ember.removeObserver(this.controlFilter.source,"value",this,"updateFilterCb"),!e.teardown){var t=this.get("options.filter")
if(t&&t.source&&this.validateFilter(t.key)){var n=this.store.peekRecord("options/value",t.source)
n&&(this.controlFilter={source:n,key:t.key,method:t.method},Ember.addObserver(this.controlFilter.source,"value",this,"updateFilterCb"),this.updateFilterCb())}}},updateFilterCb:function(){this.set(Ember.String.camelize("filtered-"+this.controlFilter.key),this.get("service").controlFilter(this.controlFilter.method,this.controlFilter.source.get("value")))},validateFilter:function(e){return["choices"].includes(e)},willDestroy:function(){this._super.apply(this,arguments),this.conditionsClearObservers(),this.setupControlFilter({teardown:!0})}})
e.default=a}),define("tco-app/options/controller",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Controller.extend({service:Ember.inject.service("options"),i18n:Ember.inject.service(),config:Ember.inject.service(),queryParams:["url"],url:null,previewURL:Ember.computed("url",function(){var e=this.get("url")
return e||this.get("ui.defaultPreviewUrl")}),observePreviewUrl:Ember.observer("previewURL",function(){this.set("ui.viewSiteURL",this.get("previewURL"))}),previewState:Ember.computed.alias("service.optionsPreviewState"),actions:{runCustomJs:function(){this.get("ui").notify((0,t.t)("app.notify.preview-updating")),this.incrementProperty("previewState.inc")}}})
e.default=n}),define("tco-app/options/index/controller",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Controller.extend({config:Ember.inject.service(),i18n:Ember.inject.service(),isSearching:Ember.computed.alias("searchData.isSearching"),searchResults:Ember.computed("searchData.results",function(){var e=this.get("searchData.results"),t=this.model.controls.filter(function(t){return e.includes(t.get("id"))&&!t.get("isHidden")&&t.get("section.isSearchable")})
return t.sort(function(t,n){return e.indexOf(t.get("id"))>e.indexOf(n.get("id"))}),t}),init:function(){this._super.apply(this,arguments),this.set("searchData",this.get("ui.search").getTarget("options"))}})
e.default=t}),define("tco-app/options/index/route",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({setupController:function(e,t){this._super(e,t),e.set("title",this.get("i18n").t("common.title.options-".concat(window.csAppData.optionsTitle||"styling")))}})
e.default=t}),define("tco-app/options/index/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"AjsdJEE2",block:'{"symbols":["child","result"],"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[0,"  "],[7,"h2"],[11,"class","cs-workspace-title"],[9],[1,[21,"title"],false],[10],[0,"\\n  "],[7,"div"],[11,"class","cs-workspace-search"],[9],[0,"\\n    "],[1,[27,"common/search-bar",null,[["target","placeholder","autoFocus","focusOnShortcut"],["options",[27,"t",["app.search-thing"],[["context"],[[27,"t",["app.options.entities"],null]]]],true,[27,"not",[[27,"or",[[23,["ui","showCustomCSS"]],[23,["ui","showCustomJS"]]],null]],null]]]],false],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-content",null,null,{"statements":[[4,"if",[[23,["isSearching"]]],null,{"statements":[[4,"each",[[23,["searchResults"]]],null,{"statements":[[0,"      "],[1,[27,"options/option-search-result",null,[["control"],[[22,2,[]]]]],false],[0,"\\n"]],"parameters":[2]},{"statements":[[4,"workspace/workspace-message",null,[["title"],[[27,"t",["app.no-things-found"],[["context"],[[27,"t",["app.options.entities"],null]]]]]],{"statements":[[0,"        "],[7,"p"],[9],[1,[27,"t",["app.refine-search"],[["context"],[[27,"t",["app.options.entities"],null]]]],false],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]}]],"parameters":[]},{"statements":[[4,"each",[[23,["model","activeSection","children"]]],null,{"statements":[[4,"unless",[[22,1,["isHidden"]]],null,{"statements":[[4,"if",[[22,1,["panel"]]],null,{"statements":[[4,"link-to",["options.section",[22,1,["id"]]],[["class"],["cs-workspace-section-goto"]],{"statements":[[0,"            "],[1,[22,1,["title"]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},{"statements":[[0,"          "],[1,[27,"options/option-section",null,[["section"],[[22,1,[]]]]],false],[0,"\\n"]],"parameters":[]}]],"parameters":[]},null]],"parameters":[1]},null]],"parameters":[]}]],"parameters":[]},null],[0,"\\n\\n\\n\\n\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/options/index/template.hbs"}})
e.default=t}),define("tco-app/options/route",["exports","tco-app/mixins/route-authorization"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Route.extend(t.default,{service:Ember.inject.service("options"),acl:["theme_options"],routeUI:{bar:["collapse","preview-sizer","view-site","cheatsheet","save"]},beforeModel:function(){this.permissionCheck()},model:function(){var e=this,t=this.store.findAll("options/value")
return Ember.RSVP.hash({values:t,customCSS:new Ember.RSVP.Promise(function(n){return t.then(function(){return n(e.store.peekRecord("options/value",e.get("service.customCSSKey")))})}),customJS:new Ember.RSVP.Promise(function(n){return t.then(function(){return n(e.store.peekRecord("options/value",e.get("service.customJSKey")))})}),config:this.get("config").fetch("options-manager"),controls:this.store.findAll("options/control"),fontSelections:this.store.findAll("font-manager/selection"),activeSection:this.store.findRecord("options/section","root"),headerAssignments:this.store.findRecord("option","cornerstone_header_assignments"),footerAssignments:this.store.findRecord("option","cornerstone_footer_assignments")})},setupController:function(e,t){this._super.apply(this,arguments),this.get("ui").setRouteUI(this),this.set("service.virtualValues.classicHeaders","pro"!==window.csAppData.env.product||!t.headerAssignments.getWithDefault("value",{}).hasOwnProperty("global")),this.set("service.virtualValues.classicFooters","pro"!==window.csAppData.env.product||!t.footerAssignments.getWithDefault("value",{}).hasOwnProperty("global")),this.set("ui.viewSiteURL",e.get("previewURL"))},afterModel:function(e){var t=this.get("ui.search").getTarget("options")
t.setOptions({id:"id",threshold:.15,distance:100,tokenize:!0,keys:[{name:"title",weight:.1},{name:"parent",weight:.3},{name:"grandparent",weight:.5}]}),t.updateIndex(e.controls.map(function(e){return Object.assign({id:e.get("id")},e.get("searchable"))})),this.set("ui.unsavedData",!1)},renderTemplate:function(){this.render("partials/bar/options",{outlet:"bar",into:"application",model:this.modelFor(this.routeName)}),this.render("partials/global/options",{outlet:"global",into:"application",model:this.modelFor(this.routeName)}),this._super(this,arguments)},actions:{save:function(){var e=this,t=this.get("ui")
t.beginSaveProgress()
var n=this.get("i18n").t("app.options.entities")
this.get("service").save().then(function(o){console.log("Options saved.",o),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.saved",{context:n}),"success"),e.set("ui.unsavedData",!1),e.controllerFor(e.routeName).set("lastSave",new Date)}).catch(function(o){console.warn("Options failed to save",o),t.endSaveProgress(),t.notify(e.get("i18n").t("app.notify.failed-to-saved",{context:n}),"error")})},navigatePreview:function(e){if(e.url){var t=this.get("config.global.home_url"),n=o(e.url)===o(t)?null:e.url
this.transitionTo({queryParams:{url:n}})}function o(e){return"string"!=typeof e?e:e+("/"===e.charAt(e.length-1)?"":"/")}},willTransition:function(e){var t=this
this.get("ui.unsavedData")&&!e.targetName.includes("options")&&(e.abort(),this.get("ui").confirm({noSkip:!0,message:this.get("i18n").t("app.unsaved-warning"),accept:function(){t.set("ui.unsavedData",!1),e.retry()},acceptClass:"sad"}))},observerNav:function(e){var t=this,n=e.id,o=e.route,r=e.context,a=[o]
n&&a.push(n)
var i=this.get("ui.unsavedData")
this.get("ui").confirm({noSkip:!0,message:i?this.get("i18n").t("app.streamline-nav-unsaved",{context:r}):this.get("i18n").t("app.streamline-nav",{context:r}),accept:function(){t.set("ui.unsavedData",!1),t.transitionTo.apply(t,a)},acceptClass:"sad"})}}})
e.default=n}),define("tco-app/options/section/adapter",["exports","tco-app/adapters/cs-longevity-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/options/section/model",["exports","ember-data/model","ember-data/attr","tco-app/mixins/options/model-condition","ember-data/relationships"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=t.default.extend(o.default,{title:(0,n.default)(),description:(0,n.default)(),order:(0,n.default)("number"),panel:(0,n.default)("boolean"),conditions:(0,n.default)(),children:(0,r.hasMany)("options/section",{inverse:"parent"}),parent:(0,r.belongsTo)("options/section",{inverse:"children"}),controls:(0,r.hasMany)("options/control"),loadedAt:Ember.on("didLoad",function(){this.set("loadedAt",new Date),this.conditionsLoad()}),ancestry:Ember.computed("parent",function(){for(var e=[],t=this.get("parent");t&&"root"!==t.get("id");)e.push({route:"options.section",id:t.get("id"),label:t.get("title")}),t=t.get("parent")
return e}),isHidden:Ember.computed("visibilityConditionsMet","noVisibleControls","noVisibleSections",function(){return!["x-header","x-footer"].includes(this.get("id"))&&(!this.get("visibilityConditionsMet")||this.get("noVisibleControls")&&this.get("noVisibleSections"))}),isSearchable:Ember.computed("visibilityConditionsMet","parent.visibilityConditionsMet",function(){return this.get("visibilityConditionsMet")&&this.get("parent.visibilityConditionsMet")}),noVisibleControls:Ember.computed("controls.@each.isHidden",function(){return this.get("controls").every(function(e){return e.get("isHidden")})}),noVisibleSections:Ember.computed("children.@each.isHidden",function(){return this.get("children").every(function(e){return e.get("isHidden")})}),willDestroy:function(){this._super(),this.conditionsClearObservers()}})
e.default=a}),define("tco-app/options/section/route",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({model:function(e){return Ember.RSVP.hash({activeSection:this.store.findRecord("options/section",e.section_id)})},setupController:function(e,t){this._super(e,t),e.set("openTo",this.get("ui").oneTimeValue("options/search-goto-sub-heading"))}})
e.default=t}),define("tco-app/options/section/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Yg1abuP4",block:'{"symbols":[],"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[1,[27,"options/option-section-header",null,[["section"],[[23,["model","activeSection"]]]]],false],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-content",null,null,{"statements":[[1,[27,"options/option-section-content",null,[["section"],[[23,["model","activeSection"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/options/section/template.hbs"}})
e.default=t})
define("tco-app/options/service",["exports","tco-app/src/lib/http"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend(Ember.Evented,{virtualValues:{},ui:Ember.inject.service(),optionsPreviewState:{route:"options",inc:0},listen:Ember.on("init",function(){this.on("option.value.changed",this,"updateState")}),updateState:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get("optionsPreviewState")
t.updates||(t.updates={}),e.id&&(t.updates[e.id]=e.value),this.set("ui.unsavedData",!0),this.set("optionsPreviewState",t),[this.get("customCSSKey"),this.get("customJSKey")].includes(e.id)||this.incrementProperty("optionsPreviewState.inc")},save:function(){return(0,t.request)("options::save",this.get("optionsPreviewState"))},cleanup:Ember.on("willDestroy",function(){this.get("radio").off("option.value.changed",this,"updateState")}),customCSSKey:Ember.computed(function(){return window.csAppData.optionsCustomCSSKey||"x_custom_styles"}),customJSKey:Ember.computed(function(){return window.csAppData.optionsCustomJSKey||"x_custom_scripts"})})
e.default=n}),define("tco-app/options/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"syqX6JO0",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["options"]],{"statements":[[4,"workspace/cs-workspace",null,null,{"statements":[[0,"    "],[1,[21,"outlet"],false],[0,"\\n"]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[0,"    "],[1,[27,"common/preview-frame",null,[["src","state","navigate","preloader","package","onObserverNav"],[[23,["previewURL"]],[23,["previewState"]],[27,"route-action",["navigatePreview"],null],"options",[27,"hash",null,[["customCSS"],[[23,["model","customCSS","value"]]]]],[27,"route-action",["observerNav"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/options/template.hbs"}})
e.default=t}),define("tco-app/options/value/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({default:(0,n.default)(),value:(0,n.default)(),options:Ember.inject.service(),modifiedObserver:Ember.observer("value",function(){this.get("options").trigger("option.value.changed",{id:this.get("id"),dirty:this.get("hasDirtyAttributes"),value:this.get("value"),model:this})})})
e.default=o}),define("tco-app/preference/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({})
e.default=n}),define("tco-app/preference/model",["exports","ember-data/model","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.extend({values:(0,n.default)()})
e.default=o}),define("tco-app/preference/service",["exports","tco-app/util/ember-control-factory"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({i18n:Ember.inject.service(),store:Ember.inject.service(),redux:Ember.inject.service(),ui:Ember.inject.service(),currentUser:Ember.inject.service(),setup:function(e){var n=this
this.set("model",e)
var o=(0,t.default)({owner:Ember.getOwner(this),sourcePath:"values",controls:window.csAppData.preferenceControls,permissionCheck:function(e){return n.get("currentUser").can(e)}})
this.set("controls",o(this.get("model"))),this.set("lastSavedWPToolbar",!!this.get("showWPToolbar")),this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{advancedMode:this.get("advancedMode"),dynamicContent:this.get("dynamicContent"),controlNav:this.get("controlNav"),showWPToolbar:this.get("showWPToolbar"),contextMenu:this.get("contextMenu"),helpText:this.get("helpText"),uiTheme:this.get("uiTheme"),contentLayoutElement:this.get("contentLayoutElement"),richTextDefault:this.get("richTextDefault")}})},visibleControls:Ember.computed("controls.@each.itemExcluded",function(){return Ember.A(this.getWithDefault("controls",[]).filter(function(e){return!e.get("excluded")}))}),canManage:Ember.computed.gt("visibleControls.length",0),save:function(){var e=this
this.get("ui").beginSaveProgress()
var t=this.get("i18n").t("common.title.preferences")
return this.get("model").save().then(function(){e.get("ui").notify(e.get("i18n").t("app.notify.saved",{context:t}),"success"),e.get("ui").endSaveProgress()
var n=!!e.get("showWPToolbar")
n!==e.get("lastSavedWPToolbar")&&e.get("ui").notify("i18n.app.preferences.wp-toolbar-".concat(n?"on":"off")),e.set("lastSavedWPToolbar",n)},function(n){e.get("ui").notify(e.get("i18n").t("app.notify.failed-to-save",{context:t}),"error"),console.warn("Failed to save preferences",n),e.get("ui").endSaveProgress()})},advancedMode:Ember.computed.alias("model.values.advanced_mode"),dynamicContent:Ember.computed.alias("model.values.dynamic_content"),controlNav:Ember.computed.alias("model.values.control_nav"),showWPToolbar:Ember.computed.alias("model.values.show_wp_toolbar"),contextMenu:Ember.computed.alias("model.values.context_menu"),helpText:Ember.computed.alias("model.values.help_text"),uiTheme:Ember.computed.alias("model.values.ui_theme"),contentLayoutElement:Ember.computed.alias("model.values.content_layout_element"),customAppCss:Ember.computed.alias("model.values.custom_app_css"),richTextDefault:Ember.computed.alias("model.values.rich_text_default"),advancedModeObserver:Ember.observer("advancedMode",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{advancedMode:this.get("advancedMode")}})}),dynamicContentObserver:Ember.observer("dynamicContent",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{dynamicContent:this.get("dynamicContent")}})}),controlNavObserver:Ember.observer("controlNav",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{controlNav:this.get("controlNav")}})}),showWPToolbarObserver:Ember.observer("showWPToolbar",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{showWPToolbar:this.get("showWPToolbar")}})}),contextMenuObserver:Ember.observer("contextMenu",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{contextMenu:this.get("contextMenu")}})}),helpTextObserver:Ember.observer("helpText",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{helpText:this.get("helpText")}})}),uiThemeObserver:Ember.observer("uiTheme",function(){var e=this.get("uiTheme")
this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{uiTheme:e}}),Ember.$("html").removeClass("cs-ui-theme-dark cs-ui-theme-light").addClass("cs-ui-theme-".concat(e))}),contentLayoutElementObserver:Ember.observer("contentLayoutElement",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{contentLayoutElement:this.get("contentLayoutElement")}})}),customAppCssObserver:Ember.observer("customAppCss",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{customAppCss:this.get("customAppCss")}})}),richTextDefaultObserver:Ember.observer("richTextDefault",function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_PREFERENCES",payload:{richTextDefault:this.get("richTextDefault")}})}),toggleAdvancedMode:function(){this.get("currentUser").can("preference.advanced_mode.user")&&this.set("advancedMode",!this.get("advancedMode"))}})
e.default=n}),define("tco-app/reducers/index",["exports","ember-redux/reducers/index"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/resolver",["exports","ember-resolver","tco-app/components/react-component"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.get
function r(e){var t=this.resolveOther(e)
return t||null}var a=t.default.extend({resolveIcon:r,resolvePreviewElement:r,resolveComponent:function(e){var t=this._resolveReactStyleFile(e)||this.resolveOther(e)
if(t)return o(t,"isComponentFactory")?t:n.default.extend({reactComponent:t})},resolveReactComponent:function(e){e.type="component"
var t=this._resolveReactStyleFile(e)||this.resolveOther(e)
return e.type="react-component",t},_resolveReactStyleFile:function(e){var t=e.fullNameWithoutType.split("/")
t[t.length-1]=Ember.String.classify(t[t.length-1])
var n=t.join("/"),o=Object.assign({},e,{fullNameWithoutType:n})
return this.resolveOther(o)}})
e.default=a}),define("tco-app/router",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t={}
window.csAppData.validPermalinks&&!window.csAppData.isPreview?(t.location="hash",t.rootURL=window.csAppData.rootURL):t.location="none"
var n=Ember.Router.extend(t),o="pro"===window.csAppData.env.product
n.map(function(){this.route("unauthorized"),this.route("not-found",{path:"/*not_found"}),this.route("options",function(){this.route("section",{path:"/:section_id"})}),this.route("template-manager"),this.route("design-cloud"),o&&(this.route("headers"),this.route("footers"),this.route("headers.header",{path:"/headers/:header_id"}),this.route("footers.footer",{path:"/footers/:footer_id"})),this.route("content"),this.route("global-blocks"),this.route("content.builder",{path:"/content/:post_id"}),this.route("global-blocks.builder",{path:"/global-blocks/:post_id"}),window.csAppData.devTools&&this.route("dev")})
var r=n
e.default=r}),define("tco-app/routes/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({beforeModel:function(){var e=this.get("config.global.initialRoute")
if(e){this.set("config.global.initialRoute",!1)
var t=e.split("/")
t[1]?this.transitionTo(t[0],t[1]):this.transitionTo(t[0])}}})
e.default=t}),define("tco-app/routes/not-found",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({afterModel:function(e){var t=window.csAppData.rootURL.substr(1,window.csAppData.rootURL.length-1);-1!==e.not_found.indexOf(t)&&this.transitionTo(e.not_found.replace(t,""))}})
e.default=t}),define("tco-app/routes/unauthorized",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Route.extend({})
e.default=t}),define("tco-app/services/ajax",["exports","ember-ajax/services/ajax"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/services/config",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({store:Ember.inject.service(),global:Ember.computed(function(){return Ember.Object.create(window.csAppData)}),fetch:function(e){return new Ember.RSVP.Promise(function(n,o){this.get("store").findRecord("fragment","".concat(e,"::config")).then(function(o){var r=o.get("value")
r&&r.i18n&&(0,t.addStrings)(r.i18n),this.set(e,Ember.Object.create(r)),n(r)}.bind(this),o)}.bind(this))}})
e.default=n}),define("tco-app/services/current-user",["exports","tco-app/src/lib/permissions"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({canUseFooters:Ember.computed(function(){return(0,t.canUseFooters)()}),canUseBuilder:Ember.computed(function(){return(0,t.canUseBuilder)()}),allowedPostTypes:Ember.computed(function(){return(0,t.allowedPostTypes)()}),canUseHeaders:Ember.computed(function(){return(0,t.canUseHeaders)()}),can:function(e,n){return(0,t.currentUserCan)(e,n)}})
e.default=n}),define("tco-app/services/debug",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({logging:!1,verboseRenderLogging:!1,devTools:Ember.computed(function(){return!!window.csAppData.devTools})})
e.default=t}),define("tco-app/services/flash-messages",["exports","ember-cli-flash/services/flash-messages"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/services/font-awesome",["exports"],function(e){function t(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({init:function(){this._super.apply(this,arguments),this.set("flipped",Object.keys(window.csAppData.font_awesome.icons).reduce(function(e,t){return e[window.csAppData.font_awesome.icons[t]]=t,e},{}))},list:Ember.computed(function(){var e={}
function n(n){return e[n]?[n].concat(t(e[n])).join(","):n}return Object.keys(window.csAppData.font_awesome.aliases).forEach(function(t){var n=window.csAppData.font_awesome.aliases[t]
e[n]||(e[n]=[]),e[n].push(t)}),Ember.A(window.csAppData.font_awesome.brands.map(function(e){return{id:e,title:n(e),prefix:"fab",group:"brands"}}).concat(window.csAppData.font_awesome.solid.map(function(e){return{id:e,title:n(e),prefix:"fas",group:"solid"}})).concat(window.csAppData.font_awesome.regular.map(function(e){return{id:"o-".concat(e),title:n("o-".concat(e)),prefix:"far",group:"regular"}})).concat(window.csAppData.font_awesome.light.map(function(e){return{id:"l-".concat(e),title:n("l-".concat(e)),prefix:"fal",group:"light"}})).concat(Object.keys(window.csAppData.font_awesome.groups).reduce(function(e,t){return window.csAppData.font_awesome[t]&&("light".includes(t),0)&&(e=e.concat(window.csAppData.font_awesome[t].map(function(e){return{id:e,title:n(e),group:t}}))),e},[])))}),resolveIcon:function(e){var t=this.resolveAlias(e)
return(t&&0===t.indexOf("o-")||0===t.indexOf("l-"))&&(t=t.substring(2)),t},resolveAlias:function(e){return window.csAppData.font_awesome.aliases[e]?window.csAppData.font_awesome.aliases[e]:e},resolveIconPrefix:function(e){var t=this.resolveAlias(e),n="fas"
return 0===t.indexOf("o-")&&(t=t.substring(2),window.csAppData.font_awesome.regular.includes(t)&&(n="far")),0===t.indexOf("l-")&&(t=t.substring(2),window.csAppData.font_awesome.regular.includes(t)&&(n="fal")),window.csAppData.font_awesome.brands.includes(t)&&(n="fab"),n},unicodeToName:function(e){var t=e.replace("&#x","").replace("\\","").replace(";","")
return this.getWithDefault("flipped.".concat(t),null)}})
e.default=n}),define("tco-app/services/head-data",["exports","ember-cli-head/services/head-data"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("tco-app/services/i18n",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({t:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
return Ember.String.htmlSafe((0,t.t)(e,n))}})
e.default=n}),define("tco-app/services/inspector",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({store:Ember.inject.service(),ui:Ember.inject.service(),i18n:Ember.inject.service(),inspecting:null})
e.default=t}),define("tco-app/services/preview",["exports","url-parse","lodash","in-view","tco-app/mixins/preview-listener","tco-app/xfr/agent","tco-app/src/util/base64"],function(e,t,n,o,r,a,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,function(){if("function"==typeof window.CustomEvent)return!1
function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0}
var n=document.createEvent("CustomEvent")
return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}()
var s=["click","mouseup","mousedown","keydown","keypress","keyup"],l=["altKey","button","buttons","charCode","code","clientX","clientY","ctrlKey","composed","isComposing","isTrusted","key","keyCode","layerX","layerY","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","screenX","screenY","shiftKey","timeStamp","type","which","x","y"],c=Ember.Service.extend(Ember.Evented,a.default,r.default,{ready:!1,xfrOrigin:"preview",redux:Ember.inject.service("redux"),fonts:Ember.inject.service("font-manager"),store:Ember.inject.service("store"),missingZones:[],modKey:!1,isPreview:Ember.computed(function(){return window.csAppData.isPreview}),setup:function(){var e=this
this.setupPort(),window.document.title="tco-preview",window.csGlobal.isPreview=!0,this.set("handleEvent",this.get("handleEvent").bind(this)),this.setupInitialRoute(),Ember.$(document.body).on("cs-preview",function(e,t){var n=t.type;["tp-wc-cart-dropdown","tp-wc-cart-modal","tp-wc-cart-off-canvas"].includes(n)&&Ember.$(document.body).trigger("wc_fragment_refresh")}),this.listenTo("preview:package:update",function(t){return e.packageUpdate(t)}),this.listenTo("preview:new:element",function(t){return e.set("scrollToNewElement",t)}),this.listenTo("preview:remote-media",function(t){return e.trigger("remote:media",t)}),this.listenTo("preview:scroll-to-element",function(t){return e.maybeScrollToElement(t)}),Ember.$("body").on("click",".cs-empty-target .cs-svg-ui",function(t){t.stopPropagation(),e.get("redux").dispatch({type:"BUILDER:NAVIGATE",payload:{panel:"elements"}})}),this.listenTo("preview:font-sync",function(t){return e.get("fonts").processQueue(t)})
try{this.packageUpdate(JSON.parse((0,i.base64Decode)(window.csPreviewPackage)))}catch(t){console.warn("Unable to parse initial element state",t)}},setupPort:function(){var e=this
if(!this.get("ready")){window.csAppData.previewData.timestamp?window.parent.postMessage("cs-preview-port-request::".concat(window.csAppData.previewData.timestamp),"*"):console.warn("Cornerstone preview window has loaded with a corrupt state")
window.addEventListener("message",function t(n){if("cs-preview-port"===n.data){window.removeEventListener("message",t,!1)
var o=n.ports[0]
o.addEventListener("message",e.get("xfrOnMessage"),!1),o.start(),e.set("xfrMessagePort",o),e.set("ready",!0),e.setupEventPropogation(),e.request("preview:package:setup").then(function(t){return e.packageUpdate(t)}),["content","header","footer"].includes(e.get("initialRoute"))||e.removePreloader(!0)}},!0)}},packageUpdate:function(e){var t=this
this.set("previewPackage",e),!1===Ember.typeOf(e)||Ember.isEmpty(e)||(this.responsiveTextUpdate(document.body),Object.keys(e).forEach(function(e){return t.notifyPropertyChange("previewPackage.".concat(e))}))},setupInitialRoute:function(){var e=document.querySelector("[data-cs-preview-route]")
if(e){this.set("initialRoute",e.getAttribute("data-cs-preview-route"))
var t={}
try{e.innerHTML&&(t=JSON.parse(e.innerHTML))}catch(n){console.warn("Invalid route config",e.innerHTML)}this.setupLinkTargeting({canNavigate:t.canNavigate}),this.set("initialRouteConfig",t)}},preLoaderActive:!0,canRemovePreloader:!0,removePreloader:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.set("canRemovePreloader",!0),this.get("preLoaderActive")&&this.get("canRemovePreloader")&&(this.set("preLoaderActive",!1),this.message("pre-loader-state",{show:!1}),this.afterPreloader())},showPreloader:function(){this.get("preLoaderActive")||(this.set("preLoaderActive",!0),this.message("pre-loader-state",{show:!0}))},notifyLoadActivity:function(){this.message("load-activity")},afterPreloader:function(){var e=this
Ember.run.next(function(){"footers"===e.get("initialRouteConfig.mode")&&e.scrollToBottom(0)})},scrollToElement:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700
Ember.$("html,body").animate({scrollTop:Ember.$(e).offset().top},t,"swing")},scrollToBottom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:700,t=document.body.scrollHeight,n=Ember.$(".x-colophon .x-bar").first()
n.length&&(t=n.offset().top),Ember.$("html,body").animate({scrollTop:t},e,"swing")},scrollToBottomAfterRender:function(){var e=this
this.set("shouldScrollToBottom",!0),Ember.run.later(function(){e.get("shouldScrollToBottom")&&e.scrollToBottom()},100)},setupEventPropogation:function(){var e=this
s.forEach(function(t){return window.document.addEventListener(t,e.handleEvent,!1)})},willDestroy:function(){var e=this
s.forEach(function(t){return window.document.removeEventListener(t,e.handleEvent)})},handleEvent:function(e){var t={}
l.forEach(function(n){Ember.isNone(e[n])||(t[n]=e[n])}),this.message("preview:event-propagation",{event:t})},scrollToElementWhenNotInView:function(e){var t=document.querySelector('[data-cs-observeable-id="'.concat(e,'"]'))
return t&&!o.default.is(t)&&this.scrollToElement(t),t},maybeScrollToElement:function(e){var t=this
this.scrollToElementWhenNotInView(e),this.scrollToElementWhenNotInView(e)||setTimeout(function(){return t.scrollToElementWhenNotInView(e)},100)},notateMissingZone:function(e){var t=this.get("missingZones")
t.includes(e)||t.push(e),Ember.run.debounce(this,this.missingZoneNotification,1e3)},missingZoneNotification:function(){var e=this
this.removePreloader(!0),this.get("missingZones").forEach(function(t){e.message("preview:error-message",{key:"missing-zone.".concat(t)})})},observeDragging:Ember.observer("dragging",function(){var e=this.get("dragging"),t=Ember.$("body")
t.toggleClass("cs-hide-cursor",e),t.toggleClass("gu-unselectable",e)}),responsiveTextUpdate:function(e){if(e){var t=Ember.$(e)
!t.length>0||this.getWithDefault("previewPackage.responsiveTextItems",[]).forEach(function(e){var n=e.selector,o=e.minSize,r=e.maxSize,a=e.compression
if(n){var i=t.find(n).addBack(n)
i.length<=0||(i.css("font-size",""),i.csFitText(a,{minFontSize:o,maxFontSize:r}))}})}},triggerResize:function(){Ember.run.debounce(this,this.triggerResizeHandler,100)},triggerResizeHandler:function(){Ember.$(window).trigger("resize")},setupLinkTargeting:function(e){var n=this,o=e.canNavigate
window.csGlobal.everinit&&(window.csGlobal.everinit("[data-x-toggle]",function(e){e.addEventListener("click",function(e){e.shiftKey&&(e.stopPropagation(),e.preventDefault())})}),window.csGlobal.everinit("a[href]",function(e){e.addEventListener("click",function(r){var a=e.getAttribute("href")||"",i=0===a.indexOf("#")&&"#"!==a
r.metaKey||r.shiftKey||(o?!i&&function(e){return(0,t.default)(e,!0).host===(0,t.default)(window.csAppData.home_url||"/",!0).host}(a)&&"#"!==a&&n.message("navigate",{url:a}):i&&e.closest("[data-cs-zone]")&&r.stopPropagation(),r.preventDefault())})}))}})
e.default=c}),define("tco-app/services/queue",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend({jobs:Ember.A(),empty:!0,queue:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100
new Ember.RSVP.Promise(function(e){t.get("jobs").push({delay:n,resolve:e}),t.get("empty")&&t.nextJob(),t.set("empty",!1)}).then(function(){e(function(){t.nextJob()})})},nextJob:function(){var e=this.get("jobs").shift()
e?Ember.run.later(function(){"function"===Ember.typeOf(e.resolve)&&e.resolve()},e.delay||100):this.set("empty",!0)}})
e.default=t}),define("tco-app/services/radio",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend(Ember.Evented)
e.default=t}),define("tco-app/services/redux",["exports","tco-app/src/store"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({init:function(){this.store=(0,t.default)(),this._super.apply(this,arguments)},getState:function(){return this.store.getState()},dispatch:function(e){return this.store.dispatch(e)},subscribe:function(e){return this.store.subscribe(e)},replaceReducer:function(e){return this.store.replaceReducer(e)}})
e.default=n}),define("tco-app/services/search",["exports","tco-app/util/search"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({targets:{},getTarget:function(e){var n=this.get("targets."+e)
return n||((n=t.default.create()).set("name",e),this.set("targets."+e,n)),n}})
e.default=n}),define("tco-app/services/ui",["exports","bowser","tco-app/src/actions/ui"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=Ember.Service.extend({i18n:Ember.inject.service(),preview:Ember.inject.service(),preference:Ember.inject.service(),redux:Ember.inject.service(),previewSize:"xl",showPreviewSizer:!1,showCustomCSS:!1,showCustomJS:!1,showActionHistory:!1,showFontConfig:!1,showTemplateManagerConfig:!1,isRTL:!1,primaryRoute:!1,debugEnabled:!1,confirmHandlers:{},unsavedData:!1,previewDelayed:0,skeletonModeActive:!1,textEditorExpanded:!1,showNavigationBar:!0,workspaceIsUndocked:!1,init:function(){this._super(),this.get("dragging"),this.get("disableHorizontalScrolling"),this.set("featureFlags",Ember.Object.create(Ember.typeOf(window.csAppData.featureFlags)?window.csAppData.featureFlags:{}))},contentLogoPath:Ember.computed("isPro",function(){return this.get("isPro")?"logo-pro-inherit":"logo-flat-original"}),preloaderLogoClass:Ember.computed("isX","isPro",function(){return this.get("isPro")||this.get("isX")?"logo-x":"logo-cs"}),optionsLogoPath:Ember.computed("isX","isPro",function(){return this.get("isPro")?"logo-pro-inherit":this.get("isX")?"logo-x":"logo-flat-original"}),optionsLogoExtra:Ember.computed("isPro",function(){return""}),isPro:Ember.computed(function(){return"pro"===window.csAppData.env.product}),isX:Ember.computed(function(){return"x"===window.csAppData.env.product}),isValidated:Ember.computed(function(){return!!window.csAppData.env.productKey}),dashboardUrl:Ember.computed("routeDashboardUrl",function(){var e=this.get("routeDashboardUrl")
return e||window.csAppData.dashboardUrl}),validationUrl:Ember.computed(function(){return window.csAppData.validationUrl}),wpmlLanguages:Ember.computed(function(){return Object.keys(window.csAppData.wpmlLanguages).map(function(e){return window.csAppData.wpmlLanguages[e]})}),wpmlTranslateableTypes:Ember.computed(function(){return window.csAppData.wpmlTranslateableTypes}),defaultPreviewUrl:Ember.computed(function(){return window.csAppData.home_url||"/"}),workspaceOrientation:"vertical",workspaceIsHorizontal:Ember.computed("workspaceOrientation",function(){return"horizontal"===this.get("workspaceOrientation")}),workspaceIsVertical:Ember.computed("workspaceOrientation",function(){return"vertical"===this.get("workspaceOrientation")}),workspaceOrientationClass:Ember.computed("workspaceOrientation",function(){return"is-".concat(this.get("workspaceOrientation"))}),afterInspect:function(){this.get("workspaceIsUndocked")||this.setProperties({showCustomJS:!1,showCustomCSS:!1,showActionHistory:!1})},store:Ember.inject.service(),search:Ember.inject.service(),onInit:Ember.on("init",function(){var e=this
this.set("isRTL",window.csAppData.isRTL),this._oneTimeValues={},window.onbeforeunload=function(){if(e.get("unsavedData"))return e.get("i18n").t("app.unsaved-warning")}}),observeShowPreviewSizer:Ember.observer("showPreviewSizer",function(){this.get("showPreviewSizer")}),observeShowCustomCSS:Ember.observer("showCustomCSS",function(){this.get("showCustomCSS")&&(this.setProperties({showCustomJS:!1,showActionHistory:!1}),this.closeReactExpanders())}),observeShowCustomJS:Ember.observer("showCustomJS",function(){this.get("showCustomJS")&&(this.setProperties({showCustomCSS:!1,showActionHistory:!1}),this.closeReactExpanders())}),observeShowActionHistory:Ember.observer("showActionHistory",function(){this.get("showActionHistory")&&(this.setProperties({showCustomCSS:!1,showCustomJS:!1}),this.closeReactExpanders())}),observeSkeletonModeActive:Ember.observer("skeletonModeActive",function(){this.get("skeletonModeActive")&&this.setProperties({})}),setRouteUI:function(e){this.set("routeDashboardUrl",null),this.set("primaryRoute",e)
var t={showPreviewSizer:!1,previewSize:"xl",showCustomCSS:!1,showCustomJS:!1,showFontConfig:!1,showTemplateManagerConfig:!1,showOrientationMenu:!1}
this.get("redux").dispatch((0,n.uiHideWorkspace)(!1))
var o=Ember.getWithDefault(e,"routeUI.bar",[]);["orientation","collapse","preview-sizer","view-site","cheatsheet","save"].forEach(function(e){var n=Ember.String.camelize("route-enabled-".concat(e))
t[n]=o.includes(e)})
var r=Ember.getWithDefault(e,"routeUI.orientation","vertical")
"preference"!==r&&this.set("workspaceOrientation",r),this.set("viewSiteURL",Ember.getWithDefault(e,"routeUI.viewSiteURL",null)),this.setProperties(t)},viewSiteURLObserver:Ember.observer("viewSiteURL",function(){this.get("redux").dispatch({type:"UI:UPDATE",payload:{viewSiteURL:this.get("viewSiteURL")}})}),canViewSite:Ember.computed("routeEnabledViewSite","viewSiteURL",function(){return this.get("routeEnabledViewSite")&&this.get("viewSiteURL")}),oneTimeValue:function(){if(1===arguments.length){var e=Object.assign({},this._oneTimeValues[arguments[0]])
return delete this._oneTimeValues[arguments[0]],e}2===arguments.length&&(this._oneTimeValues[arguments[0]]=arguments[1])},isDraggingSortableControl:!1,isSelectizeOpen:!1,disableScrolling:Ember.computed("isSelectizeOpen","isDraggingSortableControl","workspaceOrientation",function(){return this.get("isDraggingSortableControl")&&"horizontal"===this.get("workspaceOrientation")||this.get("isSelectizeOpen")}),scrollBarWidth:Ember.computed(function(){var e=document.createElement("div")
e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e)
var t=e.offsetWidth
e.style.overflow="scroll"
var n=document.createElement("div")
n.style.width="100%",e.appendChild(n)
var o=n.offsetWidth
return e.parentNode.removeChild(e),t-o}),scrollBarWidthRightStyle:Ember.computed("scrollBarWidth",function(){var e=this.get("scrollBarWidth")
return Ember.String.htmlSafe("right: ".concat(e,"px;"))}),scrollBarWidthPaddingRightStyle:Ember.computed("scrollBarWidth",function(){var e=this.get("scrollBarWidth")
return Ember.String.htmlSafe("padding-right: ".concat(e,"px;"))}),flashMessages:Ember.inject.service(),notify:function(e){if(e&&e.toString&&"function"===Ember.typeOf(e.toString)&&!e.message&&(e=e.toString()),"string"==typeof e&&(e={message:e}),arguments[1]&&("object"===r(arguments[1])?e=Object.assign(e,arguments[1]):e.type=arguments[1]),0===(e=Object.assign({type:"notice",message:"",timeout:3e3,extendedTimeout:650,canClose:null},e)).message.indexOf("i18n.")&&(e.message=this.get("i18n").t(e.message.substr(5)).string),"boolean"!=typeof e.canClose&&(e.canClose=e.timeout>3e3),!e.title)switch(e.type){case"error":e.title=this.get("i18n").t("app.notification-error")
break
case"success":e.title=this.get("i18n").t("app.notification-success")
break
default:e.title=this.get("i18n").t("app.notification-notice")}this.get("flashMessages").add(e)},notifyError:function(e,t){this.notify(e,"error"),console.warn(t)},saving:!1,beginSaveProgress:function(e){Ember.isNone(e)||this.set("savingJobs",e),this.set("savingProgress",0),this.set("saving",!0)},addSaveJob:function(){this.set("savingJobs",this.get("savingJobs")+1)},incrementSaveProgress:function(){this.set("savingProgress",this.get("savingProgress")+1)},endSaveProgress:function(){this.set("savingJobs",0),this.set("savingProgress",0),this.set("saving",!1)},confirm:function(e){if(!e.noSkip&&this.get("deleteConfirm"))return"function"===Ember.typeOf(e.accept)?e.accept():null
e.screen||(e.screen="global")
var t=this.get("confirmHandlers.".concat(e.screen))
"function"===Ember.typeOf(t)&&t(e)},canShowCheatsheet:Ember.computed.gt("cheatsheetItems.length",0),cheatsheetItems:Ember.computed(function(){var e="macOS"===t.default.getParser(window.navigator.userAgent).getOSName()?"⌘":"⌃"
return Ember.A([{name:"keyboard-shortcuts",label:"Keyboard Shortcuts",content:"".concat('<h3>Keyboard Shortcuts</h3><dl class="cs-keys"><dt>Save</dt><dd><span>').concat(e,"</span><span>S</span></dd>")+"<dt>Delete Element</dt><dd><span>⌫</span></dd><dt>Duplicate Element</dt>"+"<dd><span>".concat(e,"</span><span>D</span></dd>")+"<dt>Copy Element</dt>"+"<dd><span>".concat(e,"</span><span>C</span></dd>")+"<dt>Paste Element</dt>"+"<dd><span>".concat(e,"</span><span>V</span></dd>")+"<dt>Paste Element Style</dt>"+"<dd><span>".concat(e,"</span><span>⇧</span><span>V</span></dd>")+"<dt>Find (focus available search)</dt>"+"<dd><span>".concat(e,"</span><span>F</span></dd>")+'<dt>Close Open Windows</dt><dd><span class="cs-key-m">Esc</span></dd><dt>Enable "Quick Actions"</dt><dd><span>⇧</span></dd><dt>Hide/Show Builder</dt>'+"<dd><span>".concat(e,"</span><span>⇧</span><span>E</span></dd>")+"<dt>Toggle Advanced Mode</dt>"+"<dd><span>".concat(e,"</span><span>⇧</span><span>A</span></dd>")+"</dl>"},{name:"terminologies",label:"Terminologies",content:'<h3>Terminologies</h3><dl><dt>The Bar</dt><dd>The skinny vertical bar that is your way of getting around. The icons at the bottom are contextually relevant to the screen you are on.</dd><dt>Header Builder</dt><dd>The place you create and customize headers for your site. Labeled "Headers" in The Bar.</dd><dt>Content Builder</dt><dd>The place you create and customize the page content of your site (the space between your header and footer). Labeled "Content" in The Bar.</dd><dt>Footer Builder</dt><dd>The place you create and customize footers for your site. Labeled "Footers" in The Bar.</dd><dt>Elements</dt><dd>Each of the above builders have Elements. There are some Elements that only work in a particular context (for example, in the header), and you&apos;ll notice that the Elements in Headers and Footers have significant customization options. Over time, we will be adding these same advanced controls to Elements in the Content Builder.</dd><dt>Templates</dt><dd>Starting points for your header, content, or footers. We are working on a new "Library" that will bring management of all templates together in one place. There will be no Expanded Demos in Pro, but you can think of Templates as a demo of sorts for the respective builders. We have native ones built-in, and you can create your own.</dd><dt>Presets</dt><dd>Customized styles for individual Elements. Once the new "Library" is launched under Templates you&apos;ll be able to manage all your presets, templates, and more in one place.</dd><dt>Font Manager</dt><dd>Under Templates, this is the place to manage all native, TypeKit, and custom fonts. You can create families and then update in only one place and have it instantly push out to all uses of that font throughout your site!</dd><dt>Cheatsheet</dt><dd>What you&apos;re looking at right now! This is opened by clicking the question mark icon in "The Bar." This will house quick blurbs of information in different tabs.</dd></dl>'}])}),canShowNavObserver:Ember.computed("modKey","currentRouteName",function(){return!["preview.options"].includes(this.get("currentRouteName"))||this.get("modKey")}),settingsTabs:Ember.A(),activeTab:!1,canManageSettings:Ember.computed.gt("settingsTabs.length",0),settingsLabels:Ember.Object.create(),settingsWarnings:Ember.Object.create(),showSettings:!1,selectedSettingsTab:!1,activeSettingsTab:Ember.computed("selectedSettingsTab","settingsTabs.[]",function(){var e=this.get("settingsTabs"),t=this.get("selectedSettingsTab")
return"cheatsheet"===t?t:e.find(function(e){return e===t})}),showSettingsObserver:Ember.observer("showSettings",function(){this.get("showSettings")&&!this.get("activeSettingsTab")&&this.set("selectedSettingsTab",this.getWithDefault("settingsTabs",[])[0])}),registerSettingsTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,n=e.label,o=e.warning,r=e.prefer
if(t&&n){var a=this.get("settingsTabs")
a.find(function(e){return e.name===t})||(this.set("settingsLabels.".concat(t),n),o&&this.set("settingsWarnings.".concat(t),o),a.addObject(t)),r&&this.set("selectedSettingsTab",t)}},unregisterSettingsTab:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).name
if(e){var t=this.get("settingsTabs"),n=t.indexOf(e);-1!==n&&(t.removeAt(n),this.set("settingsLabels.".concat(e),""),this.set("settingsWarnings.".concat(e),null))}},uiThemeObserver:Ember.observer("preference.uiTheme",function(){this.setThemeClass()}),closeEmberExpanders:function(){this.setProperties({showCustomCSS:!1,showCustomJS:!1,showActionHistory:!1})},closeReactExpanders:function(){o(window.document.body.querySelectorAll(".cs-workspace-expander-content.cs-active:not(.ember-view)")).forEach(function(e){return e.dispatchEvent(new CustomEvent("cs-expander-toggle",{detail:{open:!1}}))})},setThemeClass:function(){var e=this.get("uiTheme")
e&&Ember.$("html").removeClass(function(e,t){return(t.match(/(^|\s)cs-ui-theme-\S+/g)||[]).join(" ")}).addClass("cs-ui-theme-".concat(e))},removePreloader:function(){if(!this.get("preloaderRemoved")){var e=document.querySelector(".cs-entry-preloader .cs-pre-loader.cs-active")
e&&(e.classList.remove("cs-active"),setTimeout(function(){return e&&e.parentNode.remove()},500),this.set("preloaderRemoved",!0))}},actions:{toggleOrientation:function(){this.get("redux").dispatch({type:"BUILDER:UPDATE_ORIENTATION",payload:{toggle:!0}})},toggleDocked:function(){this.set("workspaceIsUndocked",!this.get("workspaceIsUndocked"))},toggle:function(e){this.set(e,!this.get(e))}}})
e.default=a}),define("tco-app/services/wp-media",["exports","tco-app/util/custom-media-manager"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Service.extend({proxy:null,uploader:Ember.computed(function(){var e=this;(0,t.default)()
var n=new window.wp.media.view.MediaFrame.Cornerstone({className:"media-frame cs-media-frame",multiple:!1,library:{type:"image"},button:{text:"Insert Image"}}),o=function(){"undefined"!=typeof setUserSetting&&setUserSetting("imgsize","full")},r=function(){o()
var e=n.$el.find("#embed-url-field").parent()[0]
n.csOptions&&n.csOptions.dcSetup&&n.csOptions.dcSetup({dcContainer:e})},a=n.states.find(function(e){return"embed"===e.id})
return a&&a.on("activate",function(){return r()}),n.on("insert",function(){var t=n.state(),o=t.get("selection").first(),r=t.display(o).toJSON()
o=o.toJSON(),e.update(o.sizes[r.size].url)}),n.on("close",function(){n.csOptions&&n.csOptions.dcSetup&&n.csOptions.dcSetup({dcContainer:null}),o()}),n.on("open",function(){return r()}),n.on("select",function(){var t=n.state()
t&&"embed"===t.get("id")&&e.update(t.props.get("url")),e.set("resolver",null)}),n}),update:function(e){var t=this.get("resolver")
"function"==typeof t&&t(e),this.set("resolver",null)},promise:function(e){var t=this
return new Ember.RSVP.Promise(function(n){t.set("resolver",n)
var o=t.get("uploader")
o.csOptions=Object.assign({},e),window.theUploader=o,o.open()})},subscribe:function(e){var t=this
return{promise:this.promise(e),unsubscribe:function(){return t.get("uploader").csOptions={}}}}})
e.default=n}),define("tco-app/src/actions/builder",["exports"],function(e){function t(e){return{type:"BUILDER:SELECT",payload:{id:e,deep:arguments.length>1&&void 0!==arguments[1]&&arguments[1],navigate:arguments.length>2&&void 0!==arguments[2]&&arguments[2]}}}Object.defineProperty(e,"__esModule",{value:!0}),e.builderNavigate=function(e){return{type:"BUILDER:NAVIGATE",payload:{panel:e}}},e.builderToggleSelect=function(e){return{type:"BUILDER:TOGGLE_SELECT",payload:{id:e}}},e.builderManageLayout=function(e){return t(e,!0,!0)},e.builderSelect=t,e.builderDeselect=function(e){return{type:"BUILDER:DESELECT",payload:{id:e}}},e.builderSetIncomingElement=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preset
return{type:"BUILDER:SET_INCOMING_ELEMENT",payload:{type:e,preset:t}}},e.builderClearIncomingElement=function(){return{type:"BUILDER:CLEAR_INCOMING_ELEMENT"}},e.builderExpandDeep=function(e){return{type:"BUILDER:SELECT",payload:{id:e,deep:!0,expandAll:!0}}},e.builderCollapseDeep=function(e){return{type:"BUILDER:DESELECT",payload:{id:e,collapseAll:!0}}}}),define("tco-app/src/actions/clipboard",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clipboardClearElement=function(){return{type:"CLIPBOARD_CLEAR",payload:{scope:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"element"}}},e.clipboardCopyElement=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
return{type:"CLIPBOARD_COPY:ELEMENT",payload:{scope:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"element",id:e,context:t}}},e.clipboardPasteElement=function(e){return{type:"CLIPBOARD_PASTE:ELEMENT",payload:{id:e}}},e.clipboardPasteElementStyle=function(e){return{type:"CLIPBOARD_PASTE:ELEMENT_STYLE",payload:{id:e}}}})
define("tco-app/src/actions/data",["exports","lodash","tco-app/src/lib/http"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.invalidateData=function(e){return{type:"DATA:INVALIDATE",payload:{keys:e}}},e.updateData=a,e.fetchData=function(e){return function(t){(e||[]).filter(function(e){var t=e.key
return r[t]}).forEach(function(e){var n=e.key,o=e.query
r[n](o).then(function(e){return t(a(n,e))})})}}
var o=(0,t.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),r={contentTemplates:function(){return new Promise(function(e){o().findAll("content/template-entry").then(function(t){return e(t.sortBy("title").map(function(e){return{id:e.get("id"),title:e.get("title")}}))})})},presets:function(){return new Promise(function(e){(0,n.request)("presets::get_preset_stubs").then(function(t){var n={}
t.forEach(function(e){var t=e.id,o=e.element,r=e.title
n["".concat(t)]={id:t,title:r,element:o}}),e(n)})})}}
function a(e,t){return{type:"DATA:UPDATE",payload:{key:e,result:t}}}}),define("tco-app/src/actions/elements",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.elementsReset=function(){return{type:"ELEMENT_RESET",payload:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}},e.elementAddFromPreset=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}
return{type:"ELEMENT_ADD_FROM_PRESET",payload:Object.assign({id:e,preset:t,index:n},o)}},e.elementAdd=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}
return{type:"ELEMENT_ADD",payload:Object.assign({id:e,atts:t,index:n},o)}},e.elementAddSibling=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}
return{type:"ELEMENT_ADD:SIBLING",payload:Object.assign({id:e,atts:t,after:n},o)}},e.elementAddSiblingFromPreset=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}
return{type:"ELEMENT_ADD_FROM_PRESET:SIBLING",payload:Object.assign({id:e,preset:t,after:n},o)}},e.elementShift=function(e,t){return{type:"ELEMENT_SHIFT",payload:{id:e,shift:t}}},e.elementMove=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null
return{type:"ELEMENT_MOVE",payload:{id:e,index:t,parent:n}}},e.elementMoveBefore=function(e,t){return{type:"ELEMENT_MOVE:BEFORE",payload:{id:e,sibling:t}}},e.elementMoveAfter=function(e,t){return{type:"ELEMENT_MOVE:AFTER",payload:{id:e,sibling:t}}},e.elementDelete=function(e){return{type:"ELEMENT_DELETE",payload:{id:e}}},e.elementDeleteChildren=function(e){return{type:"ELEMENT_DELETE_CHILDREN",payload:{id:e}}},e.elementDeleteWithConfirm=function(e){return{type:"ELEMENT_DELETE:CONFIRM",payload:{id:e}}},e.elementDeleteChildrenWithConfirm=function(e){return{type:"ELEMENT_DELETE_CHILDREN:CONFIRM",payload:{id:e}}},e.elementDuplicate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null
return{type:"ELEMENT_DUPLICATE",payload:{id:e,parent:t}}},e.elementUpdateAtt=function(e,t,n){return{type:"ELEMENT_UPDATE:SET_ATTRIBUTE",payload:{id:e,key:t,value:n}}},e.elementUpdateAtts=function(e,t){return{type:"ELEMENT_UPDATE:SET_ATTRIBUTES",payload:{id:e,atts:t}}},e.elementUpdateLabel=function(e,t){return{type:"ELEMENT_UPDATE:SET_LABEL",payload:{id:e,label:t}}},e.elementUpdateColumnLayout=function(e,t){return{type:"ELEMENT_UPDATE:SET_COLUMN_LAYOUT",payload:{id:e,layout:t}}},e.elementResetStyle=function(e){return{type:"ELEMENT_UPDATE:RESET_STYLE",payload:{id:e}}},e.elementRemoveSpacing=function(e){return{type:"ELEMENT_UPDATE:REMOVE_SPACING",payload:{id:e}}},e.elementInsertChildren=function(e,t,n,o){return{type:"ELEMENT_ADD:INSERT_CHILDREN",payload:{children:e,id:t,sibling:n,after:o}}},e.elementCreateRowLayout=function(e,t){return{type:"ELEMENT_CREATE_ROW_LAYOUT",payload:{id:e,layout:t}}},e.elementCreateGridLayout=function(e,t){return{type:"ELEMENT_CREATE_GRID_LAYOUT",payload:{id:e,template:t}}},e.elementUpdateCellPosition=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all"
return{type:"ELEMENT_UPDATE_CELL_POSITION",payload:{id:e,source:t,from:n,to:o}}},e.elementUpdateGridLayout=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all"
return{type:"ELEMENT_UPDATE_GRID_LAYOUT",payload:{id:e,source:t,from:n,to:o}}}}),define("tco-app/src/actions/inspector",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.inspectorSetup=function(){return{type:"INSPECTOR:SETUP",payload:{}}},e.inspect=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).navigate
return{type:"INSPECTOR:INSPECT",payload:{id:e,navigate:void 0===t||t}}},e.inspectorSelectControlGroup=function(e){return{type:"INSPECTOR:SELECT_GROUP",payload:{group:e}}}}),define("tco-app/src/actions/preferences",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toggleFavoriteElement=function(e){return function(t){(function(e){try{var t=window.localStorage.getItem("csElementFavorites")
t||(t="")
var n="{{".concat(e,"}}")
t.includes(n)?t=t.replace(n,""):t+=n,window.localStorage.setItem("csElementFavorites",t)}catch(o){console.warn("unable to favorite element",e)}})(e),t({type:"PREFERENCES:TOGGLE_FAVORITE_ELEMENT",payload:{id:e}})}}}),define("tco-app/src/actions/render",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.renderPrimeElement=function(e){return{type:"RENDER:PRIME_ELEMENTS",payload:{elements:[{atts:e}]}}},e.renderPrimeElementType=function(e){return{type:"RENDER:PRIME_ELEMENTS",payload:{elements:[{atts:{_type:e}}]}}},e.renderPrimePreset=function(e){return{type:"RENDER:PRIME_PRESET",payload:{id:e}}},e.renderPrimeElements=function(e){return{type:"RENDER:PRIME_ELEMENTS",payload:{elements:e}}}}),define("tco-app/src/actions/ui",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uiToggleHideWorkspace=function(){return{type:"UI:HIDE_WORKSPACE",payload:{toggle:!0,full:arguments.length>0&&void 0!==arguments[0]&&arguments[0]}}},e.uiHideWorkspace=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
return{type:"UI:HIDE_WORKSPACE",payload:{hidden:e,full:t}}},e.uiQuickConfirm=function(e){return{type:"UI:QUICK_CONFIRM",payload:{enabled:e}}},e.uiConfirm=function(e){return{type:"UI:CONFIRM",payload:e}},e.uiDismissConfirm=function(){return{type:"UI:CONFIRM_DISMISS"}},e.uiModKey=function(e){return{type:"UI:MOD_KEY",payload:{state:e}}},e.uiUpdate=function(){return{type:"UI:UPDATE",payload:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}},e.uiBeginInlineEditing=function(e){return{type:"UI:BEGIN_INLINE_EDITING",payload:{id:e},lazy:!0}},e.uiEndInlineEditing=function(e){return{type:"UI:END_INLINE_EDITING",payload:{id:e},lazy:!0}},e.enablePreviewPointer=function(){return{type:"UI:DISABLE_PREVIEW_POINTER",payload:{state:!1}}},e.disablePreviewPointer=function(){return{type:"UI:DISABLE_PREVIEW_POINTER",payload:{state:!0}}},e.uiBeginRowResize=function(e){return{type:"UI:BEGIN_ROW_RESIZE",payload:{id:e},lazy:!0}},e.uiEndRowResize=function(){return{type:"UI:END_ROW_RESIZE",lazy:!0}},e.uiBeginGridEditor=function(e){return{type:"UI:BEGIN_GRID_EDITOR",payload:{id:e},lazy:!0}},e.uiEndGridEditor=function(){return{type:"UI:END_GRID_EDITOR",lazy:!0}},e.uiToggleContextMenu=function(e){return{type:"UI:TOGGLE_CONTEXT_MENU",payload:e,lazy:!0}},e.uiLiftElement=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null
return{type:"UI:UPDATE",payload:{liftedElement:e?{id:e,type:t}:null},lazy:!0}},e.uiResetLiftedElement=function(){return{type:"UI:UPDATE",payload:{liftedElement:null},lazy:!0}},e.uiRemoteKeybinding=function(e){return{type:"UI:REMOTE_KEY_BINDING",payload:{binding:e},lazy:!0}},e.uiObserveStart=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
return{type:"UI:OBSERVE_START",payload:{id:e},lazy:t}},e.uiObserveEnd=function(){return{type:"UI:OBSERVE_END",lazy:arguments.length>0&&void 0!==arguments[0]&&arguments[0]}},e.uiUpdateGridCounter=function(){return{type:"UI:UPDATE_GRID_COUNTER",lazy:!0}}}),define("tco-app/src/boot",["exports","tco-app/src/lib/http","tco-app/src/lib/i18n","tco-app/src/lib/keybindings","tco-app/src/util/gzip","tco-app/src/util/ie11","tco-app/src/util/debug","tco-app/src/util/convert-php-date-format","localforage"],function(e,t,n,o,r,a,i,s,l){function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e,t,n,o,r,a,i){try{var s=e[a](i),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(o,r)}function d(e){return function(){var t=this,n=arguments
return new Promise(function(o,r){var a=e.apply(t,n)
function i(e){p(a,o,r,i,s,"next",e)}function s(e){p(a,o,r,i,s,"throw",e)}i(void 0)})}}function f(){return(f=d(regeneratorRuntime.mark(function e(){var s,p,f,m,h,g,v,b,y,_,w,E,O
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((0,a.default)(),Object.keys(window.csAppData).forEach(function(e){"true"===window.csAppData[e]&&(window.csAppData[e]=!0),"false"===window.csAppData[e]&&(window.csAppData[e]=!1)}),(0,o.registerKeyMap)(window.csAppData.keybindings),(0,t.setupHttp)({nonce_key:"_cs_nonce",nonce:window.csAppData._cs_nonce,legacy:window.csAppData.useLegacyAjax,canGzip:window.csAppData.canGzip}),window.jQuery(document).on("heartbeat-tick",function(e,n){var o=n.nonce
o&&(delete window.adminpage,window.csAppData._cs_nonce=o,(0,t.setupHttp)({nonce:o}))}),window.jQuery(document).on("heartbeat-send",function(e,t){t.nonce=window.csAppData._cs_nonce}),(0,n.addStrings)(window.csAppData.app_i18n),(0,n.addStrings)(window.csAppData.common_i18n),!window.csAppData.isPreview){e.next=10
break}return e.abrupt("return")
case 10:return e.prev=10,y=function(){return(y=d(regeneratorRuntime.mark(function e(t,n){var o,r,a,i,l
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o={},e.t0=regeneratorRuntime.keys(t)
case 2:if((e.t1=e.t0()).done){e.next=23
break}if(r=e.t1.value,!t.hasOwnProperty(r)){e.next=21
break}if(a=c(t[r],2),i=a[0],!(l=a[1])){e.next=16
break}return o[r]=v(l),e.next=10,f.setItem("".concat(n,":").concat(r),i)
case 10:return e.next=12,s.setItem(i,l)
case 12:return e.next=14,p.setItem(i,Date.now())
case 14:e.next=21
break
case 16:return e.t2=v,e.next=19,s.getItem(i)
case 19:e.t3=e.sent,o[r]=(0,e.t2)(e.t3)
case 21:e.next=2
break
case 23:return e.abrupt("return",o)
case 24:case"end":return e.stop()}},e)}))).apply(this,arguments)},b=function(e,t){return y.apply(this,arguments)},s=l.default.createInstance({name:"TcoHashCache"}),p=l.default.createInstance({name:"TcoHashCacheTimes"}),f=l.default.createInstance({name:"TcoPreloaderCache"}),m=[],e.next=19,p.iterate(function(e,t){Date.now()-(e+432e5)>0&&m.push(t)})
case 19:if(!(m.length>0)){e.next=22
break}return e.next=22,Promise.all([].concat(u(m.map(function(e){return s.removeItem(e)})),u(m.map(function(e){return p.removeItem(e)}))))
case 22:return h={},g={},e.next=26,f.iterate(function(e,t){g[e]=t})
case 26:return e.next=28,s.iterate(function(e,t){e&&g[t]&&(h[g[t]]=t)})
case 28:return v=function(e){return"string"==typeof e?(0,r.uncompress)(e):e},e.next=31,(0,t.request)("app-boot::boot_data",{state:h})
case 31:return _=e.sent,w=_.common,E=_.models,e.next=36,b(w,"common")
case 36:return O=e.sent,Object.keys(O).forEach(function(e){window.csAppData[e]=O[e]}),e.next=40,b(E,"models")
case 40:window.csAppData.models=e.sent,e.next=46
break
case 43:e.prev=43,e.t0=e.catch(10),console.warn(e.t0)
case 46:(0,i.default)()
case 47:case"end":return e.stop()}},e,null,[[10,43]])}))).apply(this,arguments)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return f.apply(this,arguments)}}),define("tco-app/src/components/builder/BuilderKeyboardShortcuts",["exports","react","react-redux","tco-app/src/lib/keybindings","tco-app/src/actions/ui","tco-app/src/actions/builder","tco-app/src/actions/elements","tco-app/src/actions/clipboard"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m={uiToggleHideWorkspace:r.uiToggleHideWorkspace,builderNavigate:a.builderNavigate,elementDelete:i.elementDelete,elementDeleteWithConfirm:i.elementDeleteWithConfirm,elementDuplicate:i.elementDuplicate,clipboardCopyElement:s.clipboardCopyElement,clipboardPasteElement:s.clipboardPasteElement,clipboardPasteElementStyle:s.clipboardPasteElementStyle},h=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=u(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==l(r)&&"function"!=typeof r?p(o):r,f(p(t),"onDuplicate",function(){t.props.inspecting&&t.props.elementDuplicate(t.props.inspecting)}),f(p(t),"onDelete",function(){t.props.inspecting&&t.props.elementDeleteWithConfirm(t.props.inspecting)}),f(p(t),"onQuickDelete",function(){t.props.inspecting&&t.props.elementDelete(t.props.inspecting)}),f(p(t),"onCopy",function(){t.props.inspecting&&t.props.clipboardCopyElement(t.props.inspecting)}),f(p(t),"onPaste",function(){t.props.inspecting&&t.props.clipboardPasteElement(t.props.inspecting)}),f(p(t),"onPasteStyle",function(){t.props.inspecting&&t.props.clipboardPasteElementStyle(t.props.inspecting)}),f(p(t),"onNavLayout",function(){return t.props.builderNavigate("layout")}),t}var r,a,i
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(n,t.default.PureComponent),r=n,(a=[{key:"componentDidMount",value:function(){var e=this
this.unbindKeys=(0,o.default)({"toggle-full-collapse":function(){return e.props.uiToggleHideWorkspace(!0)},duplicate:this.onDuplicate,delete:(0,o.makeSafeHandler)(this.onDelete),"quick-delete":(0,o.makeSafeHandler)(this.onQuickDelete),copy:(0,o.makeSafeHandler)(this.onCopy),paste:(0,o.makeSafeHandler)(this.onPaste),"paste-style":(0,o.makeSafeHandler)(this.onPasteStyle),"nav-layout":this.onNavLayout})}},{key:"componentWillUnmount",value:function(){this.unbindKeys()}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}])&&c(r.prototype,a),i&&c(r,i),n}(),g=(0,n.connect)(function(e){return{inspecting:e.inspector.inspecting}},m)(h)
e.default=g}),define("tco-app/src/components/builder/BuilderWorkspace",["exports","react","react-redux","tco-app/src/components/builder/BuilderWorkspaceNav","tco-app/src/components/builder/ElementsWorkspace","tco-app/src/components/builder/WorkspaceDev","tco-app/src/components/layout/LayoutWorkspace","tco-app/src/components/inspector/InspectorWorkspace","tco-app/src/components/common/ErrorBoundary","tco-app/src/components/builder/BuilderKeyboardShortcuts","tco-app/src/components/builder/ElementContextMenu","tco-app/src/components/builder/InspectorContextMenu","tco-app/src/actions/builder"],function(e,t,n,o,r,a,i,s,l,c,u,p,d){function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var y={builderNavigate:d.builderNavigate},_=function(e){function n(){var e,r,a,i;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c]
return a=this,i=(e=h(n)).call.apply(e,[this].concat(l)),r=!i||"object"!==f(i)&&"function"!=typeof i?g(a):i,b(g(r),"onNavigate",function(e){return r.props.builderNavigate(e)}),b(g(r),"renderHeader",function(e){return t.default.createElement("div",{className:"cs-workspace-header"},t.default.createElement(o.default,{active:r.props.activePanel,onNavigate:r.onNavigate}),e)}),b(g(r),"renderError",function(){return t.default.createElement(t.default.Fragment,null,r.renderHeader(),t.default.createElement("div",{className:"cs-workspace-content"}))}),r}var a,d,y
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.default.PureComponent),a=n,(d=[{key:"getPanelComponent",value:function(){return"elements"===this.props.activePanel?r.default:"layout"===this.props.activePanel?i.default:"inspector"===this.props.activePanel?s.default:null}},{key:"render",value:function(){var e=this.getPanelComponent()
return t.default.createElement(l.default,{renderFallback:this.renderError},t.default.createElement(e,{renderHeader:this.renderHeader}),t.default.createElement(c.default,null),this.props.preferences.contextMenu&&t.default.createElement(t.default.Fragment,null,t.default.createElement(u.default,{handle:"builder",targetAttribute:"cs-context-menu"}),t.default.createElement(p.default,{handle:"inspector",targetAttribute:"cs-context-menu-inspector"})))}}])&&m(a.prototype,d),y&&m(a,y),n}(),w=(0,n.connect)(function(e){var t=e.builder,n=t.permissionContext,o=t.routePrefix,r=t.orientation,a=t.preferences
return{activePanel:t.activePanel,preferences:a,permissionContext:n,routePrefix:o,orientation:r}},y)(_)
e.default=w}),define("tco-app/src/components/builder/BuilderWorkspaceNav",["exports","react","react-redux","tco-app/src/components/workspace/WorkspaceNav","tco-app/src/lib/i18n","tco-app/src/lib/permissions","lodash"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=(0,i.memoize)(function(){return window.cornerstoneApp.lookup("service:-routing")}),m=(0,i.memoize)(function(){return window.cornerstoneApp.lookup("router:main")})
function h(){var e
return(e=f()).generateURL.apply(e,d(function(e){var t,n=(e=e.slice()).shift(),o=e[e.length-1]
t=o&&o.isQueryParams?e.pop().values:{}
return[n,e,t]}(Array.prototype.slice.call(arguments))))}var g=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),c(this,u(n).apply(this,arguments))}var i,s,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(n,t.default.PureComponent),i=n,(s=[{key:"getItems",value:function(){var e=this,t=this.props,n=t.orientation,o=t.homeRoute,i=t.routePrefix,s=t.permissionContext
if(!o||!i)return[]
var l=[]
"horizontal"===n&&l.push({route:o,label:(0,r.t)("common.title.".concat(o)),id:"home"}),(0,a.currentUserCan)("".concat(s,".manage_layout"))&&l.push({label:(0,r.t)("app.layout.title"),id:"layout"}),(0,a.currentUserCan)("".concat(s,".elements_create"))&&l.push({label:(0,r.t)("app.elements.title"),id:"elements"}),(0,a.currentUserCan)("".concat(s,".elements_inspect"))&&l.push({label:(0,r.t)("app.inspector.title"),id:"inspector"})
var c=f().get("currentState")
return l.map(function(t){var n=t.route,o=t.label,r=t.id
return{onClick:function(t){if(t.preventDefault(),n)return m().transitionTo(n)
e.props.onNavigate(r)},label:o,class:r,id:r,href:n&&h(n),active:n?f().isActiveForRoute([],{},n,c,!1):e.props.active===r}})}},{key:"render",value:function(){return t.default.createElement(o.default,{items:this.getItems()})}}])&&l(i.prototype,s),d&&l(i,d),n}(),v=(0,n.connect)(function(e){var t=e.builder
return{permissionContext:t.permissionContext,routePrefix:t.routePrefix,homeRoute:t.homeRoute,orientation:t.orientation}})(g)
e.default=v}),define("tco-app/src/components/builder/ElementContextMenu",["exports","react","classnames","react-redux","tco-app/src/components/common/ElementIcon","tco-app/src/components/common/Icon","tco-app/src/svg/cell-auto-placement","tco-app/src/components/common/ContextMenu","tco-app/src/selectors/elements","tco-app/src/reducers/elements","tco-app/src/actions/builder","tco-app/src/actions/ui","tco-app/src/lib/permissions","tco-app/src/actions/elements","tco-app/src/actions/clipboard","tco-app/src/lib/keybindings"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h){function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var O=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return n=this,r=(e=y(o)).call.apply(e,[this].concat(i)),t=!r||"object"!==g(r)&&"function"!=typeof r?_(n):r,E(_(t),"state",{open:!1}),E(_(t),"onOpenMenu",function(){return t.setState({open:!0})}),E(_(t),"onNewTarget",function(e){var n=v(e.split("::"),2),o=n[0],r=n[1]
return o&&t.props.uiToggleContextMenu({handle:t.props.handle,active:!0,meta:{id:o,context:r}}),t.props.uiObserveStart(o),!0}),E(_(t),"onCloseMenu",function(){t.props.uiObserveEnd(),t.setState({open:!1}),t.props.uiToggleContextMenu({handle:t.props.handle,active:!1,meta:null})}),t}var a,i,l
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(o,t.default.Component),a=o,(i=[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.handle,o=t.contextMenu
o.handle!==e.contextMenu.handle&&o.handle!==n&&this.setState({open:!1})}},{key:"onClickAction",value:function(e){this.onCloseMenu(),e&&this.props.dispatchers[e]&&this.props.dispatchers[e](this.props.element._id)}},{key:"renderActionGroup",value:function(e,o){var r=this
return t.default.createElement("ul",{key:e},o.map(function(e){var o=e.icon,a=void 0===o?null:o,i=e.action,s=e.label,l=e.shortcut,c=void 0===l?null:l,u=e.disabled
return t.default.createElement("li",{key:i,className:(0,n.default)({"is-disabled":u}),onClick:function(){u||r.onClickAction(i)}},a,s&&t.default.createElement("strong",null,s),c&&t.default.createElement("em",null,(0,h.displayBinding)(c)))}))}},{key:"renderContent",value:function(){var e=this,n=this.props.actions.reduce(function(e,t){return e["".concat(t.group)]||(e["".concat(t.group)]=[]),e["".concat(t.group)].push(t),e},{})
return t.default.createElement(t.default.Fragment,null,t.default.createElement("h6",null,t.default.createElement(r.default,{icon:this.props.element._iconPath}),t.default.createElement("span",null,this.props.element._label)),Object.keys(n).map(function(t){return e.renderActionGroup(t,n[t])}))}},{key:"render",value:function(){return t.default.createElement(s.default,{open:this.state.open,targetAttribute:this.props.targetAttribute,onCloseMenu:this.onCloseMenu,onOpenMenu:this.onOpenMenu,onNewTarget:this.onNewTarget},this.props.element&&this.renderContent())}}])&&b(a.prototype,i),l&&b(a,l),o}()
E(O,"defaultProps",{handle:"default",contextMenu:{},targetAttribute:"data-cs-observeable-id"})
var x,k=(0,o.connect)((x=(0,l.makeGetElement)(),function(e,n){var o=n.handle,r=e.ui.contextMenu,s=void 0===r?{}:r,l=s.meta,u=o===s.handle&&l&&l.id
if(!u)return{}
var p=x(e,{id:u}),f=e.builder.permissionContext
if(!p)return{}
var m=l&&l.context||"default",h=e.definitions,g=e.clipboard.element,v=(g=void 0===g?{}:g).atts,b=v&&v._type,y=[];["layout-cell"].includes(p._type)&&(0,d.currentUserCan)("".concat(f,".manage_layout"))&&(y.push({icon:t.default.createElement(a.default,{icon:"fa-arrow-to-right"}),action:"move-to-front",label:"Bring to Front",group:0}),y.push({icon:t.default.createElement(a.default,{icon:"fa-arrow-right"}),action:"move-forward",label:"Bring Forward",group:0}),y.push({icon:t.default.createElement(a.default,{icon:"fa-arrow-left"}),action:"move-backward",label:"Send Backward",group:0}),y.push({icon:t.default.createElement(a.default,{icon:"fa-arrow-to-left"}),action:"move-to-back",label:"Send to Back",group:0}),y.push({icon:t.default.createElement(i.default,null),action:"auto-place-cell",label:"Use Auto Placement",group:0})),(0,d.currentUserCan)("".concat(f,".elements_create"))&&y.push({icon:t.default.createElement(a.default,{icon:"fa-copy"}),action:"duplicate",label:"Duplicate",shortcut:"duplicate",group:1}),(0,d.currentUserCan)("".concat(f,".elements_delete"))&&y.push({icon:t.default.createElement(a.default,{icon:"fa-trash-alt"}),action:"delete",label:"Delete",shortcut:"delete",group:1}),(0,d.currentUserCan)("element.".concat(p._type,".copy"))&&y.push({icon:t.default.createElement(a.default,{icon:"fa-clipboard"}),action:"copy",label:"Copy",shortcut:"copy",group:2})
var _=b===p._type
if((0,d.currentUserCan)("element.".concat(p._type,".paste"))){var w=!_&&(0,c.areElementTypesCompatible)(p._type,b,h)
y.push({icon:t.default.createElement(a.default,{icon:"fa-paste"}),action:"paste",label:w?"Paste ".concat(h[b].title):"Paste",disabled:!_&&!w,shortcut:"paste",group:2})}if((0,d.currentUserCan)("element.".concat(p._type,".paste_style"))){var E=!_&&(0,c.areElementTypesCompatiblePreCheck)(p._type,b,h)
y.push({icon:t.default.createElement(a.default,{icon:"fa-paint-roller"}),action:"paste-style",label:E?"Paste ".concat(h[b].title," Style"):"Paste Style",disabled:!_&&!E,shortcut:"paste-style",group:2})}return(0,d.currentUserCan)("element.".concat(p._type,".inspect"))&&y.push({icon:t.default.createElement(a.default,{icon:"fa-backward"}),action:"reset-style",label:"Reset Style",group:2}),["section","classic:section","row","classic:row","layout-row"].includes(p._type)&&(0,d.currentUserCan)("element.".concat(p._type,".inspect"))&&y.push({icon:t.default.createElement(a.default,{icon:"fa-compress"}),action:"remove-spacing",label:"Remove Spacing",group:3}),"layer-item-vertical"===m&&["classic:section","classic:row","classic:column","section","row","column","layout-row","layout-column","layout-grid","layout-cell"].includes(p._type)&&(0,d.currentUserCan)("".concat(f,".manage_layout"))&&(y.push({icon:t.default.createElement(a.default,{icon:"fa-caret-down"}),action:"layout-expand-all",label:"Layout: Expand All",group:4}),y.push({icon:t.default.createElement(a.default,{icon:"fa-caret-right"}),action:"layout-collapse-all",label:"Layout: Collapse All",group:4})),{element:p,clipboardElement:v,context:f,contextMenu:s,actions:y}}),function(e){return{dispatchers:{delete:function(t){return e((0,f.elementDelete)(t))},duplicate:function(t){return e((0,f.elementDuplicate)(t))},copy:function(t){return e((0,m.clipboardCopyElement)(t))},paste:function(t){return e((0,m.clipboardPasteElement)(t))},"paste-style":function(t){return e((0,m.clipboardPasteElementStyle)(t))},"reset-style":function(t){return e((0,f.elementResetStyle)(t))},"remove-spacing":function(t){return e((0,f.elementRemoveSpacing)(t))},"layout-expand-all":function(t){return e((0,u.builderExpandDeep)(t))},"layout-collapse-all":function(t){return e((0,u.builderCollapseDeep)(t))},"move-forward":function(t){return e((0,f.elementShift)(t,"down"))},"move-backward":function(t){return e((0,f.elementShift)(t,"up"))},"move-to-front":function(t){return e((0,f.elementShift)(t,"end"))},"move-to-back":function(t){return e((0,f.elementShift)(t,"start"))},"auto-place-cell":function(t){return e((0,f.elementUpdateAtts)(t,{layout_cell_column_start_xs:"",layout_cell_column_start_sm:"",layout_cell_column_start_md:"",layout_cell_column_start_lg:"",layout_cell_column_start_xl:"",layout_cell_column_end_xs:"",layout_cell_column_end_sm:"",layout_cell_column_end_md:"",layout_cell_column_end_lg:"",layout_cell_column_end_xl:"",layout_cell_row_start_xs:"",layout_cell_row_start_sm:"",layout_cell_row_start_md:"",layout_cell_row_start_lg:"",layout_cell_row_start_xl:"",layout_cell_row_end_xs:"",layout_cell_row_end_sm:"",layout_cell_row_end_md:"",layout_cell_row_end_lg:"",layout_cell_row_end_xl:"",layout_cell_justify_self_xs:"auto",layout_cell_justify_self_sm:"auto",layout_cell_justify_self_md:"auto",layout_cell_justify_self_lg:"auto",layout_cell_justify_self_xl:"auto",layout_cell_align_self_xs:"auto",layout_cell_align_self_sm:"auto",layout_cell_align_self_md:"auto",layout_cell_align_self_lg:"auto",layout_cell_align_self_xl:"auto"}))}},uiObserveStart:function(t){return e((0,p.uiObserveStart)(t,!0))},uiObserveEnd:function(){return e((0,p.uiObserveEnd)())},uiToggleContextMenu:function(t){return e((0,p.uiToggleContextMenu)(t))}}})(O)
e.default=k}),define("tco-app/src/components/builder/ElementLibrary",["exports","react","classnames","react-redux","lodash","fuzzysort","tco-app/src/components/common/Icon","tco-app/src/components/workspace/WorkspaceMessage","tco-app/src/components/common/ElementIcon","tco-app/src/selectors/element-workspace","tco-app/src/actions/builder","tco-app/src/actions/render","tco-app/src/actions/preferences","tco-app/src/actions/ui","tco-app/src/util/dragula","tco-app/src/lib/i18n","tco-app/src/components/data/RouteData","tco-app/src/components/global/ElementCursor"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g,v){function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function O(e,t,n){return t&&E(e.prototype,t),n&&E(e,n),e}function x(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?S(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function P(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var T=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")}),M=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:xfr")})
var D={builderSetIncomingElement:u.builderSetIncomingElement,builderClearIncomingElement:u.builderClearIncomingElement,renderPrimeElementType:p.renderPrimeElementType,renderPrimePreset:p.renderPrimePreset,toggleFavoriteElement:d.toggleFavoriteElement,uiUpdate:f.uiUpdate},A=function(e){var n=e.group,o=e.descriptor,r=e.icon,a=e.favorite,s=e.title,c=e.onClick,u=e.onFavorite
return t.default.createElement("div",{className:"cs-elements-list-item is-".concat(n),"data-cs-element":o,onClick:c},t.default.createElement("div",{className:"cs-elements-list-item-before"},t.default.createElement(l.default,{icon:r})),t.default.createElement("strong",{className:"cs-elements-list-item-label"},s),t.default.createElement("div",{className:"cs-elements-list-item-after"},t.default.createElement("button",{onClick:u},t.default.createElement(i.default,{icon:a?"fa-star-fas":"fa-star-far"}))))},I=function(e){var o=e.isOpen,r=e.onToggle,a=e.onFavorite,s=e.onClickItem,l=e.group,c=e.title,u=e.data
return t.default.createElement("div",{className:"cs-elements-group"},t.default.createElement("button",{className:(0,n.default)("cs-elements-list-header",{"is-active":o,"is-toggle":!!r}),onClick:r},t.default.createElement("strong",null,c),t.default.createElement(i.default,{icon:"caret-collapse"})),(o||!r)&&t.default.createElement("div",{className:"cs-elements-list"},u.map(function(e){var n=e.descriptor,o=e.title,r=e.icon,i=e.favorite
return t.default.createElement(A,{key:"".concat(l,":").concat(n),group:l,onClick:s,onFavorite:function(){return a(n)},descriptor:n,icon:r,title:o,favorite:i})})))},R=function(e){function n(){var e,t
w(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return j(S(t=x(this,(e=k(n)).call.apply(e,[this].concat(r)))),"state",{isOpen:t.props.startsOpen}),j(S(t),"toggleIsOpen",function(){return t.setState({isOpen:!t.state.isOpen})}),t}return P(n,t.default.Component),O(n,[{key:"render",value:function(){return t.default.createElement(I,_({isOpen:this.state.isOpen,onToggle:this.toggleIsOpen},this.props))}}]),n}(),L=function(e){var t=b((e.getAttribute("data-cs-element")||"").split("|"),3),n=t[0],o=t[1],r=t[2]
return n?{group:n,type:o,id:r}:{}},N=function(e){function o(){var e,t
w(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return j(S(t=x(this,(e=k(o)).call.apply(e,[this].concat(r)))),"state",{isSearching:!1}),j(S(t),"onStopDrag",function(){t.drake&&t.drake.cancel()}),j(S(t),"onClickItem",function(e){if(!t.props.dragging){var n=L(e.currentTarget),o=n.group,r=n.type,a=n.id
o&&t.props.onAddAfterClick({group:o,type:r,id:a})}}),t}return P(o,t.default.PureComponent),O(o,[{key:"componentDidMount",value:function(){var e=this
if(this.props.dragging){M().on("stop-drag",this.onStopDrag)
T()
var t=(0,m.default)({isContainer:function(t){return!!t.classList&&t.classList.contains("cs-elements-list")&&e.rootEl&&e.rootEl.contains(t)},moves:function(t){return!!t.classList&&t.classList.contains("cs-elements-list-item")&&e.rootEl&&e.rootEl.contains(t)},accepts:function(){return!1},copy:!0,offset:function(e,t,n){return{x:16,y:n.getBoundingClientRect().height/2}},revertOnSpill:!0})
t.on("cloned",function(e){e.style="display:none!important"}),t.on("drag",function(t){var n=L(t),o=n.group,r=n.type,a=n.id
o&&(e.props.uiUpdate({elementCursor:r}),"standard"===o&&(e.props.builderSetIncomingElement(r),e.props.renderPrimeElementType(r)),"preset"===o&&(e.props.builderSetIncomingElement(r,{preset:a}),e.props.renderPrimePreset(a)))}),t.on("dragend",function(){e.props.uiUpdate({elementCursor:!1,suspendDrag:!1}),e.props.builderClearIncomingElement()}),this.drake=t}}},{key:"componentDidUpdate",value:function(e){this.props.searchQuery.trim()!==e.searchQuery.trim()&&(this.props.searchQuery?this.searchAsync():this.setState({isSearching:!0,searchResults:{}}))}},{key:"componentWillUnmount",value:function(){M().off("stop-drag",this.onStopDrag),this.drake&&this.drake.destroy()}},{key:"getFilteredLibrary",value:function(){var e=this
return this.props.searchQuery?Object.keys(this.state.searchResults||{}).reduce(function(t,n){return t[n]=e.state.searchResults[n].map(function(t){return e.props.library[n].find(function(e){return e.descriptor===t})}).filter(function(e){return e&&e.descriptor}),t},{}):this.props.library}},{key:"searchAsync",value:function(){var e=this
this.state.isSearching||this.setState({isSearching:!0})
var t=["favorites"]
this.searchPromises||(this.searchPromises={})
var n=Object.keys(this.props.library).filter(function(e){return!t.includes(e)}),o=this.props.searchQuery.trim()
Promise.all(n.map(function(n){if(!t.includes(n))return e.searchPromises[n]&&e.searchPromises[n].cancel(),e.searchPromises[n]=a.default.goAsync(o,e.props.library[n],{keys:["title","elementTitle"],scoreFn:function(e){var t=b(e,2),n=t[0],o=t[1]
return n&&n.score>-1e3?n.score:o&&o.score>-1e3?100*(o.score-1):null}}),e.searchPromises[n]})).then(function(t){var o=t.reduce(function(e,t,o){return t.length>0&&(e[n[o]]=t.map(function(e){return e.obj.descriptor})),e},{})
e.setState({isSearching:!1,searchResults:o})})}},{key:"renderEmpty",value:function(){return!this.props.searchQuery||this.state.isSearching?null:t.default.createElement(s.default,{title:(0,h.t)("app.no-things-found",{context:(0,h.t)("app.elements.entities")}),message:(0,h.t)("app.refine-search",{context:(0,h.t)("app.elements.entity")})})}},{key:"render",value:function(){var e=this,o=this.props.searchQuery?I:R,r=this.getFilteredLibrary(),a=Object.keys(r).filter(function(e){return r[e].length>0})
return a.length<=0?this.renderEmpty():t.default.createElement("div",{className:(0,n.default)("cs-elements",{"no-dragging":!this.props.dragging}),ref:function(t){return e.rootEl=t}},a.map(function(n){return t.default.createElement(o,{key:n,group:n,title:n,startsOpen:"presets"!==n,data:r[n],onClickItem:e.onClickItem,onFavorite:e.props.toggleFavoriteElement})}),this.props.dragging&&this.props.elementCursor&&t.default.createElement(v.default,{type:this.props.elementCursor,suspend:this.props.suspendDrag}))}}]),o}()
j(N,"defaultProps",{searchQuery:"",dragging:!0,onAddAfterClick:function(){}})
var U=(0,o.connect)(function(e,t){var n=t.scope,o=e.builder,r=o.permissionContext,a=o.routePrefix,i=o.orientation,s=o.preferences,l=(o.builder,e.ui),u=l.elementCursor,p=l.suspendDrag
return{library:(0,c.getElementLibrary)(e,n),preferences:s,permissionContext:r,routePrefix:a,orientation:i,elementCursor:u,suspendDrag:p}},D)(N),F=function(e){return t.default.createElement(g.default,{wait:!1,request:["presets"]},t.default.createElement(U,e))}
e.default=F}),define("tco-app/src/components/builder/ElementLibraryPicker",["exports","react","tco-app/src/components/builder/ElementLibrary","tco-app/src/components/common/Search","tco-app/src/components/common/Picker","tco-app/src/components/common/ScrollBox","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=function(e){function f(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,f)
for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i]
return n=this,o=(e=c(f)).call.apply(e,[this].concat(a)),t=!o||"object"!==s(o)&&"function"!=typeof o?u(n):o,d(u(t),"state",{open:!1,searchQuery:""}),d(u(t),"onQueryChange",function(e){return t.setState({searchQuery:e})}),d(u(t),"onTogglePicker",function(e){t.setState({open:e}),t.props.onTogglePicker(e)}),d(u(t),"onClickPickerButton",function(e){e.stopPropagation(),t.onTogglePicker(!t.open)}),d(u(t),"renderSwatch",function(e){var n=e.ref
return t.props.renderButton({ref:n,onClick:t.onClickPickerButton})}),d(u(t),"onAddAfterClick",function(e){var n=e.group,o=e.type,r=e.id
t.setState({searchQuery:""}),t.onTogglePicker(!1),t.props.onAddAfterClick({group:n,type:o,id:r})}),t}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(f,t.default.Component),m=f,(h=[{key:"render",value:function(){return t.default.createElement(r.default,{class:"cs-element-picker",modalClass:"cs-picker-modal-elements",open:this.state.open,renderSwatch:this.renderSwatch,noWrapper:!0,onToggle:this.onTogglePicker},t.default.createElement(o.default,{query:this.state.searchQuery,placeholder:(0,i.t)("app.search-thing",{context:(0,i.t)("app.elements.entities")}),onQueryChange:this.onQueryChange}),t.default.createElement(a.default,null,t.default.createElement(n.default,{scope:this.props.scope,onAddAfterClick:this.onAddAfterClick,searchQuery:this.state.searchQuery,dragging:!1})))}}])&&l(m.prototype,h),g&&l(m,g),f}()
e.default=f,d(f,"defaultProps",{renderButton:function(){},onAddAfterClick:function(){},scope:null})}),define("tco-app/src/components/builder/ElementsWorkspace",["exports","react","tco-app/src/components/common/ScrollBox","tco-app/src/components/common/Search","tco-app/src/components/builder/ElementLibrary","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function d(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,d)
for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s]
return n=this,o=(e=l(d)).call.apply(e,[this].concat(a)),t=!o||"object"!==i(o)&&"function"!=typeof o?c(n):o,p(c(t),"state",{searchQuery:""}),p(c(t),"onQueryChange",function(e){return t.setState({searchQuery:e})}),t}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(d,t.default.PureComponent),f=d,(m=[{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.props.renderHeader(t.default.createElement("div",{className:"cs-workspace-search"},t.default.createElement(o.default,{query:this.state.searchQuery,placeholder:(0,a.t)("app.search-thing",{context:(0,a.t)("app.elements.entities")}),onQueryChange:this.onQueryChange}))),t.default.createElement(n.default,{className:"cs-workspace-content",suppressScrollX:!0},t.default.createElement(r.default,{searchQuery:this.state.searchQuery})))}}])&&s(f.prototype,m),h&&s(f,h),d}()
e.default=d}),define("tco-app/src/components/builder/InspectorContextMenu",["exports","react","classnames","react-redux","tco-app/src/components/common/ElementIcon","tco-app/src/components/common/Icon","tco-app/src/svg/cell-auto-placement","tco-app/src/components/common/ContextMenu","tco-app/src/selectors/elements","tco-app/src/actions/elements","tco-app/src/actions/ui","tco-app/src/actions/clipboard","tco-app/src/lib/keybindings"],function(e,t,n,o,r,a,i,s,l,c,u,p,d){function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var _=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return n=this,r=(e=g(o)).call.apply(e,[this].concat(i)),t=!r||"object"!==f(r)&&"function"!=typeof r?v(n):r,y(v(t),"state",{open:!1}),y(v(t),"onOpenMenu",function(){return t.setState({open:!0})}),y(v(t),"onNewTarget",function(e){var n=m(e.split("::"),3),o=n[0],r=n[1],a=n[2]
return o&&t.props.uiToggleContextMenu({handle:t.props.handle,active:!0,meta:{id:o,context:{action:r,bp:a}}}),!0}),y(v(t),"onCloseMenu",function(){t.setState({open:!1}),t.props.uiToggleContextMenu({handle:t.props.handle,active:!1,meta:null})}),t}var a,i,l
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(o,t.default.Component),a=o,(i=[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.handle,o=t.contextMenu
o.handle!==e.contextMenu.handle&&o.handle!==n&&this.setState({open:!1})}},{key:"onClickAction",value:function(e){this.onCloseMenu(),e&&this.props.dispatchers[e]&&this.props.dispatchers[e](this.props.element._id,this.props)}},{key:"renderActionGroup",value:function(e,o){var r=this
return t.default.createElement("ul",{key:e},o.map(function(e){var o=e.icon,a=void 0===o?null:o,i=e.action,s=e.label,l=e.shortcut,c=void 0===l?null:l,u=e.disabled
return t.default.createElement("li",{key:i,className:(0,n.default)({"is-disabled":u}),onClick:function(){u||r.onClickAction(i)}},a,s&&t.default.createElement("strong",null,s),c&&t.default.createElement("em",null,(0,d.displayBinding)(c)))}))}},{key:"renderContent",value:function(){var e=this,n=this.props.actions.reduce(function(e,t){return e["".concat(t.group)]||(e["".concat(t.group)]=[]),e["".concat(t.group)].push(t),e},{})
return t.default.createElement(t.default.Fragment,null,t.default.createElement("h6",null,t.default.createElement(r.default,{icon:this.props.element._iconPath}),t.default.createElement("span",null,this.props.element._label)),Object.keys(n).map(function(t){return e.renderActionGroup(t,n[t])}))}},{key:"render",value:function(){return t.default.createElement(s.default,{open:this.state.open,targetAttribute:this.props.targetAttribute,onCloseMenu:this.onCloseMenu,onOpenMenu:this.onOpenMenu,onNewTarget:this.onNewTarget},this.props.element&&this.renderContent())}}])&&h(a.prototype,i),l&&h(a,l),o}()
y(_,"defaultProps",{handle:"default",contextMenu:{},targetAttribute:"data-cs-observeable-id"})
var w,E=(0,o.connect)((w=(0,l.makeGetElement)(),function(e,n){var o=n.handle,r=e.ui.contextMenu,s=void 0===r?{}:r,l=s.meta,c=o===s.handle&&l&&l.id
if(!c)return{}
var u=w(e,{id:c}),p=e.builder.permissionContext
if(!u)return{}
var d=l&&l.context||{},f=d.action,m=d.bp,h=e.clipboard[f]||{},g=h.atts,v=h.context,b=(v=void 0===v?{}:v).bp,y=[],_=b&&b.toUpperCase(),E=m.toUpperCase()
return"layout-cell"===f&&(y.push({icon:t.default.createElement(i.default,null),action:"auto-place-cell",label:"Use Auto Placement",group:0}),y.push({icon:t.default.createElement(a.default,{icon:"fa-copy"}),action:"apply-cell-position",label:"Apply Position (".concat(E," → All)"),group:1}),y.push({icon:t.default.createElement(a.default,{icon:"fa-clipboard"}),action:"copy-cell-position",label:"Copy Position (".concat(E,")"),group:1}),y.push({icon:t.default.createElement(a.default,{icon:"fa-paste"}),action:"paste-cell-position",label:_?"Paste Position (".concat(_," → ").concat(E,")"):"Paste Position",disabled:!_,group:1})),"layout-grid"===f&&(y.push({icon:t.default.createElement(a.default,{icon:"fa-copy"}),action:"apply-grid-layout",label:"Apply Layout (".concat(E," → All)"),group:1}),y.push({icon:t.default.createElement(a.default,{icon:"fa-clipboard"}),action:"copy-grid-layout",label:"Copy Layout (".concat(E,")"),group:1}),y.push({icon:t.default.createElement(a.default,{icon:"fa-paste"}),action:"paste-grid-layout",label:_?"Paste Layout (".concat(_," → ").concat(E,")"):"Paste Layout",disabled:!_,group:1})),{element:u,currentBp:m,copiedAtts:g,copiedBp:b,context:p,contextMenu:s,actions:y}}),function(e){return{dispatchers:{"copy-cell-position":function(t,n){var o=n.currentBp
return e((0,p.clipboardCopyElement)(t,{bp:o},"layout-cell"))},"copy-grid-layout":function(t,n){var o=n.currentBp
return e((0,p.clipboardCopyElement)(t,{bp:o},"layout-grid"))},"apply-cell-position":function(t,n){var o=n.element,r=n.currentBp
return e((0,c.elementUpdateCellPosition)(t,o,r))},"paste-cell-position":function(t,n){var o=n.copiedAtts,r=n.copiedBp,a=n.currentBp
return e((0,c.elementUpdateCellPosition)(t,o,r,a))},"apply-grid-layout":function(t,n){var o=n.element,r=n.currentBp
return e((0,c.elementUpdateGridLayout)(t,o,r))},"paste-grid-layout":function(t,n){var o=n.copiedAtts,r=n.copiedBp,a=n.currentBp
return e((0,c.elementUpdateGridLayout)(t,o,r,a))},"auto-place-cell":function(t){return e((0,c.elementUpdateAtts)(t,{layout_cell_column_start_xs:"",layout_cell_column_start_sm:"",layout_cell_column_start_md:"",layout_cell_column_start_lg:"",layout_cell_column_start_xl:"",layout_cell_column_end_xs:"",layout_cell_column_end_sm:"",layout_cell_column_end_md:"",layout_cell_column_end_lg:"",layout_cell_column_end_xl:"",layout_cell_row_start_xs:"",layout_cell_row_start_sm:"",layout_cell_row_start_md:"",layout_cell_row_start_lg:"",layout_cell_row_start_xl:"",layout_cell_row_end_xs:"",layout_cell_row_end_sm:"",layout_cell_row_end_md:"",layout_cell_row_end_lg:"",layout_cell_row_end_xl:"",layout_cell_justify_self_xs:"auto",layout_cell_justify_self_sm:"auto",layout_cell_justify_self_md:"auto",layout_cell_justify_self_lg:"auto",layout_cell_justify_self_xl:"auto",layout_cell_align_self_xs:"auto",layout_cell_align_self_sm:"auto",layout_cell_align_self_md:"auto",layout_cell_align_self_lg:"auto",layout_cell_align_self_xl:"auto"}))}},uiToggleContextMenu:function(t){return e((0,u.uiToggleContextMenu)(t))}}})(_)
e.default=E}),define("tco-app/src/components/builder/WorkspaceDev",["exports","react","tco-app/src/components/builder/ElementLibraryPicker"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function l(){var e,n,r,s,c,u,p;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,l)
for(var d=arguments.length,f=new Array(d),m=0;m<d;m++)f[m]=arguments[m]
return r=this,n=!(s=(e=a(l)).call.apply(e,[this].concat(f)))||"object"!==o(s)&&"function"!=typeof s?i(r):s,c=i(n),p=function(e){var n=e.ref,o=e.onClick
return t.default.createElement("button",{ref:n,onClick:o},"Test")},(u="renderButton")in c?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p,n}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,t.default.Component),c=l,(u=[{key:"render",value:function(){return t.default.createElement("div",null,t.default.createElement("br",null),t.default.createElement("br",null),t.default.createElement("br",null),t.default.createElement(n.default,{renderButton:this.renderButton}))}}])&&r(c.prototype,u),p&&r(c,p),l}()
e.default=l}),define("tco-app/src/components/common/Breadcrumbs",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u,p,d=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i(this,s(o).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(o,t.default.PureComponent),c=o,(u=[{key:"render",value:function(){var e=this,o=!this.props.activeItem||!this.props.items||this.props.items.length<=0
return t.default.createElement("ul",{className:(0,n.default)("cs-breadcrumbs",{"is-empty":o})},this.props.items.map(function(o){var a=o.id,i=o.label,s=e.props.activeItem===a
return t.default.createElement("li",r({key:a,onClick:function(t){s||e.props.onNavigate(a,t)},onMouseEnter:function(t){e.props.onMouseEnter(a,t)},onMouseLeave:function(t){e.props.onMouseLeave(a,t)}},e.props.makeItemProps({id:a})),t.default.createElement("a",{className:(0,n.default)({"cs-active":s})},i))}))}}])&&a(c.prototype,u),p&&a(c,p),o}()
e.default=d,p={makeItemProps:function(){return{}}},(u="defaultProps")in(c=d)?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p}),define("tco-app/src/components/common/ConfirmModal",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.Component),l=o,(c=[{key:"render",value:function(){return t.default.createElement("div",{className:(0,n.default)("cs-action-modal-outer",{"cs-active":this.props.active})},t.default.createElement("div",{className:"cs-action-modal-inner"},t.default.createElement("div",{className:"cs-action-modal-content"},t.default.createElement("div",{className:"cs-action-modal-message"},this.props.message),t.default.createElement("div",{className:"cs-action-modal-actions"},this.props.onAccept&&t.default.createElement("button",{className:(0,n.default)("cs-btn",this.props.acceptClass),onClick:this.props.onAccept},this.props.accept),this.props.onDecline&&t.default.createElement("button",{className:(0,n.default)("cs-btn",this.props.declineClass),onClick:this.props.onDecline},this.props.decline)))))}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={active:!1,onAccept:null,onDecline:null,message:"",accept:"",decline:"",declineClass:"",acceptClass:""},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/common/ContextMenu",["exports","react","react-dom","tco-app/src/util/idle-callback"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,a;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var l=arguments.length,p=new Array(l),d=0;d<l;d++)p[d]=arguments[d]
return n=this,a=(e=i(u)).call.apply(e,[this].concat(p)),t=!a||"object"!==r(a)&&"function"!=typeof a?s(n):a,c(s(t),"state",{opening:!1,x:0,y:0}),c(s(t),"reposition",(0,o.debounceIdleCallback)(function(){var e={opening:!1},n=t.menuRef.getBoundingClientRect(),o=n.width,r=n.height,a=n.right,i=n.bottom
a>window.innerWidth-t.props.minOffset&&(e.x=t.state.x-o),i>window.innerHeight&&(e.y=Math.max(t.props.minOffset,window.innerHeight-(r+t.props.minOffset))),t.props.onOpenMenu(),t.setState(e)})),c(s(t),"onContextMenu",function(e){var n=e.clientX,o=e.clientY,r=e.target,a=e.ctrlKey,i=e.metaKey,s=a||i
if(!t.menuRef||r!==t.menuRef&&!s&&!t.menuRef.contains(r)){var l=t.findClosestTarget(r)
if(l)return t.props.onNewTarget(l.getAttribute(t.props.targetAttribute),l),e.preventDefault(),t.setState({opening:!0,x:Math.max(t.props.minOffset,n),y:Math.max(t.props.minOffset,o)}),t.isOpening=!0,!1}}),c(s(t),"onWindowBlur",function(){t.props.open&&t.props.onCloseMenu()}),c(s(t),"onMouseUp",function(e){!t.props.open||t.isOpening||t.menuRef&&(e.target===t.menuRef||t.menuRef.contains(e.target))||t.props.onCloseMenu(),t.isOpening&&(t.isOpening=!1)}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.Component),p=u,(d=[{key:"componentDidMount",value:function(){window.addEventListener("contextmenu",this.onContextMenu),window.document.body.addEventListener("mouseup",this.onMouseUp,!0),window.addEventListener("blur",this.onWindowBlur)}},{key:"componentDidUpdate",value:function(e,t){this.state.opening&&!t.opening&&this.reposition()}},{key:"componentWillUnmount",value:function(){this.reposition.cancel(),window.removeEventListener("contextmenu",this.onContextMenu),window.document.body.removeEventListener("mouseup",this.onMouseUp,!0),window.removeEventListener("blur",this.onWindowBlur)}},{key:"getStyleAttribute",value:function(){var e={left:this.state.x,top:this.state.y}
return this.props.open||this.state.opening||(e.display="none"),this.state.opening&&(e.visibility="hidden"),e}},{key:"findClosestTarget",value:function(e){return e.hasAttribute(this.props.targetAttribute)?e:e.closest("[".concat(this.props.targetAttribute,"]"))}},{key:"render",value:function(){var e=this,o=t.default.createElement("div",{ref:function(t){return e.menuRef=t},className:"cs-context-menu",style:this.getStyleAttribute()},this.props.children)
return n.default.createPortal(o,window.document.body)}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{minOffset:15,inset:5,validateTarget:function(){}})}),define("tco-app/src/components/common/DynamicContent",["exports","react","react-redux","classnames","lodash","fuzzysort","moment","tco-app/src/components/common/Picker","tco-app/src/components/common/Icon","tco-app/src/components/forms/Select","tco-app/src/components/common/ScrollBox","tco-app/src/lib/http"],function(e,t,n,o,r,a,i,s,l,c,u,p){function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?y(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var x=(0,r.memoize)(function(e,t){return(0,p.requestOne)("dynamic-options::lookup",Object.assign({type:e},t||{}))},function(e,t){return"".concat(e,":").concat(JSON.stringify(t))}),k=[{value:"",label:"Global Format"},{value:"g:i a",label:"5:25 pm"},{value:"g:i A",label:"5:25 PM"},{value:"H:i",label:"17:25"},{value:"custom",label:"Custom Format"}],S=[{value:"",label:"Global Format"}].concat(O(["F j, Y","Y-m-d","m/d/Y","d/m/Y"].map(function(e){return{value:e,label:function(){return(0,i.default)().formatPHP(e)}}})),[{value:"custom",label:"Custom Format"}]),P=function(e){function n(){var e,t
m(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return E(y(t=v(this,(e=b(n)).call.apply(e,[this].concat(r)))),"state",{dynamicOptions:null,hideSelect:!1,loading:!1,isCustom:!1}),E(y(t),"onChange",function(e){var n="custom"===e
t.setState({isCustom:n}),t.props.onUpdate(n?"":"_dc::default"===e?"":e)}),t}return _(n,t.default.Component),g(n,[{key:"componentDidMount",value:function(){this.loadDynamicOptions()}},{key:"componentDidUpdate",value:function(e){e.options.choices!==this.props.options.choices&&this.loadDynamicOptions()}},{key:"componentWillUnmount",value:function(){this.cancelAjax=!0}},{key:"loadDynamicOptions",value:function(){var e=this,t=this.props.options.choices
if("string"==typeof t&&0===t.indexOf("dynamic:")){var n=t.replace("dynamic:","")
this.setState({dynamicOptions:[],loading:!0}),x(n,{context:this.props.context||null}).then(function(t){if(!e.cancelAjax){var n=!!(t.length<=0&&e.props.options.customLabel)
e.setState({isCustom:n,hideSelect:n,dynamicOptions:e.normalizeOptions(t,!0),loading:!1})}})}}},{key:"getOptionSource",value:function(){if(this.state.dynamicOptions)return this.state.dynamicOptions
var e="function"==typeof this.props.options.choices?this.props.options.choices():this.props.options.choices
return Array.isArray(e)?e.map(function(e){var t=e.value,n=e.label
return{value:t||"_dc::default",label:"function"==typeof n?n():n}}):[]}},{key:"normalizeOptions",value:function(e,t){var n=t||e.length<=0?[{value:"_dc::default",label:"Select"}].concat(O(e)):O(e)
return this.props.options.customLabel&&(n=[].concat(O(n),[{value:"custom",label:this.props.options.customLabel}])),n}},{key:"getTransformedOptions",value:function(){if(this.state.dynamicOptions)return this.state.dynamicOptions
var e="function"==typeof this.props.options.choices?this.props.options.choices():this.props.options.choices
return this.normalizeOptions(Array.isArray(e)?e.map(function(e){var t=e.value,n=e.label
return{value:t||"_dc::default",label:"function"==typeof n?n():n}}):[])}},{key:"render",value:function(){var e=this,n=this.getTransformedOptions()
return t.default.createElement(t.default.Fragment,null,!this.state.hideSelect&&t.default.createElement(c.default,{disabled:this.state.hideSelect,placeholder:this.state.loading?"Loading…":"Select",value:this.state.isCustom?"custom":this.props.value||"_dc::default",onChange:this.onChange,options:n}),(this.state.isCustom||this.state.hideSelect)&&t.default.createElement("input",{type:"text",value:this.props.value,placeholder:this.props.options.placeholder||"",onChange:function(t){return e.props.onUpdate(t.target.value)}}))}}]),n}()
E(P,"defaultProps",{context:{}})
var C={text:function(e){var n=e.value,o=e.options,r=void 0===o?{}:o,a=e.onUpdate
return t.default.createElement("input",{type:"text",value:n,placeholder:r.placeholder||"",onChange:function(e){return a(e.target.value)}})},select:P},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
return Object.keys(e).reduce(function(t,n){return e[n]&&(t+="".concat(n,'="').concat(function(e){return e.replace(new RegExp(/"/g),'\\"').replace(new RegExp(/&quot;/g),"\\&quot;")}(e[n]),'" ')),t}," ")},T=function(e,t){return"{{dc:".concat(e).concat(j(t).trimRight(),"}}")},M=(0,r.memoize)(function(){var e=window.csAppData.dynamicContentFields,t=function(e){return e.reduce(function(e,t){"string"==typeof t&&(t=function(e){return"post"===e?{key:"post",type:"select",label:"Post",options:{choices:[{value:"",label:"Current Post"},{value:"next",label:"Next Post"},{value:"prev",label:"Previous Post"},{value:"custom",label:"Specific Post"}],placeholder:"Enter Post ID"}}:"user"===e?{key:"user",type:"select",label:"User",options:{choices:[{value:"",label:"Current User"},{value:"author",label:"Author"},{value:"custom",label:"Specific User"}],placeholder:"Enter User ID"}}:"date-format"===e?{key:"format",type:"select",label:"Date Format",options:{choices:function(){return S},placeholder:"Y m d"}}:"time-format"===e?{key:"format",type:"select",label:"Time Format",options:{choices:function(){return k},placeholder:"h:i:s"}}:"term"===e?{key:"term",type:"select",label:"Term",options:{choices:[{value:"",label:"Current Category"},{value:"custom",label:"Specific Term"}],placeholder:"Enter Term ID"}}:"product"===e?{key:"product",type:"select",label:"Product",options:{choices:[{value:"",label:"Current Product"},{value:"custom",label:"Specific Product"}],placeholder:"Enter Product ID"}}:"usermeta"===e?{key:"key",type:"select",label:"Meta",options:{customLabel:"Custom Key",choices:"dynamic:usermeta",placeholder:"Enter Meta Key"}}:"postmeta"===e?{key:"key",type:"select",label:"Meta",options:{customLabel:"Custom Key",choices:"dynamic:postmeta",placeholder:"Enter Meta Key"}}:"acf-option-field"===e?{key:"field",type:"select",label:"Field",options:{customLabel:"Specific Field",choices:"dynamic:acf_option_fields",placeholder:"Enter Field Key"}}:"acf-field"===e?{key:"field",type:"select",label:"Field",options:{customLabel:"Specific Field",choices:"dynamic:acf",placeholder:"Enter Field Key"}}:"toolset-field"===e?{key:"field",type:"select",label:"Field",options:{customLabel:"Specific Field",choices:"dynamic:toolset",placeholder:"Enter Field Key"}}:{}}(t))
var n=t,o=n.type,r=n.key,a=n.label,i=void 0===a?"":a,s=n.options,l=void 0===s?{}:s
return C[o]&&r&&e.push({type:o,key:r,label:i,options:l}),e},[])},n=[],o={}
Object.keys(e.fields).forEach(function(r){var a=e.fields[r],i=a.label,s=void 0===i?"":i,l=a.options,c=void 0===l?{}:l,u=a.controls,p=void 0===u?[]:u,f=d(r.split(":"),2),m=f[0],h=f[1]
if(h&&m){var g=(e.groups[m]||{}).label||""
o[r]={name:h,key:r,label:s,options:c,group:m,groupLabel:g,controls:t(p)},n.push({key:r,index:"".concat(g," ").concat(s)})}return o},[])
var r=Object.keys(e.groups).map(function(t){return Object.assign(e.groups[t],{name:t})})
return{fields:o,groups:r,index:n}}),D=function(e){function n(){var e,t
m(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return E(y(t=v(this,(e=b(n)).call.apply(e,[this].concat(r)))),"state",{}),E(y(t),"onInsert",function(){return t.props.onInsert(t.props.field.key,t.state)}),E(y(t),"updateState",function(e,n){return t.setState(E({},e,n))}),t}return _(n,t.default.PureComponent),g(n,[{key:"renderControl",value:function(e){var n=this,o=e.key,r=e.type,a=e.options,i=C[r]
return t.default.createElement(i,{value:this.state[o]||"",options:a,context:this.props.context,onUpdate:function(e){return n.updateState(o,e)}})}},{key:"render",value:function(){var e=this,n=this.props.field,o=n.key,r=n.label,a=n.groupLabel,i=n.controls,s=void 0===i?[]:i
return t.default.createElement(t.default.Fragment,null,t.default.createElement("header",null,t.default.createElement("button",{className:"cs-dynamic-content-back",onClick:this.props.onGoBack},t.default.createElement("span",null,t.default.createElement(l.default,{icon:"fa-arrow-alt-left-fas"}))),t.default.createElement("span",{className:"cs-dynamic-content-title"},"".concat(a,": ").concat(r))),t.default.createElement("div",{className:"cs-dynamic-content-section-content"},t.default.createElement(u.default,null,t.default.createElement("ul",{className:"cs-dynamic-content-control-list"},s.map(function(n){var o=n.key,r=n.label,a=n.type,i=n.options
return t.default.createElement("li",{key:o},t.default.createElement("label",null,r),e.renderControl({key:o,type:a,options:i}))})))),t.default.createElement("footer",null,t.default.createElement("input",{className:"cs-dynamic-content-preview",value:T(o,this.state),readOnly:!0}),t.default.createElement("button",{className:"cs-dynamic-content-insert",onClick:this.onInsert},t.default.createElement("span",null,t.default.createElement(l.default,{icon:"fa-plus"})))))}}]),n}()
E(D,"defaultProps",{context:{}})
var A=function(e){function n(){var e,t
m(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return E(y(t=v(this,(e=b(n)).call.apply(e,[this].concat(r)))),"state",{open:!1,customizing:null,searchQuery:""}),E(y(t),"customizeOutput",function(e){return t.setState({customizing:e})}),E(y(t),"goBack",function(){return t.setState({customizing:null})}),E(y(t),"insertDC",function(e,n){t.props.onInsert(T(e,n)),t.setState({open:!1,customizing:null})}),E(y(t),"updateSearchQuery",function(e){var n=e.target.value,o=n?t.search(n):null
t.setState({searchQuery:n,searchResults:o})}),E(y(t),"togglePicker",function(e){t.setState({open:e,searchQuery:"",searchResults:null})}),t}return _(n,t.default.PureComponent),g(n,[{key:"search",value:function(e){return a.default.go(e,M().index,{keys:["index"]}).map(function(e){return e.obj.key})}},{key:"componentDidUpdate",value:function(){this.searchRef&&this.state.open&&!this.state.customizing&&this.searchRef.focus()}},{key:"renderExtraTags",value:function(){return null}},{key:"renderGroups",value:function(){var e=this,n=M(),o=n.fields,r=n.groups,a=Object.keys(o).filter(function(t){return!e.props.imageOnly||o[t].options.supports&&o[t].options.supports.includes("image")}).filter(function(t){return!e.state.searchResults||e.state.searchResults.includes(t)}).map(function(e){return{key:e,group:e.split(":")[0]}}),i=a.map(function(e){return e.group})
return r.filter(function(e){var t=e.name
return i.includes(t)}).map(function(n){var r=n.name,i=n.label
return t.default.createElement("li",{key:r},t.default.createElement("strong",null,i),t.default.createElement("ul",null,a.filter(function(e){var t=e.group
return r===t}).map(function(n){var r=n.key,a=o[r],i=a.label,s=a.controls,c=a.options
return t.default.createElement("li",{key:r},t.default.createElement("button",{onClick:function(){return c.always_customize?e.customizeOutput(r):e.insertDC(r)},type:"button"},t.default.createElement("span",null,t.default.createElement("b",null,i))),s&&s.length>0&&t.default.createElement("button",{onClick:function(t){t.stopPropagation(),e.customizeOutput(r)},type:"button"},t.default.createElement("span",null,t.default.createElement(l.default,{icon:"fa-cog-far"}))))})))})}},{key:"render",value:function(){var e=this
return t.default.createElement(s.default,{class:"cs-dynamic-content-picker is-".concat(this.props.mode),open:this.state.open,swatchTag:"button",modalParentSelector:this.props.modalParentSelector,swatchClass:"cs-dynamic-content-swatch",content:t.default.createElement(l.default,{icon:"add-dynamic-content"}),onToggle:this.togglePicker},t.default.createElement("div",{className:"cs-dynamic-content cs-forms"},t.default.createElement("section",{className:"cs-dynamic-content-section is-primary"},t.default.createElement("header",null,t.default.createElement("input",{ref:function(t){return e.searchRef=t},className:"cs-dynamic-content-search",type:"search",placeholder:"Search…",value:this.state.searchQuery,onChange:this.updateSearchQuery})),t.default.createElement("div",{className:"cs-dynamic-content-section-content"},t.default.createElement(u.default,null,t.default.createElement("ul",{className:"cs-dynamic-content-list"},this.renderExtraTags(),this.renderGroups())))),t.default.createElement("section",{className:(0,o.default)("cs-dynamic-content-section is-secondary",{"is-active":this.state.customizing})},this.state.customizing&&t.default.createElement(D,{context:this.props.context,onGoBack:this.goBack,field:M().fields[this.state.customizing]||{},onInsert:this.insertDC}))))}}]),n}()
E(A,"defaultProps",{value:null,context:{},mode:"inline",imageOnly:!1,modalParentSelector:".cs-app",onUpdate:function(){}})
var I=(0,n.connect)(function(e){return{context:e.builder.renderContext}})(A)
e.default=I}),define("tco-app/src/components/common/DynamicContentInput",["exports","react","tco-app/src/components/common/DynamicContent","tco-app/src/components/forms/DateTime"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var a=arguments.length,l=new Array(a),p=0;p<a;p++)l[p]=arguments[p]
return n=this,o=(e=i(u)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"state",{selectionStart:null,selectionEnd:null}),c(s(t),"updateSelection",function(e){var n=e.target,o=n.selectionStart,r=n.selectionEnd
t.setState({selectionStart:o,selectionEnd:r})}),c(s(t),"onInputChange",function(e){return t.props.onUpdate(e.target.value)}),c(s(t),"onDcInsert",function(e){var n="".concat(t.props.value),o=null===t.state.selectionStart?n.length:t.state.selectionStart,r=null===t.state.selectionEnd?n.length:t.state.selectionEnd,a=n.substr(0,o),i=n.substring(r)
t.focusIndex=a.length+e.length,t.props.onUpdate("".concat(a).concat(e).concat(i))}),c(s(t),"onDateTimeChange",function(e){return t.props.onUpdate(e)}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.Component),p=u,(d=[{key:"moveCursorToIndex",value:function(e){if(this.inputRef)try{this.inputRef.focus(),this.inputRef.setSelectionRange(e,e)}catch(t){}}},{key:"componentDidUpdate",value:function(e){this.props.value===e.value||null===this.focusIndex||isNaN(this.focusIndex)||(this.moveCursorToIndex(this.focusIndex),this.focusIndex=null)}},{key:"renderDateInput",value:function(){var e=this.props,n=e.placeholder,r=e.value,a=e.className
return t.default.createElement(o.default,{className:a,options:this.props.dateTimeOptions,value:r,onChange:this.onDateTimeChange,placeholder:n})}},{key:"renderTextInput",value:function(){var e=this,n=this.props,o=n.placeholder,r=n.value,a=n.className
return t.default.createElement("input",{ref:function(t){return e.inputRef=t},className:a,type:"text",value:r,placeholder:o,onChange:this.onInputChange,onFocus:this.updateSelection,onMouseUp:this.updateSelection,onKeyUp:this.updateSelection})}},{key:"render",value:function(){var e="date"===this.props.type?this.renderDateInput():this.renderTextInput()
return this.props.enabled?t.default.createElement("div",{className:"cs-input-button-wrapper"},e,t.default.createElement(n.default,{extraTags:this.props.extraTags,onInsert:this.onDcInsert})):e}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{type:"text",placeholder:""})}),define("tco-app/src/components/common/ElementIcon",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r(this,a(n).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,t.default.PureComponent),l=n,(c=[{key:"render",value:function(){var e,n,o,r=this.props.icon,a=void 0===r?"":r
if(!a)return t.default.createElement("svg",{role:"img",className:"cs-svg-elements"},t.default.createElement("use",{xlinkHref:"".concat(window.csAppData.iconMaps.elements,"#undefined")}))
if(a.match(/<svg /))return e=s(a.match(/<svg.*?(?:viewBox="(.*?)").*?>([\S\s]+)<\/svg>/),3),n=e[1],o=e[2],t.default.createElement("svg",{role:"img",viewBox:n,className:"cs-svg-elements",dangerouslySetInnerHTML:{__html:o||""}})
var i=a.split("/")
if(i.length<=1)return null
var l=i[0]
return i.shift(),window.csAppData.iconMaps&&window.csAppData.iconMaps[l]?t.default.createElement("svg",{role:"img",className:"cs-svg-elements"},t.default.createElement("use",{xlinkHref:"".concat(window.csAppData.iconMaps[l],"#").concat(i.join("-"))})):null}}])&&o(l.prototype,c),u&&o(l,u),n}()
e.default=l}),define("tco-app/src/components/common/ErrorBoundary",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function l(){var e,t,o,i;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,l)
for(var c=arguments.length,u=new Array(c),p=0;p<c;p++)u[p]=arguments[p]
return o=this,t=!(i=(e=r(l)).call.apply(e,[this].concat(u)))||"object"!==n(i)&&"function"!=typeof i?a(o):i,s(a(t),"state",{hasError:!1,error:null}),t}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(l,t.default.Component),c=l,p=[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0,error:e}}}],(u=[{key:"componentDidCatch",value:function(e,t){this.props.logError(e,t)}},{key:"render",value:function(){return this.state.hasError?this.props.renderFallback(this.state):this.props.children}}])&&o(c.prototype,u),p&&o(c,p),l}()
e.default=l,s(l,"defaultProps",{renderFallback:function(){return null},logError:function(e,t){return console.warn(e,t)}})}),define("tco-app/src/components/common/Expander",["exports","react","react-dom","classnames","tco-app/src/lib/i18n"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?p(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ExpanderContent=void 0
var h=function(e){function n(){var e,t
i(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return m(p(t=c(this,(e=u(n)).call.apply(e,[this].concat(r)))),"onRemoteToggle",function(e){t.props.active!==e.detail.open&&t.props.onToggle(e.detail.open)}),m(p(t),"closeOnOutsideFocus",function(e){var n=!t.modalRef.contains(e.target)&&!t.props.swatch.contains(e.target),o=!!e.target.closest(".media-modal.wp-core-ui"),r=!!e.target.closest("#wp-link-wrap"),a=!!e.target.closest(".mce-container"),i=!!e.target.closest(".cs-popover-fixed"),s=!!e.target.closest(".cs-picker-modal"),l=!!e.target.closest(".wplink-autocomplete")
if(n&&!o&&!r&&!a&&!i&&!s&&!l){var c=!1
try{c=t.didMove&&window.getSelection().toString()}catch(e){}c||t.props.onToggle(!1)}}),m(p(t),"onMouseMove",function(e){t.didMove=!0,window.document.body.removeEventListener("mousemove",t.onMouseMove)}),m(p(t),"onMouseUp",function(e){t.closeOnOutsideFocus(e),window.document.body.removeEventListener("mousemove",t.onMouseMove)}),m(p(t),"onMouseDown",function(e){window.document.body.addEventListener("mousemove",t.onMouseMove),t.didMove=!1}),t}return d(n,t.default.PureComponent),l(n,[{key:"componentDidMount",value:function(){if(this.props.closeOnFocusLoss&&(window.document.body.addEventListener("mouseup",this.onMouseUp),window.document.body.addEventListener("mousedown",this.onMouseDown),window.document.body.addEventListener("focus",this.closeOnOutsideFocus),this.focusEventsAdded=!0),this.modalRef.addEventListener("cs-expander-toggle",this.onRemoteToggle),this.props.focusSelector){var e=this.modalRef.querySelector(this.props.focusSelector)
e&&e.focus()}}},{key:"componentWillUnmount",value:function(){this.focusEventsAdded&&(window.document.body.removeEventListener("mouseup",this.onMouseUp),window.document.body.removeEventListener("mousedown",this.onMouseDown),window.document.body.removeEventListener("focus",this.closeOnOutsideFocus),this.focusEventsAdded=!1)}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:(0,o.default)("cs-workspace-expander-content","cs-workspace-expander-content-".concat(this.props.orientation),this.props.class,{"cs-expanded":this.props.expanded,"cs-active":this.props.active}),ref:function(t){return e.modalRef=t}},t.default.createElement("div",{className:"cs-workspace-expander-head"},this.props.actionsBefore&&t.default.createElement("div",{className:"cs-workspace-expander-head-actions"},this.props.actionsBefore),this.props.label&&t.default.createElement("div",{className:"cs-workspace-expander-head-label"},t.default.createElement("span",null,this.props.label)),t.default.createElement("div",{className:"cs-workspace-expander-head-actions"},this.props.actionsAfter,t.default.createElement("button",{className:"cs-close",onClick:function(){return e.props.onToggle(!1)}},t.default.createElement("span",{className:"cs-visually-hidden"},(0,r.t)("app.a11y.close"))),this.props.canExpandFull&&t.default.createElement(t.default.Fragment,null,t.default.createElement("button",{className:"cs-expand",onClick:function(){return e.props.onToggleExpand(!0)}},t.default.createElement("span",{className:"cs-visually-hidden"},(0,r.t)("app.a11y.expand"))),t.default.createElement("button",{className:"cs-collapse",onClick:function(){return e.props.onToggleExpand(!1)}},t.default.createElement("span",{className:"cs-visually-hidden"},(0,r.t)("app.a11y.collapse")))))),t.default.createElement("div",{className:"cs-workspace-expander-body"},this.props.showContent&&this.props.children))}}]),n}()
e.ExpanderContent=h,m(h,"defaultProps",{active:!1,swatch:null,orientation:"vertical",expanded:!1,actionsBefore:null,actionsAfter:null,label:"",class:"",focusSelector:null,canExpandFull:!0,onToggle:function(){},onToggleExpand:function(){},closeOnFocusLoss:!0})
var g=function(e){function r(){var e
return i(this,r),(e=c(this,u(r).apply(this,arguments))).state={container:null,canShowContent:!1,expanded:!1},e}return d(r,t.default.PureComponent),l(r,[{key:"componentDidMount",value:function(){this.setState({canShowContent:!!this.props.open,container:document.querySelector(this.props.modalParentSelector)})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.transitionTimer)}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.props.open
e.open!==n&&(clearTimeout(this.transitionTimer),n?(this.state.canShowContent||this.setState({canShowContent:!0}),this.props.closeOtherExpanders):this.state.canShowContent&&(this.transitionTimer=setTimeout(function(){t.setState({canShowContent:!1})},this.props.transitionTime)))}},{key:"renderModalContent",value:function(){var e=this
return t.default.createElement(h,{class:this.props.expanderClass,showContent:this.state.canShowContent,expanded:this.state.expanded,orientation:this.props.orientation,swatch:this.swatchRef,onToggle:this.props.onToggle,focusSelector:this.props.focusSelector,actionsBefore:this.props.headerActionsBefore,label:this.props.headerLabel,canExpandFull:this.props.canExpandFull,active:this.props.open,onToggleExpand:function(t){return e.setState({expanded:t})},closeOnFocusLoss:this.props.closeOnFocusLoss,closeOtherExpanders:this.props.closeOtherExpanders},this.props.children)}},{key:"render",value:function(){var e=this,r=this.state.container&&this.state.container.nodeType?n.default.createPortal(this.renderModalContent(),this.state.container):null
return t.default.createElement("div",{className:(0,o.default)("cs-workspace-expander",{"cs-active":this.props.open,"no-preview":!this.props.showContentPreview},this.props.class)},this.props.hasToggle&&t.default.createElement("div",{className:"cs-workspace-expander-toggle",tabIndex:"-1",onClick:function(){return e.props.onToggle(!e.props.open)},ref:function(t){return e.swatchRef=t}},this.props.label&&t.default.createElement("span",{dangerouslySetInnerHTML:{__html:this.props.label}}),this.props.content),r)}}]),r}()
e.default=g,m(g,"defaultProps",{label:"",showContentPreview:!1,class:"",content:null,modalParentSelector:".cs-app",expanderClass:"",orientation:"vertical",open:!1,focusSelector:null,hasToggle:!0,headerActionsBefore:null,headerLabel:null,headerActions:[],canExpandFull:!0,onToggleExpand:function(){},expanded:!1,transitionTime:500,closeOnFocusLoss:!0,closeOtherExpanders:!0})}),define("tco-app/src/components/common/FaIcon",["exports","react","lodash"],function(e,t,n){function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:font-awesome")}),a=(0,n.memoize)(function(e){return r().resolveIcon(e)}),i=(0,n.memoize)(function(e){return r().resolveIconPrefix(e)}),s=function(e){var n=e.icon,r=a(n),s=i(n),l=window.csAppData.font_awesome.icons[r],c={far:"data-cs-icon-o",fas:"data-cs-icon-s",fal:"data-cs-icon-l",fab:"data-cs-icon-b"}[s]||"data-cs-icon"
if(!l||!c)return null
var u,p,d,f=(u={},p=c,d=String.fromCharCode("0x"+l),p in u?Object.defineProperty(u,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[p]=d,u)
return t.default.createElement("i",o({className:"cs-fa"},f))}
e.default=s}),define("tco-app/src/components/common/HelpTextBlock",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var s,l,c,u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r(this,a(n).apply(this,arguments))}var s,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,t.default.PureComponent),s=n,(l=[{key:"render",value:function(){var e=this.props,n=e.title,o=e.message
return t.default.createElement("div",{className:"cs-help-text"},n&&t.default.createElement("h4",null,n),t.default.createElement("p",null,o,this.props.children))}}])&&o(s.prototype,l),c&&o(s,c),n}()
e.default=u,c={title:null,message:null},(l="defaultProps")in(s=u)?Object.defineProperty(s,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):s[l]=c}),define("tco-app/src/components/common/Icon",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var s=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r(this,a(n).apply(this,arguments))}var s,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,t.default.PureComponent),s=n,(l=[{key:"render",value:function(){var e=this.props.icon
return window.csAppData.iconMaps&&window.csAppData.iconMaps.ui?t.default.createElement("svg",{role:"img",className:"cs-svg-ui"},t.default.createElement("use",{xlinkHref:"".concat(window.csAppData.iconMaps.ui,"#").concat(e)})):null}}])&&o(s.prototype,l),c&&o(s,c),n}()
e.default=s}),define("tco-app/src/components/common/LayoutPresets",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.Component),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:"cs-layout-presets"},t.default.createElement("div",{className:"cs-layout-presets-inner"},this.props.presets.map(function(o){return t.default.createElement("a",{key:"cs-layout-preset-".concat(o),role:"button",className:(0,n.default)({"cs-layout-preset":!0,"is-active":o===e.props.active}),onClick:function(t){return e.props.onClick(o,t)}},t.default.createElement("span",null,o),o.split(" ").map(function(e,n){return t.default.createElement("i",{key:n,style:{flexBasis:e}})}))}),this.props.children))}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l,l.defaultProps={presets:window.csAppData.rowPresets,active:null,showCustom:!1,onClick:function(){}}}),define("tco-app/src/components/common/LayoutPresetsGrid",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c={"option-01":{title:"2 Columns",previewCellCount:4,template:'{"layout_grid_template_columns_xl":"1fr 1fr","_type":"layout-grid","_modules":[{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-02":{title:"3 Columns",previewCellCount:6,template:'{"layout_grid_template_columns_lg":"1fr 1fr 1fr","layout_grid_template_columns_xl":"1fr 1fr 1fr","_type":"layout-grid","_modules":[{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-03":{title:"4 Columns",previewCellCount:8,template:'{"layout_grid_template_columns_sm":"1fr 1fr","layout_grid_template_columns_lg":"1fr 1fr 1fr 1fr","_type":"layout-grid","_modules":[{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-04":{title:"Domino (2fr 1fr)",previewCellCount:3,template:'{"layout_grid_template_columns_lg":"2fr 1fr","layout_grid_template_columns_xl":"2fr 1fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_md":"1","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-05":{title:"Domino (1fr 2fr)",previewCellCount:3,template:'{"layout_grid_template_columns_lg":"1fr 2fr","layout_grid_template_columns_xl":"1fr 2fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_md":"1","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-06":{title:"Domino (2fr 1fr 1fr)",previewCellCount:5,template:'{"layout_grid_template_columns_lg":"2fr 1fr 1fr","layout_grid_template_columns_xl":"2fr 1fr 1fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_md":"1","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-07":{title:"Domino (1fr 1fr 2fr)",previewCellCount:5,template:'{"layout_grid_template_columns_lg":"1fr 1fr 2fr","layout_grid_template_columns_xl":"1fr 1fr 2fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_md":"1","layout_cell_column_start_lg":"3","layout_cell_column_start_xl":"3","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-08":{title:"Cell Overlap (Standard)",previewCellCount:2,template:'{"layout_grid_template_columns_xs":"1rem 1fr 1rem","layout_grid_template_columns_sm":"2rem 1fr 2rem","layout_grid_template_columns_md":"1fr 4rem 1fr","layout_grid_template_columns_lg":"1fr 4rem 1fr","layout_grid_template_columns_xl":"1fr 4rem 1fr","layout_grid_template_rows_xs":"auto 2rem auto","layout_grid_template_rows_sm":"auto 2rem auto","layout_grid_template_rows_md":"4rem 1fr 4rem","layout_grid_template_rows_lg":"4rem 1fr 4rem","layout_grid_template_rows_xl":"4rem 1fr 4rem","_type":"layout-grid","_modules":[{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"1","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_xs":"3","layout_cell_column_end_sm":"3","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_xs":"1","layout_cell_row_start_sm":"1","layout_cell_row_start_md":"1","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_xs":"3","layout_cell_row_end_sm":"3","layout_cell_row_end_md":"4","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","layout_cell_bg_color":"rgba(0, 0, 0, 0.1)","_type":"layout-cell"},{"layout_cell_column_start_xs":"2","layout_cell_column_start_sm":"2","layout_cell_column_start_md":"2","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_column_end_md":"4","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_xs":"2","layout_cell_row_start_sm":"2","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_xs":"4","layout_cell_row_end_sm":"4","layout_cell_row_end_md":"3","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","layout_cell_bg_color":"rgba(0, 0, 0, 0.1)","_type":"layout-cell"}]}'},"option-09":{title:"Cell Overlap (Reversed)",previewCellCount:2,template:'{"layout_grid_template_columns_xs":"1rem 1fr 1rem","layout_grid_template_columns_sm":"2rem 1fr 2rem","layout_grid_template_columns_md":"1fr 4rem 1fr","layout_grid_template_columns_lg":"1fr 4rem 1fr","layout_grid_template_columns_xl":"1fr 4rem 1fr","layout_grid_template_rows_xs":"auto 2rem auto","layout_grid_template_rows_sm":"auto 2rem auto","layout_grid_template_rows_md":"4rem 1fr 4rem","layout_grid_template_rows_lg":"4rem 1fr 4rem","layout_grid_template_rows_xl":"4rem 1fr 4rem","_type":"layout-grid","_modules":[{"layout_cell_column_start_xs":"2","layout_cell_column_start_sm":"2","layout_cell_column_start_md":"2","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_column_end_md":"4","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_xs":"1","layout_cell_row_start_sm":"1","layout_cell_row_start_md":"1","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_xs":"3","layout_cell_row_end_sm":"3","layout_cell_row_end_md":"4","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","layout_cell_bg_color":"rgba(0, 0, 0, 0.1)","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"1","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_xs":"3","layout_cell_column_end_sm":"3","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_xs":"2","layout_cell_row_start_sm":"2","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_xs":"4","layout_cell_row_end_sm":"4","layout_cell_row_end_md":"3","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","layout_cell_bg_color":"rgba(0, 0, 0, 0.1)","_type":"layout-cell"}]}'},"option-10":{title:"Minmax (Fill Space)",previewCellCount:6,template:'{"layout_grid_template_columns_xs":"repeat(auto-fit, minmax(16rem, 1fr))","layout_grid_template_columns_sm":"repeat(auto-fit, minmax(16rem, 1fr))","layout_grid_template_columns_md":"repeat(auto-fit, minmax(16rem, 1fr))","layout_grid_template_columns_lg":"repeat(auto-fit, minmax(16rem, 1fr))","layout_grid_template_columns_xl":"repeat(auto-fit, minmax(16rem, 1fr))","_type":"layout-grid","_modules":[{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-11":{title:"Minmax (Max Width)",previewCellCount:6,template:'{"layout_grid_template_columns_xs":"repeat(auto-fit, minmax(16rem, 16rem))","layout_grid_template_columns_sm":"repeat(auto-fit, minmax(16rem, 16rem))","layout_grid_template_columns_md":"repeat(auto-fit, minmax(16rem, 16rem))","layout_grid_template_columns_lg":"repeat(auto-fit, minmax(16rem, 16rem))","layout_grid_template_columns_xl":"repeat(auto-fit, minmax(16rem, 16rem))","layout_grid_justify_content":"space-evenly","_type":"layout-grid","_modules":[{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"},{"_type":"layout-cell"}]}'},"option-12":{title:"Offset Masonry",previewCellCount:9,template:'{"layout_grid_template_columns_xs":"1rem 1fr 1rem","layout_grid_template_columns_sm":"5rem 1fr 5rem","layout_grid_template_columns_lg":"1fr 1fr 1fr","layout_grid_template_columns_xl":"1fr 1fr 1fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_end_xs":"span 2","layout_cell_column_end_sm":"span 2","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"span 2","layout_cell_column_start_sm":"span 2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_row_start_md":"1","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_end_xs":"span 2","layout_cell_column_end_sm":"span 2","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"span 2","layout_cell_column_start_sm":"span 2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_end_xs":"span 2","layout_cell_column_end_sm":"span 2","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"span 2","layout_cell_column_start_sm":"span 2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_end_xs":"span 2","layout_cell_column_end_sm":"span 2","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"span 2","layout_cell_column_start_sm":"span 2","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"4","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_end_xs":"span 2","layout_cell_column_end_sm":"span 2","layout_cell_row_start_md":"auto","layout_cell_row_start_lg":"auto","layout_cell_row_start_xl":"auto","layout_cell_row_end_md":"span 2","layout_cell_row_end_lg":"span 3","layout_cell_row_end_xl":"span 3","_type":"layout-cell"}]}'},"option-13":{title:"Pyramid",previewCellCount:6,template:'{"layout_grid_template_columns_lg":"repeat(6, 1fr)","layout_grid_template_columns_xl":"repeat(6, 1fr)","_type":"layout-grid","_modules":[{"layout_cell_column_start_lg":"3","layout_cell_column_start_xl":"3","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","_type":"layout-cell"},{"layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_lg":"6","layout_cell_column_end_xl":"6","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"},{"layout_cell_column_start_lg":"3","layout_cell_column_start_xl":"3","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"},{"layout_cell_column_start_lg":"5","layout_cell_column_start_xl":"5","layout_cell_column_end_lg":"7","layout_cell_column_end_xl":"7","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"}]}'},"option-14":{title:"Board Game",previewCellCount:13,template:'{"layout_grid_template_columns_sm":"1fr 1fr","layout_grid_template_columns_lg":"1fr 1fr 1fr 1fr","_type":"layout-grid","_modules":[{"layout_cell_column_start_sm":"1","layout_cell_column_start_md":"1","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_sm":"-1","layout_cell_column_end_md":"-1","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"},{"layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","_type":"layout-cell"},{"layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","_type":"layout-cell"},{"layout_cell_column_start_lg":"3","layout_cell_column_start_xl":"3","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","_type":"layout-cell"},{"layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","_type":"layout-cell"},{"layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"},{"layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","_type":"layout-cell"},{"layout_cell_column_start_lg":"3","layout_cell_column_start_xl":"3","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","_type":"layout-cell"},{"layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","_type":"layout-cell"},{"layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","_type":"layout-cell"},{"layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","_type":"layout-cell"},{"layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"}]}'},"option-15":{title:"Mosaic",previewCellCount:9,template:'{"layout_grid_template_columns_xs":"repeat(4, 1fr)","layout_grid_template_columns_sm":"repeat(6, 1fr)","layout_grid_template_columns_md":"repeat(6, 1fr)","layout_grid_template_columns_lg":"repeat(8, 1fr)","layout_grid_template_columns_xl":"repeat(8, 1fr)","layout_grid_template_rows_xs":"repeat(6, minmax(min-content, calc(100vw / 4)))","layout_grid_template_rows_sm":"repeat(6, minmax(min-content, calc(100vw / 6)))","layout_grid_template_rows_md":"repeat(5, minmax(min-content, calc(100vw / 6)))","layout_grid_template_rows_lg":"repeat(4, calc(100vw / 8))","layout_grid_template_rows_xl":"repeat(4, calc(100vw / 8))","layout_grid_gap_column":"0rem","layout_grid_gap_row":"0rem","_type":"layout-grid","_modules":[{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"3","layout_cell_column_start_lg":"5","layout_cell_column_start_xl":"5","layout_cell_column_end_xs":"5","layout_cell_column_end_sm":"5","layout_cell_column_end_md":"6","layout_cell_column_end_lg":"8","layout_cell_column_end_xl":"8","layout_cell_row_start_xs":"1","layout_cell_row_start_sm":"1","layout_cell_row_start_md":"1","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_xs":"2","layout_cell_row_end_sm":"2","layout_cell_row_end_md":"2","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"1","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_xs":"2","layout_cell_column_end_sm":"3","layout_cell_column_end_md":"2","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_xs":"3","layout_cell_row_start_sm":"3","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"1","layout_cell_row_start_xl":"1","layout_cell_row_end_xs":"4","layout_cell_row_end_sm":"4","layout_cell_row_end_md":"3","layout_cell_row_end_lg":"2","layout_cell_row_end_xl":"2","layout_cell_bg_color":"rgba(0, 0, 0, 0.8)","_type":"layout-cell"},{"layout_cell_column_start_xs":"4","layout_cell_column_start_sm":"4","layout_cell_column_start_md":"4","layout_cell_column_start_lg":"8","layout_cell_column_start_xl":"8","layout_cell_column_end_xs":"5","layout_cell_column_end_sm":"6","layout_cell_column_end_md":"5","layout_cell_column_end_lg":"9","layout_cell_column_end_xl":"9","layout_cell_row_start_xs":"6","layout_cell_row_start_sm":"6","layout_cell_row_start_md":"4","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_xs":"7","layout_cell_row_end_sm":"7","layout_cell_row_end_md":"5","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","layout_cell_bg_color":"rgba(0, 0, 0, 0.8)","_type":"layout-cell"},{"layout_cell_column_start_xs":"3","layout_cell_column_start_sm":"4","layout_cell_column_start_md":"5","layout_cell_column_start_lg":"5","layout_cell_column_start_xl":"5","layout_cell_column_end_xs":"5","layout_cell_column_end_sm":"7","layout_cell_column_end_md":"7","layout_cell_column_end_lg":"7","layout_cell_column_end_xl":"7","layout_cell_row_start_xs":"2","layout_cell_row_start_sm":"2","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_xs":"4","layout_cell_row_end_sm":"4","layout_cell_row_end_md":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","layout_cell_bg_color":"rgba(0, 0, 0, 0.5)","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"1","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_xs":"3","layout_cell_column_end_sm":"4","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"4","layout_cell_column_end_xl":"4","layout_cell_row_start_xs":"4","layout_cell_row_start_sm":"4","layout_cell_row_start_md":"3","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_xs":"6","layout_cell_row_end_sm":"6","layout_cell_row_end_md":"5","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","layout_cell_bg_color":"rgba(0, 0, 0, 0.5)","_type":"layout-cell"},{"layout_cell_column_start_xs":"2","layout_cell_column_start_sm":"3","layout_cell_column_start_md":"2","layout_cell_column_start_lg":"1","layout_cell_column_start_xl":"1","layout_cell_column_end_xs":"3","layout_cell_column_end_sm":"4","layout_cell_column_end_md":"3","layout_cell_column_end_lg":"2","layout_cell_column_end_xl":"2","layout_cell_row_start_xs":"2","layout_cell_row_start_sm":"2","layout_cell_row_start_md":"2","layout_cell_row_start_lg":"2","layout_cell_row_start_xl":"2","layout_cell_row_end_xs":"3","layout_cell_row_end_sm":"3","layout_cell_row_end_md":"3","layout_cell_row_end_lg":"3","layout_cell_row_end_xl":"3","layout_cell_bg_color":"rgba(0, 0, 0, 0.15)","_type":"layout-cell"},{"layout_cell_column_start_xs":"4","layout_cell_column_start_sm":"5","layout_cell_column_start_md":"3","layout_cell_column_start_lg":"2","layout_cell_column_start_xl":"2","layout_cell_column_end_xs":"5","layout_cell_column_end_sm":"6","layout_cell_column_end_md":"4","layout_cell_column_end_lg":"3","layout_cell_column_end_xl":"3","layout_cell_row_start_xs":"4","layout_cell_row_start_sm":"4","layout_cell_row_start_md":"3","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_xs":"5","layout_cell_row_end_sm":"5","layout_cell_row_end_md":"4","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","layout_cell_bg_color":"rgba(0, 0, 0, 0.15)","_type":"layout-cell"},{"layout_cell_column_start_xs":"3","layout_cell_column_start_sm":"6","layout_cell_column_start_md":"3","layout_cell_column_start_lg":"4","layout_cell_column_start_xl":"4","layout_cell_column_end_xs":"4","layout_cell_column_end_sm":"7","layout_cell_column_end_md":"4","layout_cell_column_end_lg":"5","layout_cell_column_end_xl":"5","layout_cell_row_start_xs":"5","layout_cell_row_start_sm":"5","layout_cell_row_start_md":"5","layout_cell_row_start_lg":"4","layout_cell_row_start_xl":"4","layout_cell_row_end_xs":"6","layout_cell_row_end_sm":"6","layout_cell_row_end_md":"6","layout_cell_row_end_lg":"5","layout_cell_row_end_xl":"5","layout_cell_bg_color":"rgba(0, 0, 0, 0.15)","_type":"layout-cell"},{"layout_cell_column_start_xs":"1","layout_cell_column_start_sm":"1","layout_cell_column_start_md":"6","layout_cell_column_start_lg":"7","layout_cell_column_start_xl":"7","layout_cell_column_end_xs":"2","layout_cell_column_end_sm":"2","layout_cell_column_end_md":"7","layout_cell_column_end_lg":"8","layout_cell_column_end_xl":"8","layout_cell_row_start_xs":"6","layout_cell_row_start_sm":"6","layout_cell_row_start_md":"4","layout_cell_row_start_lg":"3","layout_cell_row_start_xl":"3","layout_cell_row_end_xs":"7","layout_cell_row_end_sm":"7","layout_cell_row_end_md":"5","layout_cell_row_end_lg":"4","layout_cell_row_end_xl":"4","layout_cell_bg_color":"rgba(0, 0, 0, 0.15)","_type":"layout-cell"}]}'}},u=function(e){function n(){var e,t,r
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t=this,r=a(n).call(this),e=!r||"object"!==o(r)&&"function"!=typeof r?i(t):r,l(i(e),"onWheel",function(e){e.stopPropagation()}),l(i(e),"setDimensions",function(){if(e.elScroll&&e.elContent){var t=parseInt(window.getComputedStyle(e.elScroll).width),n=parseInt(window.getComputedStyle(e.elScroll,":before").width),o=parseInt(window.getComputedStyle(e.elContent).width)
isNaN(t)&&(t=0),isNaN(n)&&(n=0),isNaN(o)&&(o=0),e.setState({scrollerWidthFull:t,scrollerWidthAdj:t-2*n,contentWidth:o,scrollOffset:e.elScroll.scrollLeft})}}),l(i(e),"goBack",function(){var t=e.getScrollOffset()-e.getScrollerWidthFull()
e.elScroll.scrollTo({top:0,left:Math.max(t,0),behavior:"smooth"})}),l(i(e),"goForward",function(){var t=e.getScrollOffset()+e.getScrollerWidthFull(),n=e.getContentWidth()-e.getScrollerWidthAdj()
e.elScroll.scrollTo({top:0,left:Math.min(t,n),behavior:"smooth"})}),e.state={scrollerWidthFull:0,scrollerWidthAdj:0,contentWidth:0,scrollOffset:0,isInserting:!1},e}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,t.default.Component),u=n,(p=[{key:"componentDidMount",value:function(){this.setDimensions(),window.addEventListener("resize",this.setDimensions),this.elScroll.addEventListener("wheel",this.onWheel)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.setDimensions),this.elScroll.removeEventListener("wheel",this.onWheel)}},{key:"setScrollerWidthFull",value:function(e){this.setState({scrollerWidthFull:e})}},{key:"setScrollerWidthAdj",value:function(e){this.setState({scrollerWidthAdj:e})}},{key:"setContentWidth",value:function(e){this.setState({contentWidth:e})}},{key:"setScrollOffset",value:function(e){this.setState({scrollOffset:e})}},{key:"getScrollerWidthFull",value:function(){return this.state.scrollerWidthFull}},{key:"getScrollerWidthAdj",value:function(){return this.state.scrollerWidthAdj}},{key:"getContentWidth",value:function(){return this.state.contentWidth}},{key:"getScrollOffset",value:function(){return this.state.scrollOffset}},{key:"atStart",value:function(){return this.getScrollOffset()<=0}},{key:"atEnd",value:function(){return this.getContentWidth()-this.getScrollOffset()-this.getScrollerWidthAdj()<=0}},{key:"insert",value:function(e,t){this.state.isInserting||(this.setState({isInserting:!0}),this.props.onChooseLayout(c[t].template,e))}},{key:"renderButtonClassNames",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"bck",t=["cs-layout-grids-nav-".concat(e)],n="bck"===e&&this.atStart(),o="fwd"===e&&this.atEnd()
return(n||o)&&(t=["cs-layout-grids-nav-".concat(e),"is-hidden"]),t.join(" ")}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:"cs-layout-grids-outer",onScroll:this.setDimensions},t.default.createElement("a",{className:this.renderButtonClassNames("bck"),role:"button",onClick:this.goBack},"←"),t.default.createElement("a",{className:this.renderButtonClassNames("fwd"),role:"button",onClick:this.goForward},"→"),t.default.createElement("div",{className:"cs-layout-grids-inner",ref:function(t){return e.elScroll=t}},t.default.createElement("ul",{className:"cs-layout-grids-options",ref:function(t){return e.elContent=t}},Object.keys(c).map(function(n){return t.default.createElement("li",{key:n,className:"cs-layout-grids-".concat(n),onClick:function(t){return e.insert(t,n)}},t.default.createElement("div",null,new Array(c[n].previewCellCount).fill().map(function(e,t){return t}).map(function(e){return t.default.createElement("i",{key:e})})),t.default.createElement("strong",null,c[n].title))}))))}}])&&r(u.prototype,p),d&&r(u,d),n}()
e.default=u}),define("tco-app/src/components/common/ManualScrollBox",["exports","react","lodash","tco-app/src/components/common/Icon"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:ui").get("scrollBarWidth")}),u=function(e){function n(){var e
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=i(this,s(n).apply(this,arguments))).state={canScrollUp:!1,canScrollDown:!1},e}var r,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.Component),r=n,(u=[{key:"render",value:function(){var e=c(),n=e>0?{paddingRight:"".concat(e,"px"),marginRight:"-".concat(e,"px")}:{}
return t.default.createElement("div",{className:"cs-manual-scroll-box"},t.default.createElement("div",{className:"cs-manual-scroll-box-inner",style:n},this.props.children),t.default.createElement("ul",{className:"cs-manual-scroll-box-buttons"},this.state.canScrollUp&&t.default.createElement("button",{onClick:function(){},className:"cs-manual-scroll-box-button-up"},t.default.createElement(o.default,{icon:"fa-chevron-up"})),this.state.canScrollDown&&t.default.createElement("button",{onClick:function(){},className:"cs-manual-scroll-box-button-down"},t.default.createElement(o.default,{icon:"fa-chevron-down"}))))}}])&&a(r.prototype,u),p&&a(r,p),n}()
e.default=u})
define("tco-app/src/components/common/Picker",["exports","react","react-dom","classnames"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?u(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.PickerModal=void 0
var m=["ps-y-reach-start","ps-scroll-y","ps-y-reach-end","ps-x-reach-start","ps-scroll-x","ps-x-reach-end"],h=function(e){function r(){var e,t
a(this,r)
for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i]
return f(u(t=l(this,(e=c(r)).call.apply(e,[this].concat(o)))),"state",{side:null,top:"",left:"",visible:!1}),f(u(t),"onMouseMove",function(e){t.didMove=!0,window.document.body.removeEventListener("mousemove",t.onMouseMove)}),f(u(t),"onMouseUp",function(e){t.closeOnOutsideFocus(e),window.document.body.removeEventListener("mousemove",t.onMouseMove)}),f(u(t),"onMouseDown",function(e){window.document.body.addEventListener("mousemove",t.onMouseMove),t.didMove=!1}),f(u(t),"closeOnOutsideFocus",function(e){if(!t.props.cancelCloseOutside&&(!t.modalRef.contains(e.target)&&t.props.swatch.current&&!t.props.swatch.current.contains(e.target))){var n=!1
try{n=t.didMove&&window.getSelection().toString()}catch(e){}n||t.props.close()}}),f(u(t),"updatePosition",function(){if(t.props.swatch.current&&t.modalRef){var e=t.props.swatch.current.getBoundingClientRect(),n=t.modalRef.getBoundingClientRect(),o=e.top-n.height,r=window.innerHeight-(e.top+n.height),a=e.left-n.width,i=window.innerWidth-(e.right+n.width),s=!1,l=!0
o<0&&(l=r<0&&r<o),i<0&&(s=!(a<0)||a>i),t.setState({side:s?"left":"right",top:l?e.bottom-n.height:e.top,left:s?e.left-n.width:e.right,visible:!0})}}),t}return p(r,t.default.PureComponent),s(r,[{key:"componentDidMount",value:function(){var e=this
if(this.props.scrollBox&&m.forEach(function(t){return e.props.scrollBox.addEventListener(t,e.updatePosition)}),this.props.closeOnFocusLoss&&(window.document.body.addEventListener("mouseup",this.onMouseUp),window.document.body.addEventListener("mousedown",this.onMouseDown),window.document.body.addEventListener("focus",this.closeOnOutsideFocus),this.focusEventsAdded=!0),window.addEventListener("scroll",this.updatePosition),window.addEventListener("resize",this.updatePosition),this.updatePosition(),this.props.focusSelector){var t=this.modalRef.querySelector(this.props.focusSelector)
t&&t.focus()}}},{key:"componentDidUpdate",value:function(e){this.props.reposition===e.reposition&&this.props.swatch===e.swatch||this.updatePosition()}},{key:"componentWillUnmount",value:function(){var e=this
this.props.scrollBox&&m.forEach(function(t){return e.props.scrollBox.removeEventListener(t,e.updatePosition)}),this.focusEventsAdded&&(window.document.body.removeEventListener("mouseup",this.onMouseUp),window.document.body.removeEventListener("mousedown",this.onMouseDown),window.document.body.removeEventListener("focus",this.closeOnOutsideFocus),this.focusEventsAdded=!1),window.removeEventListener("scroll",this.updatePosition),window.removeEventListener("resize",this.updatePosition)}},{key:"render",value:function(){var e=this,r=this.props,a=r.children,i=r.container,s=this.state,l=s.top,c=s.left,u=s.side,p=(s.visible,t.default.createElement("div",{className:(0,o.default)("cs-picker-modal",this.props.class,this.state.visible&&u?"cs-picker-floating-".concat(u):null,{"cs-picker-floating":!0}),ref:function(t){return e.modalRef=t},style:{top:l,left:c}},a))
return i&&i.nodeType?n.default.createPortal(p,i):null}}]),r}()
e.PickerModal=h,f(h,"defaultProps",{swatch:null,container:null,scrollBox:null,class:"",focusSelector:null,cancelCloseOutside:!1,closeOnFocusLoss:!0,onToggle:function(){}})
var g=function(e){function n(e){var o
return a(this,n),f(u(o=l(this,c(n).call(this,e))),"state",{container:null,scrollBox:null}),f(u(o),"modalClose",function(){return o.props.onToggle(!1)}),o.swatchRef=t.default.createRef(),o}return p(n,t.default.PureComponent),s(n,[{key:"componentDidMount",value:function(){this.setState({container:document.querySelector(this.props.modalParentSelector),scrollBox:this.swatchRef.current.closest(".cs-scroll-box")})}},{key:"renderSwatch",value:function(){var e=this
return this.props.renderSwatch?this.props.renderSwatch({ref:this.swatchRef}):t.default.createElement(this.props.swatchTag,{className:this.props.swatchClass,onClick:function(){return e.props.onToggle(!e.props.open)},ref:this.swatchRef},this.props.label&&t.default.createElement("span",{dangerouslySetInnerHTML:{__html:this.props.label}}),this.props.content)}},{key:"renderModal",value:function(){return this.props.open&&this.swatchRef.current&&t.default.createElement(h,{class:this.props.modalClass,reposition:this.props.reposition,container:this.state.container,scrollBox:this.state.scrollBox,swatch:this.swatchRef,close:this.modalClose,focusSelector:this.props.focusSelector,cancelCloseOutside:this.props.cancelCloseOutside},this.props.children)}},{key:"render",value:function(){return this.props.noWrapper?t.default.createElement(t.default.Fragment,null,this.renderSwatch(),this.renderModal()):t.default.createElement("div",{className:(0,o.default)("cs-picker",{"cs-active":this.props.open},this.props.class)},this.renderSwatch(),this.renderModal())}}]),n}()
e.default=g,f(g,"defaultProps",{label:"",class:"",content:null,modalParentSelector:".cs-app",swatchClass:"cs-picker-swatch",swatchTag:"div",modalClass:"",noWrapper:!1,open:!1,focusSelector:null,reposition:null})}),define("tco-app/src/components/common/Popover",["exports","react","react-dom","classnames"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=this,n=i(u).apply(this,arguments),e=!n||"object"!==r(n)&&"function"!=typeof n?s(t):n,c(s(e),"closeOnOutsideFocus",function(t){e.isActive()&&e.popoverRef&&(e.popoverRef.contains(t.target)||e.props.onOutsideClick())}),c(s(e),"updatePosition",function(){if(e.containerRef&&e.props.fixed&&e.props.active){var t,n=window.innerHeight,o=window.innerWidth,r=e.containerRef.getBoundingClientRect(),a=r.top,i=r.bottom,s=r.left,l=r.width,c=r.height,u=e.props.side||"bottom"
switch(u){case"top":t={bottom:n-i+c+7+5,left:s}
break
case"left":t={top:a+c/2,right:o-s+7+5}
break
case"bottom":t={top:a+c+7+5,left:s}
break
case"right":t={top:a+c/2,left:s+l+7+5}}if(e.props.flowCorrection&&e.popoverRef){var p=e.popoverRef.getBoundingClientRect(),d=!1
if("left"===u||"right"===u){var f=p.height/2
t.top+f>n&&(t.top=a-p.height+30,d="end"),t.top-f<0&&(t.top=a-15,d="start")}e.setState({flow:d})}e.setState({style:t})}}),e.state={show:!1,isTransitioning:!1,flow:"",style:{}},e}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.PureComponent),p=u,(d=[{key:"componentDidMount",value:function(){this.setState({container:document.querySelector(this.props.popoverParentSelector),scrollBox:this.containerRef.closest(".cs-scroll-box"),scrollContainer:this.containerRef.closest(".cs-scroll-container")||window.document.body}),window.document.body.addEventListener("click",this.closeOnOutsideFocus),window.document.body.addEventListener("focus",this.closeOnOutsideFocus),this.props.fixed&&(this.addFixedEvents(),this.openOrClose())}},{key:"componentDidUpdate",value:function(e){e.fixed!==this.state.fixed&&this.addFixedEvents(),this.props.fixed&&e.active!==this.props.active&&this.openOrClose()}},{key:"addFixedEvents",value:function(){this.removeFixedEvents(),this.containerRef&&(window.addEventListener("resize",this.updatePosition),this.state.scrollBox?(this.state.scrollBox.addEventListener("ps-scroll-y",this.updatePosition),this.state.scrollBox.addEventListener("ps-scroll-x",this.updatePosition)):this.state.scrollContainer&&this.state.scrollContainer.addEventListener("scroll",this.updatePosition))}},{key:"openOrClose",value:function(){this.props.active?(this.updatePosition(),this.setState({show:!0})):this.setState({show:!1})}},{key:"maybeFocusInput",value:function(){}},{key:"removeFixedEvents",value:function(){window.removeEventListener("resize",this.updatePosition),this.state.scrollBox&&(this.state.scrollBox.removeEventListener("ps-scroll-y",this.updatePosition),this.state.scrollBox.removeEventListener("ps-scroll-x",this.updatePosition)),this.state.scrollContainer&&this.state.scrollContainer.removeEventListener("scroll",this.updatePosition)}},{key:"componentWillUnmount",value:function(){this.removeFixedEvents(),window.document.body.removeEventListener("click",this.closeOnOutsideFocus),window.document.body.removeEventListener("focus",this.closeOnOutsideFocus)}},{key:"isActive",value:function(){return this.props.fixed?this.props.active&&this.state.show:this.props.active}},{key:"render",value:function(){var e=this,r=!this.props.fixed&&this.props.flowCorrection?this.state.flow&&"cs-popover-flow-".concat(this.state.flow):"",a=t.default.createElement("div",{className:(0,o.default)("cs-popover",{"cs-popover-fixed":this.props.fixed,"cs-active":this.isActive(),"cs-transitioning":this.state.isTransitioning},"cs-popover-".concat(this.props.side),r),ref:function(t){return e.popoverRef=t},style:this.state.style},this.props.active&&this.props.children)
return t.default.createElement("div",{ref:function(t){return e.containerRef=t},style:{position:"relative",zIndex:100,minHeight:"100%"}},this.props.fixed&&this.state.container&&this.state.container.nodeType?n.default.createPortal(a,this.state.container):a)}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{fixed:!1,side:"bottom",flowCorrection:!0,onOutsideClick:function(){},popoverParentSelector:".cs-app"})}),define("tco-app/src/components/common/ScrollBox",["exports","react","classnames","perfect-scrollbar"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=!1,p=function(e){function p(){var e,t,n,a;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,p)
for(var l=arguments.length,d=new Array(l),f=0;f<l;f++)d[f]=arguments[f]
return n=this,a=(e=i(p)).call.apply(e,[this].concat(d)),t=!a||"object"!==r(a)&&"function"!=typeof a?s(n):a,c(s(t),"initializeScrollbar",function(){t.destroyScrollbar(),u||t.scrollbar.addEventListener("wheel",t.wheelCheck,{passive:!0}),t.ps=new o.default(t.scrollbar,{wheelSpeed:t.props.wheelSpeed,scrollYMarginOffset:0,scrollXMarginOffset:0,wheelPropagation:!1,swipePropagation:!1,useBothWheelAxes:!u,minScrollbarLength:20,scrollingThreshold:t.props.scrollingThreshold,suppressScrollX:t.props.suppressScrollX,suppressScrollY:t.props.suppressScrollY}),t.scrollbar.addEventListener("ps-scroll-x",t.onScrollX),t.scrollbar.addEventListener("ps-scroll-y",t.onScrollY),t.scrollbar.addEventListener("ps-y-reach-end",t.onScrollYEnd),t.scrollbar.addEventListener("ps-y-reach-start",t.onScrollYStart),t.scrollbar.addEventListener("ps-x-reach-end",t.onScrollXEnd),t.scrollbar.addEventListener("ps-x-reach-start",t.onScrollXStart)}),c(s(t),"wheelCheck",function(e){Math.abs(e.deltaX)>0&&(u=!0,t.initializeScrollbar())}),c(s(t),"onScroll",function(e,n){t.props.onScroll(e,t.ps,n)}),c(s(t),"onScrollX",function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
t.onScroll(e,t.ps,Object.assign({x:!0},n))}),c(s(t),"onScrollY",function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
t.props.onScroll(e,t.ps,Object.assign({y:!0},n))}),c(s(t),"onScrollYEnd",function(e){return t.onScrollY(e,{end:!0})}),c(s(t),"onScrollYStart",function(e){return t.onScrollY(e,{start:!0})}),c(s(t),"onScrollXEnd",function(e){return t.onScrollX(e,{end:!0})}),c(s(t),"onScrollXStart",function(e){return t.onScrollX(e,{start:!0})}),c(s(t),"destroyScrollbar",function(){t.ps&&(t.scrollbar.removeEventListener("wheel",t.wheelCheck),t.scrollbar.removeEventListener("ps-scroll-x",t.onScrollX),t.scrollbar.removeEventListener("ps-scroll-y",t.onScrollY),t.scrollbar.removeEventListener("ps-y-reach-end",t.onScrollYEnd),t.scrollbar.removeEventListener("ps-y-reach-start",t.onScrollYStart),t.scrollbar.removeEventListener("ps-x-reach-end",t.onScrollXEnd),t.scrollbar.removeEventListener("ps-x-reach-start",t.onScrollXStart),t.ps.destroy(),t.ps=null)}),t}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(p,t.default.Component),d=p,(f=[{key:"componentDidMount",value:function(){this.props.enabled&&this.initializeScrollbar()}},{key:"componentDidUpdate",value:function(e){var t=e.resetScroll,n=e.enabled
this.scrollbar&&t!==this.props.resetScroll&&(this.scrollbar.scrollTop=0,this.scrollbar.scrollLeft=0),n!==this.props.enabled&&(this.destroyScrollbar(),n&&this.initializeScrollbar()),this.ps&&this.ps.update()}},{key:"componentWillUnmount",value:function(){this.destroyScrollbar()}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:(0,n.default)({"cs-scroll-box":this.props.enabled,"cs-scroll-box-disabled":!this.props.enabled,"show-rail":this.props.forceDisplayRail},this.props.className),ref:function(t){return e.scrollbar=t}},this.props.children)}}])&&a(d.prototype,f),m&&a(d,m),p}()
c(p,"defaultProps",{enabled:!0,forceDisplayRail:!1,psRef:function(){},className:"",wheelSpeed:1,resetScroll:null,scrollingThreshold:1e3,suppressScrollX:!1,suppressScrollY:!1,onScroll:function(){},onScrollX:function(){},onScrollY:function(){}})
var d=p
e.default=d}),define("tco-app/src/components/common/Search",["exports","react","classnames","tco-app/src/components/common/Icon","tco-app/src/lib/keybindings"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u,p,d,f=function(e){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),s(this,l(a).apply(this,arguments))}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(a,t.default.PureComponent),u=a,(p=[{key:"componentDidMount",value:function(){var e=this
this.props.autoFocus&&this.searchInput&&this.searchInput.focus(),this.props.focusOnShortcut&&(this.unbindKeys=(0,r.default)({find:function(){e.searchInput&&e.searchInput.focus()}}))}},{key:"componentWillUnmount",value:function(){this.unbindKeys&&this.unbindKeys()}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:(0,n.default)("cs-search-bar",this.props.class)},t.default.createElement("input",{className:(0,n.default)({"cs-no-input-focus":this.props.noFocus}),type:"search",placeholder:this.props.placeholder,value:this.props.query,onChange:function(t){return e.props.onQueryChange(t.target.value,t)},ref:function(t){e.searchInput=t}}),this.props.showIcon&&t.default.createElement("span",null,t.default.createElement(o.default,{icon:"fa-search"})),(this.props.alwaysShowClear||this.props.query)&&t.default.createElement("span",{className:"cs-clear",onClick:function(t){"function"==typeof e.props.onClear?e.props.onClear(t):e.props.onQueryChange(e.props.clearValue)}},t.default.createElement(o.default,{icon:"fa-times"})))}}])&&i(u.prototype,p),d&&i(u,d),a}()
e.default=f,d={query:"",alwaysShowClear:!1,class:"",autoFocus:!0,focusOnShortcut:!0,showIcon:!0,placeholder:"",clearValue:"",onClear:null,onQueryChange:function(){}},(p="defaultProps")in(u=f)?Object.defineProperty(u,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[p]=d}),define("tco-app/src/components/common/SortableContainer",["exports","react","classnames","tco-app/src/util/dragula"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function p(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,p)
for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c]
return n=this,o=(e=s(p)).call.apply(e,[this].concat(i)),t=!o||"object"!==r(o)&&"function"!=typeof o?l(n):o,u(l(t),"state",{isDragging:!1}),u(l(t),"onDragStart",function(){t.setState({isDragging:!0}),t.props.onDragStart()}),u(l(t),"onDragEnd",function(){t.setState({isDragging:!1}),t.props.onDragEnd()}),t}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(p,t.default.Component),d=p,(f=[{key:"setupDragula",value:function(){this.teardownDragula(),this.ulRef&&this.props.canDrag&&(this.ulRef.drake=(0,o.default)([this.ulRef],{moves:function(e,t,n){return!e.className.includes("is-editing-label")&&a(e.children).find(function(e){return e.className.includes("cs-sortable-item-handle")}).contains(n)},offset:function(e,t,n){return{x:e.x,y:n.querySelector(".cs-sortable-item-handle").clientHeight/2}},revertOnSpill:!0,mirrorContainer:this.ulRef}),this.ulRef.drake.on("drag",this.onDragStart),this.ulRef.drake.on("dragend",this.onDragEnd))}},{key:"componentDidMount",value:function(){this.setupDragula()}},{key:"componentDidUpdate",value:function(e){e.canDrag!==this.props.canDrag&&this.setupDragula()}},{key:"teardownDragula",value:function(){this.ulRef&&this.ulRef.drake&&this.ulRef.drake.destroy()}},{key:"componentWillUnmount",value:function(){this.teardownDragula()}},{key:"render",value:function(){var e=this
return t.default.createElement("ul",{className:(0,n.default)("cs-sortable",{"cs-sorting":this.state.isDragging,"cs-sortable-no-inline-add":!this.props.canInlineAdd}),ref:function(t){return e.ulRef=t}},this.props.children)}}])&&i(d.prototype,f),m&&i(d,m),p}()
e.default=p,u(p,"defaultProps",{canDrag:!0,canInlineAdd:!0})}),define("tco-app/src/components/common/SortableItem",["exports","react","classnames","tco-app/src/components/common/Icon","tco-app/src/components/forms/LabelInput","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=function(e){function f(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,f)
for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l]
return n=this,o=(e=c(f)).call.apply(e,[this].concat(a)),t=!o||"object"!==i(o)&&"function"!=typeof o?u(n):o,d(u(t),"state",{isEditingLabel:!1}),d(u(t),"onDrop",function(e){var n=e.detail.args[3],o=n&&n.parentElement&&s(n.parentElement.children).indexOf(n)-1
t.props.onDrop(o)}),d(u(t),"onIsEditingLabel",function(e){return t.setState({isEditingLabel:e})}),t}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(f,t.default.Component),m=f,(h=[{key:"componentDidMount",value:function(){this.liRef&&this.liRef.addEventListener("dragula-drop",this.onDrop)}},{key:"componentWillUnmount",value:function(){this.liRef&&this.liRef.removeEventListener("dragula-drop",this.onDrop)}},{key:"renderControls",value:function(){return t.default.createElement("div",{className:"cs-sortable-item-handle-controls"},this.props.controls.map(function(e){var n=e.action,o=e.label,r=e.content,a=e.onClick
return t.default.createElement("button",{className:"cs-sortable-action-".concat(n),key:n,title:o,onClick:a},r)}))}},{key:"renderAddButton",value:function(e){var n=this
return t.default.createElement("button",{className:"cs-add-sortable-item-".concat(e?"after":"before"),onClick:function(){return n.props.onAdd(e)}},t.default.createElement("span",null,t.default.createElement(o.default,{icon:"fa-plus"}),this.props.addLabel||(0,a.t)("app.common.add")))}},{key:"render",value:function(){var e=this
return t.default.createElement("li",{ref:function(t){return e.liRef=t},className:(0,n.default)("cs-sortable-item",{"cs-active":this.props.active,"cs-sortable-item-has-drawer":this.props.hasDrawer,"is-editing-label":this.state.isEditingLabel})},this.props.canShowAdd&&this.renderAddButton(),t.default.createElement("div",{className:"cs-sortable-item-handle",onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},this.props.hasDrawer&&t.default.createElement("button",{className:"cs-sortable-item-handle-toggle",onClick:function(){return e.props.onToggleDrawer()}},t.default.createElement(o.default,{icon:"caret-collapse"})),t.default.createElement("div",{className:"cs-sortable-item-handle-label",onClick:function(){e.props.hasDrawer||e.props.onSelect()}},this.props.beforeLabel,t.default.createElement(r.default,{label:this.props.label,onUpdate:function(t){return e.props.onUpdateLabel(t)},onStateChange:this.onIsEditingLabel})),this.renderControls()),this.props.children&&this.props.hasDrawer&&t.default.createElement("div",{className:(0,n.default)("cs-sortable-item-drawer",{"cs-active":this.props.active})},this.props.active&&this.props.children),this.props.canShowAdd&&this.props.lastItem&&this.renderAddButton(!0))}}])&&l(m.prototype,h),g&&l(m,g),f}()
e.default=f,d(f,"defaultProps",{onToggleDrawer:function(){},onDrop:function(){},onSelect:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onAdd:function(){},active:!1,label:null,addLabel:"",beforeLabel:null,controls:[],onUpdateLabel:null})}),define("tco-app/src/components/common/Style",["exports","react","react-dom"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.Component),l=o,(c=[{key:"renderStyle",value:function(){return t.default.createElement("style",{id:this.props.id},this.props.children)}},{key:"render",value:function(){return n.default.createPortal(this.renderStyle(),window.document.head)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/common/WelcomeMessage",["exports","react"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=function(e){var n=e.title,o=e.children
return t.default.createElement("div",{className:"cs-welcome"},n&&t.default.createElement("h3",{className:"cs-welcome-title"},n),o)}
e.default=n}),define("tco-app/src/components/controls/Control",["exports","react","classnames","tco-app/src/components/controls/types"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function h(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.Control=e.ControlWrapper=e.ControlSingle=e.ControlInput=e.ControlItem=e.ControlGroup=e.ControlGroupContainer=e.ControlInputs=e.ControlLabel=e.ControlHeader=e.ControlList=void 0
var g=function(e){var o=e.children,r=e.className
return t.default.createElement("ul",{className:(0,n.default)("cs-control-list",r)},o)}
e.ControlList=g
var v=function(e){var n=e.label,o=e.description,r=e.children,a=e.headerModifierClass
return t.default.createElement("header",{className:a?"cs-control-group-header ".concat(a):"cs-control-group-header"},t.default.createElement("span",{className:"cs-control-group-label",dangerouslySetInnerHTML:{__html:n||"&nbsp;"}}),o&&t.default.createElement("span",{className:"cs-control-group-description",dangerouslySetInnerHTML:{__html:o}}),r)}
e.ControlHeader=v
var b=function(e){var n=e.label
return t.default.createElement("div",{className:"cs-control-label"},t.default.createElement("span",{dangerouslySetInnerHTML:{__html:n||"&nbsp;"}}))}
e.ControlLabel=b
var y=function(e){var n=e.children
return t.default.createElement("div",{className:"cs-control-inputs"},n)}
e.ControlInputs=y
var _=function(e){var o=e.className,r=e.children,a=h(e,["className","children"])
return t.default.createElement("div",m({className:(0,n.default)("cs-control-group",o)},a),r)}
e.ControlGroupContainer=_
var w=function(e){var n=e.label,o=e.description,r=e.afterHeader,a=e.headerModifierClass,i=e.children,s=e.managed,l=h(e,["label","description","afterHeader","headerModifierClass","children","managed"])
return t.default.createElement(_,l,t.default.createElement(v,{label:n,description:o,headerModifierClass:a},r),"no-list"===s?t.default.createElement(t.default.Fragment,null,i):t.default.createElement(g,null,i))}
e.ControlGroup=w
var E=function(e){var o=e.className,r=e.height,a=void 0===r?null:r,i=e.label,s=e.children,l=h(e,["className","height","label","children"])
return t.default.createElement("li",m({className:(0,n.default)("cs-control",o,a?"is-height-".concat(a):"")},l),i&&t.default.createElement(b,{label:i}),t.default.createElement(y,null,s))}
e.ControlItem=E
var O=function(e){var o=e.children,r=e.half
return t.default.createElement("div",{className:(0,n.default)("cs-control-input",{"is-1-2":r})},o)}
e.ControlInput=O
e.ControlSingle=function(e){return t.default.createElement(E,e,t.default.createElement(O,null,e.children))}
var x=function(e){function o(){return a(this,o),l(this,u(o).apply(this,arguments))}return p(o,t.default.PureComponent),s(o,[{key:"groupWrapper",value:function(){}},{key:"itemWrapper",value:function(){}},{key:"render",value:function(){var e=this.props.control,o=e.type,r=e.options,a="group"===o?"":"cs-control-".concat(o),i=r._originalType?"".concat(a,"-").concat(r._originalType.replace("/","-")):""
if(this.props.topLevelOnly&&this.props.level>1)return console.log("".concat(this.props.control.type," can only be used as a top level control")),null
var s=this.props.singular?t.default.createElement(O,{half:!1!==this.props.autoHalf&&this.props.level>2||r.half&&!this.props.noHalf},this.props.children):t.default.createElement(t.default.Fragment,null,this.props.children),l=this.props.control.options.height||this.props.defaultHeight||null
return 1===this.props.level?t.default.createElement(w,{className:(0,n.default)(a,i),"data-cs-control-group-name":this.props.control.group.full,"data-cs-control-id":this.props.id,label:this.props.noLabel?null:this.props.control.label,description:this.props.control.description,afterHeader:this.props.afterHeader,headerModifierClass:this.props.headerModifierClass,managed:this.props.managed},this.props.topLevelOnly||this.props.isList||this.props.managed?s:t.default.createElement(E,{height:l},s)):2===this.props.level?t.default.createElement(E,{className:(0,n.default)(a,i),"data-cs-control-group-name":this.props.control.group.full,"data-cs-control-id":this.props.id,height:l,label:this.props.noLabel?null:this.props.control.label},s):s}}]),o}()
e.ControlWrapper=x,f(x,"defaultProps",{afterHeader:null,headerModifierClass:null,includeList:!0})
var k=function(e){function n(){var e
return a(this,n),f(c(e=l(this,u(n).apply(this,arguments))),"updateCanScroll",function(t){"vertical"!==e.props.orientation&&e.setState({canScroll:t})}),e.state={canScroll:!0,tempProp:!1},e}return p(n,t.default.PureComponent),s(n,[{key:"getControlComponent",value:function(){return this.props.components[this.props.control.type]||o.default[this.props.control.type]||o.default.unknown}},{key:"renderAfterHeader",value:function(){return null}},{key:"render",value:function(){var e=this.getControlComponent()
return t.default.createElement(e,m({inspecting:this.props.inspecting,options:this.props.control.options,values:this.props.values,value:this.props.values.value,updateValue:this.props.updateValue,updateValues:this.props.updateValues,level:this.props.level},this.props,{updateCanScroll:this.updateCanScroll}))}}]),n}()
e.Control=k,f(k,"defaultProps",{id:null,level:1,tag:"div",noLabel:!1,orientation:"vertical",components:{},ListComponent:function(){}})}),define("tco-app/src/components/controls/ControlNavigation",["exports","react","classnames","tco-app/src/components/common/ScrollBox"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u,p,d=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this
return!this.props.groups||this.props.groups.length<=0?null:t.default.createElement("nav",{className:(0,n.default)("cs-workspace-controls-nav",{"cs-searching":this.props.isSearching})},t.default.createElement(o.default,{forceDisplayRail:!0},t.default.createElement("ul",{className:"cs-workspace-controls-nav-groups-top"},this.props.groups.map(function(o){var r=o.name,a=o.title,i=o.children
return t.default.createElement("li",{key:r,className:(0,n.default)("cs-workspace-controls-nav-group",{"cs-active":r===e.props.activeGroup})},t.default.createElement("a",{onClick:function(){return e.props.onSelectGroup(r)}},t.default.createElement("span",null,a)),r===e.props.activeGroup&&t.default.createElement("ul",{className:"cs-workspace-controls-nav-groups-sub"},i.map(function(o){var r=o.name,a=o.title
return t.default.createElement("li",{key:r,className:(0,n.default)("cs-workspace-controls-nav-group",{"cs-active":e.props.activeSubGroup===r})},t.default.createElement("a",{"data-group-name":"{{child.name}}",onClick:function(){return e.props.onSelectSubGroup(r)}},t.default.createElement("span",null,a)))})))}))))}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=d,p={isSearching:!1,canSearch:!0,searchQuery:"",searchPlaceholder:"",onCloseSearch:function(){},groups:null,group:null,activeGroup:"",activeSubGroup:"",onSelectGroup:function(){},onSelectSubGroup:function(){}},(u="defaultProps")in(c=d)?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p}),define("tco-app/src/components/controls/types/ControlAspectRatio",["exports","react","tco-app/src/components/forms/Ratio"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{valueA:this.props.values.width,valueB:this.props.values.height,onUpdateTermA:function(t){return e.props.updateValue(t,"width")},onUpdateTermB:function(t){return e.props.updateValue(t,"height")},placeholder:this.props.options.placeholder})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlAttributes",["exports","react","classnames","tco-app/src/components/controls/Control","tco-app/src/components/common/Icon","tco-app/src/components/common/DynamicContentInput","tco-app/src/components/forms/ValueList","tco-app/src/util/unique"],function(e,t,n,o,r,a,i,s){function l(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){w(e,t,n[t])})}return e}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function g(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?b(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var E=function(e){function n(e){var t
f(this,n),w(b(t=g(this,v(n).call(this,e))),"onMove",function(e,n){var o=d(t.state.values)
o.splice(n<0?o.length+n:n,0,o.splice(e,1)[0]),t.setValues(o)}),w(b(t),"onDuplicate",function(e){var n=d(t.state.values),o=n.findIndex(function(t){return t.id===e}),r=n[o],a=r.value,i=r.name
n.splice(o,0,{id:(0,s.uniqueID)(),name:i,value:a}),t.setValues(n)}),w(b(t),"onDelete",function(e){t.setValues(t.state.values.filter(function(t){return t.id!==e}))}),w(b(t),"onAdd",function(){t.setValues([].concat(d(t.state.values),[{id:(0,s.uniqueID)(),name:"",value:""}])),t.props.onAfterAdd&&t.props.onAfterAdd()}),w(b(t),"onUpdateName",function(e,n){var o=d(t.state.values),r=o.findIndex(function(t){return t.id===e})
o[r]=p({},o[r],{name:n}),t.setValues(o)}),w(b(t),"onUpdateValue",function(e,n){var o=d(t.state.values),r=o.findIndex(function(t){return t.id===e})
o[r]=p({},o[r],{value:n}),t.setValues(o)})
var o={}
try{var r=JSON.parse(t.props.value)
r&&(o=r)}catch(a){}return t.state={values:Object.keys(o).map(function(e){return{id:(0,s.uniqueID)(),name:e,value:o[e]}})},t}return y(n,t.default.PureComponent),h(n,[{key:"setValues",value:function(e){this.setState({values:e})
var t=e.reduce(function(e,t){var n=t.name,o=t.value
return n&&(e[n]=o),e},{})
try{var n=JSON.stringify(t)
n&&this.props.onUpdate(n)}catch(o){}}},{key:"render",value:function(){return this.props.children({values:this.state.values,onMove:this.onMove,onDuplicate:this.onDuplicate,onDelete:this.onDelete,onUpdateName:this.onUpdateName,onUpdateValue:this.onUpdateValue,onAdd:this.onAdd})}}]),n}(),O=function(e){function n(){var e,t
f(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return w(b(t=g(this,(e=v(n)).call.apply(e,[this].concat(r)))),"state",{expanded:null}),w(b(t),"onExpandItem",function(e){return t.setState({expanded:e})}),t}return y(n,t.default.PureComponent),h(n,[{key:"componentDidMount",value:function(){this.expandNewItem()}},{key:"componentDidUpdate",value:function(e){this.expandNewItem(e)}},{key:"expandNewItem",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).didAdd,t=void 0!==e&&e
if(this.props.didAdd&&!t){var n=this.props.values[this.props.values.length-1].id
this.setState({expanded:n}),this.props.onDidAddComplete()}}},{key:"render",value:function(){var e=this
return t.default.createElement(i.ValueList,c({},this.props,{renderItem:function(n,o){return t.default.createElement(x,{useDynamicContent:e.props.useDynamicContent,key:n.id,onExpandItem:e.onExpandItem,expanded:e.state.expanded,onDuplicate:e.props.onDuplicate,onDelete:e.props.onDelete,onUpdateName:e.props.onUpdateName,onUpdateValue:e.props.onUpdateValue,item:n,listItemProps:o})}}))}}]),n}(),x=function(e){function n(){var e,t
f(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return w(b(t=g(this,(e=v(n)).call.apply(e,[this].concat(r)))),"onDuplicate",function(){return t.props.onDuplicate(t.props.item.id)}),w(b(t),"onDelete",function(){return t.props.onDelete(t.props.item.id)}),w(b(t),"onUpdateName",function(e){return t.props.onUpdateName(t.props.item.id,e)}),w(b(t),"onUpdateValue",function(e){return t.props.onUpdateValue(t.props.item.id,e)}),w(b(t),"onClick",function(){t.props.onExpandItem(t.props.item.id===t.props.expanded?null:t.props.item.id)}),t}return y(n,t.default.PureComponent),h(n,[{key:"renderLabel",value:function(){return t.default.createElement("span",{onClick:this.onClick},this.props.item.name?"".concat(this.props.item.name,'="').concat(this.props.item.value||"",'"'):"Click to edit")}},{key:"render",value:function(){return t.default.createElement(i.ValueListItem,c({showMore:this.props.expanded===this.props.item.id,content:this.renderLabel(),actions:t.default.createElement(t.default.Fragment,null,t.default.createElement("button",{onClick:this.onDuplicate},t.default.createElement(r.default,{icon:"fa-copy"})),t.default.createElement("button",{onClick:this.onDelete},t.default.createElement(r.default,{icon:"fa-trash-alt"})))},this.props.listItemProps),t.default.createElement(o.ControlList,null,t.default.createElement(o.ControlItem,{label:"Name"},t.default.createElement(o.ControlInput,null,t.default.createElement(a.default,{className:"cs-input-code",type:"text",onUpdate:this.onUpdateName,value:this.props.item.name,enabled:this.props.useDynamicContent,placeholder:""}))),t.default.createElement(o.ControlItem,{label:"Value"},t.default.createElement(o.ControlInput,null,t.default.createElement(a.default,{className:"cs-input-code",type:"text",onUpdate:this.onUpdateValue,value:this.props.item.value,enabled:this.props.useDynamicContent,placeholder:""})))))}}]),n}(),k=function(e){function n(){var e,t
f(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return w(b(t=g(this,(e=v(n)).call.apply(e,[this].concat(r)))),"state",{didAdd:!1}),w(b(t),"onUpdateStringState",function(e){return t.props.updateValue(e)}),w(b(t),"onAfterAdd",function(){return t.setState({didAdd:!0})}),w(b(t),"onAfterAddComplete",function(){return t.setState({didAdd:!1})}),t}return y(n,t.default.PureComponent),h(n,[{key:"render",value:function(){var e=this,n=this.props.options.dynamic
return t.default.createElement(E,{onAfterAdd:this.onAfterAdd,value:this.props.value,onUpdate:this.onUpdateStringState},function(r){var a=r.onAdd,i=l(r,["onAdd"])
return t.default.createElement(o.ControlWrapper,c({afterHeader:t.default.createElement("button",{onClick:a,className:"cs-value-list-add"},t.default.createElement("span",null,"+")),headerModifierClass:"has-add",managed:"no-list"},e.props),i.values.length>0&&t.default.createElement(o.ControlList,null,t.default.createElement(o.ControlItem,null,t.default.createElement(o.ControlInput,null,t.default.createElement(O,c({didAdd:e.state.didAdd,onDidAddComplete:e.onAfterAddComplete,useDynamicContent:!1!==n&&e.props.userCan("dynamic_content")},i))))))})}}]),n}()
e.default=k}),define("tco-app/src/components/controls/types/ControlBorder",["exports","react","lodash","tco-app/src/components/forms/UnitField","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/forms/ColorPicker","tco-app/src/components/forms/Select","tco-app/src/lib/i18n","tco-app/src/util/merge-options","tco-app/src/util/string","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l,c,u){function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var g=["top","right","bottom","left"],v={style:"none",width:"0px",color:"transparent",alt_color:"transparent"},b=(0,n.memoize)(function(e,t,n){return y(e,t)[n]||t},function(e,t,n){return"".concat(e,"|").concat(t,"|").concat(n)}),y=(0,n.memoize)(function(e,t){var n=(0,c.splitOnWhitespace)(e),o={}
return g.forEach(function(e,r){void 0===n[r]?o[e]="undefined"!==n[0]?n[0]:t:o[e]=n[r]}),o},function(e,t){return"".concat(e,"|").concat(t)}),_=function(e){function n(){var e
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=f(this,m(n).apply(this,arguments))).state={selectedSide:"top",linked:e.detectLinked()},e}var p,_,w
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(n,t.default.PureComponent),p=n,(_=[{key:"detectLinked",value:function(){var e=(0,c.splitOnWhitespace)(this.props.values.color||"").length<=1
if(this.props.options.color_only)return e
var t=(0,c.splitOnWhitespace)(this.props.values.style||"").length<=1,n=(0,c.splitOnWhitespace)(this.props.values.width||"").length<=1
return e&&t&&n}},{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"updateCombinedValue",value:function(e,t){var n=e.replace(/\ /g,""),o=this.state.linked?n:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Object.assign({},y(e,t),n),r=o.top,a=o.right,i=o.bottom,s=o.left
return"".concat(r," ").concat(a," ").concat(i," ").concat(s)}(this.props.values[t],v[t],function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.state.selectedSide,n))
this.props.updateValue(o,t)}},{key:"updateLinked",value:function(e){var t=function(e){return[e,e,e,e].join(" ")},n={color:e?this.getActiveValue("color"):t(this.getActiveValue("color")),alt_color:e?this.getActiveValue("alt_color"):t(this.getActiveValue("alt_color"))}
this.props.options.color_only||(n.style=e?this.getActiveValue("style"):t(this.getActiveValue("style")),n.width=e?this.getActiveValue("width"):t(this.getActiveValue("width"))),this.props.updateValues(n),this.setState({linked:e})}},{key:"getActiveValue",value:function(e){return this.valueForSide(e,this.state.selectedSide)}},{key:"valueForSide",value:function(e,t){return b(this.props.values[e],v[e],t)}},{key:"render",value:function(){var e=this,n=this.getActiveValue("style"),c=this.props.options.color_only?g.filter(function(t){return"none"!==e.valueForSide("style",t)&&(n=e.valueForSide("width",t),parseFloat((String(n).match(/-?\d*(?:\.\d+)?/)||[])[0])>0)
var n}):g,p=!this.props.options.color_only,d=p&&c.length>=2&&!this.state.linked,f=p&&"none"!==n,m=this.isKeyMapped("color")&&"none"!==n,h=p&&!this.props.options.always_linked,v=(0,l.default)({available_units:["px","em","rem"],ranges:{px:{min:0,max:25,step:1},em:{min:0,max:2.5,step:.001},rem:{min:0,max:2.5,step:.001}}},this.props.options.width||{}),b=c.map(function(e){return{value:e,class:"cs-choice-".concat(e),tooltip:(0,s.t)("app.controls.box.".concat(e))}}),y=this.props.options.color||{},_=Object.assign({},y,{label:y.alt_label||y.label||""})
return t.default.createElement(t.default.Fragment,null,h&&t.default.createElement(u.ControlItem,{label:(0,s.t)("app.controls.link-sides")},t.default.createElement(u.ControlInput,null,t.default.createElement(r.default,{value:this.state.linked,choices:[{value:!1,icon:"unlink",tooltip:(0,s.t)("app.controls.unlinked")},{value:!0,icon:"link",tooltip:(0,s.t)("app.controls.linked")}],onUpdate:function(t){return e.updateLinked(t)}}))),d&&t.default.createElement(u.ControlItem,{label:(0,s.t)("app.controls.side")},t.default.createElement(u.ControlInput,null,t.default.createElement(r.default,{value:this.state.selectedSide,choices:b,onUpdate:function(t){return e.setState({selectedSide:t})}}))),p&&t.default.createElement(u.ControlItem,{label:(0,s.t)("app.controls.style")},t.default.createElement(u.ControlInput,null,t.default.createElement(i.default,{value:n,options:[{value:"none",label:(0,s.t)("app.border.none")},{value:"solid",label:(0,s.t)("app.border.solid")},{value:"dotted",label:(0,s.t)("app.border.dotted")},{value:"dashed",label:(0,s.t)("app.border.dashed")},{value:"double",label:(0,s.t)("app.border.double")},{value:"groove",label:(0,s.t)("app.border.groove")},{value:"ridge",label:(0,s.t)("app.border.ridge")},{value:"inset",label:(0,s.t)("app.border.inset")},{value:"outset",label:(0,s.t)("app.border.outset")}],onChange:function(t){return e.updateCombinedValue(t,"style")}}))),f&&t.default.createElement(u.ControlItem,{label:(0,s.t)("app.controls.width")},t.default.createElement(u.ControlInput,null,t.default.createElement(o.default,{value:this.getActiveValue("width"),onUpdate:function(t){return e.updateCombinedValue(t,"width")},unitMode:v.unit_mode,validKeywords:v.valid_keywords,availableUnits:v.available_units,disabled:v.disabled,fallbackValue:v.fallback_value,slider:!0,ranges:v.ranges}))),m&&t.default.createElement(u.ControlItem,{label:(0,s.t)("app.controls.color")},t.default.createElement(u.ControlInput,{half:this.isKeyMapped("alt_color")},t.default.createElement(a.default,{value:this.getActiveValue("color"),options:y,usePalette:!1!==y.palette,onUpdate:function(t){return e.updateCombinedValue(t,"color")}})),this.isKeyMapped("alt_color")&&t.default.createElement(u.ControlInput,{half:!0},t.default.createElement(a.default,{value:this.getActiveValue("alt_color"),options:_,usePalette:!1!==_.palette,onUpdate:function(t){return e.updateCombinedValue(t,"alt_color")}}))))}}])&&d(p.prototype,_),w&&d(p,w),n}()
e.default=_}),define("tco-app/src/components/controls/types/ControlBoxShadow",["exports","react","tco-app/src/components/controls/Control","tco-app/src/components/forms/UnitField","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/forms/ColorPicker","tco-app/src/util/merge-options","tco-app/src/util/string","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m=function(e){function c(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),p(this,d(c).apply(this,arguments))}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(c,t.default.PureComponent),m=c,(h=[{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"getValues",value:function(){var e=(0,s.splitOnWhitespace)(this.props.value||""),t="inset"===e[0]
return t&&e.shift(),{xOffset:void 0!==e[0]?e[0]:"0px",yOffset:void 0!==e[1]?e[1]:"0px",blur:void 0!==e[2]?e[2]:"0px",spread:void 0!==e[3]?e[3]:"0px",inset:t}}},{key:"updatePart",value:function(e,t,n){var o=Object.assign({},n,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,e)),r=o.xOffset,a=o.yOffset,i=o.blur,s=o.spread,l=o.inset,c="".concat(l?"inset ":"").concat(r," ").concat(a," ").concat(i," ").concat(s)
this.props.updateValue(c)}},{key:"render",value:function(){var e=this,s=this.getValues(),c=(0,i.default)(this.props.options.x_offset||{},{available_units:["px","em","rem"],ranges:{px:{min:-50,max:50,step:1},em:{min:-1,max:1,step:.001},rem:{min:-1,max:1,step:.001}}}),u=(0,i.default)(this.props.options.y_offset||{},{available_units:["px","em","rem"],ranges:{px:{min:-50,max:50,step:1},em:{min:-1,max:1,step:.001},rem:{min:-1,max:1,step:.001}}}),p=(0,i.default)(this.props.options.blur||{},{available_units:["px","em","rem"],ranges:{px:{min:0,max:100,step:1},em:{min:0,max:5,step:.001},rem:{min:0,max:5,step:.001}}}),d=(0,i.default)(this.props.options.blur||{},{available_units:["px","em","rem"]}),f=this.props.options.color||{},m=Object.assign({},f,{label:f.alt_label||f.label||""})
return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ControlItem,{label:(0,l.t)("app.controls.x-offset")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:s.xOffset,onUpdate:function(t){return e.updatePart(t,"xOffset",s)},unitMode:c.unit_mode,validKeywords:c.valid_keywords,availableUnits:c.available_units,disabled:c.disabled,fallbackValue:c.fallback_value,slider:!0,step:c.step,min:c.min,max:c.max,ranges:c.ranges}))),t.default.createElement(n.ControlItem,{label:(0,l.t)("app.controls.y-offset")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:s.yOffset,onUpdate:function(t){return e.updatePart(t,"yOffset",s)},unitMode:u.unit_mode,validKeywords:u.valid_keywords,availableUnits:u.available_units,disabled:u.disabled,fallbackValue:u.fallback_value,slider:!0,step:u.step,min:u.min,max:u.max,ranges:u.ranges}))),t.default.createElement(n.ControlItem,{label:(0,l.t)("app.controls.blur")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:s.blur,onUpdate:function(t){return e.updatePart(t,"blur",s)},unitMode:p.unit_mode,validKeywords:p.valid_keywords,availableUnits:p.available_units,disabled:p.disabled,fallbackValue:p.fallback_value,slider:!0,step:p.step,min:p.min,max:p.max,ranges:p.ranges}))),t.default.createElement(n.ControlItem,{label:(0,l.t)("app.controls.spread-position")},t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(o.default,{value:s.spread,onUpdate:function(t){return e.updatePart(t,"spread",s)},unitMode:d.unit_mode,validKeywords:d.valid_keywords,availableUnits:d.available_units,disabled:d.disabled,fallbackValue:d.fallback_value})),t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{value:s.inset,choices:[{value:!1,icon:"sign-out-alt"},{value:!0,icon:"sign-in-alt"}],onUpdate:function(t){return e.updatePart(t,"inset",s)}}))),this.isKeyMapped("color")&&t.default.createElement(n.ControlItem,{label:(0,l.t)("app.controls.color")},t.default.createElement(n.ControlInput,{half:this.isKeyMapped("alt_color")},t.default.createElement(a.default,{value:this.props.values.color,options:f,usePalette:!1!==f.palette,onUpdate:function(t){return e.props.updateValue(t,"color")}})),this.isKeyMapped("alt_color")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(a.default,{value:this.props.values.alt_color,options:m,usePalette:!1!==m.palette,onUpdate:function(t){return e.props.updateValue(t,"alt_color")}}))))}}])&&u(m.prototype,h),g&&u(m,g),c}()
e.default=m}),define("tco-app/src/components/controls/types/ControlCheckboxList",["exports","react","tco-app/src/components/forms/Checkbox","tco-app/src/components/controls/Control"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this,r=Array.isArray(this.props.options.list)?this.props.options.list:[]
return t.default.createElement(t.default.Fragment,null,r.map(function(r){var a=r.key,i=r.label,s=r.full
return t.default.createElement(o.ControlInput,{key:a,half:!s},t.default.createElement(n.default,{checked:e.props.values[a],label:i,onToggle:function(t){return e.props.updateValue(t,a)}}))}))}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=u,c(u,"transformProps",function(e){var t=(Array.isArray(e.options.list)?e.options.list:[]).reduce(function(e,t){return e+=t.full?1:.5},0)
return t>1?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){c(e,t,n[t])})}return e}({},e,{defaultHeight:Math.ceil(t)}):e})}),define("tco-app/src/components/controls/types/ControlChooseMulti",["exports","react","tco-app/src/components/forms/ChooseMulti"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this,o=this.props.options,r=o.choices,a=o.off_value,i=o.delimiter,s=o.arrayOutput
return t.default.createElement(n.default,{choices:r,offValue:a,delimiter:i,arrayOutput:s,value:this.props.value,onUpdate:function(t){return e.props.updateValue(t)}})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlChooseSingle",["exports","react","tco-app/src/components/forms/ChooseSingle"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{choices:this.props.options.choices,offValue:this.props.options.off_value,value:this.props.value,onUpdate:function(t){return e.props.updateValue(t)}})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlClassicDimensions",["exports","react","tco-app/src/components/common/Icon","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=["top","right","bottom","left","linked"],f=["0px","0px","0px","0px","linked"],m=function(e){function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c(this,u(a).apply(this,arguments))}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(a,t.default.PureComponent),m=a,(h=[{key:"getValues",value:function(){var e=this,t={}
return d.forEach(function(n,o){t[n]=null==e.props.value?f[o]:e.props.value[o]}),t}},{key:"getConsumableValues",value:function(){try{return s(this.props.value)}catch(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){i(e,t,n[t])})}return e}({},this.props.value)}}},{key:"toggleLinked",value:function(e){var t=this.getConsumableValues()
if(t[4]=e?"linked":"unlinked",e){var n=d.indexOf(this.recentKey),o=t[n>=0?n:0]
t[0]=o,t[1]=o,t[2]=o,t[3]=o}var r=this.props.options.lock,a=void 0===r?{}:r
Object.keys(a).forEach(function(e){t[d.indexOf(e)]=a[e]}),this.props.updateValue(t)}},{key:"updateKey",value:function(e,t){this.recentKey=e
var n=this.getConsumableValues()
"linked"===n[4]?(n[0]=t,n[1]=t,n[2]=t,n[3]=t):n[d.indexOf(e)]=t
var o=this.props.options.lock,r=void 0===o?{}:o
Object.keys(r).forEach(function(e){n[d.indexOf(e)]=r[e]}),this.props.updateValue(n)}},{key:"render",value:function(){var e=this,a=this.getValues(),i=Object.assign({top:(0,o.t)("app.controls.box.top"),right:(0,o.t)("app.controls.box.right"),bottom:(0,o.t)("app.controls.box.bottom"),left:(0,o.t)("app.controls.box.left")},this.props.options.labels||{}),s=this.props.options.lock,l="linked"===a.linked
return t.default.createElement(r.ControlItem,null,t.default.createElement(r.ControlInput,null,t.default.createElement("ul",{className:"cs-dimensions"},t.default.createElement("li",null,t.default.createElement("input",{disabled:s&&s.top,type:"text",value:a.top,onChange:function(t){return e.updateKey("top",t.target.value)}}),t.default.createElement("span",null,i.top)),t.default.createElement("li",null,t.default.createElement("input",{disabled:s&&s.right,type:"text",value:a.right,onChange:function(t){return e.updateKey("right",t.target.value)}}),t.default.createElement("span",null,i.right)),t.default.createElement("li",null,t.default.createElement("input",{disabled:s&&s.bottom,type:"text",value:a.bottom,onChange:function(t){return e.updateKey("bottom",t.target.value)}}),t.default.createElement("span",null,i.bottom)),t.default.createElement("li",null,t.default.createElement("input",{disabled:s&&s.left,type:"text",value:a.left,onChange:function(t){return e.updateKey("left",t.target.value)}}),t.default.createElement("span",null,i.left)),t.default.createElement("li",null,t.default.createElement("button",{className:"cs-link-dimensions",onClick:function(){return e.toggleLinked(!l)}},t.default.createElement(n.default,{icon:l?"fa-unlink":"fa-link"}))))))}}])&&l(m.prototype,h),g&&l(m,g),a}()
e.default=m}),define("tco-app/src/components/controls/types/ControlCodeEditor",["exports","react","lodash","tco-app/src/components/forms/CodeEditor"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")}),u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var r,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.PureComponent),r=n,(u=[{key:"render",value:function(){var e=this,n=this.props.options,r=n.placeholder,a=n.mode,i=n.button_label,s=n.header_label,l=n.disable_input_preview
return t.default.createElement(o.default,{value:this.props.value,placeholder:r,mode:a,label:i,headerLabel:s,showContentPreview:!l,onUpdate:function(t){return e.props.updateValue(t)},orientation:this.props.orientation,onToggleOpen:function(e){e&&c().closeEmberExpanders()}})}}])&&a(r.prototype,u),p&&a(r,p),n}()
e.default=u}),define("tco-app/src/components/controls/types/ControlColor",["exports","react","tco-app/src/components/forms/ColorPicker","tco-app/src/components/controls/Control"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this,r=this.props,a=r.options,i=r.value,s=r.values,l=Object.assign({},a,{label:a.alt_label||a.label||""}),c=void 0!==s.alt
return t.default.createElement(t.default.Fragment,null,t.default.createElement(o.ControlInput,{half:c||a.half||this.props.level>2&&!1!==a.half},t.default.createElement(n.default,{value:i,options:a,usePalette:!1!==a.palette,onUpdate:function(t){return e.props.updateValue(t)}})),c&&t.default.createElement(o.ControlInput,{half:!0},t.default.createElement(n.default,{value:s.alt,options:l,usePalette:!1!==l.palette,onUpdate:function(t){return e.props.updateValue(t,"alt")}})))}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=c}),define("tco-app/src/components/controls/types/ControlColumns",["exports","react","react-redux","classnames","tco-app/src/util/dragula","tco-app/src/selectors/elements","tco-app/src/actions/ui","tco-app/src/actions/elements","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l,c){function u(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function h(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?v(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var w,E=["1/1","1/2 + 1/2","1/3 + 2/3","2/3 + 1/3","1/3 + 1/3 + 1/3","1/4 + 1/4 + 1/4 + 1/4","1/5 + 1/5 + 1/5 + 1/5 + 1/5"],O=E.map(function(e){return{layout:e,markup:e.split(" + ").reduce(function(e,t){return e+='<span class="cs-'.concat(t.replace("/","-"),'">').concat(t,"</span>")},"")}}),x={enablePreviewPointer:i.enablePreviewPointer,disablePreviewPointer:i.disablePreviewPointer,elementMove:s.elementMove,elementUpdateColumnLayout:s.elementUpdateColumnLayout},k=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(r)))),"state",{useCustom:!1,customValue:""}),_(v(t),"onChange",function(e){var n=e.target.value
t.chooseLayout(n),t.setState({customValue:n,useCustom:!0})}),t}return b(n,t.default.PureComponent),m(n,[{key:"chooseLayout",value:function(e){this.setState({useCustom:!1}),this.props.elementUpdateColumnLayout(this.props.inspecting,e)}},{key:"render",value:function(){var e=this,n=this.props.isCustomLayout||this.state.useCustom,r=this.state.customValue||this.props.currentLayout
return t.default.createElement("div",{className:"cs-column-layout"},t.default.createElement("ul",null,O.map(function(r){var a=r.layout,i=r.markup
return t.default.createElement("li",{className:(0,o.default)({"cs-active":!n&&e.props.currentLayout===a}),key:a,onClick:function(){return e.chooseLayout(a)},dangerouslySetInnerHTML:{__html:i}})}),t.default.createElement("li",{className:(0,o.default)("custom",{"cs-active":n}),onClick:function(){return e.setState({useCustom:!0})}},t.default.createElement("span",{className:"cs-1-1 custom"},t.default.createElement("span",null,(0,l.t)("app.custom"))))),n&&t.default.createElement("input",{type:"text",value:r,onChange:this.onChange}))}}]),n}(),S=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(r)))),"state",{isDragging:!1}),t}return b(n,t.default.PureComponent),m(n,[{key:"componentDidMount",value:function(){var e=this
this.ulRef&&(this.drake=(0,r.default)([this.ulRef],{accepts:function(){return!0},moves:function(e){return!!e.classList&&e.classList.contains("cs-column-order-item")},offset:function(e,t,n){return{y:e.y,x:n.clientHeight/2}},mirrorContainer:this.ulRef,direction:"horizontal",revertOnSpill:!0}),this.drake.on("drag",function(t){e.liftIndex=u(t.parentElement.children).indexOf(t),e.setState({isDragging:!0}),e.props.disablePreviewPointer()}),this.drake.on("drop",function(t,n,o,r){var a=r&&r.parentElement&&u(r.parentElement.children).indexOf(r)-1,i=e.props.columns[e.liftIndex]&&e.props.columns[e.liftIndex]._id
i&&e.props.elementMove(i,a)}),this.drake.on("dragend",function(){e.setState({isDragging:!1}),e.props.enablePreviewPointer()}))}},{key:"componentWillUnmount",value:function(){this.drake&&this.drake.destroy()}},{key:"render",value:function(){var e=this
return t.default.createElement("ul",{className:(0,o.default)("cs-column-order",{"cs-sorting":this.state.isDragging}),ref:function(t){return e.ulRef=t}},this.props.columns.map(function(e){var n=e._id,r=e.size
return t.default.createElement("li",{key:n,className:(0,o.default)("cs-column-order-item","cs-".concat(r.replace("/","-")))},t.default.createElement("span",{className:"handle"},t.default.createElement("span",null,r)))}))}}]),n}(),P=function(e){function n(){return d(this,n),h(this,g(n).apply(this,arguments))}return b(n,t.default.PureComponent),m(n,[{key:"render",value:function(){return t.default.createElement(c.ControlItem,null,t.default.createElement(c.ControlInput,null,t.default.createElement(k,this.props),t.default.createElement(S,this.props)))}}]),n}(),C=(0,n.connect)((w=(0,a.makeGetActiveColumns)(),function(e,t){var n=t.inspecting,o=n&&w(e,{id:n})||[],r=o.map(function(e){return e.size}).join(" + ")
return{columns:o,currentLayout:r,isCustomLayout:!E.includes(r)}}),x)(P)
e.default=C}),define("tco-app/src/components/controls/types/ControlDateTime",["exports","react","classnames","tco-app/src/components/common/DynamicContentInput"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=["date"],u=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),u=r,(p=[{key:"render",value:function(){var e=this.props.options,r=e.placeholder,a=e.monospace,i=e.input_type,s=e.dynamic,l=i&&c.includes(i)?i:"text",u=!1!==s&&this.props.userCan("dynamic_content")&&"text"===l,p="TBD"===this.props.value?window.csAppData.countdownTBD:this.props.value
return t.default.createElement(o.default,{className:(0,n.default)({"cs-input-code":a}),type:"date",dateOptions:this.props.dateTimeOptions,onUpdate:this.props.updateValue,value:p,enabled:u,placeholder:r||""})}}])&&a(u.prototype,p),d&&a(u,d),r}()
e.default=u}),define("tco-app/src/components/controls/types/ControlDimensions",["exports","react","lodash","tco-app/src/components/forms/UnitField","tco-app/src/components/forms/ChooseSingle","tco-app/src/util/merge-options","tco-app/src/util/string","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var h=["top","right","bottom","left"],g=h.reduce(function(e,t){return e[t]=(0,s.t)("app.controls.box.".concat(t)),e},{}),v=(0,n.memoize)(function(e,t,n){return b(e,t)[n]||t},function(e,t,n){return"".concat(e,"|").concat(t,"|").concat(n)}),b=(0,n.memoize)(function(e,t){var n=(0,i.splitOnWhitespace)(e),o={}
return h.forEach(function(e,r){void 0===n[r]?o[e]="undefined"!==n[0]?n[0]:t:o[e]=n[r]}),o},function(e,t){return"".concat(e,"|").concat(t)}),y=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=p(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==c(r)&&"function"!=typeof r?d(o):r,m(d(t),"state",{recentSide:"top",linked:null}),m(d(t),"updateLinked",function(e){e&&t.props.updateValue(t.getCombinedValueUpdate(t.getActiveValue(t.state.recentSide))),t.setState({linked:!!e})}),t}var y,_,w
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.PureComponent),y=n,(_=[{key:"componentDidUpdate",value:function(e){this.props.inspecting!==e.inspecting&&this.resetLinked()}},{key:"getActiveValue",value:function(e){return this.props.options[e]&&this.props.options[e].disabled&&void 0!==this.props.options[e].fallback_value?this.props.options[e].fallback_value:v(this.props.value,"0px",e)}},{key:"isLinked",value:function(){return null===this.state.linked?(e=this.props.value,t=(0,i.splitOnWhitespace)(e||""),n={},t.forEach(function(e){return n[e]=!0}),Object.keys(n).length<=1):this.state.linked
var e,t,n}},{key:"getCombinedValueUpdate",value:function(e,t){var n=this,o=Object.assign({},b(this.props.value,"0px"),t?m({},t,e):{})
if(!this.isLinked()&&t||h.forEach(function(t){o[t]=e,n.props.options[t]&&n.props.options[t].disabled&&void 0!==n.props.options[t].fallback_value&&(o[t]=n.props.options[t].fallback_value)}),r===e&&a===e&&s===e&&i===e)return e
var r=o.top,a=o.right,i=o.bottom,s=o.left
return"".concat(r," ").concat(a," ").concat(i," ").concat(s)}},{key:"updateCombinedValue",value:function(e,t){this.setState({recentSide:t,linked:this.isLinked()}),this.props.updateValue(this.getCombinedValueUpdate(e,t))}},{key:"resetLinked",value:function(){this.setState({linked:null})}},{key:"render",value:function(){var e=this
return t.default.createElement(t.default.Fragment,null,t.default.createElement(l.ControlItem,{label:(0,s.t)("app.controls.link-sides")},t.default.createElement(l.ControlInput,null,t.default.createElement(r.default,{value:this.isLinked(),choices:[{value:!1,icon:"unlink",tooltip:(0,s.t)("app.controls.unlinked")},{value:!0,icon:"link",tooltip:(0,s.t)("app.controls.linked")}],onUpdate:this.updateLinked}))),h.map(function(n){var r=e.props.options.labels&&e.props.options.labels[n]?e.props.options.labels[n]:g[n],i=(0,a.default)({available_units:["px","em","rem","%"],ranges:{px:{min:0,max:100,step:1},em:{min:0,max:2.5,step:.001},rem:{min:0,max:2.5,step:.001},"%":{min:0,max:100,step:.1}}},e.props.options[n]||{})
return t.default.createElement(l.ControlItem,{key:n,label:r},t.default.createElement(l.ControlInput,null,t.default.createElement(o.default,{value:e.getActiveValue(n),onUpdate:function(t){return e.updateCombinedValue(t,n)},unitMode:i.unit_mode,validKeywords:i.valid_keywords,availableUnits:i.available_units,disabled:i.disabled,fallbackValue:i.fallback_value,slider:!0,ranges:i.ranges})))}))}}])&&u(y.prototype,_),w&&u(y,w),n}()
e.default=y}),define("tco-app/src/components/controls/types/ControlFlex",["exports","react","tco-app/src/components/forms/FlexPicker"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){return t.default.createElement(n.default,{value:this.props.value,updateValue:this.props.updateValue})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlFlexbox",["exports","react","tco-app/src/components/controls/Control","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/forms/Checkbox","tco-app/src/components/forms/FlexPicker","tco-app/src/components/forms/PlacementPicker","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m=["flex-start","center","flex-end"],h=["space-between","space-around"],g=["stretch"],v=function(e){return[].concat(m,g).includes(e)?e:"space-around"===e?"stretch":m[0]},b=function(e){return[].concat(m,h).includes(e)?e:"stretch"===e?"space-around":m[0]},y=function(e){function m(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,m)
for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i]
return n=this,o=(e=u(m)).call.apply(e,[this].concat(a)),t=!o||"object"!==l(o)&&"function"!=typeof o?p(n):o,f(p(t),"onUpdateSelfFlex",function(e){return t.props.updateValue(e,"self")}),f(p(t),"onUpdateFlexDirection",function(e){e!==t.getFlexDirection()&&t.props.updateValues({direction:"".concat(e).concat(!1!==t.props.options.allow_reverse&&t.getReverseLayout()?"-reverse":""),justify:b(t.props.values.align),align:v(t.props.values.justify)})}),f(p(t),"onUpdateWrap",function(e){return t.props.updateValue(e,"wrap")}),f(p(t),"onUpdateReverseLayout",function(e){var n=!1!==t.props.options.allow_reverse&&e?"-reverse":""
t.props.updateValue("".concat(t.getFlexDirection()).concat(n),"direction")}),t}var h,g,y
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(m,t.default.PureComponent),h=m,(g=[{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"getReverseLayout",value:function(){return(this.props.values.direction||"").includes("reverse")}},{key:"getFlexDirection",value:function(){return(this.props.values.direction||"row").split("-")[0]}},{key:"render",value:function(){var e=this,l=this.getFlexDirection(),c="row"===l,u=c?"justify":"align",p=c?"align":"justify"
return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.flex.children")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:l,choices:[{value:"row",label:(0,s.t)("app.controls.flex.row")},{value:"column",label:(0,s.t)("app.controls.flex.column")}],onUpdate:this.onUpdateFlexDirection})),!1!==this.props.options.allow_reverse&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.getReverseLayout(),label:(0,s.t)("app.controls.flex.reverse"),onToggle:this.onUpdateReverseLayout})),this.isKeyMapped("wrap")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.props.values.wrap,label:(0,s.t)("app.controls.flex.wrap"),onToggle:this.onUpdateWrap}))),t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.flex.align-h")},t.default.createElement(n.ControlInput,null,t.default.createElement(i.default,{value:this.props.values[u],display:"flex",axis:c?"main":"cross",context:"content",iconDirection:"x",onChange:function(t){return e.props.updateValue(t,u)}}))),t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.flex.align-v")},t.default.createElement(n.ControlInput,null,t.default.createElement(i.default,{value:this.props.values[p],display:"flex",axis:c?"cross":"main",context:"items",iconDirection:"y",onChange:function(t){return e.props.updateValue(t,p)}}))),this.isKeyMapped("self")&&t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.flex.self")},t.default.createElement(n.ControlInput,null,t.default.createElement(a.default,{value:this.props.values.self,updateValue:this.onUpdateSelfFlex}))))}}])&&c(h.prototype,g),y&&c(h,y),m}()
e.default=y}),define("tco-app/src/components/controls/types/ControlFontFamily",["exports","react","tco-app/src/components/forms/Select","lodash"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),u=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i(this,s(o).apply(this,arguments))}var r,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(o,t.default.PureComponent),r=o,(u=[{key:"componentDidMount",value:function(){"fw_fallback"===this.props.value&&this.props.updateValue("inherit")}},{key:"render",value:function(){var e=this,o=c().peekAll("font-manager/selection").filter(function(e){return e.get("selectable")}).map(function(e){return{value:e.get("_id"),label:e.get("title")}})
return o.unshift({value:"inherit",label:"Inherit"}),t.default.createElement(n.default,{value:this.props.value,options:o,onChange:function(t){return e.props.updateValue(t)}})}}])&&a(r.prototype,u),p&&a(r,p),o}()
e.default=u}),define("tco-app/src/components/controls/types/ControlFontWeight",["exports","react","lodash","tco-app/src/components/forms/Select","tco-app/src/lib/i18n"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),p=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:font-manager")}),d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var a,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.PureComponent),a=n,(d=[{key:"componentDidMount",value:function(){0===this.props.value.indexOf("fw_fallback")&&this.props.updateValue(this.props.value.replace("fw_fallback","inherit"))}},{key:"componentDidUpdate",value:function(e){if(e.font_family!==this.props.values.font_family){var t=this.getWeightOptions(),n=this.props.value.split(":").pop(),o=t.find(function(e){return e.value.split(":").pop()===n})||t.find(function(e){return"400"===e.value.split(":").pop()})||t[0]
o&&o.value!==this.props.value&&this.props.updateValue(o.value)}}},{key:"getWeightOptions",value:function(){var e=this,t="inherit",n=p().get("allWeights")||[]
if("inherit"!==this.props.values.font_family){var o=u().peekAll("font-manager/selection").find(function(t){return e.props.values.font_family===t.get("_id")})
o&&(t=o.get("_id"),n=o.get("weights")||[])}return n.filter(function(e){return!e.includes("i")}).sort().map(function(e){return{value:"".concat(t,":").concat(e),label:(0,r.t)("app.font-weight.".concat(e))}})}},{key:"render",value:function(){var e=this
return t.default.createElement(o.default,{value:this.props.value,options:this.getWeightOptions(),onChange:function(t){return e.props.updateValue(t)}})}}])&&i(a.prototype,d),f&&i(a,f),n}()
e.default=d}),define("tco-app/src/components/controls/types/ControlIcon",["exports","react","tco-app/src/components/forms/IconPicker","tco-app/src/components/controls/Control"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this.props,r=e.value,a=e.values,i=e.options,s=e.updateValue
return t.default.createElement(t.default.Fragment,null,t.default.createElement(o.ControlInput,{half:!!a.alt||i.half||this.props.level>2&&!1!==i.half},t.default.createElement(n.default,{value:r,label:i.label,onUpdate:function(e){return s(e)}})),a.alt&&t.default.createElement(o.ControlInput,{half:!0},t.default.createElement(n.default,{value:a.alt,label:i.alt_label||i.label,onUpdate:function(e){return s(e,"alt")}})))}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=c}),define("tco-app/src/components/controls/types/ControlImage",["exports","react","classnames","tco-app/src/components/forms/Checkbox","tco-app/src/components/forms/ImageUpload","tco-app/src/components/common/Icon","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=function(e){function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),u(this,p(l).apply(this,arguments))}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(l,t.default.PureComponent),f=l,(m=[{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"renderUpload",value:function(){var e=this,n=this.isKeyMapped("img_source")?"img_source":"value"
return t.default.createElement(s.ControlInput,null,t.default.createElement(r.default,{useDynamicContent:!1!==this.props.options.dynamic&&this.props.userCan("dynamic_content"),value:this.props.values[n],onUpdate:function(t){return e.props.updateValue(t,n)},onUpdateDimensions:function(t){var n=t.width,o=t.height
n!==e.props.values.width&&e.props.updateValue(n,"width"),o!==e.props.values.height&&e.props.updateValue(o,"height")}}))}},{key:"retinaPreview",value:function(e){return e&&this.props.values.is_retina?Math.round(e/2):e}},{key:"render",value:function(){var e=this
if(this.props.level>1)return this.renderUpload()
var r=this.isKeyMapped("has_link"),l=this.isKeyMapped("has_info"),c=this.isKeyMapped("is_retina"),u=this.isKeyMapped("alt_text"),p=r||l,d=4
return u&&(d-=1),r&&(d-=.5),l&&(d-=.5),d=Math.floor(d),t.default.createElement(t.default.Fragment,null,t.default.createElement(s.ControlItem,{label:c?(0,i.t)("app.controls.image.retina"):(0,i.t)("app.controls.image.dim-preview")},t.default.createElement(s.ControlInput,null,t.default.createElement("div",{className:"cs-image-dimensions"},c&&t.default.createElement("button",{className:(0,n.default)({"cs-active":this.props.values.is_retina}),onClick:function(){return e.props.updateValue(!e.props.values.is_retina,"is_retina")}},t.default.createElement(a.default,{icon:"fa-eye"})),t.default.createElement("div",null,t.default.createElement("span",null,(0,i.t)("app.controls.image.w")),t.default.createElement("input",{type:"text",disabled:!0,value:this.retinaPreview(this.props.values.width)})),t.default.createElement("div",null,t.default.createElement("span",null,(0,i.t)("app.controls.image.h")),t.default.createElement("input",{type:"text",disabled:!0,value:this.retinaPreview(this.props.values.height)}))))),t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.image.source"),height:d},this.renderUpload()),u&&t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.image.alt-text")},t.default.createElement(s.ControlInput,null,t.default.createElement("input",{type:"text",value:this.props.values.alt_text,placeholder:this.props.options.alt_text_placeholder||(0,i.t)("app.controls.image.alt-text"),onChange:function(t){return e.props.updateValue(t.target.value,"alt_text")}}))),p&&t.default.createElement(s.ControlItem,{label:" "},r&&t.default.createElement(s.ControlInput,null,t.default.createElement(o.default,{checked:this.props.values.has_link,label:(0,i.t)("app.controls.image.link"),half:!0,onToggle:function(t){return e.props.updateValue(t,"has_link")}})),l&&t.default.createElement(s.ControlInput,null,t.default.createElement(o.default,{checked:this.props.values.has_info,label:(0,i.t)("app.controls.image.info"),half:!0,onToggle:function(t){return e.props.updateValue(t,"has_info")}}))))}}])&&c(f.prototype,m),h&&c(f,h),l}()
e.default=f}),define("tco-app/src/components/controls/types/ControlImageSource",["exports","react","tco-app/src/components/forms/ImageUpload"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{useDynamicContent:!1!==this.props.options.dynamic&&this.props.userCan("dynamic_content"),value:this.props.value,pattern:this.props.options.pattern,onUpdate:function(t){return e.props.updateValue(t)}})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l})
define("tco-app/src/components/controls/types/ControlLayoutCell",["exports","react","react-redux","tco-app/src/components/forms/ResponsiveTabsVertical","tco-app/src/components/forms/PlacementPicker","tco-app/src/components/common/Icon","tco-app/src/svg/cell-auto-placement","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function d(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?m(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var b=function(e){function n(){var e,t
c(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return v(m(t=d(this,(e=f(n)).call.apply(e,[this].concat(r)))),"state",{hideMessage:!1}),v(m(t),"onHideAutoPlacementMessage",function(){return t.setState({hideMessage:!0})}),t}return h(n,t.default.Component),p(n,[{key:"render",value:function(){return this.props.isPlaced||this.state.hideMessage?null:t.default.createElement("div",{className:"cs-responsive-tabs-message",onClick:this.onHideAutoPlacementMessage},t.default.createElement("div",{className:"cs-responsive-tabs-message-content"},t.default.createElement(i.default,null),t.default.createElement("h6",null,"Auto Placement"),t.default.createElement("p",null,"For greater control, click to access the advanced layout options")))}}]),n}(),y=function(e){function n(){var e,t
c(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return v(m(t=d(this,(e=f(n)).call.apply(e,[this].concat(r)))),"state",{selected:null}),v(m(t),"onChangeSize",function(e){return t.setState({selected:e})}),v(m(t),"getSelectedColumnStart",function(){return"column_start_".concat(t.state.selected||t.props.current)}),v(m(t),"getSelectedColumnEnd",function(){return"column_end_".concat(t.state.selected||t.props.current)}),v(m(t),"getSelectedRowStart",function(){return"row_start_".concat(t.state.selected||t.props.current)}),v(m(t),"getSelectedRowEnd",function(){return"row_end_".concat(t.state.selected||t.props.current)}),v(m(t),"getSelectedJustifySelf",function(){return"justify_self_".concat(t.state.selected||t.props.current)}),v(m(t),"getSelectedAlignSelf",function(){return"align_self_".concat(t.state.selected||t.props.current)}),v(m(t),"onChangeColumnStartValue",function(e){return t.props.onChange(t.getSelectedColumnStart(),e.target.value)}),v(m(t),"onChangeColumnEndValue",function(e){return t.props.onChange(t.getSelectedColumnEnd(),e.target.value)}),v(m(t),"onChangeRowStartValue",function(e){return t.props.onChange(t.getSelectedRowStart(),e.target.value)}),v(m(t),"onChangeRowEndValue",function(e){return t.props.onChange(t.getSelectedRowEnd(),e.target.value)}),v(m(t),"onChangeJustifySelfValue",function(e){return t.props.onChange(t.getSelectedJustifySelf(),e)}),v(m(t),"onChangeAlignSelfValue",function(e){return t.props.onChange(t.getSelectedAlignSelf(),e)}),v(m(t),"makeContextMenuAtts",function(e){return{"cs-context-menu-inspector":[t.props.inspecting,"layout-cell",e].join("::")}}),t}return h(n,t.default.Component),p(n,[{key:"getIsPlaced",value:function(){return this.props.values[this.getSelectedColumnStart()]||this.props.values[this.getSelectedColumnEnd()]||this.props.values[this.getSelectedRowStart()]||this.props.values[this.getSelectedRowEnd()]||"auto"!==this.props.values[this.getSelectedJustifySelf()]||"auto"!==this.props.values[this.getSelectedAlignSelf()]}},{key:"render",value:function(){var e=this.state.selected||this.props.current,n="".concat(this.props.inspecting,":").concat(e)
return t.default.createElement(o.default,{current:this.props.current,selected:e,onChange:this.onChangeSize,contextMenuId:this.props.inspecting,makeContextMenuAtts:this.makeContextMenuAtts},t.default.createElement(b,{isPlaced:this.getIsPlaced(),key:n}),t.default.createElement(s.ControlList,null,t.default.createElement(s.ControlItem,{label:"X Axis & Alignment"},t.default.createElement(s.ControlInput,{half:!0},t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedColumnStart()],placeholder:"Start",onChange:this.onChangeColumnStartValue})),t.default.createElement(s.ControlInput,{half:!0},t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedColumnEnd()],placeholder:"End",onChange:this.onChangeColumnEndValue}))),t.default.createElement(s.ControlItem,{label:" "},t.default.createElement(s.ControlInput,null,t.default.createElement(r.default,{value:this.props.values[this.getSelectedJustifySelf()],display:"grid",axis:"main",context:"self",iconDirection:"x",onChange:this.onChangeJustifySelfValue}))),t.default.createElement(s.ControlItem,{label:"Y Axis & Alignment"},t.default.createElement(s.ControlInput,{half:!0},t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedRowStart()],placeholder:"Start",onChange:this.onChangeRowStartValue})),t.default.createElement(s.ControlInput,{half:!0},t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedRowEnd()],placeholder:"End",onChange:this.onChangeRowEndValue}))),t.default.createElement(s.ControlItem,{label:" "},t.default.createElement(s.ControlInput,null,t.default.createElement(r.default,{value:this.props.values[this.getSelectedAlignSelf()],display:"grid",axis:"cross",context:"self",iconDirection:"y",onChange:this.onChangeAlignSelfValue})))))}}]),n}(),_=function(e){function n(){var e,t
c(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return v(m(t=d(this,(e=f(n)).call.apply(e,[this].concat(r)))),"onChange",function(e,n){return t.props.updateValue(n,e)}),t}return h(n,t.default.PureComponent),p(n,[{key:"render",value:function(){return t.default.createElement(s.ControlItem,null,t.default.createElement(s.ControlInput,null,t.default.createElement(y,{inspecting:this.props.inspecting,key:this.props.previewBreakpoint,current:this.props.previewBreakpoint,values:this.props.values,onChange:this.onChange})))}}]),n}(),w=(0,n.connect)(function(e){return{previewBreakpoint:e.builder.previewBreakpoint}})(_)
e.default=w}),define("tco-app/src/components/controls/types/ControlLayoutColumn",["exports","react","react-redux","tco-app/src/components/forms/ResponsiveTabsVertical","tco-app/src/components/controls/Control"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?p(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var h=function(e){function n(){var e,t
i(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return m(p(t=c(this,(e=u(n)).call.apply(e,[this].concat(r)))),"state",{selected:null}),m(p(t),"onChangeSize",function(e){return t.setState({selected:e})}),m(p(t),"getSelectedFlexGrow",function(){return"flex_grow_".concat(t.state.selected||t.props.current)}),m(p(t),"getSelectedFlexShrink",function(){return"flex_shrink_".concat(t.state.selected||t.props.current)}),m(p(t),"getSelectedFlexBasis",function(){return"flex_basis_".concat(t.state.selected||t.props.current)}),m(p(t),"onChangeFlexGrowValue",function(e){t.props.onChange(t.getSelectedFlexGrow(),e.target.value)}),m(p(t),"onChangeFlexShrinkValue",function(e){t.props.onChange(t.getSelectedFlexShrink(),e.target.value)}),m(p(t),"onChangeFlexBasisValue",function(e){t.props.onChange(t.getSelectedFlexBasis(),e.target.value)}),t}return d(n,t.default.Component),l(n,[{key:"render",value:function(){var e=this.state.selected||this.props.current
return t.default.createElement(o.default,{current:this.props.current,selected:e,onChange:this.onChangeSize},t.default.createElement(r.ControlList,null,t.default.createElement(r.ControlItem,{label:"Flex Grow"},t.default.createElement(r.ControlInput,null,t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedFlexGrow()],placeholder:"0",onChange:this.onChangeFlexGrowValue}))),t.default.createElement(r.ControlItem,{label:"Flex Shrink"},t.default.createElement(r.ControlInput,null,t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedFlexShrink()],placeholder:"1",onChange:this.onChangeFlexShrinkValue}))),t.default.createElement(r.ControlItem,{label:"Flex Basis"},t.default.createElement(r.ControlInput,null,t.default.createElement("input",{type:"text",value:this.props.values[this.getSelectedFlexBasis()],placeholder:"auto",onChange:this.onChangeFlexBasisValue})))))}}]),n}(),g=function(e){function n(){var e,t
i(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return m(p(t=c(this,(e=u(n)).call.apply(e,[this].concat(r)))),"onChange",function(e,n){return t.props.updateValue(n,e)}),t}return d(n,t.default.PureComponent),l(n,[{key:"render",value:function(){return t.default.createElement(r.ControlItem,null,t.default.createElement(r.ControlInput,null,t.default.createElement(h,{key:this.props.previewBreakpoint,current:this.props.previewBreakpoint,values:this.props.values,onChange:this.onChange})))}}]),n}(),v=(0,n.connect)(function(e){return{previewBreakpoint:e.builder.previewBreakpoint}})(g)
e.default=v}),define("tco-app/src/components/controls/types/ControlLayoutGrid",["exports","react","react-redux","tco-app/src/util/idle-callback","tco-app/src/components/forms/ResponsiveTabsVertical","tco-app/src/components/forms/GridTemplateInput","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function p(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var v=function(e,t){return Number.isNaN(t)?e:e.replace(/([\d.]+vw)/g,function(e){var n=parseFloat(e)
return n?"".concat(n/100*t,"px"):e})},b=function(e){function n(){var e,t
l(this,n)
for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i]
return g(f(t=p(this,(e=d(n)).call.apply(e,[this].concat(a)))),"state",{columnTemplate:"",rowTemplate:"",keyword:null}),g(f(t),"idleUpdateComputedStyles",(0,o.debounceIdleCallback)(function(){return t.updateComputedStyles()})),g(f(t),"onResize",function(){return t.idleUpdateComputedStyles()}),t}return m(n,t.default.Component),u(n,[{key:"componentDidMount",value:function(){this.updateComputedStyles(),window.addEventListener("resize",this.onResize)}},{key:"componentDidUpdate",value:function(e){this.props.gridTemplateColumns===e.gridTemplateColumns&&this.props.gridTemplateRows===e.gridTemplateRows||this.idleUpdateComputedStyles()}},{key:"componentWillUnmount",value:function(){this.idleUpdateComputedStyles.cancel(),window.removeEventListener("resize",this.onResize)}},{key:"updateComputedStyles",value:function(){var e=this.props.gridTemplateColumns.match(".*?(auto-(?:fit|fill))")||[],t=this.props.gridTemplateRows.match(".*?(auto-(?:fit|fill))")||[]
if(e[1]||t[1])return this.setState({total:1,keyword:e[1]||t[1],columnTemplate:"",rowTemplate:""})
if(this.sizerEl){var n=window.getComputedStyle(this.sizerEl),o=n.gridTemplateColumns,r=n.gridTemplateRows,a=o.split(" ").map(function(e){return parseFloat(e)}),i=r.split(" ").map(function(e){return parseFloat(e)}),s=a.reduce(function(e,t){return e+t},0),l=i.reduce(function(e,t){return e+t},0),c=a.map(function(e){return Math.round(e/s*1e3)}),u=i.map(function(e){return Math.round(e/l*1e3)})
this.setState({total:a.length*i.length,columnTemplate:c.map(function(e){return"".concat(e,"fr")}).join(" "),rowTemplate:u.map(function(e){return"".concat(e,"fr")}).join(" "),keyword:null})}}},{key:"getSizerMaxWidth",value:function(){return"xs"===this.props.bp?"480px":"sm"===this.props.bp?"768px":"md"===this.props.bp?"980px":"lg"===this.props.bp?"1200px":"none"}},{key:"renderSizer",value:function(){var e=this,n=this.props,o=n.gridTemplateColumns,r=n.gridTemplateRows,a=this.getSizerMaxWidth(),i=parseInt(a)
return t.default.createElement("div",{className:"cs-grid-template-preview-sizer",ref:function(t){return e.sizerEl=t},style:{gridTemplateColumns:v(o,i),gridTemplateRows:v(r,i),maxWidth:a}},t.default.createElement("i",null))}},{key:"renderPreview",value:function(){if(this.state.keyword)return t.default.createElement("div",{className:"cs-grid-template-preview is-keyword"},t.default.createElement("span",null,this.state.keyword))
var e=this.state,n=e.columnTemplate,o=e.rowTemplate,r=e.total,a=new Array(r).fill().map(function(e,t){return t})
return t.default.createElement("div",{className:"cs-grid-template-preview",style:{gridTemplateColumns:n,gridTemplateRows:o}},a.map(function(e){return t.default.createElement("i",{key:e})}))}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.renderSizer(),this.renderPreview())}}]),n}(),y=function(e){function n(){var e,t
l(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return g(f(t=p(this,(e=d(n)).call.apply(e,[this].concat(r)))),"state",{selected:null}),g(f(t),"onChangeSize",function(e){return t.setState({selected:e})}),g(f(t),"getSelectedColumns",function(){return"template_columns_".concat(t.state.selected||t.props.current)}),g(f(t),"getSelectedRows",function(){return"template_rows_".concat(t.state.selected||t.props.current)}),g(f(t),"onChangeColumnsValue",function(e){t.props.onChange(t.getSelectedColumns(),e)}),g(f(t),"onChangeRowsValue",function(e){t.props.onChange(t.getSelectedRows(),e)}),g(f(t),"makeContextMenuAtts",function(e){return{"cs-context-menu-inspector":[t.props.inspecting,"layout-grid",e].join("::")}}),t}return m(n,t.default.Component),u(n,[{key:"getPicker",value:function(){return t.default.createElement("div",{className:"cs-grid-template-picker"},t.default.createElement("button",null,t.default.createElement("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t.default.createElement("path",{d:"M13.3,5.2l1.1-2.1l-1.4-1.4l-2.1,1.1c-0.3-0.2-0.7-0.3-1.1-0.4L9,0H7L6.2,2.3C5.9,2.4,5.5,2.5,5.2,2.7 L3.1,1.6L1.6,3.1l1.1,2.1C2.5,5.5,2.4,5.9,2.3,6.2L0,7v2l2.3,0.8c0.1,0.4,0.3,0.7,0.4,1.1l-1.1,2.1l1.4,1.4l2.1-1.1 c0.3,0.2,0.7,0.3,1.1,0.4L7,16h2l0.8-2.3c0.4-0.1,0.7-0.3,1.1-0.4l2.1,1.1l1.4-1.4l-1.1-2.1c0.2-0.3,0.3-0.7,0.4-1.1L16,9V7 l-2.3-0.8C13.6,5.9,13.5,5.5,13.3,5.2z M8,11c-1.7,0-3-1.3-3-3s1.3-3,3-3s3,1.3,3,3S9.7,11,8,11z"}))))}},{key:"render",value:function(){var e=this.state.selected||this.props.current,n=this.props.values[this.getSelectedColumns()],o=this.props.values[this.getSelectedRows()]
return t.default.createElement(r.default,{current:this.props.current,selected:e,onChange:this.onChangeSize,makeContextMenuAtts:this.makeContextMenuAtts},t.default.createElement(b,{key:e,bp:e,gridTemplateColumns:n.trim(),gridTemplateRows:o.trim()}),t.default.createElement(i.ControlList,null,t.default.createElement(i.ControlItem,{label:"Columns Template"},t.default.createElement(i.ControlInput,null,t.default.createElement(a.default,{value:n,onChange:this.onChangeColumnsValue,emptyMessage:"Click + to begin creating a Column Template."}))),t.default.createElement(i.ControlItem,{label:"Rows Template"},t.default.createElement(i.ControlInput,null,t.default.createElement(a.default,{value:o,onChange:this.onChangeRowsValue,emptyMessage:"Click + to begin creating a Row Template."})))))}}]),n}(),_=function(e){function n(){var e,t
l(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return g(f(t=p(this,(e=d(n)).call.apply(e,[this].concat(r)))),"onChange",function(e,n){return t.props.updateValue(n,e)}),t}return m(n,t.default.PureComponent),u(n,[{key:"render",value:function(){return t.default.createElement(i.ControlItem,null,t.default.createElement(i.ControlInput,null,t.default.createElement(y,{key:this.props.previewBreakpoint,inspecting:this.props.inspecting,current:this.props.previewBreakpoint,values:this.props.values,onChange:this.onChange})))}}]),n}(),w=(0,n.connect)(function(e){var t=e.builder.previewBreakpoint
e.ui.gridTemplateCache,e.inspector.inspecting
return{previewBreakpoint:t}})(_)
e.default=w}),define("tco-app/src/components/controls/types/ControlLayoutRow",["exports","react","react-redux","tco-app/src/components/forms/ResponsiveTabsVertical","tco-app/src/components/forms/ChooseLayoutRow","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var g=function(e){function n(){var e,t
s(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return h(d(t=u(this,(e=p(n)).call.apply(e,[this].concat(r)))),"state",{selected:null}),h(d(t),"onChangeSize",function(e){return t.setState({selected:e})}),h(d(t),"onChangeValue",function(e){return t.props.onChange(t.getSelected(),e)}),t}return f(n,t.default.Component),c(n,[{key:"getSelected",value:function(){return this.state.selected||this.props.current}},{key:"render",value:function(){var e=this.getSelected()
return t.default.createElement(o.default,{current:this.props.current,selected:e,onChange:this.onChangeSize,sizes:Object.keys(this.props.values)},t.default.createElement(r.default,{key:e,value:this.props.values[e],onChange:this.onChangeValue}))}}]),n}(),v=function(e){function n(){var e,t
s(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return h(d(t=u(this,(e=p(n)).call.apply(e,[this].concat(r)))),"onChange",function(e,n){return t.props.updateValue(n,e)}),t}return f(n,t.default.PureComponent),c(n,[{key:"render",value:function(){return t.default.createElement(a.ControlItem,null,t.default.createElement(a.ControlInput,null,t.default.createElement(g,{key:this.props.previewBreakpoint,current:this.props.previewBreakpoint,values:this.props.values,onChange:this.onChange})))}}]),n}(),b=(0,n.connect)(function(e){return{previewBreakpoint:e.builder.previewBreakpoint}})(v)
e.default=b}),define("tco-app/src/components/controls/types/ControlLink",["exports","react","tco-app/src/components/controls/Control","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/forms/Checkbox","tco-app/src/lib/i18n","lodash","tco-app/src/components/common/DynamicContentInput"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=(0,i.memoize)(function(e){return(e||"").match(/mailto:/)?"email":(e||"").match(/tel:/)?"tel":"url"}),m=(0,i.memoize)(function(e){return(e||"").match(/mailto:/)?e.replace(/mailto:(?:\/\/)?/g,"").replace(/\?.*/g,""):""}),h=(0,i.memoize)(function(e){if(!(e||"").match(/mailto:/))return""
var t=e.match(/\?subject=(.*)/)||""
return t||t[1]?decodeURI(t[1]):""}),g=(0,i.memoize)(function(e){return(e||"").match(/tel:/)?decodeURI(e.replace(/tel:(?:\/\/)?/g,"")):""}),v=function(e){function i(){var e,t,n,o,r,a,s;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,i)
for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f]
return n=this,t=!(o=(e=u(i)).call.apply(e,[this].concat(d)))||"object"!==l(o)&&"function"!=typeof o?p(n):o,r=p(t),s={linkType:null},(a="state")in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,t}var v,b,y
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(i,t.default.PureComponent),v=i,(b=[{key:"getLinkType",value:function(){return null===this.state.linkType?f(this.props.values.url):this.state.linkType}},{key:"componentDidUpdate",value:function(e){this.props.inspecting!==e.inspecting&&this.setState({linked:null})}},{key:"updateEmailAddress",value:function(e){var t=h(this.props.values.url),n=e.replace(/mailto:(?:\/\/)?/g,"").replace(/\?.*/g,"")
this.props.updateValue("mailto:".concat(n).concat(t?"?subject=".concat(encodeURI(t)):""),"url")}},{key:"updateEmailSubject",value:function(e){var t=m(this.props.values.url),n=e.length>0?"?subject=".concat(encodeURI(e)):""
this.props.updateValue("mailto:".concat(t).concat(n),"url")}},{key:"updatePhoneNumber",value:function(e){this.props.updateValue(""===e?"":"tel:".concat(encodeURI(e)),"url")}},{key:"getLinkPreview",value:function(){var e=this.props.values.url
switch(this.getLinkType()){case"email":var t=h(e)
return"mailto:".concat(m(e)).concat(t?"?subject=".concat(t):"")
case"tel":return"tel:".concat(g(e))}return e}},{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"render",value:function(){var e=this,i=this.getLinkType(),l=!1!==this.props.options.dynamic&&this.props.userCan("dynamic_content")
return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.preview")},t.default.createElement(n.ControlInput,null,t.default.createElement("input",{type:"text",value:this.getLinkPreview(),disabled:!0}))),t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.type")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:i,choices:[{value:"url",icon:"link",tooltip:(0,a.t)("app.controls.link.url")},{value:"email",icon:"envelope",tooltip:(0,a.t)("app.controls.link.email")},{value:"tel",icon:"phone",tooltip:(0,a.t)("app.controls.link.phone")}],onUpdate:function(t){return e.setState({linkType:t})}}))),this.isKeyMapped("content")&&t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.content")},t.default.createElement(n.ControlInput,null,t.default.createElement(s.default,{enabled:l,value:this.props.values.content,onUpdate:function(t){return e.props.updateValue(t,"content")}}))),"url"===i&&t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.url")},t.default.createElement(n.ControlInput,null,t.default.createElement(s.default,{enabled:l,value:this.props.values.url,placeholder:(0,a.t)("app.controls.link.url-placeholder"),onUpdate:function(t){return e.props.updateValue(t,"url")}})),this.isKeyMapped("new_tab")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.props.values.new_tab,label:(0,a.t)("app.controls.link.new-tab"),onToggle:function(t){return e.props.updateValue(t,"new_tab")}})),this.isKeyMapped("nofollow")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.props.values.nofollow,onToggle:function(t){return e.props.updateValue(t,"nofollow")}},t.default.createElement("code",null,"nofollow")))),"email"===i&&t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.email")},t.default.createElement(n.ControlInput,null,t.default.createElement(s.default,{enabled:l,value:m(this.props.values.url),placeholder:(0,a.t)("app.controls.link.email-placeholder"),onUpdate:function(t){return e.updateEmailAddress(t)}}))),"email"===i&&t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.email-subject")},t.default.createElement(n.ControlInput,null,t.default.createElement(s.default,{enabled:l,value:h(this.props.values.url),placeholder:(0,a.t)("app.controls.link.email-subject-placeholder"),onUpdate:function(t){return e.updateEmailSubject(t)}}))),"tel"===i&&t.default.createElement(n.ControlItem,{label:(0,a.t)("app.controls.link.phone")},t.default.createElement(n.ControlInput,null,t.default.createElement(s.default,{enabled:l,value:g(this.props.values.url),placeholder:(0,a.t)("app.controls.link.phone-placeholder"),onUpdate:function(t){return e.updatePhoneNumber(t)}}))))}}])&&c(v.prototype,b),y&&c(v,y),i}()
e.default=v}),define("tco-app/src/components/controls/types/ControlNumber",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this,o=this.props.options,r=o.placeholder,a=o.monospace
return t.default.createElement("input",{className:(0,n.default)({"cs-input-code":a}),type:"number",value:this.props.value,placeholder:r||"",onChange:function(t){return e.props.updateValue(t.target.value)}})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlPlacement",["exports","react","tco-app/src/components/forms/PlacementPicker"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this.props.options,o=(e=void 0===e?{}:e).display,r=void 0===o?"flex":o,a=e.axis,i=void 0===a?"main":a,s=e.context,l=void 0===s?"content":s,c=e.icon_direction,u=void 0===c?"x":c
return t.default.createElement(n.default,{value:this.props.value,display:r,axis:i,context:l,iconDirection:u,onChange:this.props.updateValue})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlRatio",["exports","react","tco-app/src/components/forms/Ratio","tco-app/src/components/controls/Control"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this
return t.default.createElement(o.ControlInput,null,t.default.createElement(n.default,{value:this.props.value,onUpdateValue:function(t){return e.props.updateValue(t)},placeholder:this.props.options.placeholder}))}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=c}),define("tco-app/src/components/controls/types/ControlSelect",["exports","react","tco-app/src/components/forms/Select","lodash","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:controls")}),d=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),f=function(e){function o(){var e,t,n,r,a,s,u;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var p=arguments.length,d=new Array(p),f=0;f<p;f++)d[f]=arguments[f]
return n=this,t=!(r=(e=l(o)).call.apply(e,[this].concat(d)))||"object"!==i(r)&&"function"!=typeof r?c(n):r,a=c(t),u={dynamicOptions:null,loading:!1},(s="state")in a?Object.defineProperty(a,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[s]=u,t}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.default.PureComponent),f=o,(m=[{key:"componentDidMount",value:function(){this.loadDynamicOptions()}},{key:"componentDidUpdate",value:function(e){e.options.choices!==this.props.options.choices&&this.loadDynamicOptions()}},{key:"componentWillUnmount",value:function(){this.cancelAjax=!0}},{key:"loadDynamicOptions",value:function(){var e=this,t=this.props.options.choices
if("string"==typeof t&&0===t.indexOf("dynamic:")){var n=t.replace("dynamic:","")
if(0===n.indexOf("post-picker:")){var o=n.replace("post-picker:","")
if(!o)return
return this.setState({dynamicOptions:[],loading:!0}),p().getPostOptions(o).then(function(t){e.cancelAjax||e.setState({dynamicOptions:t,loading:!1})})}this.setState({dynamicOptions:[],loading:!0}),d().findRecord("fragment","app-choices::".concat(n)).then(function(t){e.cancelAjax||e.setState({dynamicOptions:t.get("value"),loading:!1})})}}},{key:"getTransformedOptions",value:function(){if(this.state.dynamicOptions)return this.state.dynamicOptions
var e=this.props.options.choices
return"list:fonts"===e?p().getOptionList("fonts"):"list:font-weights"===e?p().getOptionList("font-weights"):Array.isArray(e)?e:[]}},{key:"render",value:function(){var e=this
return t.default.createElement(a.ControlInput,null,t.default.createElement(n.default,{placeholder:this.state.loading?(0,r.t)("app.loading"):this.props.options.placeholder||this.props.value||"",value:this.props.value,options:this.getTransformedOptions(),onChange:function(t){return e.props.updateValue(t)}}))}}])&&s(f.prototype,m),h&&s(f,h),o}()
e.default=f}),define("tco-app/src/components/controls/types/ControlShare",["exports","react","tco-app/src/components/controls/Control","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/forms/Checkbox","tco-app/src/components/forms/Select","tco-app/src/components/common/DynamicContentInput","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m=function(e){function m(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,m)
for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i]
return n=this,o=(e=u(m)).call.apply(e,[this].concat(a)),t=!o||"object"!==l(o)&&"function"!=typeof o?p(n):o,f(p(t),"state",{linkType:null}),f(p(t),"onUpdateUrl",function(e){return t.props.updateValue(e,"url")}),f(p(t),"onUpdateNewTab",function(e){return t.props.updateValue(e,"new_tab")}),f(p(t),"onUpdateNofollow",function(e){return t.props.updateValue(e,"nofollow")}),f(p(t),"onUpdateShareEnabled",function(e){return t.props.updateValue("share"===e,"share_enabled")}),f(p(t),"onUpdateShareType",function(e){return t.props.updateValue(e,"share_type")}),f(p(t),"onUpdateShareTitle",function(e){return t.props.updateValue(e,"share_title")}),t}var h,g,v
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(m,t.default.PureComponent),h=m,(g=[{key:"componentDidUpdate",value:function(e){this.props.inspecting!==e.inspecting&&this.setState({linked:null})}},{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"canUseDynamic",value:function(){return!1!==this.props.options.dynamic&&this.props.userCan("dynamic_content")}},{key:"renderShare",value:function(){return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.share")},t.default.createElement(n.ControlInput,null,t.default.createElement(a.default,{value:this.props.values.share_type,options:window.csAppData.socialShareOptions,onChange:this.onUpdateShareType}))),t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.share.title")},t.default.createElement(n.ControlInput,null,t.default.createElement(i.default,{store:this.props.store,enabled:this.canUseDynamic(),value:this.props.values.share_title,onUpdate:this.onUpdateShareTitle}))))}},{key:"renderLink",value:function(){return t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.link.url")},t.default.createElement(n.ControlInput,null,t.default.createElement(i.default,{store:this.props.store,enabled:this.canUseDynamic(),value:this.props.values.url,placeholder:(0,s.t)("app.controls.link.url-placeholder"),onUpdate:this.onUpdateUrl})),this.isKeyMapped("new_tab")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.props.values.new_tab,label:(0,s.t)("app.controls.link.new-tab"),onToggle:this.onUpdateNewTab})),this.isKeyMapped("nofollow")&&t.default.createElement(n.ControlInput,{half:!0},t.default.createElement(r.default,{checked:this.props.values.nofollow,onToggle:this.onUpdateNofollow},t.default.createElement("code",null,"nofollow"))))}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ControlItem,{label:(0,s.t)("app.controls.share.type")},t.default.createElement(n.ControlInput,null,t.default.createElement(o.default,{value:this.props.values.share_enabled?"share":"link",choices:[{value:"link",label:(0,s.t)("app.controls.share.link")},{value:"share",label:(0,s.t)("app.controls.share")}],onUpdate:this.onUpdateShareEnabled}))),this.props.values.share_enabled?this.renderShare():this.renderLink())}}])&&c(h.prototype,g),v&&c(h,v),m}()
e.default=m}),define("tco-app/src/components/controls/types/ControlSortable",["exports","react","lodash","tco-app/src/components/common/Icon","tco-app/src/components/common/SortableContainer","tco-app/src/components/common/SortableItem","tco-app/src/components/common/ManualScrollBox","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m,h,g,v=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),p(this,d(n).apply(this,arguments))}var a,s,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.PureComponent),a=n,(s=[{key:"canShowAdd",value:function(){var e=void 0!==this.props.options.capacity?this.props.options.capacity:100
return this.props.canAdd&&this.props.items.length<e}},{key:"canShowDelete",value:function(){var e=void 0!==this.props.options.floor?this.props.options.floor:0
return this.props.canDelete&&this.props.items.length>e}},{key:"renderSortable",value:function(){var e=this,n=this.canShowAdd(),o=this.canShowDelete()
return t.default.createElement(r.default,{onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},this.props.items.map(function(r,a){return t.default.createElement(e.props.itemComponent,{key:r,item:r,options:e.props.options,canAdd:e.props.canAdd,canDelete:e.props.canDelete,canShowAdd:n,canShowDelete:o,addElementAtts:e.props.addElementAtts,addLabel:e.props.addLabel,userCan:e.props.userCan,index:a,lastItem:a===e.props.items.length-1})}))}},{key:"renderAddButton",value:function(){var e=this
return t.default.createElement("button",{className:"cs-sortable-ghost-add",onClick:function(){return e.props.onAddNew()}},t.default.createElement("strong",null,t.default.createElement(o.default,{icon:"fa-plus"}),this.props.addElementLabel))}},{key:"maybeWrapScrollBox",value:function(e){return"horizontal"===this.props.orientation?t.default.createElement(i.default,{canScroll:!1},e):e}},{key:"renderWrapper",value:function(e){return t.default.createElement(l.ControlGroupContainer,{"data-cs-control-group-name":this.props.control.group.full,"data-cs-control-id":this.props.id},this.maybeWrapScrollBox(t.default.createElement(t.default.Fragment,null,t.default.createElement(l.ControlHeader,{label:this.props.control.label,description:this.props.control.description}),e)))}},{key:"render",value:function(){return this.props.items.length>0?this.renderWrapper(this.renderSortable()):this.canShowAdd()?this.renderWrapper(this.renderAddButton()):null}}])&&u(a.prototype,s),c&&u(a,c),n}()
e.default=v,m=v,h="defaultProps",g={items:[],canAdd:!0,canDelete:!0,addLabel:"",addElementAtts:{},onDragStart:function(){},onDragEnd:function(){},onAddNew:function(){},itemComponent:a.default},h in m?Object.defineProperty(m,h,{value:g,enumerable:!0,configurable:!0,writable:!0}):m[h]=g}),define("tco-app/src/components/controls/types/ControlText",["exports","react","classnames","tco-app/src/components/common/DynamicContentInput"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=["date"],u=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),u=r,(p=[{key:"render",value:function(){var e=this.props.options,r=e.placeholder,a=e.monospace,i=e.input_type,s=e.dynamic,l=e.dc_tags,u=i&&c.includes(i)?i:"text",p=!1!==s&&this.props.userCan("dynamic_content")&&"text"===u
return t.default.createElement(o.default,{className:(0,n.default)({"cs-input-code":a}),type:u,extraTags:l,onUpdate:this.props.updateValue,value:this.props.value,enabled:p,placeholder:r||""})}}])&&a(u.prototype,p),d&&a(u,d),r}()
e.default=u}),define("tco-app/src/components/controls/types/ControlTextEditor",["exports","react","react-redux","lodash","tco-app/src/components/forms/TextEditor","tco-app/src/components/common/DynamicContent"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")})
d().closeEmberExpanders()
var f=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return o=this,r=(e=l(n)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(o):r,p(c(t),"state",{selectionStart:null,selectionEnd:null}),p(c(t),"updateSelection",function(e){var n=e.selectionStart,o=e.selectionEnd
t.setState({selectionStart:n,selectionEnd:o})}),p(c(t),"onDcInsert",function(e){var n=t.props.value.substr(0,t.state.selectionStart),o=t.props.value.substring(t.state.selectionEnd)
t.props.updateValue("".concat(n).concat(e).concat(o))}),p(c(t),"onToggleOpen",function(e){return e&&d().closeEmberExpanders()}),p(c(t),"editorInsert",function(e,t){e&&e.execCommand("mceInsertContent",!1,t)}),t}var o,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t.default.PureComponent),o=n,(f=[{key:"render",value:function(){var e=this,n=this.props.options,o=n.placeholder,i=n.mode,s=n.height,l=n.dynamic,c=n.disable_input_preview,u=!1!==l&&this.props.userCan("dynamic_content")
return t.default.createElement(r.default,{mode:i,contentStyle:"dark"===this.props.uiTheme?"dark":"",value:this.props.value,placeholder:o,height:s,richTextDefault:this.props.richTextDefault,showContentPreview:!c,onUpdate:this.props.updateValue,orientation:this.props.orientation,onSelectionChange:this.updateSelection,onToggleOpen:this.onToggleOpen},function(n,o){return u&&t.default.createElement(a.default,{mode:"fixed",value:e.props.value,onInsert:"html"===n?e.onDcInsert:function(t){return e.editorInsert(o(),t)},selectionStart:null===e.state.selectionStart?e.props.value.length:e.state.selectionStart,selectionEnd:null===e.state.selectionStart?e.props.value.length:e.state.selectionEnd})})}}])&&s(o.prototype,f),m&&s(o,m),n}(),m=(0,n.connect)(function(e){var t=e.builder.preferences,n=t.richTextDefault
return{uiTheme:t.uiTheme,richTextDefault:n}})(f)
e.default=m}),define("tco-app/src/components/controls/types/ControlTextShadow",["exports","react","tco-app/src/components/forms/UnitField","tco-app/src/components/forms/ColorPicker","tco-app/src/util/merge-options","tco-app/src/util/string","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=function(e){function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),u(this,p(l).apply(this,arguments))}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(l,t.default.PureComponent),f=l,(m=[{key:"isKeyMapped",value:function(e){return void 0!==this.props.values[e]}},{key:"getValues",value:function(){var e=(0,a.splitOnWhitespace)(this.props.value||"")
return{xOffset:void 0!==e[0]?e[0]:"0px",yOffset:void 0!==e[1]?e[1]:"0px",blur:void 0!==e[2]?e[2]:"0px"}}},{key:"updatePart",value:function(e,t,n){var o=Object.assign({},n,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,e)),r=o.xOffset,a=o.yOffset,i=o.blur,s="".concat(r," ").concat(a," ").concat(i)
this.props.updateValue(s)}},{key:"render",value:function(){var e=this,a=this.getValues(),l=(0,r.default)({available_units:["px","em","rem"],ranges:{px:{min:-50,max:50,step:1},em:{min:-1,max:1,step:.001},rem:{min:-1,max:1,step:.001}}},this.props.options.x_offset||{}),c=(0,r.default)({available_units:["px","em","rem"],ranges:{px:{min:-50,max:50,step:1},em:{min:-1,max:1,step:.001},rem:{min:-1,max:1,step:.001}}},this.props.options.y_offset||{}),u=(0,r.default)({available_units:["px","em","rem"],ranges:{px:{min:0,max:50,step:1},em:{min:0,max:2.5,step:.001},rem:{min:0,max:2.5,step:.001}}},this.props.options.blur||{}),p=this.props.options.color||{},d=Object.assign({},p,{label:p.alt_label||p.label||""})
return t.default.createElement(t.default.Fragment,null,t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.x-offset")},t.default.createElement(s.ControlInput,null,t.default.createElement(n.default,{value:a.xOffset,onUpdate:function(t){return e.updatePart(t,"xOffset",a)},unitMode:l.unit_mode,validKeywords:l.valid_keywords,availableUnits:l.available_units,disabled:l.disabled,fallbackValue:l.fallback_value,slider:!0,step:l.step,min:l.min,max:l.max,ranges:l.ranges}))),t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.y-offset")},t.default.createElement(s.ControlInput,null,t.default.createElement(n.default,{value:a.yOffset,onUpdate:function(t){return e.updatePart(t,"yOffset",a)},unitMode:c.unit_mode,validKeywords:c.valid_keywords,availableUnits:c.available_units,disabled:c.disabled,fallbackValue:c.fallback_value,slider:!0,step:c.step,min:c.min,max:c.max,ranges:c.ranges}))),t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.blur")},t.default.createElement(s.ControlInput,null,t.default.createElement(n.default,{value:a.blur,onUpdate:function(t){return e.updatePart(t,"blur",a)},unitMode:u.unit_mode,validKeywords:u.valid_keywords,availableUnits:u.available_units,disabled:u.disabled,fallbackValue:u.fallback_value,slider:!0,step:u.step,min:u.min,max:u.max,ranges:u.ranges}))),this.isKeyMapped("color")&&t.default.createElement(s.ControlItem,{label:(0,i.t)("app.controls.color")},t.default.createElement(s.ControlInput,{half:this.isKeyMapped("alt_color")},t.default.createElement(o.default,{value:this.props.values.color,options:p,usePalette:!1!==p.palette,onUpdate:function(t){return e.props.updateValue(t,"color")}})),this.isKeyMapped("alt_color")&&t.default.createElement(s.ControlInput,{half:!0},t.default.createElement(o.default,{value:this.props.values.alt_color,options:d,usePalette:!1!==d.palette,onUpdate:function(t){return e.props.updateValue(t,"alt_color")}}))))}}])&&c(f.prototype,m),h&&c(f,h),l}()
e.default=f}),define("tco-app/src/components/controls/types/ControlTextarea",["exports","react","classnames","tco-app/src/components/common/DynamicContent"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var a=arguments.length,l=new Array(a),p=0;p<a;p++)l[p]=arguments[p]
return n=this,o=(e=i(u)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"state",{selectionStart:null,selectionEnd:null}),c(s(t),"onInputChange",function(e){t.props.updateValue(e.target.value)}),c(s(t),"onDcInsert",function(e){var n=null===t.state.selectionStart?t.props.value.length:t.state.selectionStart,o=null===t.state.selectionEnd?t.props.value.length:t.state.selectionEnd,r=t.props.value.substr(0,n),a=t.props.value.substring(o)
t.props.updateValue("".concat(r).concat(e).concat(a))}),c(s(t),"updateSelection",function(e){var n=e.target,o=n.selectionStart,r=n.selectionEnd
t.setState({selectionStart:o,selectionEnd:r})}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.PureComponent),p=u,(d=[{key:"render",value:function(){var e=this,r=this.props.options,a=r.placeholder,i=r.monospace,s=r.dynamic,l=t.default.createElement("textarea",{className:(0,n.default)({"cs-input-code":i}),value:this.props.value,placeholder:a||"",onChange:function(t){return e.props.updateValue(t.target.value)},onFocus:this.updateSelection,onMouseUp:this.updateSelection,onKeyUp:this.updateSelection})
return!1!==s&&this.props.userCan("dynamic_content")?t.default.createElement("div",{className:"cs-input-button-wrapper"},l,t.default.createElement(o.default,{mode:"inline-bottom",onInsert:this.onDcInsert})):l}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u}),define("tco-app/src/components/controls/types/ControlToggle",["exports","react","tco-app/src/components/forms/Toggle"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{on:this.props.value,onToggle:function(t){return e.props.updateValue(t)}})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlUnit",["exports","react","tco-app/src/components/common/DynamicContent","tco-app/src/components/forms/UnitField","tco-app/src/components/controls/Control"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function r(){var e,t,n,o,i,c,u;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,r)
for(var p=arguments.length,d=new Array(p),f=0;f<p;f++)d[f]=arguments[f]
return n=this,o=(e=s(r)).call.apply(e,[this].concat(d)),t=!o||"object"!==a(o)&&"function"!=typeof o?l(n):o,i=l(t),u=function(e){return t.props.updateValue(e)},(c="onUpdate")in i?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u,t}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(r,t.default.PureComponent),u=r,(p=[{key:"componentDidMount",value:function(){if(this.unitFieldRef&&this.unitFieldRef.unitSelectionRef){var e=this.unitFieldRef.unitSelectionRef.closest(".cs-control-input")
if(e&&e.parentElement&&e.parentElement.firstChild===e){var t=this.unitFieldRef.unitSelectionRef.querySelector(".cs-unit-input-choices")
t&&t.clientWidth>160&&(t.style="left:-125px;")}}}},{key:"render",value:function(){var e=this,r=this.props.options,a=r.dynamic,i=r.unit_mode,s=r.valid_keywords,l=r.available_units,c=r.disabled,u=r.fallback_value,p=t.default.createElement(o.default,{value:this.props.value,onUpdate:this.onUpdate,unitMode:i,dynamic:a,validKeywords:s,availableUnits:l,disabled:c,fallbackValue:u,ref:function(t){return e.unitFieldRef=t}})
return a&&"unitless"===i&&this.props.userCan("dynamic_content")?t.default.createElement("div",{className:"cs-input-button-wrapper"},p,t.default.createElement(n.default,{onInsert:this.onUpdate})):p}}])&&i(u.prototype,p),d&&i(u,d),r}()
e.default=u}),define("tco-app/src/components/controls/types/ControlUnitSlider",["exports","react","tco-app/src/components/forms/UnitField"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this,o=this.props.options,r=o.unit_mode,a=o.valid_keywords,i=o.available_units,s=o.disabled,l=o.fallback_value,c=o.step,u=o.min,p=o.max,d=o.ranges
return t.default.createElement(n.default,{value:this.props.value,onUpdate:function(t){return e.props.updateValue(t)},unitMode:r,validKeywords:a,availableUnits:i,disabled:s,fallbackValue:l,slider:!0,step:c,min:u,max:p,ranges:d})}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/controls/types/ControlUnknown",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var s=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r(this,a(n).apply(this,arguments))}var s,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,t.default.PureComponent),s=n,(l=[{key:"componentDidMount",value:function(){console.warn("Unable to render unknown control type",this)}},{key:"render",value:function(){return t.default.createElement("div",null)}}])&&o(s.prototype,l),c&&o(s,c),n}()
e.default=s}),define("tco-app/src/components/controls/types/index",["exports","react","tco-app/src/components/controls/types/ControlAspectRatio","tco-app/src/components/controls/types/ControlAttributes","tco-app/src/components/controls/types/ControlBorder","tco-app/src/components/controls/types/ControlBoxShadow","tco-app/src/components/controls/types/ControlCheckboxList","tco-app/src/components/controls/types/ControlChooseMulti","tco-app/src/components/controls/types/ControlChooseSingle","tco-app/src/components/controls/types/ControlClassicDimensions","tco-app/src/components/controls/types/ControlCodeEditor","tco-app/src/components/controls/types/ControlColor","tco-app/src/components/controls/types/ControlLayoutRow","tco-app/src/components/controls/types/ControlLayoutColumn","tco-app/src/components/controls/types/ControlLayoutGrid","tco-app/src/components/controls/types/ControlLayoutCell","tco-app/src/components/controls/types/ControlColumns","tco-app/src/components/controls/types/ControlDimensions","tco-app/src/components/controls/types/ControlDateTime","tco-app/src/components/controls/types/ControlFlex","tco-app/src/components/controls/types/ControlFlexbox","tco-app/src/components/controls/types/ControlFontFamily","tco-app/src/components/controls/types/ControlFontWeight","tco-app/src/components/controls/types/ControlIcon","tco-app/src/components/controls/types/ControlImage","tco-app/src/components/controls/types/ControlImageSource","tco-app/src/components/controls/types/ControlLink","tco-app/src/components/controls/types/ControlNumber","tco-app/src/components/controls/types/ControlPlacement","tco-app/src/components/controls/types/ControlRatio","tco-app/src/components/controls/types/ControlSelect","tco-app/src/components/controls/types/ControlShare","tco-app/src/components/controls/types/ControlText","tco-app/src/components/controls/types/ControlTextEditor","tco-app/src/components/controls/types/ControlTextShadow","tco-app/src/components/controls/types/ControlTextarea","tco-app/src/components/controls/types/ControlToggle","tco-app/src/components/controls/types/ControlUnit","tco-app/src/components/controls/types/ControlUnitSlider","tco-app/src/components/controls/types/ControlUnknown","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g,v,b,y,_,w,E,O,x,k,S,P,C,j,T,M,D,A,I,R,L,N,U,F,B){function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(){return(H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function q(e,t,n){return t&&W(e.prototype,t),n&&W(e,n),e}function G(e,t){return!t||"object"!==z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(e,n){return function(o){function r(){return V(this,r),G(this,$(r).apply(this,arguments))}return K(r,t.default.Component),q(r,[{key:"render",value:function(){var o="function"==typeof e.transformProps?e.transformProps(this.props):this.props
return t.default.createElement(B.ControlWrapper,H({},n,o),t.default.createElement(e,o))}}]),r}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var J={group:X(function(e){function n(){return V(this,n),G(this,$(n).apply(this,arguments))}return K(n,t.default.Component),q(n,[{key:"render",value:function(){return t.default.createElement(this.props.ListComponent,{control:this.props.control,controlProps:{level:this.props.level+1},userCan:this.props.userCan})}}]),n}(),{isList:!0}),_columns:X(g.default,{topLevelOnly:!0}),"layout-row":X(d.default,{topLevelOnly:!0}),"layout-column":X(f.default,{topLevelOnly:!0}),"layout-grid":X(m.default,{topLevelOnly:!0}),"layout-cell":X(h.default,{topLevelOnly:!0}),placement:X(C.default,{singular:!0}),"aspect-ratio":X(n.default,{singular:!0}),attributes:o.default,border:X(r.default,{topLevelOnly:!0}),"box-shadow":X(a.default,{topLevelOnly:!0}),"checkbox-list":X(i.default,{managed:!0}),"choose-multi":X(s.default,{singular:!0}),"choose-single":X(l.default,{singular:!0}),"classic-dimensions":X(c.default,{topLevelOnly:!0}),"code-editor":X(u.default,{singular:!0}),color:X(p.default,{managed:!0}),dimensions:X(v.default,{topLevelOnly:!0}),"date-time":X(b.default,{singular:!0}),flex:X(y.default,{singular:!0}),flexbox:X(_.default,{topLevelOnly:!0}),"font-family":X(w.default,{singular:!0}),"font-weight":X(E.default,{singular:!0}),icon:X(O.default,{managed:!0}),image:X(x.default,{managed:!0,defaultHeight:2}),"image-source":X(k.default,{singular:!0,noHalf:!0}),link:X(S.default,{topLevelOnly:!0}),number:X(P.default,{singular:!0,autoHalf:!0}),ratio:X(j.default,{singular:!0,noHalf:!0}),select:X(T.default,{singular:!0,autoHalf:!0}),share:X(M.default,{topLevelOnly:!0}),text:X(D.default,{singular:!0,autoHalf:!0}),"text-editor":X(A.default,{singular:!0,noHalf:!0}),"text-shadow":X(I.default,{topLevelOnly:!0}),textarea:X(R.default,{singular:!0,noHalf:!0,defaultHeight:5}),toggle:X(L.default,{singular:!0,noHalf:!0}),unit:X(N.default,{singular:!0,autoHalf:!0}),"unit-slider":X(U.default,{singular:!0,noHalf:!0}),unknown:F.default}
e.default=J}),define("tco-app/src/components/data/RouteData",["exports","react","react-redux","tco-app/src/actions/data"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u,p,d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var o,r,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.Component),o=n,(r=[{key:"componentDidMount",value:function(){this.maybeFetchData()}},{key:"componentDidUpdate",value:function(e){e.toRequest!==this.props.toRequest&&this.maybeFetchData()}},{key:"maybeFetchData",value:function(){this.props.toRequest.length>0&&this.props.fetchData(this.props.toRequest)}},{key:"render",value:function(){return this.props.wait&&this.props.loading?"function"==typeof this.props.fallback?this.props.fallback(this.props.result):this.props.fallback:"function"==typeof this.props.children?this.props.children(this.props.result):this.props.children}}])&&a(o.prototype,r),c&&a(o,c),n}()
p={request:[],fallback:null,wait:!0},(u="defaultProps")in(c=d)?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p
var f=(0,n.connect)(function(e,t){var n=t.request,o=[],r={}
return(void 0===n?[]:n).map(function(e){return"string"==typeof e?{key:e}:e}).forEach(function(t){!1!==t.cache&&e.data[t.key]?r[t.key]=e.data[t.key]:o.push(t)}),{loading:o.length>0,toRequest:o,result:r}},{fetchData:o.fetchData})(d)
e.default=f}),define("tco-app/src/components/forms/Checkbox",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement("label",{className:(0,n.default)("cs-rc","cs-rc-checkbox"),style:this.props.style},t.default.createElement("input",{type:"checkbox",checked:this.props.checked,onChange:function(t){return e.props.onToggle(t.target.checked)}}),t.default.createElement("span",{className:"cs-rc-indicator"}),t.default.createElement("span",{className:"cs-rc-label"},this.props.children||this.props.label))}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={style:{},label:"",checked:!1,onToggle:function(){}},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/forms/Choose",["exports","react","classnames","tco-app/src/components/forms/ChooseChoice"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u,p,d,f=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),s(this,l(r).apply(this,arguments))}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(r,t.default.PureComponent),u=r,(p=[{key:"render",value:function(){var e=this,r=this.props.choices?this.props.choices.length||1:this.props.children&&this.props.children.length||1
return t.default.createElement("ul",{className:(0,n.default)("cs-choose",this.props.isVertical?"is-vertical":"cols-".concat(r))},this.props.choices.length>0&&this.props.choices.map(function(n){return t.default.createElement(o.default,a({key:"".concat(n.value),isSelected:e.props.isSelected(n.value),onClick:function(t){return e.props.updateSelection(t)}},n))}),this.props.children)}}])&&i(u.prototype,p),d&&i(u,d),r}()
e.default=f,d={choices:[],isVertical:!1,isSelected:function(){return!1},updateSelection:function(){}},(p="defaultProps")in(u=f)?Object.defineProperty(u,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[p]=d}),define("tco-app/src/components/forms/ChooseChoice",["exports","react","classnames","tco-app/src/util/decode-entities","tco-app/src/components/common/FaIcon","tco-app/src/components/common/Icon"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p,d,f,m=function(e){function p(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),l(this,c(p).apply(this,arguments))}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(p,t.default.PureComponent),d=p,(f=[{key:"renderIcon",value:function(){if(this.props.icon)return 0===this.props.icon.indexOf("ui:")?t.default.createElement(a.default,{icon:this.props.icon.substr(3)}):t.default.createElement(r.default,{icon:this.props.icon})}},{key:"renderLabel",value:function(){return i("string")===this.props.label?(0,o.default)(this.props.label):this.props.label?this.props.label:this.props.children}},{key:"render",value:function(){var e=this
return t.default.createElement("li",{className:(0,n.default)(this.props.class,{"cs-active":this.props.isSelected}),onClick:function(t){return e.props.onClick(e.props.value,t)}},t.default.createElement("abbr",{title:this.props.tooltip},this.renderIcon(),this.renderLabel()))}}])&&s(d.prototype,f),m&&s(d,m),p}()
e.default=m,f={value:null,icon:null,label:null,class:null,tooltip:"",isSelected:!1,onClick:function(){}},(d="defaultProps")in(p=m)?Object.defineProperty(p,d,{value:f,enumerable:!0,configurable:!0,writable:!0}):p[d]=f}),define("tco-app/src/components/forms/ChooseLayoutRow",["exports","react","tco-app/src/components/common/LayoutPresets"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function c(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,c)
for(var s=arguments.length,u=new Array(s),p=0;p<s;p++)u[p]=arguments[p]
return n=this,r=(e=a(c)).call.apply(e,[this].concat(u)),t=!r||"object"!==o(r)&&"function"!=typeof r?i(n):r,l(i(t),"state",{showCustom:!1}),l(i(t),"onChooseLayout",function(e){t.props.onChange(e),t.setState({showCustom:!1})}),l(i(t),"onChooseCustom",function(){return t.setState({showCustom:!0})}),l(i(t),"onInputCustomValue",function(e){t.props.onChange(e.target.value)}),t}var u,p,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(c,t.default.Component),u=c,(p=[{key:"componentDidUpdate",value:function(e,t){this.state.showCustom&&!t.showCustom&&this.refInput.focus()}},{key:"render",value:function(){var e=this,o=this.state.showCustom||!this.props.presets.includes(this.props.value)
return t.default.createElement(n.default,{presets:this.props.presets,active:!this.state.showCustom&&this.props.value,onClick:this.onChooseLayout},!o&&t.default.createElement("a",{className:"cs-layout-preset is-custom",role:"button",onClick:this.onChooseCustom},t.default.createElement("i",null,t.default.createElement("b",null,"Custom"))),o&&t.default.createElement("input",{type:"text",className:"cs-no-input-focus",value:this.props.value,placeholder:"25% 75%",onChange:this.onInputCustomValue,ref:function(t){e.refInput=t}}))}}])&&r(u.prototype,p),d&&r(u,d),c}()
e.default=c,l(c,"defaultProps",{presets:window.csAppData.rowPresets,value:"100%",onChange:function(){}})}),define("tco-app/src/components/forms/ChooseMulti",["exports","react","tco-app/src/components/forms/Choose"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u,p,d=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i(this,s(o).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(o,t.default.PureComponent),c=o,(u=[{key:"getSelected",value:function(){return this.props.arrayOutput?this.props.value||[]:"".concat(this.props.value).split(this.props.delimiter)}},{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{choices:this.props.choices,isSelected:function(t){return e.getSelected().includes(t)},updateSelection:function(t){var n=e.getSelected(),o=n.includes(t)?n.filter(function(e){return e!==t}):[].concat(r(n),[t])
o.sort(),e.props.onUpdate(e.props.arrayOutput?r(o):o.join(e.props.delimiter))}},this.props.children)}}])&&a(c.prototype,u),p&&a(c,p),o}()
e.default=d,p={choices:[],offValue:null,delimiter:" ",arrayOutput:!1,onUpdate:function(){},value:""},(u="defaultProps")in(c=d)?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p}),define("tco-app/src/components/forms/ChoosePicker",["exports","react","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/common/Picker","tco-app/src/components/common/FaIcon","tco-app/src/components/common/Icon"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function d(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,d)
for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s]
return n=this,o=(e=l(d)).call.apply(e,[this].concat(a)),t=!o||"object"!==i(o)&&"function"!=typeof o?c(n):o,p(c(t),"state",{open:!1}),p(c(t),"onTogglePicker",function(e){return t.setState({open:e})}),p(c(t),"onUpdate",function(e){t.props.onChange(e),t.setState({open:!1})}),t}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(d,t.default.PureComponent),f=d,(m=[{key:"renderSwatch",value:function(e){var n=e.icon
if(n)return 0===n.indexOf("ui:")?t.default.createElement(a.default,{icon:n.substr(3)}):t.default.createElement(r.default,{icon:n})}},{key:"render",value:function(){var e=this,r=this.props.options.find(function(t){return t.value===e.props.value})
return t.default.createElement(o.default,{open:this.state.open,label:r&&r.label||"Custom",content:this.renderSwatch(r),onToggle:this.onTogglePicker},t.default.createElement("div",{className:"cs-choose-picker-content"},t.default.createElement(n.default,{isVertical:!0,value:this.props.value,choices:this.props.options,onUpdate:this.onUpdate})))}}])&&s(f.prototype,m),h&&s(f,h),d}()
e.default=d}),define("tco-app/src/components/forms/ChooseSingle",["exports","react","tco-app/src/components/forms/Choose"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this
return t.default.createElement(n.default,{choices:this.props.choices,isVertical:this.props.isVertical,isSelected:function(t){return t===e.props.value},updateSelection:function(t){t===e.props.value?null!==e.props.offValue&&e.props.onUpdate(e.props.offValue):e.props.onUpdate(t)}},this.props.children)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={choices:[],offValue:null,isVertical:!1,onUpdate:function(){}},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/forms/CodeEditor",["exports","react","tco-app/src/util/merge-options","tco-app/src/components/common/Expander"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f={mode:"css",theme:"solarized dark",indentUnit:2,smartIndent:!0,tabSize:2,indentWithTabs:!1,electricChars:!0,keyMap:"sublime",lineWrapping:!1,lineNumbers:!0,firstLineNumber:1,fixedGutter:!0,scrollbarStyle:"overlay",inputStyle:"contenteditable",showCursorWhenSelecting:!1,lineWiseCopyCut:!1,undoDepth:200,historyEventDelay:1500,autofocus:!1,dragDrop:!0,cursorBlinkRate:750,cursorScrollMargin:0,cursorHeight:1,resetSelectionOnContextMenu:!0,workTime:200,workDelay:300,pollInterval:100,flattenSpans:!0,addModeClass:!0,maxHighlightLength:1e4,viewportMargin:10,showTrailingSpace:!0,styleActiveLine:!0,styleSelectedText:!1,matchBrackets:!0,autoCloseBrackets:!0,autoCloseTags:!0,closeTag:!0,foldGutter:!0},m=function(e){function o(){var e
return a(this,o),(e=l(this,c(o).apply(this,arguments))).state={open:!1},e.textAreaRef=t.default.createRef(),e}return u(o,t.default.PureComponent),s(o,[{key:"componentDidMount",value:function(){var e=this
window.wp.CodeMirror&&this.textAreaRef&&this.textAreaRef.current&&(this.codemirror=window.wp.CodeMirror.fromTextArea(this.textAreaRef.current,(0,n.default)(f,this.props.settings)),this.codemirror.on("change",function(t){return e.props.onUpdate(t.doc.getValue())}),this.props.autoFocus&&(this.codemirror.focus(),this.codemirror.execCommand("goDocEnd")))}},{key:"componentWillUnmount",value:function(){this.codemirror&&this.codemirror.toTextArea()}},{key:"render",value:function(){return t.default.createElement("textarea",{defaultValue:this.props.value,ref:this.textAreaRef})}}]),o}()
d(m,"defaultProps",{value:"",onUpdate:function(){},codeMirrorSettings:{},autoFocus:!0})
var h=function(e){function n(){var e
return a(this,n),(e=l(this,c(n).apply(this,arguments))).state={open:!1},e}return u(n,t.default.PureComponent),s(n,[{key:"renderPlaceholder",value:function(){return this.props.value?null:t.default.createElement("pre",{className:"cs-code-editor-placeholder",dangerouslySetInnerHTML:{__html:this.props.placeholder.replace(new RegExp(/\\n/,"g"),"\n")}})}},{key:"renderCM",value:function(){var e=this
return t.default.createElement(t.default.Fragment,null,this.renderPlaceholder(),t.default.createElement(m,{settings:this.props.codeMirrorSettings,autoFocus:this.props.autoFocus,value:this.props.value,onUpdate:function(t){return e.props.onUpdate(t)}}))}},{key:"renderNoCM",value:function(){var e=this
return t.default.createElement("div",{className:"cs-code-editor-no-cm"},this.renderPlaceholder(),t.default.createElement("textarea",{className:"cs-no-input-focus",value:this.props.value,onChange:function(t){return e.props.onUpdate(t.target.value)}}))}},{key:"render",value:function(){var e=this
return t.default.createElement(o.default,{class:"cs-expandable-code-editor",open:this.state.open,label:this.props.label,headerLabel:this.props.headerLabel,closeOnFocusLoss:!1,showContentPreview:this.props.showContentPreview,content:t.default.createElement("input",{value:this.props.showContentPreview?this.props.value||this.props.placeholder:"",type:"text",disabled:!0}),onToggle:function(t){e.setState({open:t}),e.props.onToggleOpen(t)},expanderClass:"cs-code-editor-wrapper",orientation:this.props.orientation},window.wp.CodeMirror?this.renderCM():this.renderNoCM())}}]),n}()
e.default=h,d(h,"defaultProps",{value:"",placeholder:"",mode:null,label:null,headerLabel:null,orientation:"vertical",showContentPreview:!1,onUpdate:function(){},onToggleOpen:function(){},autoFocus:!0,codeMirrorSettings:{}})}),define("tco-app/src/components/forms/ColorPicker",["exports","react","react-redux","classnames","lodash","react-dom","tinycolor2","tco-app/src/components/common/Picker","tco-app/src/lib/i18n","tco-app/src/util/idle-callback","tco-app/src/actions/ui"],function(e,t,n,o,r,a,i,s,l,c,u){function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function h(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?v(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ColorInputPalette=e.Huebert=e.HuebertSlider=e.HuebertSpectrum=void 0,window.tinycolor=i.default
var w=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:color-manager")}),E=function(e,t){return"linear-gradient( to ".concat(t?"top":"right",", ").concat(e.join(", ")," )")},O=function(e,t,n){return Math.min(Math.max(e,t),n)},x=function(e,t,n){return e+n*(t-e)},k=function(e){return O(e,0,1)},S=(0,r.memoize)(function(e){return(0,i.default)({h:e,s:1,l:.5}).toRgbString()}),P=(0,r.memoize)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=(0,i.default)("hsl ".concat(e," 1.0 0.5"))
n.setAlpha(k(t))
for(var o=[],r=0;r<12;r++)o.push(n.spin(-30).toRgbString())
return o},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1
return"".concat(e,":").concat(t)}),C=(0,r.memoize)(function(){return E(P(0))}),j=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(r)))),"state",{prevX:0,prevY:0,x:0,y:0}),_(v(t),"state",{isDragging:!1}),_(v(t),"onMouseDown",function(e){1!==e.which&&0!==e.button||(e.stopPropagation(),e.preventDefault(),t.updateFromMousePosition(e.pageX,e.pageY),window.addEventListener("mouseup",t.onMouseUp),window.addEventListener("mousemove",t.onMouseMove,{passive:!0}))}),_(v(t),"onMouseUp",function(e){e.stopPropagation(),e.preventDefault(),t.setState({isDragging:!1}),t.props.onDragEnd(),window.removeEventListener("mouseup",t.onMouseUp),window.removeEventListener("mousemove",t.onMouseMove,{passive:!0})}),_(v(t),"onMouseMove",function(e){t.state.isDragging||(t.setState({isDragging:!0}),t.props.onDragStart()),t.updateFromMousePosition(e.pageX,e.pageY)}),t}return b(n,t.default.PureComponent),m(n,[{key:"updateX",value:function(){var e=this.spectrumRef.getBoundingClientRect().width
this.setState({x:x(0,e,O(this.props.x,0,1))})}},{key:"updateY",value:function(){var e=this.spectrumRef.getBoundingClientRect().height
this.setState({y:x(0,e,O(this.props.y,0,1))})}},{key:"componentDidUpdate",value:function(e){this.state.isDragging||this.props.x===e.x||this.props.x===this.state.prevX||this.updateX(),this.state.isDragging||this.props.y===e.y||this.props.y===this.state.prevY||this.updateY()}},{key:"updateFromMousePosition",value:function(e,t){var n=this.spectrumRef.getBoundingClientRect(),o=n.left,r=n.top,a=n.width,i=n.height,s=O(e-o,0,a),l=O(t-r,0,i),c=s/a,u=l/i
this.setState({x:s,y:l,prevX:c,prevY:u}),this.props.onUpdate(c,u)}},{key:"componentDidMount",value:function(){this.updateX(),this.updateY(),this.spectrumRef.addEventListener("mousedown",this.onMouseDown)}},{key:"componentWillUnmount",value:function(){this.spectrumRef.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove,{passive:!0})}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{ref:function(t){return e.spectrumRef=t},className:"huebert-picker-spectrum",tabIndex:"-1",style:this.props.style},t.default.createElement("div",{className:"huebert-picker-spectrum-x"}),t.default.createElement("div",{className:"huebert-picker-spectrum-y"}),t.default.createElement("div",{className:"huebert-picker-spectrum-iris",style:{left:this.state.x,top:this.state.y}}),t.default.createElement("div",{className:"huebert-picker-spectrum-ratio"}))}}]),n}()
e.HuebertSpectrum=j,_(j,"defaultProps",{style:{},position:0,onUpdate:function(){},onDragStart:function(){},onDragEnd:function(){}})
var T=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(r)))),"state",{prevUpdate:0,position:0}),_(v(t),"state",{isDragging:!1}),_(v(t),"onMouseDown",function(e){1===e.which&&(e.preventDefault(),e.stopPropagation(),t.updateFromMousePosition(e.pageX),window.addEventListener("mouseup",t.onMouseUp),window.addEventListener("mousemove",t.onMouseMove,{passive:!0}))}),_(v(t),"onMouseUp",function(e){e.preventDefault(),e.stopPropagation(),t.setState({isDragging:!1}),t.props.onDragEnd(),window.removeEventListener("mouseup",t.onMouseUp),window.removeEventListener("mousemove",t.onMouseMove,{passive:!0})}),_(v(t),"onMouseMove",function(e){t.state.isDragging||(t.setState({isDragging:!0}),t.props.onDragStart()),t.updateFromMousePosition(e.pageX)}),t}return b(n,t.default.PureComponent),m(n,[{key:"updatePosition",value:function(){var e=this.sliderRef.getBoundingClientRect().width
this.setState({position:x(0,e,O(this.props.position,0,1))})}},{key:"componentDidUpdate",value:function(e){this.state.isDragging||this.props.position===e.position||this.props.position===this.state.prevUpdate||this.updatePosition()}},{key:"updateFromMousePosition",value:function(e){var t=this.sliderRef.getBoundingClientRect(),n=t.left,o=t.width,r=O(e-n,0,o),a=r/o
this.setState({position:r,prevUpdate:a}),this.props.onUpdate(a)}},{key:"componentDidMount",value:function(){this.updatePosition(),this.sliderRef.addEventListener("mousedown",this.onMouseDown)}},{key:"componentWillUnmount",value:function(){this.sliderRef.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove,{passive:!0})}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{ref:function(t){return e.sliderRef=t},className:"huebert-picker-control-slider",tabIndex:"-1"},t.default.createElement("div",{className:"huebert-picker-control-slider-handle",style:{left:this.state.position}}),t.default.createElement("div",{className:"huebert-picker-control-slider-value",style:this.props.style}))}}]),n}()
e.HuebertSlider=T,_(T,"defaultProps",{style:{},position:0,onUpdate:function(){},onDragStart:function(){},onDragEnd:function(){}})
var M=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(a)))),"state",{inputValue:null,invalid:!1}),_(v(t),"parseColor",(0,r.memoize)(function(e){return(0,i.default)(w().lookupColor(e))})),_(v(t),"colorToHsl",function(e){return t.parseColor(e).toHsl()}),_(v(t),"colorToHsv",function(e){return t.parseColor(e).toHsv()}),_(v(t),"updateColorFromTextInput",function(e){var n=e.target.value,o=function(e){t.setState({inputValue:e,invalid:!1}),t.props.onUpdate(e)},r=n.match(new RegExp(/[^#][a-fA-F\d]+/))
if(r&&r[0]===n){var a="#".concat(n)
if((0,i.default)(a).isValid())return o(a)}return(0,i.default)(n).isValid()?o(n):t.setState({inputValue:n,invalid:!0})}),_(v(t),"updateColorFromDimensions",(0,c.debounceIdleCallback)(function(e){var n=e.h,o=e.s,r=e.v,a=e.a,s={}
t.props.value&&"transparent"!==t.props.value?s=t.colorToHsv(t.props.value):(s.h=0,s.s=1,s.v=1,s.a=1),void 0!==n&&(s.h=360-360*n,o||0!==s.s||(s.s=1),o||0!==s.v||(s.v=1)),void 0!==o&&(s.s=o),void 0!==r&&(s.v=1-r),void 0!==a&&(s.a=a)
var l=t.formatColor((0,i.default)(s))
t.setState({inputValue:l,invalid:!1}),t.props.onUpdate(l)},30)),_(v(t),"onUpdateFromSpectrum",function(e,n){t.lazyUpdateHandle=t.updateColorFromDimensions({s:e,v:n})}),_(v(t),"onUpdateHue",function(e){t.lazyUpdateHandle=t.updateColorFromDimensions({h:e})}),_(v(t),"onUpdateAlpha",function(e){t.lazyUpdateHandle=t.updateColorFromDimensions({a:e})}),t}return b(n,t.default.Component),m(n,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.value!==e.value||(this.props.outputFormat!==e.outputFormat||(this.props.usePalette!==e.usePalette||(this.state.inputValue!==t.inputValue||this.state.invalid!==t.invalid)))}},{key:"componentDidUpdate",value:function(e,t){this.props.value!==e.value&&this.state.inputValue!==this.props.value&&this.detectColorForTextInput()}},{key:"componentWillUnmount",value:function(){(0,c.cancelIdleCallback)(this.lazyUpdateHandle)}},{key:"detectColorForTextInput",value:function(){var e=this.parseColor(this.props.value)
if(!e.isValid())return this.setState({inputValue:this.props.value,invalid:!0})
this.setState({inputValue:e.toString(),invalid:!1})}},{key:"componentDidMount",value:function(){this.detectColorForTextInput()}},{key:"renderPalette",value:function(){var e=this
return t.default.createElement("div",{className:"cs-form-color-input-palette"},w().getPaletteItems().map(function(n){var r=n.id,a=n.label,i=n.value
return t.default.createElement("div",{key:r,className:(0,o.default)("cs-form-color-input-palette-item",{"cs-active":r===e.props.value}),title:a,onClick:function(){return e.props.onUpdate(r)}},t.default.createElement("div",{style:{backgroundColor:i||"transparent"}}))}))}},{key:"formatColor",value:function(e){var t=this.props.outputFormat
return"hsl"===t?e.toHslString():"hsv"===t?e.toHslString():"hex"===t?e.toHexString():"rgb"===t?e.toRgbString():"hsv"===e.getFormat()?e.toRgbString():e.toString()}},{key:"render",value:function(){var e=this,n=this.colorToHsv(this.props.value),r=n.h,a=n.s,s=n.v,l=n.a,c=S(r),u=k(l),p=(360-r)/360,d=k(a),f=1-k(s),m=(0,i.default)({h:r,s:a,v:s,a:l}),h=[m.setAlpha(0).toRgbString(),m.setAlpha(1).toRgbString()]
return t.default.createElement("div",{className:"huebert huebert-single huebert-open"},t.default.createElement("div",{className:"huebert-picker",tabIndex:"-1"},t.default.createElement(j,{x:d,y:f,style:{backgroundColor:c},onUpdate:this.onUpdateFromSpectrum,onDragStart:this.props.onDragEventStart,onDragEnd:this.props.onDragEventEnd}),t.default.createElement(T,{position:p,style:{backgroundImage:C()},onUpdate:this.onUpdateHue,onDragStart:this.props.onDragEventStart,onDragEnd:this.props.onDragEventEnd}),t.default.createElement(T,{position:u,style:{backgroundImage:E(h)},onUpdate:this.onUpdateAlpha,onDragStart:this.props.onDragEventStart,onDragEnd:this.props.onDragEventEnd}),this.props.usePalette&&this.renderPalette(),t.default.createElement("button",{onClick:function(){return e.props.onUpdate("transparent")},tabIndex:"-1",className:"huebert-picker-control-button huebert-picker-control-button-clear"}),t.default.createElement("input",{className:(0,o.default)("huebert-picker-control-output-value",{invalid:this.state.inputValue&&this.state.invalid}),type:"text",value:null===this.state.inputValue?"":this.state.inputValue,onChange:this.updateColorFromTextInput})))}}]),n}()
e.Huebert=M,_(M,"defaultProps",{value:"",outputFormat:"rgba",usePalette:!1,onUpdate:function(){},onDragEventStart:function(){},onDragEventEnd:function(){}})
var D=function(e){function n(){return d(this,n),h(this,g(n).apply(this,arguments))}return b(n,t.default.PureComponent),m(n,[{key:"render",value:function(){var e=this,n=t.default.createElement(t.default.Fragment,null,w().getPaletteItems().map(function(n){var r=n.id,a=n.label,i=n.value
return t.default.createElement("div",{key:r,className:(0,o.default)("cs-form-color-input-palette-item",{"cs-active":r===e.props.selected}),title:a,onClick:function(){return e.props.onSelect(r)}},t.default.createElement("div",{style:{backgroundColor:i||"transparent"}}))}))
return this.props.target&&this.props.target.nodeType?a.default.createPortal(n,this.props.target):null}}]),n}()
e.ColorInputPalette=D,_(D,"defaultProps",{target:null,items:[],selected:null,onSelect:function(){}})
var A={enablePreviewPointer:u.enablePreviewPointer,disablePreviewPointer:u.disablePreviewPointer},I=function(e){function n(){var e,t
d(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return _(v(t=h(this,(e=g(n)).call.apply(e,[this].concat(r)))),"state",{open:!1,isDragging:!1}),_(v(t),"onTogglePicker",function(e){return t.setState({open:e})}),_(v(t),"onDragEventStart",function(){t.setState({isDragging:!0}),t.props.disablePreviewPointer()}),_(v(t),"onDragEventEnd",function(){t.setState({isDragging:!1}),t.props.enablePreviewPointer()}),t}return b(n,t.default.Component),m(n,[{key:"render",value:function(){var e=this,n=this.props.usePalette?w().lookupColor(this.props.value):this.props.value
return t.default.createElement(s.default,{class:"cs-form-color-picker",open:this.state.open,onToggle:this.onTogglePicker,cancelCloseOutside:this.state.isDragging,label:this.props.options.label||(0,l.t)("app.select"),content:t.default.createElement("div",{className:"cs-picker-swatch-content",style:{backgroundColor:n}})},t.default.createElement(M,{value:this.props.value,outputFormat:this.props.options.output_format,usePalette:this.props.usePalette,onUpdate:function(t){return e.props.onUpdate(t)},onDragEventStart:this.onDragEventStart,onDragEventEnd:this.onDragEventEnd}))}}]),n}()
_(I,"defaultProps",{value:null,options:{},usePalette:!1,onUpdate:function(){},onDragEventStart:function(){},onDragEventEnd:function(){}})
var R=(0,n.connect)(function(){return{}},A)(I)
e.default=R})
define("tco-app/src/components/forms/DateTime",["exports","react","react-datetime","moment","tco-app/src/components/common/Picker"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function p(){var e,n,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,p)
for(var i=arguments.length,c=new Array(i),d=0;d<i;d++)c[d]=arguments[d]
return o=this,r=(e=s(p)).call.apply(e,[this].concat(c)),n=!r||"object"!==a(r)&&"function"!=typeof r?l(o):r,u(l(n),"state",{open:!1}),u(l(n),"onInputChange",function(e){return n.props.onChange(e.target.value)}),u(l(n),"onPickerChange",function(e){return n.props.onChange(e&&e.toString?e.toString():e)}),u(l(n),"onFocus",function(e){n.state.open||n.setState({open:!0}),n.props.onFocus&&n.props.onFocus(e)}),u(l(n),"onBlur",function(e){n.state.open||n.setState({open:!0}),n.props.onBlur&&n.props.onBlur(e)}),u(l(n),"togglePicker",function(e){n.setState({open:e})}),u(l(n),"renderSwatch",function(e){var o=e.ref
return t.default.createElement("input",{type:"text",value:n.props.value,onChange:n.onInputChange,onFocus:n.onFocus,onBlur:n.onBlur,ref:o})}),n}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(p,t.default.PureComponent),d=p,(f=[{key:"render",value:function(){var e=this.props.options.dateFormat||(0,o.default)().convertPHPFormat(window.csAppData.date_format),a=this.props.options.timeFormat||(0,o.default)().convertPHPFormat(window.csAppData.time_format),i=(0,o.default)(this.props.value)
return t.default.createElement(r.default,{renderSwatch:this.renderSwatch,open:this.state.open,onToggle:this.togglePicker},t.default.createElement(n.default,{className:"cs-date-time-picker",dateFormat:e,timeFormat:a,value:i,onChange:this.onPickerChange,input:!1}))}}])&&i(d.prototype,f),m&&i(d,m),p}()
e.default=p,u(p,"defaultProps",{options:{}})}),define("tco-app/src/components/forms/FlexPicker",["exports","react","classnames","tco-app/src/components/forms/ChooseSingle","tco-app/src/components/common/Picker","tco-app/src/components/common/Icon","tco-app/src/util/string","tco-app/src/lib/i18n","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var h=[{label:(0,s.t)("app.forms.flex.standard"),value:"0 1 auto",icon:"ui:flex-standard"},{label:(0,s.t)("app.forms.flex.no-shrink"),value:"0 0 auto",icon:"ui:flex-no-shrink"},{label:(0,s.t)("app.forms.flex.fill-space"),value:"1 0 auto",icon:"ui:flex-fill-space"},{label:(0,s.t)("app.forms.flex.fill-space-equally"),value:"1 0 0%",icon:"ui:flex-fill-space-equally"}],g=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=p(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==c(r)&&"function"!=typeof r?d(o):r,m(d(t),"state",{open:!1,custom:!1}),m(d(t),"onUpdatePreset",function(e){var n="custom"===e
t.setState({custom:n}),n||t.props.updateValue(e)}),m(d(t),"onUpdateFlexGrow",function(e){return t.updateCombinedValue("flexGrow",e.target.value)}),m(d(t),"onUpdateFlexShrink",function(e){return t.updateCombinedValue("flexShrink",e.target.value)}),m(d(t),"onUpdateFlexBasis",function(e){return t.updateCombinedValue("flexBasis",e.target.value)}),m(d(t),"onTogglePicker",function(e){return t.setState({open:e})}),t}var g,v,b
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.PureComponent),g=n,(v=[{key:"getValues",value:function(){var e=(0,i.splitOnWhitespace)("z ".concat(this.props.value))
return{flexGrow:void 0!==e[1]?e[1]:"",flexShrink:void 0!==e[2]?e[2]:"",flexBasis:void 0!==e[3]?e[3]:""}}},{key:"updateCombinedValue",value:function(e,t){var n=Object.assign({},this.getValues(),m({},e,t)),o=n.flexGrow,r=n.flexShrink,a=n.flexBasis
this.props.updateValue("".concat(o," ").concat(r," ").concat(a))}},{key:"render",value:function(){var e=this,n=this.getValues(),i={value:"custom",icon:"ui:flex-custom",label:(0,s.t)("app.custom")},c=i.value,u=i.label,p=i.icon
if(!this.state.custom){var d=h.find(function(t){return t.value===e.props.value})
d&&d.value&&d.label&&(c=d.value,u=d.label,p=d.icon)}return t.default.createElement(r.default,{open:this.state.open,label:u,reposition:"custom"===c?"one":"two",content:t.default.createElement(a.default,{icon:p.substr(3)}),onToggle:this.onTogglePicker},t.default.createElement("div",{className:"cs-choose-picker-content"},t.default.createElement(o.default,{isVertical:!0,value:c,choices:[].concat(h,[i]),onUpdate:this.onUpdatePreset}),"custom"===c&&t.default.createElement(l.ControlList,null,t.default.createElement(l.ControlSingle,{label:(0,s.t)("app.forms.flex.flex-grow")},t.default.createElement("input",{type:"text",value:n.flexGrow,onChange:this.onUpdateFlexGrow})),t.default.createElement(l.ControlSingle,{label:(0,s.t)("app.forms.flex.flex-shrink")},t.default.createElement("input",{type:"text",value:n.flexShrink,onChange:this.onUpdateFlexShrink})),t.default.createElement(l.ControlSingle,{label:(0,s.t)("app.forms.flex.flex-basis")},t.default.createElement("input",{type:"text",value:n.flexBasis,onChange:this.onUpdateFlexBasis})))))}}])&&u(g.prototype,v),b&&u(g,b),n}()
e.default=g}),define("tco-app/src/components/forms/GridTemplateInput",["exports","react","tco-app/src/components/common/Picker","tco-app/src/components/common/Icon","tco-app/src/components/forms/LabelInput","tco-app/src/util/string","tco-app/src/util/unique","tco-app/src/components/forms/ValueList"],function(e,t,n,o,r,a,i,s){function l(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){w(e,t,n[t])})}return e}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function g(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?b(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var E=function(e){function n(e){var t
return f(this,n),w(b(t=g(this,v(n).call(this,e))),"onMove",function(e,n){var o=d(t.state.values)
o.splice(n<0?o.length+n:n,0,o.splice(e,1)[0]),t.setValues(o)}),w(b(t),"onDuplicate",function(e){var n=d(t.state.values),o=n.findIndex(function(t){return t.id===e}),r=n[o],a=r.value,s=r.isComment
n.splice(o,0,{id:(0,i.uniqueID)(),value:a,isComment:s}),t.setValues(n)}),w(b(t),"onDelete",function(e){t.setValues(t.state.values.filter(function(t){return t.id!==e}))}),w(b(t),"onToggleComment",function(e){var n=d(t.state.values),o=n.findIndex(function(t){return t.id===e}),r=n[o].isComment
n[o]=p({},n[o],{isComment:!r}),t.setValues(n)}),w(b(t),"onUpdateLabel",function(e,n){var o=d(t.state.values),r=o.findIndex(function(t){return t.id===e})
o[r]=p({},o[r],{value:n}),t.setValues(o)}),w(b(t),"onAdd",function(){t.setValues([].concat(d(t.state.values),[{value:"1fr"}]))}),t.state={values:(0,a.splitCssValue)(t.props.value).map(function(e){return{id:(0,i.uniqueID)(),isComment:-1!==e.indexOf("/*"),value:e.replace(/\/\*(.*)\*\//,function(e,t){return t})}})},t}return y(n,t.default.PureComponent),h(n,[{key:"setValues",value:function(e){this.props.onUpdate(e.map(function(e){var t=e.value
return e.isComment?"/*".concat(t,"*/"):t}).join(" "))}},{key:"render",value:function(){return this.props.children({values:this.state.values,onMove:this.onMove,onDuplicate:this.onDuplicate,onToggleComment:this.onToggleComment,onUpdateLabel:this.onUpdateLabel,onDelete:this.onDelete,onAdd:this.onAdd})}}]),n}(),O=function(e){function n(){return f(this,n),g(this,v(n).apply(this,arguments))}return y(n,t.default.PureComponent),h(n,[{key:"render",value:function(){var e=this
return t.default.createElement(s.ValueList,c({},this.props,{renderItem:function(n,o){return t.default.createElement(x,{key:n.id,onToggleComment:e.props.onToggleComment,onDuplicate:e.props.onDuplicate,onDelete:e.props.onDelete,onUpdateLabel:e.props.onUpdateLabel,item:n,listItemProps:o})}}))}}]),n}(),x=function(e){function n(){var e,t
f(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return w(b(t=g(this,(e=v(n)).call.apply(e,[this].concat(r)))),"state",{isEditingLabel:!1}),w(b(t),"onToggleComment",function(){return t.props.onToggleComment(t.props.item.id)}),w(b(t),"onDuplicate",function(){return t.props.onDuplicate(t.props.item.id)}),w(b(t),"onDelete",function(){return t.props.onDelete(t.props.item.id)}),w(b(t),"onUpdateLabel",function(e){return t.props.onUpdateLabel(t.props.item.id,e)}),w(b(t),"onIsEditingLabel",function(e){return t.setState({isEditingLabel:e})}),t}return y(n,t.default.PureComponent),h(n,[{key:"render",value:function(){return t.default.createElement(s.ValueListItem,c({canDrag:!this.state.isEditingLabel,isInteractive:this.state.isEditingLabel,content:t.default.createElement(r.default,{label:this.props.item.value,onUpdate:this.onUpdateLabel,onStateChange:this.onIsEditingLabel}),actions:t.default.createElement(t.default.Fragment,null,t.default.createElement("button",{onClick:this.onToggleComment},t.default.createElement(o.default,{icon:"fa-eye"})),t.default.createElement("button",{onClick:this.onDuplicate},t.default.createElement(o.default,{icon:"fa-copy"})),t.default.createElement("button",{onClick:this.onDelete},t.default.createElement(o.default,{icon:"fa-trash-alt"})))},this.props.listItemProps))}}]),n}(),k=function(e){function o(){var e,t
f(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return w(b(t=g(this,(e=v(o)).call.apply(e,[this].concat(r)))),"state",{open:!1}),w(b(t),"onUpdateInput",function(e){return t.props.onChange(e.target.value)}),w(b(t),"onUpdateStringState",function(e){return t.props.onChange(e)}),w(b(t),"togglePicker",function(e){return t.setState({open:e})}),t}return y(o,t.default.Component),h(o,[{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:"cs-control-input",style:{position:"relative"}},t.default.createElement("input",{value:this.props.value,onChange:this.onUpdateInput,type:"text",style:{paddingRight:"28px"}}),t.default.createElement(n.default,{class:"cs-grid-template-picker",modalClass:"cs-grid-template-picker",open:this.state.open,swatchTag:"button",swatchClass:"",content:t.default.createElement("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t.default.createElement("path",{d:"M13.3,5.2l1.1-2.1l-1.4-1.4l-2.1,1.1c-0.3-0.2-0.7-0.3-1.1-0.4L9,0H7L6.2,2.3C5.9,2.4,5.5,2.5,5.2,2.7 L3.1,1.6L1.6,3.1l1.1,2.1C2.5,5.5,2.4,5.9,2.3,6.2L0,7v2l2.3,0.8c0.1,0.4,0.3,0.7,0.4,1.1l-1.1,2.1l1.4,1.4l2.1-1.1 c0.3,0.2,0.7,0.3,1.1,0.4L7,16h2l0.8-2.3c0.4-0.1,0.7-0.3,1.1-0.4l2.1,1.1l1.4-1.4l-1.1-2.1c0.2-0.3,0.3-0.7,0.4-1.1L16,9V7 l-2.3-0.8C13.6,5.9,13.5,5.5,13.3,5.2z M8,11c-1.7,0-3-1.3-3-3s1.3-3,3-3s3,1.3,3,3S9.7,11,8,11z"})),onToggle:this.togglePicker},t.default.createElement(E,{key:this.props.value,value:this.props.value,onUpdate:this.onUpdateStringState},function(n){var o=n.onAdd,r=l(n,["onAdd"])
return t.default.createElement("div",{className:"cs-choose-picker-content"},t.default.createElement("header",{className:"cs-control-group-header"},t.default.createElement("span",{className:"cs-control-group-label"},"Manage Template"),t.default.createElement("button",{onClick:o,className:"cs-value-list-add"},t.default.createElement("span",null,"+"))),t.default.createElement(O,c({emptyMessage:e.props.emptyMessage},r)))})))}}]),o}()
e.default=k,w(k,"defaultProps",{emptyMessage:""})}),define("tco-app/src/components/forms/IconPicker",["exports","react","classnames","lodash","react-virtualized","tco-app/src/components/common/Picker","tco-app/src/components/common/Search","tco-app/src/components/common/ScrollBox","tco-app/src/components/common/FaIcon","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function m(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?g(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.IconChoose=void 0
var w=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:font-awesome")}),E=(0,o.memoize)(function(e){return w().resolveAlias(e)}),O=(0,o.memoize)(function(e){return w().resolveIcon(e)}),x=(0,o.memoize)(function(e){return w().resolveIconPrefix(e)}),k=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:ui").get("scrollBarWidth")}),S=Object.keys(window.csAppData.font_awesome.groups).filter(function(e){return!!window.csAppData.faConfig["fa_".concat(e,"_enable")]}),P=S.map(function(e){return{value:e,label:window.csAppData.font_awesome.groups[e]}})
P.length>1&&P.push({value:"all",label:"all"})
var C={}
function j(e){return C[e]?[e].concat(_(C[e])).join(","):e}Object.keys(window.csAppData.font_awesome.aliases).forEach(function(e){var t=window.csAppData.font_awesome.aliases[e]
C[t]||(C[t]=[]),C[t].push(e)})
var T=window.csAppData.font_awesome.brands.map(function(e){return{id:e,title:j(e),prefix:"fab",group:"brands"}}).concat(window.csAppData.font_awesome.solid.map(function(e){return{id:e,title:j(e),prefix:"fas",group:"solid"}})).concat(window.csAppData.font_awesome.regular.map(function(e){return{id:"o-".concat(e),title:j("o-".concat(e)),prefix:"far",group:"regular"}})).concat(window.csAppData.font_awesome.light.map(function(e){return{id:"l-".concat(e),title:j("l-".concat(e)),prefix:"fal",group:"light"}})).concat(Object.keys(window.csAppData.font_awesome.groups).reduce(function(e,t){return window.csAppData.font_awesome[t]&&("light".includes(t),0)&&(e=e.concat(window.csAppData.font_awesome[t].map(function(e){return{id:e,title:j(e),group:t}}))),e},[])),M=(0,o.memoize)(function(e){return"all"===e?T:T.filter(function(t){return t.group===e})}),D=(0,o.memoize)(function(e,t){return e?M(t).filter(function(t){return t.title.includes(e)}):M(t)},function(e,t){return"".concat(e||"","|").concat(t)})
function A(){var e=getComputedStyle(document.body),t=Array.prototype.slice.call(arguments).map(function(t){return e.getPropertyValue(t)})
return arguments.length>1?t:t[0]}["brands","solid","regular","light"].forEach(function(e){var t=e.value
return M(t)})
var I=function(e){function o(){var e,t
p(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return y(g(t=m(this,(e=h(o)).call.apply(e,[this].concat(r)))),"state",{open:!1,activeTab:null,activeIcon:null,searchQuery:"",width:null,height:null,iconWidth:null}),y(g(t),"onResize",function(){return t.detectSizes()}),y(g(t),"onSearchQueryChange",function(e){return t.setState({searchQuery:e})}),y(g(t),"handleScroll",function(e){var n=e.target,o=n.scrollTop,r=n.scrollLeft
t.Grid.handleScrollEvent({scrollTop:o,scrollLeft:r})}),y(g(t),"scrollToIcon",function(){setTimeout(function(){t.ScrollBox.scrollbar.scrollTop=Math.ceil((window.csAppData.font_awesome[t.state.activeTab].indexOf(O(t.props.value))+1)/t.Grid.props.columnCount)*t.Grid.props.rowHeight-t.Grid.props.rowHeight},300)}),y(g(t),"Grid",null),y(g(t),"ScrollBox",null),t}return v(o,t.default.PureComponent),f(o,[{key:"componentDidMount",value:function(){var e,t=this
this.detectSizes(),this.setState({activeTab:(e=x(this.props.value),{far:"regular",brands:"brands",fal:"light",fas:"solid"}[e]||"regular")}),window.addEventListener("resize",this.onResize)
var n=setInterval(function(){null!==t.Grid&&(clearInterval(n),t.Grid.props.onMount())},1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize)}},{key:"detectSizes",value:function(){if(this.innerRef&&this.innerRef.getBoundingClientRect){var e=this.innerRef.getBoundingClientRect(),t=e.height,n=e.width
t===this.state.height&&n===this.state.width||this.setState({height:t,width:n,iconWidth:parseFloat(A("--d-icons-popup-icons-h"))||50})}}},{key:"setActiveTab",value:function(e){window.localStorage.setItem("csLastChooseIconTab",e),this.setState({activeTab:e})}},{key:"renderGrid",value:function(){var e=this
if(!this.state.width||!this.state.height||!this.state.iconWidth)return null
var o=D(this.state.searchQuery,this.state.activeTab)
if(o.length<=0)return t.default.createElement("span",null,(0,c.t)("app.forms.icon-picker.blank"))
var a=E(this.props.value),i=Math.ceil(this.state.width/this.state.iconWidth)
return t.default.createElement(s.default,{ref:function(t){return e.ScrollBox=t},onScroll:this.handleScroll,suppressScrollX:!0},t.default.createElement(r.Grid,{ref:function(t){return e.Grid=t},onMount:this.scrollToIcon,className:"cs-icons-virtualized",columnCount:i,columnWidth:this.state.iconWidth,height:this.state.height,rowCount:Math.ceil(o.length/i),rowHeight:this.state.iconWidth,width:this.state.width,style:{width:this.state.width+k(),overflowX:"visible",overflowY:"visible"},cellRenderer:function(r){var s=r.columnIndex,c=r.key,u=r.rowIndex,p=r.style,d=u*i+s
if(!o[d])return t.default.createElement("div",{key:c,style:p})
var f=o[d],m=f.id,h=f.title,g=f.group
return t.default.createElement("div",{onClick:function(){return e.props.onUpdate(m)},key:c,style:p,title:h,"data-cs-icon-id":m,"data-cs-icon-group":g,className:(0,n.default)("cs-icons-virtualized-choice",{"cs-active":a===m})},t.default.createElement(l.default,{icon:m}))}}))}},{key:"render",value:function(){var e=this
return S.length<=0?t.default.createElement("div",{className:"cs-icons-outer"},t.default.createElement("div",{className:"cs-icons-message"},t.default.createElement("h3",null,"No Icons Available"),t.default.createElement("p",null,"You currently have all Font Awesome familes disabled. To utilize the icon picker again you will need to enable at least one icon group."))):t.default.createElement("div",{className:"cs-icons-outer"},t.default.createElement(i.default,{query:this.state.searchQuery,placeholder:(0,c.t)("app.search-thing",{context:(0,c.t)("app.forms.icon-picker.search-context")}),focusOnShortcut:!1,onQueryChange:this.onSearchQueryChange}),P.length>1&&t.default.createElement("div",{className:"cs-icons-tabs"},t.default.createElement(s.default,{suppressScrollY:!0},P.map(function(o){var r=o.value,a=o.label
return t.default.createElement("button",{key:r,className:(0,n.default)({"cs-active":e.state.activeTab===r}),onClick:function(){return e.setActiveTab(r)},dangerouslySetInnerHTML:{__html:a}})}))),t.default.createElement("div",{className:"cs-icons-inner",ref:function(t){return e.innerRef=t}},this.renderGrid()))}}]),o}()
e.IconChoose=I,y(I,"defaultProps",{value:null,onUpdate:function(){}})
var R=function(e){function n(){var e,t
p(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return y(g(t=m(this,(e=h(n)).call.apply(e,[this].concat(r)))),"state",{open:!1}),y(g(t),"onTogglePicker",function(e){return t.setState({open:e})}),y(g(t),"onUpdateIcon",function(e){t.props.onUpdate(e),t.props.closeOnSelect&&t.setState({open:!1})}),t}return v(n,t.default.PureComponent),f(n,[{key:"render",value:function(){return t.default.createElement(a.default,{class:"cs-form-icon-picker",open:this.state.open,onToggle:this.onTogglePicker,label:this.props.label||(0,c.t)("app.select"),content:t.default.createElement("div",{"data-cs-icon-id":this.props.value},t.default.createElement(l.default,{icon:this.props.value}))},t.default.createElement(I,{ready:this.props.open,value:this.props.value,onUpdate:this.onUpdateIcon}))}}]),n}()
e.default=R,y(R,"defaultProps",{value:null,label:"",onUpdate:function(){},closeOnSelect:!0})}),define("tco-app/src/components/forms/ImageUpload",["exports","react","classnames","lodash","tco-app/src/components/common/Icon","tco-app/src/components/common/DynamicContent"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:wp-media")}),f=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return n=this,r=(e=l(o)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(n):r,p(c(t),"state",{dcContainer:null}),p(c(t),"imgLoad",function(e){var n=e.target
t.props.onUpdateDimensions({width:n.naturalWidth||window.csAppData.defaultImageWidth,height:n.naturalHeight||window.csAppData.defaultImageHeight})}),p(c(t),"onDcInsert",function(e){return t.props.onUpdate(e)}),p(c(t),"onDcInsertInWPModal",function(e){return console.log("DC",e)}),p(c(t),"dcSetup",function(e){var n=e.dcContainer
t.setState({dcContainer:n})}),p(c(t),"onAdd",function(){var e=d().subscribe({useDynamicContent:t.props.useDynamicContent,dcSetup:t.dcSetup}),n=e.promise,o=e.unsubscribe
t.unsubscribe=o,n.then(function(e){return t.props.onUpdate(e)})}),p(c(t),"onRemove",function(){return t.props.onUpdate("")}),t}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.default.PureComponent),f=o,(m=[{key:"componentDidMount",value:function(){this.imgRef&&this.imgRef.addEventListener("load",this.imgLoad),this.maybeSetBlankDimensions()}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.maybeSetBlankDimensions()}},{key:"maybeSetBlankDimensions",value:function(){this.props.value||this.props.onUpdateDimensions({width:"",height:""})}},{key:"componentWillUnmount",value:function(){this.imgRef&&this.imgRef.removeEventListener("load",this.imgLoad),this.unsubscribe&&this.unsubscribe()}},{key:"normalizeValue",value:function(e){return"1"===e||"true"===e||""!==e&&"false"!==e&&!!e}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:(0,n.default)("cs-image",{pattern:this.props.pattern,empty:!this.props.value},this.props.class),style:{backgroundImage:this.props.value?"url(".concat(this.props.value,")"):"none"}},this.props.useDynamicContent&&t.default.createElement(a.default,{mode:"image",imageOnly:!0,onInsert:this.onDcInsert}),t.default.createElement("span",{onClick:this.onAdd,className:"add"},t.default.createElement(r.default,{icon:"fa-plus-circle"})),t.default.createElement("span",{onClick:this.onRemove,className:"remove"},t.default.createElement(r.default,{icon:"fa-times-circle"})),t.default.createElement("img",{src:this.props.value,ref:function(t){return e.imgRef=t},style:{width:1,height:1,opacity:0,pointerEvents:"none"}}))}}])&&s(f.prototype,m),h&&s(f,h),o}()
e.default=f,p(f,"defaultProps",{value:null,width:null,height:null,onUpdate:function(){},useDynamicContent:!1,onUpdateDimensions:function(){}})}),define("tco-app/src/components/forms/InputList",["exports","react","tco-app/src/components/controls/Control"],function(e,t,n){function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function r(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.InputList=e.InputListItemInline=e.InputListItem=void 0
e.InputListItem=function(e){var a=e.class,i=r(e,["class"])
return t.default.createElement(n.ControlItem,o({className:a},i))}
e.InputListItemInline=function(e){var a=e.class,i=r(e,["class"])
return t.default.createElement(n.ControlItem,o({className:a,label:null},i))}
e.InputList=function(e){var a=e.class,i=r(e,["class"])
return t.default.createElement(n.ControlList,o({className:a},i))}}),define("tco-app/src/components/forms/LabelInput",["exports","react","classnames","tco-app/src/lib/i18n"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=this,n=i(u).apply(this,arguments),e=!n||"object"!==r(n)&&"function"!=typeof n?s(t):n,c(s(e),"onKeyDown",function(t){13===t.keyCode&&(e.sendUpdate(),t.preventDefault()),27===t.keyCode&&(e.setState({isEditing:!1,aborted:!0}),t.preventDefault())}),c(s(e),"onBlur",function(t){if(e.state.aborted)return e.setState({isEditing:!1,aborted:!1})
e.state.isEditing&&e.sendUpdate()}),c(s(e),"onDoubleClick",function(t){e.props.canEdit&&!e.state.isEditing&&e.setState({isEditing:!0})}),e.state={isEditing:!1,aborted:!1,newValue:e.props.label},e}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.PureComponent),p=u,(d=[{key:"componentDidMount",value:function(){this.addInputEvents(),this.spanRef&&this.spanRef.addEventListener("dblclick",this.onDoubleClick)}},{key:"removeInputEvents",value:function(){this.inputRef&&(this.inputRef.removeEventListener("keydown",this.onKeyDown),this.inputRef.removeEventListener("blur",this.onBlur))}},{key:"addInputEvents",value:function(){this.inputRef&&(this.removeInputEvents(),this.inputRef.addEventListener("keydown",this.onKeyDown),this.inputRef.addEventListener("blur",this.onBlur))}},{key:"componentDidUpdate",value:function(e,t){e.label!==this.props.label&&this.setState({newValue:this.props.label}),!t.isEditing===this.state.isEditing&&(this.props.onStateChange(this.state.isEditing),this.inputRef&&this.inputRef.focus(),this.addInputEvents()),!this.props.canEdit&&this.state.isEditing&&this.setState({isEditing:!1,aborted:!1})}},{key:"componentWillUnmount",value:function(){this.removeInputEvents(),this.spanRef&&this.spanRef.removeEventListener("dblclick",this.onDoubleClick)}},{key:"sendUpdate",value:function(){this.setState({isEditing:!1}),this.props.onUpdate(this.state.newValue)}},{key:"showLabel",value:function(){var e=this.props.canEdit?(0,o.t)("app.forms.label-input.placeholder"):""
return this.props.label||this.props.placeholder||e}},{key:"render",value:function(){var e=this
return t.default.createElement("span",{className:(0,n.default)("cs-inline-edit",{"cs-inline-edit-placeholder":!this.props.label}),ref:function(t){return e.spanRef=t}},this.state.isEditing&&t.default.createElement("input",{type:"text",value:this.state.newValue,ref:function(t){return e.inputRef=t},onChange:function(t){e.state.isEditing&&e.setState({newValue:t.target.value})}}),!this.state.isEditing&&this.showLabel())}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{canEdit:!0,label:"",onUpdate:function(){},onStateChange:function(){}})}),define("tco-app/src/components/forms/PlacementPicker",["exports","react","tco-app/src/components/forms/ChoosePicker","tco-app/src/lib/i18n"],function(e,t,n,o){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a={start:"ui:placement-{dir}-start","flex-start":"ui:placement-{dir}-start",center:"ui:placement-{dir}-center",end:"ui:placement-{dir}-end","flex-end":"ui:placement-{dir}-end","space-between":"ui:placement-{dir}-between","space-around":"ui:placement-{dir}-around","space-evenly":"ui:placement-{dir}-evenly",baseline:"ui:placement-{dir}-baseline",stretch:"ui:placement-{dir}-stretch",auto:"ui:placement-{dir}-auto"}
function i(e,t,n){var o="grid"===e,a="cross"===t,i="content"===n,s="self"===n,l=["space-between","space-around","space-evenly"],c=["stretch"],u=[].concat(o?["start","center","end"]:["flex-start","center","flex-end"])
return o?(u=[].concat(r(u),c),i&&(u=[].concat(r(u),l))):u=a||s?[].concat(r(u),["baseline"],c):[].concat(r(u),l),s&&(u=[].concat(r(u),["auto"])),u}var s=function(e){var r=e.value,s=e.display,l=void 0===s?"flex":s,c=e.axis,u=void 0===c?"main":c,p=e.context,d=void 0===p?"content":p,f=e.iconDirection,m=void 0===f?"x":f,h=e.onChange
return t.default.createElement(n.default,{value:r,options:i(l,u,d).map(function(e){return{label:(0,o.t)("app.forms.flex.".concat(e)),icon:(a[e]||"").replace("{dir}",m||"x"),value:e}}),onChange:h})}
e.default=s}),define("tco-app/src/components/forms/Ratio",["exports","react"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),a(this,i(n).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,t.default.PureComponent),l=n,(c=[{key:"getValue",value:function(){var e=this.props.valueA,t=this.props.valueB
if("string"==typeof this.props.value){var n=o(this.props.value.split(":"),2)
e=n[0],t=n[1]}return{valueA:e||"",valueB:t||""}}},{key:"render",value:function(){var e=this,n=o((this.props.placeholder||"").split(":"),2),r=n[0],a=n[1],i=this.getValue(),s=i.valueA,l=i.valueB
return t.default.createElement("ul",{className:"cs-form-ratio-input"},t.default.createElement("li",null,t.default.createElement("input",{type:"text",value:s,onChange:function(t){e.props.onUpdateTermA(t.target.value),e.props.onUpdateValue("".concat(t.target.value,":").concat(e.getValue().valueB))},placeholder:r||""})),t.default.createElement("li",null,":"),t.default.createElement("li",null,t.default.createElement("input",{type:"text",value:l,onChange:function(t){e.props.onUpdateTermB(t.target.value),e.props.onUpdateValue("".concat(e.getValue().valueA,":").concat(t.target.value))},placeholder:a||""})))}}])&&r(l.prototype,c),u&&r(l,u),n}()
e.default=p,u={value:null,valueA:null,valueB:null,onUpdateTermA:function(){},onUpdateTermB:function(){},onUpdateValue:function(){},placeholder:""},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/forms/ResponsiveTabsVertical",["exports","react","classnames","tco-app/src/components/common/Icon"],function(e,t,n,o){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=["xs","sm","md","lg","xl"],i=function(e){var i=e.sizes,s=e.selected,l=e.current,c=e.onChange,u=e.children,p=e.makeContextMenuAtts,d=void 0===p?function(){return{}}:p
return t.default.createElement("div",{className:"cs-responsive-tabs"},t.default.createElement("ul",{className:"cs-responsive-tabs-nav"},i.filter(function(e){return a.includes(e)}).map(function(e){return t.default.createElement("li",r({key:e,className:(0,n.default)({"is-active":e===s,"is-current":e===l}),onClick:function(){return c(e)}},d(e)),t.default.createElement(o.default,{icon:"preview-sizer-".concat(e)}))})),t.default.createElement("div",r({className:"cs-responsive-tabs-panel"},d(s)),u))}
i.defaultProps={sizes:a,selected:!1,current:!1}
var s=i
e.default=s}),define("tco-app/src/components/forms/Select",["exports","react","classnames","tco-app/src/util/decode-entities","tco-app/src/lib/i18n"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function p(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,p)
for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c]
return n=this,o=(e=s(p)).call.apply(e,[this].concat(i)),t=!o||"object"!==a(o)&&"function"!=typeof o?l(n):o,u(l(t),"state",{focused:!1}),u(l(t),"onChange",function(e){t.props.onChange(e.target.value)}),t}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(p,t.default.PureComponent),d=p,(f=[{key:"render",value:function(){var e=this,a=this.props.options.map(function(e){var t=e.value,n=e.label
return{value:t,label:(0,o.default)(n)}}),i=a.find(function(t){return t.value==e.props.value}),s=(0,o.default)(this.props.placeholder||(0,r.t)("app.select"))
return t.default.createElement("div",{className:(0,n.default)("cs-styled-select",{"cs-active":this.state.focused})},t.default.createElement("div",{className:(0,n.default)("cs-styled-select-label",{"cs-styled-select-placeholder":!this.props.value})},t.default.createElement("span",null,i?i.label:s)),t.default.createElement("select",{disabled:this.props.disabled,onChange:this.onChange,value:i?this.props.value:this.props.emptyValue},!i&&t.default.createElement("option",{value:this.props.emptyValue,disabled:!0},s),a.map(function(e){var n=e.value,o=e.label
return t.default.createElement("option",{key:n,value:n},o)})))}}])&&i(d.prototype,f),m&&i(d,m),p}()
e.default=p,u(p,"defaultProps",{value:null,emptyValue:"",placeholder:"",options:[],onChange:function(){}})}),define("tco-app/src/components/forms/SelectReact",["exports","react","classnames","react-select","tco-app/src/util/decode-entities","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p,d,f,m={control:function(){return{}},menu:function(){return{}},menuList:function(){return{}},option:function(){return{}},placeholder:function(){return{}}},h=function(e){function i(){var e
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=l(this,c(i).apply(this,arguments))).state={open:!1},e}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(i,t.default.PureComponent),p=i,(d=[{key:"render",value:function(){var e=this,i=this.props.options.map(function(e){var t=e.value,n=e.label
return{value:t,label:(0,r.default)(n)}}),s=i.find(function(t){return t.value===e.props.value})||null
return t.default.createElement(o.default,{value:s,placeholder:this.props.placeholder||(0,a.t)("app.select"),options:i,onChange:function(t){var n=t.value
return e.props.onChange(n)},styles:m,className:(0,n.default)("cs-react-select",{"cs-active":this.state.open}),classNamePrefix:"cs-react-select",onMenuOpen:function(){e.setState({open:!0}),e.props.onMenuOpen()},onMenuClose:function(){e.setState({open:!1}),e.props.onMenuClose()},components:{DropdownIndicator:function(){return t.default.createElement("span",null)},IndicatorSeparator:function(){return t.default.createElement("span",null)}},noOptionsMessage:this.props.noOptionsMessage})}}])&&s(p.prototype,d),f&&s(p,f),i}()
e.default=h,f={value:null,placeholder:"",options:[],onChange:function(){},onMenuOpen:function(){},onMenuClose:function(){}},(d="defaultProps")in(p=h)?Object.defineProperty(p,d,{value:f,enumerable:!0,configurable:!0,writable:!0}):p[d]=f}),define("tco-app/src/components/forms/TextEditor",["exports","react","classnames","tco-app/src/components/common/Expander","tco-app/src/components/common/Icon","tco-app/src/lib/i18n","tco-app/src/lib/notify","tco-app/src/util/idle-callback"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function u(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function m(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?g(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var _=0,w=function(){return"cswpeditor-".concat(_++)},E=function(){return void 0!==window.tinyMCEPreInit},O=["html","text"],x=!1,k=function(e){function n(){var e,t
p(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return y(g(t=m(this,(e=h(n)).call.apply(e,[this].concat(r)))),"state",{localValue:null}),y(g(t),"lazyUpdate",(0,s.debounceIdleCallback)(function(e){t.props.onChange(e)},50)),y(g(t),"onBlur",function(){return t.setState({localValue:null})}),y(g(t),"onChange",function(e){t.setState({localValue:e.target.value}),t.lazyUpdate(e.target.value)}),t}return v(n,t.default.Component),f(n,[{key:"componentDidMount",value:function(){this.textareaEl.addEventListener("blur",this.onBlur)}},{key:"componentWillUnmount",value:function(){this.lazyUpdate.cancel(),this.textareaEl.removeEventListener("blur",this.onBlur)}},{key:"render",value:function(){var e=this,n=this.props,o=(n.onChange,n.inputRef),r=n.value,a=u(n,["onChange","inputRef","value"]),i=null===this.state.localValue?r:this.state.localValue
return t.default.createElement("textarea",c({ref:function(t){e.textareaEl=t,o(t)},value:i,onChange:this.onChange},a))}}]),n}(),S=function(e){function o(){var e
return p(this,o),y(g(e=m(this,h(o).apply(this,arguments))),"getEditor",function(){return e.editor}),y(g(e),"updateSelectionFromTextarea",function(t){return e.props.onSelectionChange(t.target)}),y(g(e),"onUpdateFromHTML",function(t){return e.props.onUpdate(t)}),e.textAreaRef=t.default.createRef(),e.editorID=w(),e}return v(o,t.default.PureComponent),f(o,[{key:"componentDidMount",value:function(){if(!this.props.availableModes.includes("text"))return this.focusActiveEditor()
E()?this.initializeEditor():x||((0,i.notify)((0,a.t)("app.notify.tinymce-failed"),{type:"notice",timeout:15e3,extendedTimeout:650}),x=!0)}},{key:"componentDidUpdate",value:function(e){if(!E())return this.setState({mode:"html"}),void this.focusActiveEditor()
e.mode!==this.props.mode&&this.focusActiveEditor(),e.value===this.props.value||this.isUpdatingText||(this.editor.setContent(this.props.value,{format:"raw"}),this.isUpdatingText=!1)}},{key:"componentWillUnmount",value:function(){this.editor&&this.editor.destroy(),this.idleUpdate&&this.idleUpdate.cancel()}},{key:"focusActiveEditor",value:function(){"html"!==this.props.mode&&E()?this.editor&&(this.editor.focus(),this.editor.selection.select(this.editor.getBody(),!0),this.editor.selection.collapse(!1)):this.htmlTextArea&&this.htmlTextArea.focus()}},{key:"initializeEditor",value:function(){var e=this
window.tinymce.init(Object.assign({},window.tinyMCEPreInit.mceInit.cswpeditor,{id:this.editorID,selector:"#".concat(this.editorID),resize:!1,valid_elements:"*[*]",extended_valid_elements:"*[*]",content_style:"dark"===this.props.contentStyle?"body { color: #a5a5a5; background-color: #333333; } a { color: #268bd2; }":"",setup:function(t){e.editor=t,t.on("init",function(){window.wpActiveEditor||(window.wpActiveEditor=e.editorID),e.focusActiveEditor()}),t.addButton("cs_media",{icon:"image",onclick:function(){window.wp&&window.wp.media&&window.wp.media.editor&&window.wp.media.editor.open(e.editorID,{frame:"post",state:"insert",title:window.wp.media.view.l10n.addMedia,multiple:!0})}}),e.idleUpdate&&e.idleUpdate.cancel(),e.idleUpdate=(0,s.debounceIdleCallback)(function(){if("text"===e.props.mode){var t=e.editor.getContent().replace(/<p/gi,"<p cs-preserve-p").replace(/\n?<br\s*?\/>\n?/gi,"%%cs-preserve-br%%");(t=window.wp.editor.removep(t).replace(/<p cs-preserve-p/gi,"<p").replace(/%%cs-preserve-br%%/gi,"<br />\n").replace(/^(?:<p>(.*)<\/p>)$/g,"$1"))!==e.props.value&&(e.isUpdatingText=!0,e.props.onUpdate(t),e.isUpdatingText=!1)}},75),t.on("keyup change NodeChange PostProcess",function(){return e.idleUpdate()})}}))}},{key:"render",value:function(){var e=this
return t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:(0,n.default)("cs-text-editor","cs-text-editor-mode-".concat(this.props.mode))},t.default.createElement("div",{className:"cs-text-editor-text"},t.default.createElement("div",{id:"wp-".concat(this.editorID,"-wrap"),className:"wp-core-ui wp-editor-wrap tmce-active"},t.default.createElement("div",{id:"wp-".concat(this.editorID,"-editor-container"),className:"wp-editor-container"},t.default.createElement("textarea",{id:this.editorID,className:"cs-wp-editor wp-editor-area",defaultValue:this.props.value})))),t.default.createElement(k,{value:this.props.value,className:"cs-text-editor-html",onChange:this.onUpdateFromHTML,onFocus:this.updateSelectionFromTextarea,onMouseUp:this.updateSelectionFromTextarea,onKeyUp:this.updateSelectionFromTextarea,inputRef:function(t){return e.htmlTextArea=t}})),this.props.children(this.props.mode,this.getEditor))}}]),o}()
y(S,"defaultProps",{value:"",placeholder:"",mode:null,onUpdate:function(){},autoFocus:!0,availableModes:[],contentStyle:""})
var P=function(e){function i(){var e,t
p(this,i)
for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r]
return y(g(t=m(this,(e=h(i)).call.apply(e,[this].concat(o)))),"state",{open:!1,mode:null}),t}return v(i,t.default.PureComponent),f(i,[{key:"getCurrentMode",value:function(){return this.state.mode?this.state.mode:this.props.richTextDefault&&this.getAvailableModes().includes("text")?"text":"html"}},{key:"getAvailableModes",value:function(){return this.props.availableModes.filter(function(e){return O.includes(e)})}},{key:"getContentPreview",value:function(){var e=this.props.showContentPreview?this.props.value||this.props.placeholder:""
return this.props.height>1?t.default.createElement("textarea",{value:e,disabled:!0}):t.default.createElement("input",{value:e,type:"text",disabled:!0})}},{key:"render",value:function(){var e=this,i=this.getAvailableModes(),s=this.getCurrentMode()
return t.default.createElement(o.default,{class:"cs-expandable-code-editor",open:this.state.open,label:(0,a.t)("app.controls.text-editor.".concat(this.props.showContentPreview?"click-to-edit":"edit-text")),headerLabel:(0,a.t)("app.controls.text-editor.mode-".concat("text"===s?"rich-text":"html")),headerActionsBefore:E()&&t.default.createElement(t.default.Fragment,null,i.map(function(o){return t.default.createElement("button",{key:o,onClick:function(){return e.setState({mode:o})},className:(0,n.default)({"cs-active":o===s})},t.default.createElement(r.default,{icon:"text"===o?"action-btn-fonts":"fa-code"}))})),showContentPreview:this.props.showContentPreview,content:this.getContentPreview(),onToggle:function(t){e.setState({open:t}),e.props.onToggleOpen(t)},expanderClass:"cs-workspace-expander-content-expandable-text-editor",orientation:this.props.orientation},t.default.createElement(S,{autoFocus:this.props.autoFocus,contentStyle:this.props.contentStyle,placeholder:this.props.placeholder,mode:s,availableModes:i,value:this.props.value,onSelectionChange:this.props.onSelectionChange,onUpdate:function(t){return e.props.onUpdate(t)}},this.props.children))}}]),i}()
e.default=P,y(P,"defaultProps",{value:"",placeholder:"",mode:null,orientation:"vertical",showContentPreview:!1,onUpdate:function(){},onToggleOpen:function(){},autoFocus:!0,richTextDefault:!1,availableModes:["html","text"]})}),define("tco-app/src/components/forms/Toggle",["exports","react","classnames","tco-app/src/lib/i18n"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var a=arguments.length,l=new Array(a),p=0;p<a;p++)l[p]=arguments[p]
return n=this,o=(e=i(u)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"onToggle",function(){return t.props.onToggle(!t.normalizeValue(t.props.on))}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.PureComponent),p=u,(d=[{key:"normalizeValue",value:function(e){return"1"===e||"true"===e||""!==e&&"false"!==e&&!!e}},{key:"render",value:function(){return t.default.createElement("ul",{onClick:this.onToggle,className:(0,n.default)("cs-toggle",this.normalizeValue(this.props.on)?"on":"off")},t.default.createElement("li",{className:"on"},t.default.createElement("span",null,(0,o.t)("app.forms.toggle.on"))),t.default.createElement("li",{className:"off"},t.default.createElement("span",null,(0,o.t)("app.forms.toggle.off"))))}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{on:!1,onToggle:function(){}})}),define("tco-app/src/components/forms/UnitField",["exports","react","classnames","tco-app/src/lib/coalescence/common","tco-app/src/util/string","tco-app/src/util/idle-callback"],function(e,t,n,o,r,a){function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function p(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var v={distance:["none","px","em","rem","vh","vw","%"],angle:["deg","rad"],time:["s","ms"]},b={none:{min:0,max:3,step:.001},px:{min:0,max:1500,step:1},em:{min:-.15,max:.5,step:.001},rem:{min:-.15,max:.5,step:.001},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1},"%":{min:0,max:100,step:1},deg:{min:0,max:360,step:1},rad:{min:0,max:6.2832,step:1e-4}},y=function(e){function o(){var e,t
l(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return g(f(t=p(this,(e=d(o)).call.apply(e,[this].concat(r)))),"state",{choicesOpen:!1}),g(f(t),"closeOnOutsideFocus",function(e){t.unitSelectionRef&&(t.unitSelectionRef.contains(e.target)||t.setState({choicesOpen:!1}))}),g(f(t),"onInputChange",function(e){return t.props.onUpdateInput(e.target.value)}),g(f(t),"onInputKeyPress",function(e){"Enter"===e.key&&t.props.onEnter()}),g(f(t),"onClickUnitButton",function(){t.props.disabled||t.setState({choicesOpen:!t.state.choicesOpen})}),t}return m(o,t.default.PureComponent),u(o,[{key:"componentDidMount",value:function(){window.document.body.addEventListener("click",this.closeOnOutsideFocus),window.document.body.addEventListener("focus",this.closeOnOutsideFocus)}},{key:"componentWillUnmount",value:function(){window.document.body.removeEventListener("click",this.closeOnOutsideFocus),window.document.body.removeEventListener("focus",this.closeOnOutsideFocus)}},{key:"render",value:function(){var e=this,o=this.props.validKeywords.length+this.props.allowedUnits.length,r=this.props.allowedUnits.find(function(t){return t===e.props.unit})
return t.default.createElement("div",{className:(0,n.default)("cs-unit-input")},t.default.createElement("input",{value:this.props.value,onChange:this.onInputChange,onKeyPress:this.onInputKeyPress,type:"text",disabled:this.props.disabled,ref:function(t){return e.inputRef=t}}),o>0&&t.default.createElement("div",{className:"cs-unit-input-selection",ref:function(t){return e.unitSelectionRef=t}},t.default.createElement("button",{className:(0,n.default)("cs-unit-input-unit",{"cs-active":this.state.choicesOpen&&o>1,"cs-solitary":this.props.disabled||1===o}),disabled:this.props.disabled,onClick:this.onClickUnitButton},r||"⋯"),t.default.createElement("div",{className:(0,n.default)("cs-unit-input-choices",{"cs-active":this.state.choicesOpen&&o>1})},this.props.validKeywords.map(function(o){return t.default.createElement("button",{key:o,className:(0,n.default)("cs-unit-input-choice",{"cs-active":o===e.props.value}),onClick:function(){var t="calc"===o
e.props.onUpdateInput(t?"calc()":o),e.setState({choicesOpen:!1}),e.inputRef&&(e.inputRef.focus(),setTimeout(function(){t&&e.inputRef&&e.inputRef.setSelectionRange&&e.inputRef.setSelectionRange(5,5)},0))}},o)}),this.props.allowedUnits.map(function(o){return t.default.createElement("button",{key:o,className:(0,n.default)("cs-unit-input-choice",{"cs-active":o===e.props.unit}),onClick:function(){e.props.onUpdateUnit(o),e.setState({choicesOpen:!1}),e.inputRef&&e.inputRef.focus()}},o)}))))}}]),o}()
g(y,"defaultProps",{value:"",unit:"",disabled:!1,allowedUnits:[],validKeywords:[],onUpdateInput:function(){},onUpdateUnit:function(){},onEnter:function(){}})
var _=function(e){function n(){var e,t
l(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return g(f(t=p(this,(e=d(n)).call.apply(e,[this].concat(r)))),"state",{isSliding:!1,position:.5}),g(f(t),"onMouseDown",function(e){1!==e.which&&0!==e.button||(window.document.body.addEventListener("mouseup",t.onMouseUp),window.document.body.addEventListener("mousemove",t.onMouseMove,{passive:!0}))}),g(f(t),"onMouseUp",function(e){t.reposition(e,!1),window.document.body.removeEventListener("mouseup",t.onMouseUp),window.document.body.removeEventListener("mousemove",t.onMouseMove,{passive:!0})}),g(f(t),"onMouseMove",function(e){t.reposition(e,!0)}),t}return m(n,t.default.PureComponent),u(n,[{key:"componentDidMount",value:function(){this.sliderTarget&&this.sliderTarget.addEventListener("mousedown",this.onMouseDown)}},{key:"componentWillUnmount",value:function(){this.sliderTarget&&(this.sliderTarget.removeEventListener("mousedown",this.onMouseDown),window.document.body.removeEventListener("mouseup",this.onMouseUp),window.document.body.removeEventListener("mousemove",this.onMouseMove,{passive:!0}))}},{key:"getPercentage",value:function(){if(this.state.isSliding)return this.state.position
var e=this.props,t=e.min,n=e.max,o=e.value
return Math.min(Math.max(0,(o-t)/(n-t)),1)}},{key:"reposition",value:function(e,t){var n=e.clientX,o=this.props,r=o.step,a=o.min,i=o.max-a,s=this.sliderTarget.getBoundingClientRect(),l=s.left,c=s.width,u=(Math.max(l,Math.min(l+c,n))-l)/c,p=r?Math.min(i,Math.ceil(u*i/r)*r):u*i
this.setState({position:p/i,isSliding:t}),this.props.onUpdate(a+p)}},{key:"renderSlider",value:function(){var e=this,n=this.getPercentage()
return t.default.createElement("div",{className:"cs-unit-slider-target cs-unit-slider-noui-target cs-unit-slider-noui-ltr cs-unit-slider-noui-horizontal",disabled:this.props.disabled,ref:function(t){e.sliderTarget=t}},t.default.createElement("div",{className:"cs-unit-slider-noui-base"},t.default.createElement("div",{className:"cs-unit-slider-noui-connects"},t.default.createElement("div",{className:"cs-unit-slider-noui-connect",style:{transform:"translate(0%, 0px) scale(".concat(n,", 1)")}})),t.default.createElement("div",{className:"cs-unit-slider-noui-origin",style:{transform:"translate(".concat(100*n-100,"%, 0px)"),zIndex:4}},t.default.createElement("div",{className:"cs-unit-slider-noui-handle cs-unit-slider-noui-handle-lower"}))))}},{key:"render",value:function(){return t.default.createElement("div",{className:"cs-unit-slider"},t.default.createElement("div",{className:"cs-unit-slider-target-container"},this.renderSlider()),this.props.children)}}]),n}()
g(_,"defaultProps",{value:"",disabled:!1,onUpdate:function(){}})
var w=function(e){function n(){var e,t
l(this,n)
for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i]
return g(f(t=p(this,(e=d(n)).call.apply(e,[this].concat(r)))),"state",{userInput:t.getRawValue(),invalid:!1}),g(f(t),"lazyUpdate",(0,a.debounceIdleCallback)(function(e){t.props.onUpdate(e)},25)),g(f(t),"detectUnitFromUser",function(){if(!(t.props.validKeywords.includes("calc")&&(t.state.userInput||"").includes("calc"))&&!t.isKeywordValid(t.state.userInput)){var e=t.detectUnit(t.state.userInput,t.detectUnit(t.props.value)),n=t.stripUnit(t.state.userInput,t.stripUnit(t.props.value,0))
return t.setState({userInput:"".concat(n)}),t.props.onUpdate("".concat(n).concat(e))}}),g(f(t),"onSliderUpdateValue",function(e){return t.updateUserInput(e,!0)}),t}return m(n,t.default.PureComponent),u(n,[{key:"componentDidUpdate",value:function(e,t){if(e.value!==this.props.value){var n=this.getRawValue(this.props.value)
parseFloat(this.state.userInput)!==n&&this.setState({userInput:n,invalid:!1})}}},{key:"componentWillUnmount",value:function(){cancelIdleCallback(this.lazyUpdateHandle)}},{key:"getAllowedUnits",value:function(){var e=this,t=v[this.props.unitMode]||[]
return Array.isArray(this.props.availableUnits)?t.filter(function(t){return e.props.availableUnits.includes(t)}):i(t)}},{key:"getRawValue",value:function(){return this.isKeywordValid(this.props.value)?this.props.value:this.stripUnit(this.props.value)}},{key:"detectUnit",value:function(e,t){var n,o=this.getAllowedUnits()
if(o.length<=0)return""
var r=String(e),a=r.match(/-?\d*(?:\.\d+)?/)
return a&&(n=r.replace(a[0],"")),t&&""===n&&(n=t),o.includes(n)?n:o[0]}},{key:"stripUnit",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=String(e).match(/-?\d*(?:\.\d+)?/)
return o&&(t=parseFloat(o[0])),isNaN(t)?n:t}},{key:"isKeywordValid",value:function(e){return!(!this.props.dynamic||"unitless"!==this.props.unitMode||!e.match(/^{{dc:.*?}}$/))||!(!Array.isArray(this.props.validKeywords)||"string"!=typeof e||(0,r.splitOnWhitespace)(e).length>1||(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length)&&!!this.props.validKeywords.find(function(t){return(0,o.stringLike)(e,"calc"===t?"calc%":t)})}},{key:"getSelectedUnit",value:function(){return this.isKeywordValid(this.props.value)?"":this.detectUnit(this.props.value)}},{key:"updateUserInput",value:function(e,t){if(this.setState({userInput:e}),this.isKeywordValid(e))return this.onUpdate(e,t)
var n=String(e).match(/^-?\d*(?:\.\d+)?$/)
return n&&!isNaN(parseFloat(e))?this.onUpdate("".concat(n[0]).concat(this.getSelectedUnit()),t):""===e&&""===this.props.fallbackValue?this.onUpdate("",t):void this.setState({invalid:!0})}},{key:"onUpdate",value:function(e,t){t?this.lazyUpdateHandle=this.lazyUpdate(e):this.props.onUpdate(e)}},{key:"updateUnit",value:function(e,t){var n=void 0===t?this.stripUnit(this.props.value,0):t
return this.props.onUpdate("none"===e?n:"".concat(n).concat(e))}},{key:"renderUnitInput",value:function(e){var n=this,o=e.selectedUnit,r=e.allowedUnits
return t.default.createElement(y,{value:this.state.userInput,unit:o,allowedUnits:r,disabled:this.props.disabled,validKeywords:this.props.validKeywords,onUpdateInput:function(e){return n.updateUserInput(e)},onUpdateUnit:function(e){return n.updateUnit(e)},onEnter:this.detectUnitFromUser,ref:function(e){e&&(e.inputRef&&(n.inputRef=e.inputRef),e.unitSelectionRef&&(n.unitSelectionRef=e.unitSelectionRef))}})}},{key:"getRanges",value:function(){var e,t,n,o={step:.1,min:0,max:100}
if("unitless"===this.props.unitMode)e=parseFloat(this.props.step),t=parseFloat(this.props.min),n=parseFloat(this.props.max)
else{var r=this.getSelectedUnit()||"none"
b[r]&&(b[r].step&&(o.step=b[r].step),b[r].min&&(o.min=b[r].min),b[r].max&&(o.max=b[r].max)),this.props.ranges&&this.props.ranges[r]&&(this.props.ranges[r].step&&(e=parseFloat(this.props.ranges[r].step)),this.props.ranges[r].min&&(t=parseFloat(this.props.ranges[r].min)),this.props.ranges[r].max&&(n=parseFloat(this.props.ranges[r].max)))}return isNaN(e)||(o.step=e),isNaN(t)||(o.min=t),isNaN(n)||(o.max=n),o}},{key:"render",value:function(){var e=this.getAllowedUnits(),n=this.getSelectedUnit()
if(!this.props.slider)return this.renderUnitInput({selectedUnit:n,allowedUnits:e})
var o=this.getRanges(),r=o.min,a=o.max,i=o.step
return t.default.createElement(_,{disabled:this.props.disabled,value:this.getRawValue(),min:r,max:a,step:i,onUpdate:this.onSliderUpdateValue},this.renderUnitInput({selectedUnit:n,allowedUnits:e}))}}]),n}()
e.default=w,g(w,"defaultProps",{value:"",disabled:!1,unitMode:"distance",validKeywords:[],availableUnits:null,fallbackValue:null,slider:!1,ranges:{},onUpdate:function(){}})}),define("tco-app/src/components/forms/ValueList",["exports","react","react-dom","classnames"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function c(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?p(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.ValueListItem=e.ValueList=void 0
var h=function(e){function n(){var e,t
i(this,n)
for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a]
return m(p(t=c(this,(e=u(n)).call.apply(e,[this].concat(r)))),"state",{isDraggingItem:!1,dropIndex:null}),m(p(t),"onDrag",function(e){t.isDraggingItem||t.setState({isDraggingItem:!0})
var n=t.locateDropIndex(e)
n!==t.state.dropIndex&&t.setState({dropIndex:n})}),m(p(t),"onDragEnd",function(e){var n=t.locateDropIndex(e)
t.setState({isDraggingItem:!1,dropIndex:null}),null!==n&&t.props.onMove(e.listIndex,e.listIndex<n?n-1:n)}),t}return d(n,t.default.PureComponent),l(n,[{key:"locateDropIndex",value:function(e){var t=e.listIndex,n=e.x,o=e.y,r=window.document.elementFromPoint(n,o),i=r.classList.contains("cs-value-list-item")?r:r.closest(".cs-value-list-item")
if(!i||!this.listEl||!this.listEl.contains(i))return null
var s=a(this.listEl.children).indexOf(i),l=i.getBoundingClientRect()
return o>l.top+l.height/2&&(s+=1),s===t||s===t+1?null:s}},{key:"render",value:function(){var e=this
return this.props.values.length<=0?t.default.createElement("span",null,this.props.emptyMessage):t.default.createElement("div",{className:(0,o.default)("cs-value-list",{"is-dragging-item":this.state.isDraggingItem})},t.default.createElement("ul",{ref:function(t){e.listEl=t}},this.props.values.map(function(t,n){return e.props.renderItem(t,{listIndex:n,onDrag:e.onDrag,onDragEnd:e.onDragEnd,indicateBefore:e.state.dropIndex===n,indicateAfter:e.state.dropIndex===e.props.values.length&&n===e.props.values.length-1})})))}}]),n}()
e.ValueList=h
var g=function(e){function r(){var e,t
i(this,r)
for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a]
return m(p(t=c(this,(e=u(r)).call.apply(e,[this].concat(o)))),"state",{initialPosition:{},dragOffset:{}}),m(p(t),"maybeDrag",function(e){if(t.props.canDrag){var n=e.clientX,o=e.clientY,r=t.liRef.getBoundingClientRect(),a=r.top,i=r.left,s=r.height,l=r.width
t.setState({initialPosition:{top:a,left:i,height:s,width:l,clientX:n,clientY:o}}),window.addEventListener("mouseup",t.releaseDrag),window.addEventListener("mousemove",t.onDrag)}}),m(p(t),"onDrag",function(e){t.state.dragging||(t.setState({isDragging:!0}),window.document.body.classList.add("is-dragging-cs-value-list"))
var n=t.calculateOffsets(e),o=n.dragOffset,r=n.dragEvent
t.props.onDrag(r),t.setState({dragOffset:o})}),m(p(t),"releaseDrag",function(e){if(t.state.isDragging){window.document.body.classList.remove("is-dragging-cs-value-list"),t.setState({isDragging:!1})
var n=t.calculateOffsets(e).dragEvent
t.props.onDragEnd(n)}window.removeEventListener("mouseup",t.releaseDrag),window.removeEventListener("mousemove",t.onDrag)}),t}return d(r,t.default.PureComponent),l(r,[{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.releaseDrag),window.removeEventListener("mousemove",this.startDrag)}},{key:"calculateOffsets",value:function(e){var t=e.clientX,n=e.clientY,o=this.state.initialPosition,r=(o.top,o.left,o.height,o.width,{x:t-o.clientX,y:n-o.clientY})
return{dragEvent:{listIndex:this.props.listIndex,x:t,y:n},dragOffset:r}}},{key:"getDragPosition",value:function(){if(!this.state.isDragging)return null
var e=this.state.dragOffset,t=e.x,n=e.y,o=this.state.initialPosition
return{position:"fixed",top:o.top,left:o.left,height:o.height,width:o.width,transform:"translate3d(".concat(t,"px, ").concat(n,"px, 0)")}}},{key:"render",value:function(){var e=this,r=t.default.createElement("li",{ref:function(t){e.liRef=t},className:(0,o.default)("cs-value-list-item",{"has-indicator-before":!this.state.isDragging&&this.props.indicateBefore,"has-indicator-after":!this.state.isDragging&&this.props.indicateAfter,"is-disabled":this.props.isDisabled,"is-dragging":this.state.isDragging,"is-interactive":this.props.isInteractive}),style:this.getDragPosition()},t.default.createElement("span",{className:"cs-value-list-item-main",onMouseDown:this.maybeDrag},t.default.createElement("span",{className:"cs-value-list-item-handle"},t.default.createElement("b",null),t.default.createElement("b",null),t.default.createElement("b",null),t.default.createElement("b",null)),this.props.content&&t.default.createElement("span",{className:"cs-value-list-item-content"},this.props.content),this.props.actions&&t.default.createElement("span",{className:"cs-value-list-item-actions"},this.props.actions)),this.props.children&&this.props.showMore&&t.default.createElement("div",{className:"cs-value-list-item-more"},this.props.children))
return this.state.isDragging?t.default.createElement("li",{className:"cs-value-list-item",style:{minHeight:this.state.initialPosition.height}},n.default.createPortal(r,document.body)):r}}]),r}()
e.ValueListItem=g,m(g,"defaultProps",{indicateBefore:!1,indicateAfter:!1,isDisabled:!1,actions:null,showMore:!1,content:null,canDrag:!0})}),define("tco-app/src/components/global/AppConfirmModal",["exports","react","tco-app/src/components/common/ConfirmModal","react-redux","tco-app/src/actions/ui","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return n=this,r=(e=l(o)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(n):r,p(c(t),"onAccept",function(){t.props.uiDismissConfirm(),t.props.dispatch(t.props.action)}),p(c(t),"onDecline",function(){t.props.uiDismissConfirm(),t.props.declineAction&&t.props.dispatch(t.props.declineAction)}),t}var r,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.default.Component),r=o,(d=[{key:"render",value:function(){var e=this.props,o=e.active,r=e.back,i=e.action,s=e.declineAction,l=e.message,c=e.decline,u=e.accept,p=e.acceptClass,d=e.declineClass,f=r||!i&&!s&&!c
return t.default.createElement(n.default,{active:o,message:l,accept:u||(0,a.t)("app.confirm-yep"),decline:f?(0,a.t)("app.back"):c||(0,a.t)("app.confirm-nope"),acceptClass:p,declineClass:d,onAccept:i&&this.onAccept,onDecline:(s||f||i)&&this.onDecline})}}])&&s(r.prototype,d),f&&s(r,f),o}(),f=(0,o.connect)(function(e){return e.ui.confirm},function(e,t){return{dispatch:e,uiDismissConfirm:function(){return e((0,r.uiDismissConfirm)())}}})(d)
e.default=f}),define("tco-app/src/components/global/ElementCursor",["exports","react","react-dom","react-redux","tco-app/src/components/common/ElementIcon","tco-app/src/selectors/elements"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return n=this,r=(e=l(o)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(n):r,p(c(t),"state",{x:0,y:0}),p(c(t),"onMouseMove",function(e){var n=e.clientX,o=e.clientY
return t.setState({x:n,y:o})}),t}var a,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.default.Component),a=o,(d=[{key:"componentDidMount",value:function(){this.setState({x:this.props.initialX||0,y:this.props.initialY||0}),document.body.classList.toggle("cs-element-cursor-is-active",!0),window.addEventListener("mousemove",this.onMouseMove,{passive:!0})}},{key:"componentWillUnmount",value:function(){document.body.classList.toggle("cs-element-cursor-is-active",!1),window.removeEventListener("mousemove",this.onMouseMove,{passive:!0})}},{key:"renderCursor",value:function(){var e={top:this.state.y,left:this.state.x}
return this.props.suspend&&(e.display="none"),t.default.createElement("div",{className:"cs-element-cursor",style:e},t.default.createElement(r.default,{icon:this.props.elementIcon}))}},{key:"render",value:function(){return n.default.createPortal(this.renderCursor(),window.document.body)}}])&&s(a.prototype,d),f&&s(a,f),o}()
p(d,"defaultProps",{initialX:0,initialY:0})
var f=(0,o.connect)(function(e,t){var n=t.type
return{elementIcon:(0,a.getElementIconByType)(e,n)}})(d)
e.default=f}),define("tco-app/src/components/global/KeyboardShortcuts",["exports","react","react-redux","lodash","tco-app/src/lib/keybindings","tco-app/src/actions/ui"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:preference")}),f={uiModKey:a.uiModKey,uiQuickConfirm:a.uiQuickConfirm},m=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return o=this,r=(e=l(n)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(o):r,p(c(t),"onDeleteConfirm",function(){t.props.uiQuickConfirm(!0)}),p(c(t),"onDeleteRelease",function(){t.props.uiQuickConfirm(!1)}),p(c(t),"onModKeyPress",function(){t.props.uiModKey(!0)}),p(c(t),"onModKeyRelease",function(){t.props.uiModKey(!1)}),p(c(t),"onSave",function(){window.cornerstoneApp.lookup("route:application").send("save")}),p(c(t),"toggleAdvancedMode",function(){d().toggleAdvancedMode()}),t}var o,a,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t.default.Component),o=n,(a=[{key:"componentDidMount",value:function(){this.unbindKeys=(0,r.default)({"shift-keydown":this.onDeleteConfirm,"shift-keyup":this.onDeleteRelease,"mod-keydown":this.onModKeyPress,"mod-keyup":this.onModKeyRelease,save:this.onSave,"advanced-mode":this.toggleAdvancedMode})}},{key:"componentWillUnmount",value:function(){this.unbindKeys()}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}])&&s(o.prototype,a),f&&s(o,f),n}(),h=(0,n.connect)(function(e){return{}},f)(m)
e.default=h}),define("tco-app/src/components/global/Launchpad",[],function(){}),define("tco-app/src/components/global/Ui",["exports","react","react-redux","tco-app/src/components/common/Style"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var r,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.Component),r=n,(c=[{key:"componentDidMount",value:function(){this.toggleHideWorkspace()}},{key:"componentDidUpdate",value:function(e){this.props.hideWorkspace===e.hideWorkspace&&this.props.hideWorkspaceFull===e.hideWorkspaceFull||this.toggleHideWorkspace()}},{key:"toggleHideWorkspace",value:function(){document.body.classList.toggle("cs-full-collapse",this.props.hideWorkspace&&this.props.hideWorkspaceFull)}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.props.customAppCss&&t.default.createElement(o.default,null,this.props.customAppCss))}}])&&a(r.prototype,c),u&&a(r,u),n}(),u=(0,n.connect)(function(e){var t=e.builder.preferences.customAppCss
return Object.assign({customAppCss:t},e.ui)})(c)
e.default=u}),define("tco-app/src/components/inspector/InspectorBreadcrumbs",["exports","react","react-redux","tco-app/src/components/common/Breadcrumbs","tco-app/src/actions/ui","tco-app/src/actions/inspector","tco-app/src/selectors/elements"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f,m={uiObserveStart:r.uiObserveStart,uiObserveEnd:r.uiObserveEnd,inspect:a.inspect},h=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),l=0;l<a;l++)i[l]=arguments[l]
return o=this,r=(e=c(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==s(r)&&"function"!=typeof r?u(o):r,d(u(t),"onNavigate",function(e){return t.props.inspect(e)}),d(u(t),"onObserveStart",function(e){return t.props.uiObserveStart(e)}),d(u(t),"onObserveEnd",function(){return t.props.uiObserveEnd()}),d(u(t),"makeItemProps",function(e){return{"cs-context-menu":e.id}}),t}var r,a,i
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(n,t.default.PureComponent),r=n,(a=[{key:"render",value:function(){var e=this.props,n=e.items,r=e.activeItem
return t.default.createElement(o.default,{items:n,activeItem:r,makeItemProps:this.makeItemProps,onNavigate:this.onNavigate,onMouseEnter:this.onObserveStart,onMouseLeave:this.onObserveEnd})}}])&&l(r.prototype,a),i&&l(r,i),n}(),g=(0,n.connect)((f=(0,i.makeGetBreadcrumbs)(),function(e){return{activeItem:e.inspector.inspecting,items:f(e)}}),m)(h)
e.default=g}),define("tco-app/src/components/inspector/InspectorControl",["exports","react","react-redux","tco-app/src/components/inspector/InspectorControlList","tco-app/src/components/inspector/InspectorControlSortable","tco-app/src/components/controls/Control"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=parseInt(window.csAppData.renderDebounce)||200
var m=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l]
return o=this,r=(e=c(n)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?u(o):r,d(u(t),"updateValue",function(e,n){t.props.dispatch({type:"ELEMENT_UPDATE:SET_ATTRIBUTE",payload:{id:t.props.inspecting,key:t.props.control.keys[n||"value"],debounce:t.getDebounce(),value:e}})}),d(u(t),"updateValues",function(e){var n={}
Object.keys(e).forEach(function(o){t.props.control.keys[o]&&(n[t.props.control.keys[o]]=e[o])}),t.props.dispatch({type:"ELEMENT_UPDATE:SET_ATTRIBUTES",payload:{id:t.props.inspecting,debounce:t.getDebounce(),atts:n}})}),t}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(n,t.default.PureComponent),m=n,(h=[{key:"getDebounce",value:function(){return this.props.control.options.debouce||["text","textarea","text-editor"].includes(this.props.control.type)?f:null}},{key:"render",value:function(){return this.props.control?t.default.createElement(a.Control,s({id:this.props.controlId,control:this.props.control,ListComponent:o.default,values:this.props.values,inspecting:this.props.inspecting,updateValue:this.updateValue,updateValues:this.updateValues,orientation:this.props.orientation,userCan:this.props.userCan},this.props.controlProps,{components:{sortable:r.default}})):null}}])&&l(m.prototype,h),g&&l(m,g),n}(),h=(0,n.connect)(function(e,t){var n=t.controlId,o=e.inspector.controls[n],r=e.inspector.inspecting
if(!o||!e.elements[r])return{}
var a={},i=Object.keys(o.keys)
if(i.length>0){var s=e.elements[r]
i.forEach(function(e){a[e]=s[o.keys[e]]})}return{control:o,values:a,inspecting:r,orientation:e.builder.orientation}})(m)
e.default=h}),define("tco-app/src/components/inspector/InspectorControlList",["exports","react","react-redux","tco-app/src/components/inspector/InspectorControl"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var r,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.PureComponent),r=n,(c=[{key:"resolveChildren",value:function(){var e=this
return this.props.controls.map(function(n){return t.default.createElement(o.default,{controlId:n,key:"".concat(e.props.inspecting,":").concat(n),inspecting:e.props.inspecting,userCan:e.props.userCan,controlProps:e.props.controlProps})})}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.resolveChildren())}}])&&a(r.prototype,c),u&&a(r,u),n}(),u=(0,n.connect)(function(e,t){var n=t.control.id,o=e.inspector.controls[n],r=o&&o.controls?o.controls:[]
return"root"===n&&e.inspector.activeGroup&&(r=r.filter(function(t){return e.inspector.activeGroup===e.inspector.controls[t].group.top})),{inspecting:e.inspector.inspecting,controls:r.filter(function(t){return!e.inspector.hiddenControls.includes(t)})}})(c)
e.default=u}),define("tco-app/src/components/inspector/InspectorControlSortable",["exports","react","react-redux","tco-app/src/components/controls/types/ControlSortable","tco-app/src/components/inspector/InspectorSortableItem","tco-app/src/selectors/elements","tco-app/src/actions/elements","tco-app/src/actions/ui","tco-app/src/lib/permissions","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var v,b={enablePreviewPointer:s.enablePreviewPointer,disablePreviewPointer:s.disablePreviewPointer,elementAdd:i.elementAdd},y=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=f(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==u(r)&&"function"!=typeof r?m(o):r,g(m(t),"onDragStart",function(){t.props.disablePreviewPointer(),t.props.updateCanScroll(!1)}),g(m(t),"onDragEnd",function(){t.props.enablePreviewPointer(),t.props.updateCanScroll(!0)}),g(m(t),"onAddNew",function(){return t.props.elementAdd(t.props.inspecting,t.props.addElementAtts)}),t}var a,i,s
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(n,t.default.PureComponent),a=n,(i=[{key:"render",value:function(){return t.default.createElement(o.default,p({canAdd:(0,l.currentUserCan)("".concat(this.props.permissionContext,".elements_create")),canDelete:(0,l.currentUserCan)("".concat(this.props.permissionContext,".elements_delete")),items:this.props.items},this.props,{addLabel:this.props.addElementLabel,itemComponent:r.default,onDragStart:this.onDragStart,onDragEnd:this.onDragEnd,onAddNew:this.onAddNew}))}}])&&d(a.prototype,i),s&&d(a,s),n}(),_=(0,n.connect)((v=(0,a.makeGetElement)(),function(e,t){var n=t.inspecting,o=t.options,r=v(e,{id:n}),i=(0,a.getAddNewElementFromId)(e,{id:n}),s=i.addElementLabel,l=i.addElementAtts
return o.add_label?s=(0,c.t)("app.add-thing",{context:o.add_label}):o.element&&(s=(0,c.t)("app.add-thing",{context:(e.definitions[o.element]||{}).title||"Element"})),{inspecting:n,permissionContext:e.builder.permissionContext,items:r&&r._modules?r._modules:[],addElementAtts:o.element?{_type:o.element}:l,addElementLabel:s}}),b)(y)
e.default=_}),define("tco-app/src/components/inspector/InspectorNavigation",["exports","react","react-redux","tco-app/src/components/controls/ControlNavigation","tco-app/src/actions/inspector","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d={inspectorSelectControlGroup:r.inspectorSelectControlGroup},f=function(e){var t=e.container,n=e.duration,o=e.start,r=e.element,a=e.offset,i=void 0===a?0:a,s=e.horizontal,l=e.after
if(t){var c=0,u=0
!o&&r&&(c=r.offsetLeft,u=r.offsetTop)
var p=isNaN(i)?0:i,d=s?{scrollLeft:c+p}:{scrollTop:u+p}
window.jQuery(t).animate(d,{duration:isNaN(n)?450:n,complete:function(){"function"==typeof l&&l()}})}},m=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u]
return o=this,r=(e=l(n)).call.apply(e,[this].concat(s)),t=!r||"object"!==i(r)&&"function"!=typeof r?c(o):r,p(c(t),"state",{activeSubGroup:null}),p(c(t),"selectGroup",function(e){return t.props.inspectorSelectControlGroup(e)}),p(c(t),"selectSubGroup",function(e){var n=document.querySelector('[data-cs-control-group-name="'.concat(e,'"]'))
if(n){var o=n.closest(".cs-scroll-box.ps")
t.setState({activeSubGroup:e}),o&&f({container:o,element:n,horizontal:"horizontal"===t.props.orientation,after:function(){return t.setState({activeSubGroup:null})}})}}),t}var r,a,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t.default.PureComponent),r=n,(a=[{key:"render",value:function(){var e=this.props,n=e.groups,r=e.activeGroup,a=e.activeSubGroup
return t.default.createElement(o.default,{groups:n,activeGroup:r,activeSubGroup:this.state.activeSubGroup||a,onSelectGroup:this.selectGroup,onSelectSubGroup:this.selectSubGroup})}}])&&s(r.prototype,a),d&&s(r,d),n}(),h=(0,n.connect)(function(e){var t=e.inspector,n=t.groups,o=t.hiddenGroups,r=t.activeGroup,a=t.activeSubGroup,i=t.inspecting
return i&&e.elements[i]?{groups:n.filter(function(e){var t=e.name
return!o.includes(t)}).map(function(e){return{name:e.name,title:e.title,children:e.children.filter(function(e){var t=e.name
return!o.includes(t)})}}),activeGroup:r,activeSubGroup:a,orientation:e.builder.orientation}:{}},d)(m)
e.default=h}),define("tco-app/src/components/inspector/InspectorPresets",["exports","react","react-redux","classnames","lodash","tco-app/src/components/forms/SelectReact","tco-app/src/components/forms/Checkbox","tco-app/src/components/common/Popover","tco-app/src/util/elements","tco-app/src/reducers/helpers","tco-app/src/actions/elements","tco-app/src/actions/data","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c,u,p,d){function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var y=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:template-manager")}),_=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),w={elementUpdateAtts:u.elementUpdateAtts,invalidateData:p.invalidateData},E=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,t=!(r=(e=h(n)).call.apply(e,[this].concat(i)))||"object"!==f(r)&&"function"!=typeof r?g(o):r,b(g(t),"state",{mode:t.props.canApply?"apply":"save",saveName:"",presets:[],loaded:!1,selectedPreset:null,presetMenuOpen:!1,applyPopoverOpen:!1,replaceContent:!1,presetSaved:null}),t}var r,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.default.PureComponent),r=n,(c=[{key:"componentDidMount",value:function(){this.updatePresets()}},{key:"componentDidUpdate",value:function(e,t){e.inspecting._def.id===this.props.inspecting._def.id&&t.presetSaved===this.state.presetSaved||this.updatePresets()}},{key:"componentWillUnmount",value:function(){this.cancelAjax=!0}},{key:"updatePresets",value:function(){var e=this,t=this.props.inspecting._type
return t?_().query("element/preset",{type:t}).then(function(t){if(!e.cancelAjax){var n=t.map(function(e){return{value:e.get("id"),label:e.get("title")}})
n.sort(function(e,t){return window.Ember.compare(e.label,t.label)}),e.setState({loaded:!0,presets:n})}},function(n){e.cancelAjax||(console.log("Unable to load presets for ".concat(t),n),e.setState({loaded:!0,presets:[]}))}):this.setState({loaded:!0,presets:[]})}},{key:"savePreset",value:function(){var e=this
this.state.saveName&&this.props.canSave&&(y().savePreset(this.state.saveName,this.props.makePreset()).then(function(){e.setState({presetSaved:Date.now()}),e.props.invalidateData(["presets"])}),this.setState({saveName:""}))}},{key:"applyPreset",value:function(){if(this.setState({applyPopoverOpen:!1}),this.state.selectedPreset&&this.props.canApply){var e=_().peekRecord("element/preset",this.state.selectedPreset)
e&&this.props.elementUpdateAtts(this.props.inspecting._id,this.state.replaceContent?e.get("values"):(0,l.omitProtectedKeys)(e.get("values"),this.props.inspecting._def))}}},{key:"renderApply",value:function(){var e=this,n=this.state.presets.length<=0,r=n?(0,d.t)("app.presets.na"):(0,d.t)("app.presets.placeholder")
return t.default.createElement("div",{className:"cs-control-input cs-active"},t.default.createElement("ul",{className:"cs-control-input-list"},t.default.createElement("li",null,t.default.createElement("div",{className:"cs-control-input-list-input"},t.default.createElement(a.default,{placeholder:r,value:this.state.selectedPreset,options:this.state.presets,noOptionsMessage:function(){return(0,d.t)("app.presets.na")},onChange:function(t){return e.setState({selectedPreset:t})},onMenuOpen:function(){return e.setState({presetMenuOpen:!0})},onMenuClose:function(){return e.setState({presetMenuOpen:!1})}}),t.default.createElement("button",{className:(0,o.default)("cs-control-select-action-btn cs-control-manage-presets-apply",{"cs-brbr-0":this.state.presetMenuOpen}),disabled:n,onClick:function(){!n&&e.state.selectedPreset&&e.setState({applyPopoverOpen:!0})}},(0,d.t)("app.apply")),t.default.createElement(s.default,{active:this.state.applyPopoverOpen,side:"right",fixed:!0,onOutsideClick:function(){return e.setState({applyPopoverOpen:!1})}},t.default.createElement("div",{className:"cs-popover-section"},t.default.createElement("p",null,(0,d.t)("app.inspector.apply-preset-warning")),(0,l.hasProtectedKeys)(this.props.inspecting._def)&&t.default.createElement(i.default,{label:(0,d.t)("app.presets.replace-content"),checked:this.state.replaceContent,onToggle:function(){return e.setState({replaceContent:!e.state.replaceContent})},style:{fontSize:"10px"}})),t.default.createElement("div",{className:"cs-popover-section is-footer"},t.default.createElement("button",{onClick:function(){return e.applyPreset()},className:"cs-btn cs-btn-sm cs-btn-nope"},(0,d.t)("app.presets.apply-confirm")),t.default.createElement("button",{onClick:function(){return e.setState({applyPopoverOpen:!1})},className:"cs-btn cs-btn-sm"},(0,d.t)("app.presets.apply-decline"))))))))}},{key:"renderSave",value:function(){var e=this
return t.default.createElement("div",{className:"cs-control-input cs-active"},t.default.createElement("ul",{className:"cs-control-input-list"},t.default.createElement("li",null,t.default.createElement("div",{className:"cs-control-input-list-input"},t.default.createElement("input",{type:"text",value:this.state.saveName,placeholder:"Name",onChange:function(t){return e.setState({saveName:t.target.value})}}),t.default.createElement("button",{className:"cs-control-manage-presets-save",onClick:function(){return e.savePreset()}},(0,d.t)("app.save"))))))}},{key:"render",value:function(){var e=this,n=this.props.canApply&&this.props.canSave,r="apply"===this.state.mode&&this.props.canApply,a="save"===this.state.mode&&this.props.canSave
return t.default.createElement("div",{className:"cs-control-select-action cs-control-manage-presets"},n&&t.default.createElement("ul",{className:"cs-control-manage-presets-toggle is-equal"},t.default.createElement("li",null,t.default.createElement("button",{className:(0,o.default)({"cs-active":"apply"===this.state.mode}),onClick:function(){return e.setState({mode:"apply"})}},(0,d.t)("app.presets.apply"))),t.default.createElement("li",null,t.default.createElement("button",{className:(0,o.default)({"cs-active":"save"===this.state.mode}),onClick:function(){return e.setState({mode:"save"})}},(0,d.t)("app.presets.save")))),r&&!n&&t.default.createElement("div",{className:"cs-control-header"},t.default.createElement("label",null,"Apply Preset")),r&&this.renderApply(),a&&!n&&t.default.createElement("div",{className:"cs-control-header"},t.default.createElement("label",null,"Save Preset")),a&&this.renderSave())}}])&&m(r.prototype,c),u&&m(r,u),n}()
b(E,"defaultProps",{inspecting:{}})
var O=(0,n.connect)(function(e){var t=e.elements,n=e.inspector.inspecting
return{makePreset:function(){return(0,c.copyElement)(t,n)}}},w)(E)
e.default=O}),define("tco-app/src/components/inspector/InspectorSortableItem",["exports","react","react-redux","lodash","tco-app/src/components/common/SortableItem","tco-app/src/components/common/Icon","tco-app/src/selectors/elements","tco-app/src/actions/elements","tco-app/src/actions/ui","tco-app/src/actions/inspector","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c,u){function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var b,y=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")}),_={elementAddSibling:s.elementAddSibling,elementMove:s.elementMove,elementDeleteWithConfirm:s.elementDeleteWithConfirm,elementDuplicate:s.elementDuplicate,elementUpdateLabel:s.elementUpdateLabel,uiObserveStart:l.uiObserveStart,uiObserveEnd:l.uiObserveEnd,inspect:c.inspect},w=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=m(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==p(r)&&"function"!=typeof r?h(o):r,v(h(t),"onUpdateLabel",function(e){return t.props.elementUpdateLabel(t.props.element,e)}),v(h(t),"observeStart",function(){return t.props.uiObserveStart(t.props.element)}),v(h(t),"observeEnd",function(){return t.props.uiObserveEnd()}),v(h(t),"onInspect",function(){return t.props.inspect(t.props.element)}),v(h(t),"onDuplicate",function(){t.props.canAdd||y().notify((0,u.t)("app.notify.elements-max-children")),t.props.elementDuplicate(t.props.element)}),v(h(t),"onDelete",function(){t.props.canDelete||y().notify((0,u.t)("app.notify.elements-min-children")),t.props.elementDeleteWithConfirm(t.props.element)}),v(h(t),"onMove",function(e){return t.props.elementMove(t.props.element,e)}),v(h(t),"onAddItem",function(e){return t.props.elementAddSibling(t.props.element,t.props.addElementAtts,e)}),t}var o,i,s
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(n,t.default.PureComponent),o=n,(i=[{key:"render",value:function(){var e=[{action:"inspect",label:(0,u.t)("app.inspect"),content:t.default.createElement(a.default,{icon:"fa-search"}),onClick:this.onInspect}]
return this.props.canShowAdd&&e.push({action:"duplicate",label:(0,u.t)("app.duplicate"),content:t.default.createElement(a.default,{icon:"fa-copy"}),onClick:this.onDuplicate}),this.props.canShowDelete&&e.push({action:"delete",label:(0,u.t)("app.delete"),content:t.default.createElement(a.default,{icon:"fa-trash-alt"}),onClick:this.onDelete}),t.default.createElement(r.default,d({label:this.props.label,onUpdateLabel:this.onUpdateLabel,onMouseEnter:this.observeStart,onMouseLeave:this.observeEnd,onDrop:this.onMove,onAdd:this.onAddItem,controls:e},this.props))}}])&&f(o.prototype,i),s&&f(o,s),n}(),E=(0,n.connect)((b=(0,i.makeGetElement)(),function(e,t){var n=t.item
if(n){var o=b(e,{id:n})
return o?{element:o._id,label:o._label}:{}}return{}}),_)(w)
e.default=E}),define("tco-app/src/components/inspector/InspectorWorkspace",["exports","react","react-redux","tco-app/src/components/common/ScrollBox","tco-app/src/lib/i18n","tco-app/src/selectors/elements","tco-app/src/components/inspector/InspectorNavigation","tco-app/src/components/inspector/InspectorBreadcrumbs","tco-app/src/components/inspector/InspectorControlList","tco-app/src/components/inspector/InspectorPresets","tco-app/src/components/common/HelpTextBlock","tco-app/src/components/workspace/WorkspaceMessage","tco-app/src/components/common/Icon","tco-app/src/components/workspace/WorkspaceActions","tco-app/src/lib/permissions","tco-app/src/actions/elements","tco-app/src/actions/builder","tco-app/src/actions/inspector"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g,v){function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var k,S={elementDuplicate:h.elementDuplicate,elementDeleteWithConfirm:h.elementDeleteWithConfirm,elementDeleteChildrenWithConfirm:h.elementDeleteChildrenWithConfirm,builderManageLayout:g.builderManageLayout,inspectorSelectControlGroup:v.inspectorSelectControlGroup},P=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=w(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==b(r)&&"function"!=typeof r?E(o):r,x(E(t),"state",{cooldown:!1}),x(E(t),"userCan",function(e){return!("dynamic_content"===e&&!t.props.preferences.dynamicContent)&&(0,m.currentUserCan)("".concat(t.props.permissionContext,".").concat(e))}),x(E(t),"onScroll",function(e,n,o){var r=e.target,a=o.start,i=o.end
if(!t.state.cooldown){var s=y(r.querySelectorAll("[data-cs-control-group-name]")).filter(function(e){return!!e.getAttribute("data-cs-control-group-name")}),l=null,c=(l=a?s[0]:i?s[s.length-1]:s.find(function(e){var t=e.getBoundingClientRect(),n=t.top,o=t.height
return n<=91&&n+o>=91})||s[0])?l.getAttribute("data-cs-control-group-name"):null
c&&(c&&c!==t.prevGroup&&t.props.inspectorSelectControlGroup(c),t.prevGroup=c)}}),t}var a,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(n,t.default.PureComponent),a=n,(h=[{key:"componentDidUpdate",value:function(e){var t=this
this.props.activeGroup!==e.activeGroup&&(this.setState({cooldown:!0}),this.cooldownTimer=setTimeout(function(){return t.setState({cooldown:!1})},100))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.cooldownTimer)}},{key:"renderActions",value:function(){var e=this,n=this.userCan("elements_create"),o=this.userCan("elements_delete"),a=this.userCan("manage_layout"),i=this.userCan("apply_presets")&&(0,m.currentUserCan)("element.".concat(this.props.inspecting._type,".apply_presets")),s=this.userCan("save_presets")&&(0,m.currentUserCan)("element.".concat(this.props.inspecting._type,".save_presets")),l=this.props.inspecting._type.replace("classic:",""),u=["section","row","column"].includes(l),p=(u?a:n)||o,h=i||s
if(!p&&!h)return null
var g=this.props.inspecting._id,v=[u?{label:(0,r.t)("app.manage-layout"),content:t.default.createElement(d.default,{icon:"fa-bars"}),onClick:function(){return e.props.builderManageLayout(g)}}:{label:(0,r.t)("app.duplicate"),content:t.default.createElement(d.default,{icon:"fa-copy"}),onClick:function(){return e.props.elementDuplicate(g)}}]
return o&&v.push("column"===l?{label:(0,r.t)("app.erase"),quickConfirmLabel:(0,r.t)("app.really-erase"),content:t.default.createElement(d.default,{icon:"fa-eraser"}),onClick:function(){return e.props.elementDeleteChildrenWithConfirm(g)}}:{label:(0,r.t)("app.delete"),quickConfirmLabel:(0,r.t)("app.really-delete"),content:t.default.createElement(d.default,{icon:"fa-trash-alt"}),onClick:function(){return e.props.elementDeleteWithConfirm(g)}}),t.default.createElement("div",{className:"cs-control-group cs-inspector-actions"},p&&t.default.createElement(f.default,{items:v}),h&&t.default.createElement(c.default,{canApply:i,canSave:s,inspecting:this.props.inspecting}))}},{key:"renderContent",value:function(){var e="vertical"===this.props.orientation
return t.default.createElement("div",{className:"cs-workspace-controls"},!this.props.showNavigationBar&&t.default.createElement(i.default,null),t.default.createElement(o.default,{key:e,class:"workspace-controls",resetScroll:this.props.activeGroup,scrollTo:this.props.scrollTo,onScroll:this.onScroll},t.default.createElement("div",{className:"cs-controls"},e&&!this.props.showNavigationBar&&t.default.createElement(s.default,null),e&&"undefined"===this.props.inspecting._def.id&&t.default.createElement(u.default,{title:(0,r.t)("app.inspector.undefined-title"),message:(0,r.t)("app.inspector.undefined-message",{type:this.props.inspecting._type})}),e&&this.props.inspecting._def.options.is_classic&&t.default.createElement(u.default,{title:(0,r.t)("app.inspector.classic-element-title"),message:(0,r.t)("app.inspector.classic-element-message")}),this.renderActions(),t.default.createElement(l.default,{control:{id:"root"},userCan:this.userCan}))))}},{key:"render",value:function(){var e="horizontal"!==this.props.orientation||this.props.showNavigationBar?null:t.default.createElement(s.default,null)
return t.default.createElement(t.default.Fragment,null,this.props.renderHeader(e),t.default.createElement("div",{className:"cs-workspace-content"},this.props.inspecting?this.renderContent():t.default.createElement(p.default,{title:(0,r.t)("app.inspector.na-title"),message:(0,r.t)("app.inspector.na-message")})))}}])&&_(a.prototype,h),g&&_(a,g),n}(),C=(0,n.connect)((k=(0,a.makeInspectElement)(),function(e){var t=e.builder,n=t.permissionContext,o=t.routePrefix,r=t.orientation,a=t.preferences,i=e.inspector.activeGroup,s=k(e)
return{showNavigationBar:"inline"!==a.controlNav,preferences:a,permissionContext:n,activeGroup:i,routePrefix:o,orientation:r,inspecting:s}}),S)(P)
e.default=C}),define("tco-app/src/components/interface/Canvas",[],function(){})
define("tco-app/src/components/interface/Window",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.Component),l=o,(c=[{key:"render",value:function(){var e=this.props.screen&&"cs-window-".concat(Ember.String.dasherize(this.props.screen)),o=this.props.isHorizontal?"is-col":"is-row"
return t.default.createElement("div",{className:(0,n.default)("cs-window",o,e)},this.props.children)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/components/layout/ContentTemplateItem",["exports","react","react-redux","classnames","tco-app/src/components/common/Icon","tco-app/src/selectors/elements"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p,d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),l(this,c(n).apply(this,arguments))}var a,i,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t.default.Component),a=n,(i=[{key:"render",value:function(){return t.default.createElement("div",{className:(0,o.default)("cs-layer","is-lvl-0",{"is-selected":this.props.selected}),onClick:this.props.onClick},this.props.beforeContent,t.default.createElement("div",{className:"cs-layer-content"},t.default.createElement("div",{className:"cs-layer-content-before"},"save"===this.props.mode&&t.default.createElement(r.default,{icon:"fa-check-circle"})),t.default.createElement("div",{className:"cs-layer-content-inner"},t.default.createElement("span",null,this.props.element._label))),this.props.afterContent)}}])&&s(a.prototype,i),p&&s(a,p),n}(),f=(0,n.connect)((p=(0,a.makeGetElement)(),function(e,t){var n=t.id
return{element:p(e,{id:n})||{}}}))(d)
e.default=f}),define("tco-app/src/components/layout/ContentTemplates",["exports","react","react-redux","classnames","tco-app/src/components/layout/ContentTemplateItem","tco-app/src/components/common/Icon","tco-app/src/selectors/elements","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var g=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return o=this,r=(e=p(n)).call.apply(e,[this].concat(i)),t=!r||"object"!==l(r)&&"function"!=typeof r?d(o):r,m(d(t),"onSelectItem",function(e){null!==t.props.saveSelection?t.props.saveSelection.includes(e)?t.props.onUpdateSelection(t.props.saveSelection.filter(function(t){return t!==e})):t.props.onUpdateSelection([].concat(c(t.props.saveSelection),[e])):t.props.onUpdateSelection(t.props.sections.filter(function(t){return t!==e}))}),t}var i,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.Component),i=n,(h=[{key:"renderBefore",value:function(e){return"insert"===this.props.mode?this.renderInsert(e,!1):t.default.createElement("button",{className:"cs-layer-add-level-zero"})}},{key:"renderAfter",value:function(e,t){if("insert"===this.props.mode&&t===this.props.sections.length-1)return this.renderInsert(e,!0)}},{key:"renderInsert",value:function(e,n){var o=this
return t.default.createElement("button",{className:"cs-layer-add-level-zero show-label",onClick:function(){return o.props.onInsertTemplate(e,n)}},t.default.createElement("span",null,t.default.createElement(a.default,{icon:"fa-plus"}),(0,s.t)("app.insert-thing",{context:(0,s.t)("app.templates.entity")})))}},{key:"render",value:function(){var e=this,n=t.default.createElement("div",{className:(0,o.default)("cs-layers-list","cs-layers-list-".concat(this.props.mode),{"can-insert":this.props.showInserts})},this.props.sections.map(function(n,o){return t.default.createElement(r.default,{beforeContent:e.renderBefore(n,o),key:n,mode:e.props.mode,id:n,selected:"save"===e.props.mode&&(null===e.props.saveSelection||e.props.saveSelection.includes(n)),onClick:"save"===e.props.mode?function(){return e.onSelectItem(n)}:function(){},afterContent:e.renderAfter(n,o)})}))
return"horizontal"===this.props.orientation?n:t.default.createElement("div",{className:(0,o.default)("cs-layers","is-".concat(this.props.orientation))},n)}}])&&u(i.prototype,h),g&&u(i,g),n}()
m(g,"defaultProps",{saveSelection:null})
var v,b=(0,n.connect)((v=(0,i.makeGetLayoutSections)(),function(e){var t=h(v(e),1)[0],n=e.builder
return n.permissionContext,{orientation:n.orientation,sections:(0,i.getChildrenById)(e,{id:t})}}))(g)
e.default=b}),define("tco-app/src/components/layout/LayersHorizontal",["exports","react","react-redux","lodash","tco-app/src/components/layout/LayersSection","tco-app/src/components/common/ScrollBox","tco-app/src/selectors/elements"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m,h=function(e){function n(){var e,t,r,a;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c]
return r=this,a=(e=u(n)).call.apply(e,[this].concat(l)),t=!a||"object"!==s(a)&&"function"!=typeof a?p(r):a,f(p(t),"state",{incoming:!1,mirrorX:0,mirrorY:0,dropIndex:0,mirrorContent:null}),f(p(t),"nextIndex",0),f(p(t),"onMouseOver",function(e){t.state.incoming&&t.setNextIndex(e)}),f(p(t),"onMouseMove",function(e){if(t.state.incoming){var n={mirrorX:e.clientX,mirrorY:e.clientY},o=t.nextIndex+(e.clientY>t.recentMidPoint?1:0)
t.state.dropIndex!==o&&(n.dropIndex=o),t.setState(n)}}),f(p(t),"onDragStart",function(e,n){var o=n.incoming,r=n.mirrorContent,a=e.clientX,i=e.clientY
t.setNextIndex(e),t.setState({dropIndex:t.nextIndex,mirrorX:a,mirrorY:i,incoming:o,mirrorContent:r}),window.document.body.addEventListener("mousemove",t.onMouseMove),window.document.body.addEventListener("mouseup",t.onDragEnd)}),f(p(t),"onDragEnd",function(){window.document.body.removeEventListener("mousemove",t.onMouseMove),t.setState({incoming:null,mirrorX:0,mirrorY:0,mirrorContent:null})}),f(p(t),"sectionDidAppear",(0,o.debounce)(function(){if(t.layersEl&&!t.state.incoming){var e=t.layersEl.querySelectorAll(".cs-layer-content.is-interactive"),n=e[e.length-1]
if(n){var o=t.layersEl.closest(".cs-scroll-box.ps")
if(o){var r=n.getBoundingClientRect().left
o.scrollLeft=r}}}},50,{leading:!1})),t}var i,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(n,t.default.PureComponent),i=n,(m=[{key:"componentDidMount",value:function(){this.layersEl&&this.layersEl.addEventListener("mouseover",this.onMouseOver)}},{key:"setNextIndex",value:function(e){var t=l(e.target.classList).includes("cs-layer")?e.target:e.target.closest(".cs-layer")
if(t){var n=l(t.children).find(function(e){return l(e.classList).includes("cs-layer-content")})
if(n){var o=n.getBoundingClientRect(),r=o.top,a=o.height
this.recentMidPoint=r+a/2,this.nextIndex=l(t.parentElement.children).indexOf(t)}}}},{key:"componentWillUnmount",value:function(){window.document.body.removeEventListener("mouseup",this.onDragEnd),window.document.body.removeEventListener("mousemove",this.onMouseMove),this.layersEl&&this.layersEl.removeEventListener("mouseover",this.onMouseOver)}},{key:"fillSections",value:function(){var e=(this.props.isBars?3:4)-this.props.sections.length
if(1===e)return t.default.createElement("div",{className:"cs-layers-section"})
if(e>1){for(var n=[],o=0;o<e;o+=1)n.push(t.default.createElement("div",{key:o,className:"cs-layers-section"}))
return t.default.createElement(t.default.Fragment,null,n)}return null}},{key:"renderSection",value:function(e,n){return t.default.createElement(r.default,{key:e,id:e,incoming:this.state.incoming,dropIndex:this.state.dropIndex,alternateContent:n&&this.props.alternateContent,onReady:this.sectionDidAppear,onItemDragStart:this.onDragStart},n&&this.props.children)}},{key:"renderMirror",value:function(){return this.state.mirrorContent?t.default.createElement("div",{className:"cs-layers-mirror",style:{left:this.state.mirrorX,top:this.state.mirrorY},dangerouslySetInnerHTML:{__html:this.state.mirrorContent}}):null}},{key:"render",value:function(){var e=this
return this.props.alternateContent&&this.props.sections.length>0?t.default.createElement("div",{className:"cs-layers is-horizontal",ref:function(t){e.layersEl=t}},this.renderSection(this.props.sections[0],!0),t.default.createElement("div",{className:"cs-layers-section"}),t.default.createElement("div",{className:"cs-layers-section"}),t.default.createElement("div",{className:"cs-layers-section"}),this.renderMirror()):t.default.createElement(a.default,{suppressScrollY:!0,scrollingThreshold:250},t.default.createElement("div",{className:"cs-layers is-horizontal",ref:function(t){e.layersEl=t}},this.props.sections.map(function(t,n){return e.renderSection(t,0===n)}),this.fillSections(),this.renderMirror()))}}])&&c(i.prototype,m),h&&c(i,h),n}(),g=(0,n.connect)((m=(0,i.makeGetLayoutSections)(),function(e){return{sections:m(e)}}))(h)
e.default=g}),define("tco-app/src/components/layout/LayersItem",["exports","react","react-redux","classnames","lodash","tco-app/src/components/common/Icon","tco-app/src/components/common/ElementIcon","tco-app/src/components/forms/LabelInput","tco-app/src/selectors/elements","tco-app/src/actions/ui","tco-app/src/actions/elements","tco-app/src/actions/builder","tco-app/src/actions/inspector","tco-app/src/lib/permissions","tco-app/src/lib/i18n","tco-app/src/components/builder/ElementLibraryPicker"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h){function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var E=(0,r.memoize)(function(e){return!["region","root"].includes(e)}),O={elementAdd:u.elementAdd,elementAddFromPreset:u.elementAddFromPreset,elementAddSibling:u.elementAddSibling,elementAddSiblingFromPreset:u.elementAddSiblingFromPreset,elementDeleteWithConfirm:u.elementDeleteWithConfirm,elementDuplicate:u.elementDuplicate,elementUpdateLabel:u.elementUpdateLabel,uiObserveStart:c.uiObserveStart,uiObserveEnd:c.uiObserveEnd,inspect:d.inspect,builderToggleSelect:p.builderToggleSelect,builderSelect:p.builderSelect,enablePreviewPointer:c.enablePreviewPointer,disablePreviewPointer:c.disablePreviewPointer},x=function(e){function n(){var e,o,r,i;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c]
return r=this,i=(e=b(n)).call.apply(e,[this].concat(l)),o=!i||"object"!==g(i)&&"function"!=typeof i?y(r):i,w(y(o),"state",{isDragging:!1,isElementPickerOpen:!1,isEditingLabel:!1}),w(y(o),"onAddChild",function(e){e.stopPropagation(),o.props.addChildElementAtts&&o.props.elementAdd(o.props.id,o.props.addChildElementAtts)}),w(y(o),"onDuplicate",function(e){e.stopPropagation(),o.props.elementDuplicate(o.props.id)}),w(y(o),"onDelete",function(e){e.stopPropagation(),o.props.elementDeleteWithConfirm(o.props.id)}),w(y(o),"onInspectWithoutNavigation",function(e){e.stopPropagation(),o.inspectWithoutNavigation()}),w(y(o),"onInspect",function(e){e.stopPropagation(),o.props.inspect(o.props.id)}),w(y(o),"onToggle",function(e){e.stopPropagation(),o.props.builderToggleSelect(o.props.id)}),w(y(o),"onMouseEnter",function(){o.props.onMouseEnterItem(o.props.id),o.props.draggingIsActive||o.props.uiObserveStart(o.props.id),o.props.canHoverIntentExpand&&o.props.hasChildren&&(o.expandTimer=setTimeout(function(){return o.props.builderToggleSelect(o.props.id)},750)),o.props.canHoverIntentSelect&&(o.selectTimer=setTimeout(function(){return o.inspectWithoutNavigation()},750))}),w(y(o),"onMouseLeave",function(){clearTimeout(o.expandTimer),clearTimeout(o.selectTimer),o.props.enablePreviewPointer(),o.props.onMouseLeaveItem(o.props.id),o.props.uiObserveEnd()}),w(y(o),"onUpdateLabel",function(e){return o.props.elementUpdateLabel(o.props.id,e)}),w(y(o),"maybeDrag",function(e){o.state.isEditingLabel||1!==e.which&&0!==e.button||(e.preventDefault(),E(o.props.element._type)&&(window.document.body.addEventListener("mouseup",o.releaseDrag),window.document.body.addEventListener("mousemove",o.startDrag)))}),w(y(o),"startDrag",function(e){o.props.onDragStart(e,{incoming:o.props.id,mirrorContent:"<span>".concat(o.props.element._label,"</span>")}),o.setState({isDragging:!0}),o.props.disablePreviewPointer(),window.document.body.removeEventListener("mousemove",o.startDrag)}),w(y(o),"releaseDrag",function(){o.state.isDragging&&(clearTimeout(o.expandTimer),clearTimeout(o.selectTimer),o.props.enablePreviewPointer()),o.setState({isDragging:!1}),window.document.body.removeEventListener("mouseup",o.releaseDrag),window.document.body.removeEventListener("mousemove",o.startDrag)}),w(y(o),"onMouseUpGlobal",function(e){var t=e.clientX,n=e.clientY
o.props.interactive||setTimeout(function(){if(o.handleRef){var e=o.handleRef.getBoundingClientRect(),r=e.top,a=e.left,i=e.bottom,s=e.right
t>=a&&t<=s&&n>=r&&n<=i&&o.props.uiObserveStart(o.props.id)}},0)}),w(y(o),"onIsEditingLabel",function(e){return o.setState({isEditingLabel:e})}),w(y(o),"onToggleElementLibraryPicker",function(e){return o.setState({isElementPickerOpen:e})}),w(y(o),"onAddBefore",function(e){e.stopPropagation(),o.props.addSiblingElementAtts&&o.props.elementAddSibling(o.props.element._id,o.props.addSiblingElementAtts)}),w(y(o),"onAddAfter",function(e){e.stopPropagation(),o.props.addSiblingElementAtts&&o.props.elementAddSibling(o.props.element._id,o.props.addSiblingElementAtts,!0)}),w(y(o),"addChildFromPicker",function(e){var t=e.group,n=e.type,r=e.id
return"standard"===t?o.props.elementAdd(o.props.id,{_type:n}):"preset"===t?o.props.elementAddFromPreset(o.props.id,r):void 0}),w(y(o),"addSiblingFromPicker",function(e){var t=e.group,n=e.type,r=e.id
return"standard"===t?o.props.elementAddSibling(o.props.id,{_type:n}):"preset"===t?o.props.elementAddSiblingFromPreset(o.props.id,r):void 0}),w(y(o),"addSiblingAfterFromPicker",function(e){var t=e.group,n=e.type,r=e.id
return"standard"===t?o.props.elementAddSibling(o.props.id,{_type:n},!0):"preset"===t?o.props.elementAddSiblingFromPreset(o.props.id,r,!0):void 0}),w(y(o),"renderElementPickerActionButton",function(e){var n=e.ref,o=e.onClick
return t.default.createElement("button",{ref:n,onClick:o,className:"cs-layer-action"},t.default.createElement(a.default,{icon:"fa-plus"}))}),w(y(o),"renderElementPickerButton",function(e){var n=e.ref,r=e.onClick
return t.default.createElement("button",{ref:n,onClick:r,className:"cs-layer-add-level-zero"},o.renderElementPickerButtonLabel())}),w(y(o),"renderElementPickerButtonAfter",function(e){var n=e.ref,r=e.onClick
return t.default.createElement("button",{ref:n,onClick:r,className:"cs-layer-add-level-zero show-label"},o.renderElementPickerButtonLabel())}),o}var r,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(n,t.default.PureComponent),r=n,(l=[{key:"componentDidMount",value:function(){window.document.body.addEventListener("mouseup",this.onMouseUpGlobal)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.expandTimer),clearTimeout(this.selectTimer),window.document.body.removeEventListener("mouseup",this.onMouseUpGlobal),window.document.body.removeEventListener("mousemove",this.startDrag),window.document.body.removeEventListener("mouseup",this.releaseDrag)}},{key:"inspectWithoutNavigation",value:function(){this.props.inspect(this.props.id,{navigate:!1}),this.props.isHorizontal&&this.props.builderSelect(this.props.id,!0)}},{key:"renderElementPickerButtonLabel",value:function(){return t.default.createElement("span",null,t.default.createElement(a.default,{icon:"fa-plus"}),this.state.isElementPickerOpen?(0,m.t)("app.add-thing",{context:(0,m.t)("app.elements.entity")}):this.props.addSiblingElementLabel)}},{key:"renderActions",value:function(){var e=this,n=[]
if("region"!==this.props.element._type){if((0,f.currentUserCan)("".concat(this.props.context,".elements_inspect"))&&n.push({action:"inspect",label:(0,m.t)("app.inspect"),content:t.default.createElement(a.default,{icon:"fa-search"}),handler:this.onInspect}),(0,f.currentUserCan)("".concat(this.props.context,".elements_create"))){if(this.props.canAddChild&&!this.props.isHorizontal){var r=this.props,i=r.addChildElementAtts,s=r.addChildValidChildren
i&&!this.state.isElementPickerOpen?n.push({action:"add",label:(0,m.t)("app.add"),content:t.default.createElement(a.default,{icon:"fa-plus"}),handler:this.onAddChild}):(this.state.isElementPickerOpen||s&&s.length>0)&&n.push({render:function(){return t.default.createElement(h.default,{scope:s,onTogglePicker:e.onToggleElementLibraryPicker,onAddAfterClick:e.addChildFromPicker,key:"add",renderButton:e.renderElementPickerActionButton})}})}n.push({action:"duplicate",label:(0,m.t)("app.duplicate"),content:t.default.createElement(a.default,{icon:"fa-copy"}),handler:this.onDuplicate})}(0,f.currentUserCan)("".concat(this.props.context,".elements_delete"))&&n.push({action:"delete",label:(0,m.t)("app.delete"),className:"cs-danger",content:t.default.createElement(a.default,{icon:"fa-trash-alt"}),handler:this.onDelete})}return n.map(function(e){var n=e.action,r=e.content,a=e.className,i=e.handler,s=e.render
return s?s():t.default.createElement("button",{key:n,onClick:i,className:(0,o.default)("cs-layer-action",a)},r)})}},{key:"renderIcon",value:function(){return t.default.createElement(i.default,{icon:this.props.element._iconPath})}},{key:"renderElementPickerInline",value:function(e,n,r){return!this.state.isElementPickerOpen&&this.props.addSiblingElementAtts?t.default.createElement("button",{onClick:e,className:(0,o.default)("cs-layer-add-level-zero",{"show-label":r})},t.default.createElement("span",null,t.default.createElement(a.default,{icon:"fa-plus"}),this.props.addSiblingElementLabel)):this.state.isElementPickerOpen||this.props.addSiblingValidChildren&&this.props.addSiblingValidChildren.length>0?t.default.createElement(h.default,{scope:this.props.addSiblingValidChildren,onTogglePicker:this.onToggleElementLibraryPicker,onAddAfterClick:n,renderButton:r?this.renderElementPickerButtonAfter:this.renderElementPickerButton}):null}},{key:"renderAddBefore",value:function(){return this.props.isHorizontal||0===this.props.level?this.renderElementPickerInline(this.onAddBefore,this.addSiblingFromPicker,!1):null}},{key:"renderAddAfter",value:function(){return this.props.isHorizontal&&this.props.isFinalSibling?this.renderElementPickerInline(this.onAddAfter,this.addSiblingAfterFromPicker,!0):null}},{key:"render",value:function(){var e,n=this,r="is-lvl-".concat(this.props.level),i=this.props.interactive&&!this.props.draggingIsActive,l=[this.props.element._id]
return this.props.isHorizontal||l.push("layer-item-vertical"),t.default.createElement("div",{"cs-context-menu":l.join("::"),className:(0,o.default)("cs-layer",(e={},w(e,r,!this.props.isHorizontal),w(e,"has-element-css",!!this.props.element.css),e)),onClick:this.onInspectWithoutNavigation},this.renderAddBefore(),this.props.showIndicatorBefore&&t.default.createElement("div",{className:"cs-layer-indicator is-before"}),t.default.createElement("div",{className:(0,o.default)("cs-layer-content",{"is-active":this.props.active,"is-interactive":i,"is-receiving":this.props.isReceiving}),onMouseDown:this.maybeDrag,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,ref:function(e){return n.handleRef=e}},t.default.createElement("div",{className:"cs-layer-content-before"},this.props.hasChildren&&!this.props.isHorizontal?t.default.createElement("button",{className:(0,o.default)("cs-layer-collapse",{"is-collapsed":!this.props.isExpanded}),onClick:this.onToggle},t.default.createElement(a.default,{icon:"caret-collapse"})):this.renderIcon()),t.default.createElement("div",{className:"cs-layer-content-inner"},t.default.createElement(s.default,{label:this.props.element._label,onUpdate:this.onUpdateLabel,onStateChange:this.onIsEditingLabel})),t.default.createElement("div",{className:"cs-layer-content-after"},this.renderActions())),this.renderAddAfter(),this.props.showIndicatorAfter&&t.default.createElement("div",{className:"cs-layer-indicator is-after"}))}}])&&v(r.prototype,l),c&&v(r,c),n}()
w(x,"defaultProps",{onMouseEnterItem:function(){},onMouseLeaveItem:function(){}})
var k,S=(0,n.connect)((k=(0,l.makeGetElement)(),function(e,t){var n=t.id,o=k(e,{id:n})||{},r=(o._def.options.valid_children||[]).length>0,a=(0,l.getAddNewElementForParent)(e,{id:n}),i={addSiblingElementAtts:a.addElementAtts,addSiblingElementLabel:a.addElementLabel,addSiblingValidChildren:a.addElementValidChildren}
if(r){var s=(0,l.getAddNewElementFromId)(e,{id:n}),c=s.addElementAtts,u=s.addElementLabel,p=s.addElementValidChildren
i=Object.assign(i,{addChildElementAtts:c,addChildElementLabel:u,addChildValidChildren:p})}var d="horizontal"===e.builder.orientation,f=d&&e.builder.selected.includes(n)
return Object.assign({canAddChild:r,context:e.builder.permissionContext,active:e.inspector.inspecting===n,interactive:e.builder.observing===n||f,hasChildren:!!(o._modules||[]).length,isHorizontal:d,isFinalSibling:(0,l.getSiblingsById)(e,{id:n}).length-1===o._order,element:o},i)}),O)(x)
e.default=S}),define("tco-app/src/components/layout/LayersSection",["exports","react","react-redux","classnames","tco-app/src/components/common/ScrollBox","tco-app/src/components/layout/LayersItem","tco-app/src/selectors/elements","tco-app/src/reducers/elements","tco-app/src/actions/elements","tco-app/src/actions/builder","tco-app/src/components/workspace/WorkspaceButton","tco-app/src/components/builder/ElementLibraryPicker","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c,u,p,d){function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var y={elementAdd:l.elementAdd,elementAddFromPreset:l.elementAddFromPreset,elementMoveAfter:l.elementMoveAfter,elementMoveBefore:l.elementMoveBefore,elementMove:l.elementMove,builderSelect:c.builderSelect},_=function(e){function n(){var e,o,r,a;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l]
return r=this,a=(e=h(n)).call.apply(e,[this].concat(s)),o=!a||"object"!==f(a)&&"function"!=typeof a?g(r):a,b(g(o),"state",{overItem:null,canDrop:!1,isElementPickerOpen:!1}),b(g(o),"onMouseEnterItem",function(e){return o.setState({overItem:e})}),b(g(o),"onMouseLeaveItem",function(){return o.setState({overItem:null})}),b(g(o),"onMouseEnter",function(){return o.setState({canDrop:!0})}),b(g(o),"onMouseLeave",function(){return o.setState({canDrop:!1})}),b(g(o),"onToggleElementLibraryPicker",function(e){return o.setState({isElementPickerOpen:e})}),b(g(o),"onAddFirstElement",function(e){e.stopPropagation(),o.props.addElementAtts&&o.props.elementAdd(o.props.id,o.props.addElementAtts)}),b(g(o),"onAddFirstElementFromPicker",function(e){var t=e.group,n=e.type,r=e.id
return"standard"===t?o.props.elementAdd(o.props.id,{_type:n}):"preset"===t?o.props.elementAddFromPreset(o.props.id,r):void 0}),b(g(o),"renderElementPickerButton",function(e){var n=e.ref,r=e.onClick
return t.default.createElement(u.default,{buttonRef:n,icon:"fa-plus-square",label:o.state.isElementPickerOpen?(0,d.t)("app.add-thing",{context:(0,d.t)("app.elements.entity")}):o.props.addElementLabel,onClick:r})}),o}var i,s,l
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.default.Component),i=n,(s=[{key:"componentDidMount",value:function(){this.sectionEl&&(this.sectionEl.addEventListener("mouseenter",this.onMouseEnter),this.sectionEl.addEventListener("mouseleave",this.onMouseLeave)),this.props.onReady()}},{key:"componentDidUpdate",value:function(e){e.incoming&&!this.props.incoming&&this.maybeDrop(e)}},{key:"componentWillUnmount",value:function(){this.sectionEl&&(this.sectionEl.removeEventListener("mouseenter",this.onMouseEnter),this.sectionEl.removeEventListener("mouseleave",this.onMouseLeave))}},{key:"maybeDrop",value:function(e){var t=e.incoming,n=e.dropIndex,o=e.isEligable,r=e.items,a=this.state,i=a.canDrop,s=a.overItem
if(i)return s&&this.props.canMoveChildIntoParent(t,s)?(this.props.elementMove(t,null,s),void this.props.builderSelect(s,!1)):void(o&&(r[n]?this.props.elementMoveBefore(t,r[n]):n===r.length&&this.props.elementMoveAfter(t,r[r.length-1])))}},{key:"renderItems",value:function(){var e=this,n=this.props,r=n.incoming,i=n.isEligable,s=n.items,l=n.dropIndex
return t.default.createElement("div",{className:(0,o.default)("cs-layers-list",{"is-dragging":!!r})},s.map(function(n,o){var c=e.state.canDrop&&e.props.canMoveChildIntoParent(r,n,!0),u=c&&e.state.overItem===n,p=e.state.canDrop&&i&&!u&&r!==n,d=p&&s[o-1]!==r&&l===o,f=p&&o===s.length-1&&l===o+1
return t.default.createElement(a.default,{key:n,id:n,draggingIsActive:!!e.state.incoming,onMouseEnterItem:e.onMouseEnterItem,onMouseLeaveItem:e.onMouseLeaveItem,canHoverIntentSelect:c,isReceiving:u,showIndicatorBefore:d,showIndicatorAfter:f,onDragStart:e.props.onItemDragStart})}))}},{key:"renderEmpty",value:function(){var e=this.props,n=e.addElementAtts,o=e.addElementValidChildren
return!this.state.isElementPickerOpen&&n?t.default.createElement(u.default,{icon:"fa-plus-square",label:this.props.addElementLabel,onClick:this.onAddFirstElement}):this.state.isElementPickerOpen||o&&o.length>0?t.default.createElement(p.default,{scope:o,onTogglePicker:this.onToggleElementLibraryPicker,onAddAfterClick:this.onAddFirstElementFromPicker,renderButton:this.renderElementPickerButton}):null}},{key:"renderContent",value:function(){var e=this.props.alternateContent||this.renderItems()
return this.props.items.length<=3?e:t.default.createElement(r.default,{suppressScrollX:!0},e)}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{className:"cs-layers-section",ref:function(t){e.sectionEl=t}},this.props.children,this.props.items.length>0?this.renderContent():this.renderEmpty(),this.props.addElementMessage&&t.default.createElement("span",{className:"cs-layers-message"},this.props.addElementMessage))}}])&&m(i.prototype,s),l&&m(i,l),n}()
b(_,"defaultProps",{onReady:function(){},itemProps:function(){return{}}})
var w=(0,n.connect)(function(e,t){var n=(0,i.getAddNewElementFromId)(e,t),o={},r=(0,s.makeCanMoveChildIntoParent)(e)
return t.incoming&&(o.isEligable=r(t.incoming,t.id)),Object.assign({items:(0,i.getChildrenById)(e,t),canMoveChildIntoParent:r},n,o)},y)(_)
e.default=w}),define("tco-app/src/components/layout/LayersVertical",["exports","react","classnames","react-redux","tco-app/src/selectors/elements","tco-app/src/reducers/elements","tco-app/src/actions/elements","tco-app/src/actions/builder","tco-app/src/components/layout/LayersItem","tco-app/src/components/common/Icon","tco-app/src/components/workspace/WorkspaceButton"],function(e,t,n,o,r,a,i,s,l,c,u){function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function f(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var y,_={elementMoveAfter:i.elementMoveAfter,elementMoveBefore:i.elementMoveBefore,elementMove:i.elementMove,elementAdd:i.elementAdd,builderSelect:s.builderSelect},w=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return n=this,r=(e=h(o)).call.apply(e,[this].concat(i)),t=!r||"object"!==p(r)&&"function"!=typeof r?g(n):r,b(g(t),"state",{incoming:!1,mirrorX:0,mirrorY:0,indicateBefore:null,indicateAfter:null,overItem:null,mirrorContent:null}),b(g(t),"dropIndex",0),b(g(t),"nextIndex",0),b(g(t),"onMouseEnterItem",function(e){return t.setState({overItem:e})}),b(g(t),"onMouseLeaveItem",function(){return t.setState({overItem:null})}),b(g(t),"onMouseOver",function(e){if(t.state.incoming){var n=f(e.target.classList).includes("cs-layer")?e.target:e.target.closest(".cs-layer")
if(n){var o=f(n.children).find(function(e){return f(e.classList).includes("cs-layer-content")})
if(o){var r=o.getBoundingClientRect(),a=r.top,i=r.height
t.recentMidPoint=a+i/2,t.nextIndex=f(n.parentElement.children).indexOf(n)}}}}),b(g(t),"onMouseMove",function(e){if(t.state.incoming){t.setState({mirrorX:e.clientX,mirrorY:e.clientY})
var n=t.nextIndex+(e.clientY>t.recentMidPoint?1:0)
t.dropIndex!==n&&(t.dropIndex=n,t.maybeIndicate(t.props.list[n],t.props.list[n-1]))}}),b(g(t),"onDragStart",function(e,n){var o=e.clientX,r=e.clientY,a=n.incoming,i=n.mirrorContent
t.setState({mirrorX:o,mirrorY:r,incoming:a,mirrorContent:i}),window.document.body.addEventListener("mousemove",t.onMouseMove),window.document.body.addEventListener("mouseup",t.onDragEnd)}),b(g(t),"onDragEnd",function(){window.document.body.removeEventListener("mousemove",t.onMouseMove)
var e=t.state,n=e.indicateBefore,o=e.indicateAfter,r=e.overItem,a=t.state.incoming
o?t.props.elementMoveAfter(a,o):n?t.props.elementMoveBefore(a,n):t.isEligible(r,{into:!0})&&(t.props.elementMove(a,null,r),t.props.builderSelect(r,!1)),t.setState({incoming:null,mirrorX:0,mirrorY:0,indicateBefore:null,indicateAfter:null,mirrorContent:null})}),b(g(t),"addTopLevelElement",function(){return t.props.elementAdd(t.props.regionId,t.props.addElementAtts)}),t}var r,a,i
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(o,t.default.PureComponent),r=o,(a=[{key:"componentDidMount",value:function(){this.layersEl&&this.layersEl.addEventListener("mouseover",this.onMouseOver)}},{key:"isEligible",value:function(e,t){return!(!e||!this.props.items[e])&&this.props.items[e].isEligible(Object.assign({incoming:this.state.incoming},t))}},{key:"maybeIndicate",value:function(e,t){this.setState({indicateBefore:this.isEligible(e,{before:!0})?e:null,indicateAfter:this.isEligible(t,{after:!0})?t:null})}},{key:"componentWillUnmount",value:function(){window.document.body.removeEventListener("mouseup",this.onDragEnd),window.document.body.removeEventListener("mousemove",this.onMouseMove),this.layersEl&&this.layersEl.removeEventListener("mouseover",this.onMouseOver)}},{key:"renderItems",value:function(){var e=this
return this.props.list.map(function(n){var o=e.props.items[n],r=e.state.incoming,a=r&&e.props.items[r]&&!o.isExpanded&&o.isEligible({incoming:r,into:!0,preCheck:!0}),i=a&&e.state.overItem===n,s=e.state.indicateAfter===o.siblingAbove
return t.default.createElement(l.default,d({key:n,draggingIsActive:!!e.state.incoming,onMouseEnterItem:e.onMouseEnterItem,onMouseLeaveItem:e.onMouseLeaveItem,canHoverIntentExpand:a,isReceiving:i,showIndicatorBefore:!i&&!s&&e.state.indicateBefore===n,showIndicatorAfter:!i&&e.state.indicateAfter===n,onDragStart:e.onDragStart,id:n},o))})}},{key:"renderAddTopLevel",value:function(){return this.props.addElementAtts?t.default.createElement("button",{className:"cs-layer-add-level-zero show-label",onClick:this.addTopLevelElement},t.default.createElement("span",null,t.default.createElement(c.default,{icon:"fa-plus"}),this.props.addElementLabel)):null}},{key:"render",value:function(){var e=this
return this.props.list.length<=0?t.default.createElement(u.default,{icon:"fa-plus-square",label:this.props.addElementLabel,onClick:this.addTopLevelElement}):t.default.createElement("div",{className:"cs-layers is-vertical"},t.default.createElement("div",{ref:function(t){return e.layersEl=t},className:(0,n.default)("cs-layers-list",{"is-dragging":!!this.state.incoming})},this.renderItems(),this.renderAddTopLevel()),this.props.addElementMessage&&t.default.createElement("span",{className:"cs-layers-message"},this.props.addElementMessage),this.state.mirrorContent&&t.default.createElement("div",{className:"cs-layers-mirror",style:{left:this.state.mirrorX,top:this.state.mirrorY},dangerouslySetInnerHTML:{__html:this.state.mirrorContent}}))}}])&&m(r.prototype,a),i&&m(r,i),o}(),E=(0,o.connect)((y=(0,a.makeVerticalLayoutItems)(),function(e){var t=y(e)||[],n=t.list,o=t.items,a=t.regionId,i=e.builder,s=i.permissionContext,l=i.builder
return Object.assign({context:s,builder:l,regionId:a,list:n,items:o},(0,r.getAddNewElementFromId)(e,{id:a}))}),_)(w)
e.default=E}),define("tco-app/src/components/layout/LayoutWorkspace",["exports","react","react-redux","tco-app/src/components/layout/LayoutWorkspaceContent","tco-app/src/components/layout/LayoutWorkspaceBars"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var a,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.PureComponent),a=n,(u=[{key:"render",value:function(){return["header","footer"].includes(this.props.builder)?t.default.createElement(r.default,this.props):t.default.createElement(o.default,this.props)}}])&&i(a.prototype,u),p&&i(a,p),n}(),p=(0,n.connect)(function(e){return{builder:e.builder.builder}})(u)
e.default=p}),define("tco-app/src/components/layout/LayoutWorkspaceBars",["exports","react","react-redux","tco-app/src/components/layout/LayersHorizontal","tco-app/src/components/layout/LayersVertical","tco-app/src/components/common/ScrollBox","tco-app/src/components/layout/RegionSelector"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),c(this,u(n).apply(this,arguments))}var s,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(n,t.default.PureComponent),s=n,(d=[{key:"render",value:function(){var e="horizontal"===this.props.orientation,n=e?o.default:r.default,s=e?"div":a.default
return t.default.createElement(t.default.Fragment,null,this.props.renderHeader(e?null:t.default.createElement(i.default,null)),t.default.createElement(s,{className:"cs-workspace-content"},e?t.default.createElement(i.default,null):null,t.default.createElement(n,{isBars:!0})))}}])&&l(s.prototype,d),f&&l(s,f),n}(),f=(0,n.connect)(function(e){var t=e.builder
return{permissionContext:t.permissionContext,orientation:t.orientation}})(d)
e.default=f}),define("tco-app/src/components/layout/LayoutWorkspaceContent",["exports","react","classnames","react-redux","lodash","tco-app/src/components/layout/LayersHorizontal","tco-app/src/components/layout/LayersVertical","tco-app/src/components/forms/InputList","tco-app/src/components/workspace/WorkspaceActions","tco-app/src/components/forms/SelectReact","tco-app/src/components/workspace/WorkspaceActionOverlay","tco-app/src/components/common/ScrollBox","tco-app/src/components/common/Icon","tco-app/src/lib/i18n","tco-app/src/lib/permissions","tco-app/src/components/data/RouteData","tco-app/src/actions/elements","tco-app/src/selectors/elements","tco-app/src/reducers/helpers","tco-app/src/components/layout/ContentTemplates","tco-app/src/actions/data"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g,v,b,y,_){function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var P,C=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")}),j=(0,r.memoize)(function(){return window.cornerstoneApp.lookup("service:store")}),T={elementInsertChildren:g.elementInsertChildren,invalidateData:_.invalidateData},M=function(e){function o(){var e,t,n,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return n=this,r=(e=O(o)).call.apply(e,[this].concat(i)),t=!r||"object"!==w(r)&&"function"!=typeof r?x(n):r,S(x(t),"state",{showSaveTemplate:!1,showInsertTemplate:!1,saveSelection:null,saveTemplateName:"",templateSelectOpen:!1,selectedTemplate:null,didHoverInsertTemplate:!1,toggleWorkspaceActions:!1}),S(x(t),"userCan",function(e){return(0,m.currentUserCan)("".concat(t.props.permissionContext,".").concat(e))}),S(x(t),"onOpenSaveTemplate",function(){t.setState({showSaveTemplate:!0,saveTemplateName:"",saveSelection:null})}),S(x(t),"onToggleWorkspaceActions",function(){return t.setState({toggleWorkspaceActions:!t.state.toggleWorkspaceActions})}),S(x(t),"onOpenInsertTemplate",function(){t.setState({showInsertTemplate:!0})}),S(x(t),"onCloseSaveTemplate",function(){return t.setState({showSaveTemplate:!1})}),S(x(t),"onCloseInsertTemplate",function(){return t.setState({showInsertTemplate:!1})}),S(x(t),"onSaveTemplate",function(){if(t.userCan("insert_templates")){var e=(0,f.t)("app.templates.entity")
if(!t.state.saveTemplateName)return C().notify((0,f.t)("app.notify.name-required",{context:e}),"error"),void(t.saveTemplateInputEl&&t.saveTemplateInputEl.focus())
var n=(t.state.saveSelection||t.props.elements[t.props.contentRegionId]._modules).map(function(e){return(0,b.copyElement)(t.props.elements,e)}),o=j().peekAll("content/template-entry").find(function(e){return t.state.saveTemplateName===e.get("title")})
o?C().confirm({message:(0,f.t)("app.notify.name-overwrite-confirm",{context:e}),acceptClass:"sad",accept:function(){C().beginSaveProgress(),j().findRecord("content/template",o.get("id")).then(function(o){o.set("elements",n),o.save().then(function(){C().endSaveProgress(),C().notify(t.get("i18n").t("app.notify.updated",{context:e}),"success")},function(n){C().endSaveProgress(),C().notify(t.get("i18n").t("app.notify.failed-to-update",{context:e}),"error"),console.warn("Unable to update template.",n)})})}}):(t.setState({saveTemplateName:"",showSaveTemplate:!1}),C().beginSaveProgress(),j().createRecord("content/template",{title:t.state.saveTemplateName,elements:n}).save().then(function(n){var o=j().createRecord("content/template-entry",{title:n.get("title")})
o.set("id",n.get("id")),o.save(),C().endSaveProgress(),C().notify((0,f.t)("app.notify.saved",{context:e}),"success"),t.props.invalidateData(["contentTemplates"])},function(t){C().endSaveProgress(),C().notify((0,f.t)("app.notify.failed-to-save",{context:e}),"error"),console.warn("Unable to save template.",t)}))}}),S(x(t),"onSaveTemplateNameUpdate",function(e){var n=e.target.value
return t.setState({saveTemplateName:n})}),S(x(t),"onSaveTemplateNameKeyPress",function(e){"Enter"===e.key&&t.onSaveTemplate()}),S(x(t),"onInsertTemplateButton",function(){t.onInsertTemplate(null)}),S(x(t),"onUpdateSaveSelection",function(e){return t.setState({saveSelection:e})}),S(x(t),"onInsertTemplate",function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=(0,f.t)("app.templates.entity")
if(t.state.selectedTemplate&&t.userCan("insert_templates")){C().notify((0,f.t)("app.notify.loading",{context:o})),C().beginSaveProgress()
var r=function(e){C().endSaveProgress(),C().notify((0,f.t)("app.notify.failed-to-insert",{context:o}),"error"),console.warn("Could not locate template record",e)}
j().findRecord("content/template",t.state.selectedTemplate).then(function(a){try{var i=JSON.parse(JSON.stringify(a.get("elements"))).map(function(e){var n=(0,b.normalizeElement)(t.props.definitions,e),o=n.result,r=n.entities
return(0,b.toTree)(r.element,o,{removeIds:!0})})
t.props.elementInsertChildren(i,t.props.contentRegionId,e,n),C().endSaveProgress(),C().notify((0,f.t)("app.notify.inserted",{context:o}),"success")}catch(s){r(s)}},function(e){return r(e)})}}),S(x(t),"onDidInsertTemplate",function(){return t.setState({showInsertTemplate:!1})}),S(x(t),"onDidSaveTemplate",function(){return t.setState({showInsertTemplate:!1})}),t}var r,g,v
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}(o,t.default.PureComponent),r=o,(g=[{key:"renderActions",value:function(){var e=this,o=[],r=this.userCan("save_templates"),a=this.userCan("insert_templates")
return a&&o.push({label:(0,f.t)("app.templates.load"),content:t.default.createElement(d.default,{icon:"fa-download"}),onClick:this.onOpenInsertTemplate,onMouseEnter:function(){e.state.didHoverInsertTemplate||e.setState({didHoverInsertTemplate:!0})}}),r&&o.push({label:(0,f.t)("app.templates.save"),content:t.default.createElement(d.default,{icon:"fa-upload"}),onClick:this.onOpenSaveTemplate}),o.length<=0?null:t.default.createElement(l.default,{onClickToggle:this.onToggleWorkspaceActions,active:this.state.toggleWorkspaceActions,hasToggle:"horizontal"===this.props.orientation,items:o},a&&t.default.createElement(u.default,{active:this.state.showInsertTemplate,onClose:this.onCloseInsertTemplate},t.default.createElement(h.default,{wait:!1,request:this.state.didHoverInsertTemplate?["contentTemplates"]:[]},function(o){var r=o.contentTemplates
return t.default.createElement("div",{className:"cs-control-group cs-control-select-action"},t.default.createElement(s.InputList,null,t.default.createElement(s.InputListItemInline,null,t.default.createElement(c.default,{placeholder:(0,f.t)("app.select-thing",{context:(0,f.t)("app.templates.entity")}),value:e.state.selectedTemplate,options:(r||[]).map(function(e){return{value:e.id,label:e.title}}),noOptionsMessage:function(){return(0,f.t)("app.no-things",{context:(0,f.t)("app.templates.entities")})},onChange:function(t){return e.setState({selectedTemplate:t})},onMenuOpen:function(){return e.setState({templateSelectOpen:!0})},onMenuClose:function(){return e.setState({templateSelectOpen:!1})}}),t.default.createElement("button",{className:(0,n.default)({"cs-brbr-0":e.state.templateSelectOpen}),onClick:e.onInsertTemplateButton},(0,f.t)("app.insert")))))})),r&&t.default.createElement(u.default,{active:this.state.showSaveTemplate,onClose:this.onCloseSaveTemplate},t.default.createElement("div",{className:"cs-control-group cs-control-select-action"},t.default.createElement(s.InputList,null,t.default.createElement(s.InputListItemInline,null,t.default.createElement("input",{type:"text",className:"",ref:function(t){e.saveTemplateInputEl=t},placeholder:(0,f.t)("app.name-thing",{context:(0,f.t)("app.templates.entity")}),value:this.state.saveTemplateName,onChange:this.onSaveTemplateNameUpdate,onKeyPress:this.onSaveTemplateNameKeyPress}),t.default.createElement("button",{onClick:this.onSaveTemplate},(0,f.t)("app.save")))))))}},{key:"renderInsertTemplate",value:function(){return t.default.createElement(y.default,{onInsertTemplate:this.onInsertTemplate,mode:"insert",showInserts:!!this.state.selectedTemplate})}},{key:"renderSaveTemplate",value:function(){return t.default.createElement(y.default,{onUpdateSelection:this.onUpdateSaveSelection,saveSelection:this.state.saveSelection,mode:"save"})}},{key:"renderVertical",value:function(){return this.state.showSaveTemplate?this.renderSaveTemplate():this.state.showInsertTemplate?this.renderInsertTemplate():t.default.createElement(i.default,null)}},{key:"renderHorizontal",value:function(){var e=null
return this.state.showSaveTemplate?e=this.renderSaveTemplate():this.state.showInsertTemplate&&(e=this.renderInsertTemplate()),t.default.createElement(a.default,{alternateContent:e},this.renderActions())}},{key:"render",value:function(){var e="horizontal"===this.props.orientation,n=e?"div":p.default
return t.default.createElement(t.default.Fragment,null,this.props.renderHeader(e?null:this.renderActions()),t.default.createElement(n,{className:"cs-workspace-content"},e&&this.renderHorizontal(),!e&&this.renderVertical()))}}])&&E(r.prototype,g),v&&E(r,v),o}(),D=(0,o.connect)((P=(0,v.makeGetContentRegionId)(),function(e){var t=e.builder
return{permissionContext:t.permissionContext,orientation:t.orientation,definitions:e.definitions,elements:e.elements,contentRegionId:P(e)}}),T)(M)
e.default=D}),define("tco-app/src/components/layout/RegionSelector",["exports","react","react-redux","tco-app/src/selectors/elements","tco-app/src/components/layout/RegionSelectorItem"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var o,a,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.PureComponent),o=n,(a=[{key:"render",value:function(){return this.props.regions.length<=1?null:t.default.createElement("div",{className:"cs-region-selector"},t.default.createElement("ul",null,this.props.regions.map(function(e){return t.default.createElement(r.default,{key:e,id:e})})))}}])&&i(o.prototype,a),u&&i(o,u),n}(),p=(0,n.connect)(function(e){var t=e.builder,n=t.permissionContext,r=t.orientation
return{regions:(0,o.getRegions)(e),selected:e.builder.selected,permissionContext:n,orientation:r}})(u)
e.default=p}),define("tco-app/src/components/layout/RegionSelectorItem",["exports","react","classnames","react-redux","tco-app/src/selectors/elements","tco-app/src/actions/builder","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d,f={builderSelect:a.builderSelect},m=function(e){function o(){var e,t,n,r,a,i,l;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,o)
for(var p=arguments.length,d=new Array(p),f=0;f<p;f++)d[f]=arguments[f]
return n=this,r=(e=c(o)).call.apply(e,[this].concat(d)),t=!r||"object"!==s(r)&&"function"!=typeof r?u(n):r,a=u(t),l=function(){return t.props.builderSelect(t.props.id,t.props.selectDeep)},(i="onClick")in a?Object.defineProperty(a,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[i]=l,t}var r,a,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(o,t.default.Component),r=o,(a=[{key:"render",value:function(){return t.default.createElement("li",{className:(0,n.default)(this.props.element._region,{"cs-active":this.props.selected.includes(this.props.id)}),onClick:this.onClick},t.default.createElement("span",null),t.default.createElement("b",null,(0,i.t)("app.regions.".concat(this.props.element._region))))}}])&&l(r.prototype,a),d&&l(r,d),o}(),h=(0,o.connect)((d=(0,r.makeGetElement)(),function(e,t){var n=t.id
return{element:d(e,{id:n}),selectDeep:"horizontal"===e.builder.orientation,selected:e.builder.selected}}),f)(m)
e.default=h}),define("tco-app/src/components/preview-elements/ClassicBlockGridItem",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase","tco-app/src/util/base64"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e,t,n){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,c(t).apply(this,arguments))}var n,a,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,o.default),n=t,(a=[{key:"generateExtraProps",value:function(){return{_tagName:"li"}}},{key:"shouldShowPlaceholder",value:function(){return!1}},{key:"generateClass",value:function(){return"".concat(l(c(t.prototype),"generateClass",this).call(this)," x-block-grid-item}}")}},{key:"transformMarkup",value:function(e){var t=e.match(/base64content\s([\w\d\/+=]+)/)
return t[1]?(0,r.base64Decode)(t[1]).replace("<li ",'<li data-cs-observeable-id="{%%{_id}%%}" data-cs-observeable="{%%{observer}%%}" ').replace('class="','class="{%%{class}%%} '):e}}])&&i(n.prototype,a),p&&i(n,p),t}(),d=(0,n.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(p)
e.default=d}),define("tco-app/src/components/preview-elements/ClassicColumn",["exports","react","lodash","react-redux","tco-app/src/components/preview-elements/DragDropContainer"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,u(t).apply(this,arguments))}var o,a,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,r.default),o=t,(a=[{key:"componentDidMount",value:function(){this.setupDragula()}},{key:"generateStyles",value:function(){var e={backgroundColor:this.props.bg_color||"transparent"}
if(Array.isArray(this.props.padding)){var t=i(this.props.padding)
t.pop(),e.padding=t.join(" ")}if("none"!==this.props.border_style&&Array.isArray(this.props.border_width)){var o=i(this.props.border_width)
o.pop()
var r=(0,n.uniq)(o)
1===r.length&&"0px"===r[0]||(e.borderWidth=o.join(" "),e.borderColor=this.props.border_color,e.borderStyle=this.props.border_style)}return e}},{key:"generateTextAlignClass",value:function(){return(window.csAppData&&window.csAppData.css_class_map&&window.csAppData.css_class_map.text_align||{})[this.props.text_align]||""}},{key:"generateClass",value:function(){return"".concat(c(u(t.prototype),"generateClass",this).call(this)," x-column x-sm x-").concat(this.props.size.replace("/","-")," ").concat(this.generateTextAlignClass()," ").concat(this.generateVisibilityClass("visibility")," ").concat(this.generateVisibilityClass("visibility"))}}])&&s(o.prototype,a),d&&s(o,d),t}(),f=(0,o.connect)((0,r.dragDropMakeMapStateToProps)(),r.dragDropMapDispatchToProps)(d)
e.default=f}),define("tco-app/src/components/preview-elements/ClassicGap",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,l(t).apply(this,arguments))}var n,r,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,o.default),n=t,(r=[{key:"shouldShowPlaceholder",value:function(){return!1}},{key:"generateStyles",value:function(){var e={margin:0},t=this.props.gap_size,n=0,o="px",r=(t=t?String(t):"").match(/([\.\d]+)(\w+)/)
return r&&(r[1]&&(n=r[1]),r[2]&&(o=r[2])),e.paddingTop="".concat(n).concat(o),e}},{key:"generateClass",value:function(){return"".concat(s(l(t.prototype),"generateClass",this).call(this)," x-gap cs-empty-bg cs-gap-preview ").concat(this.generateVisibilityClass("visibility"),"}")}}])&&a(n.prototype,r),u&&a(n,u),t}(),p=(0,n.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(u)
e.default=p}),define("tco-app/src/components/preview-elements/ClassicPricingTableColumn",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase","tco-app/src/util/base64"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e,t,n){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,c(t).apply(this,arguments))}var n,a,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,o.default),n=t,(a=[{key:"generateExtraProps",value:function(){return{_tagName:"li"}}},{key:"shouldShowPlaceholder",value:function(){return!1}},{key:"generateClass",value:function(){return"".concat(l(c(t.prototype),"generateClass",this).call(this)," x-block-grid-item}}")}},{key:"transformMarkup",value:function(e){var t=e.match(/base64content\s([\w\d\/+=]+)/)
return t[1]?(0,r.base64Decode)(t[1]).replace("<div ",'<div data-cs-observeable-id="{%%{_id}%%}" data-cs-observeable="{%%{observer}%%}" '):e}}])&&i(n.prototype,a),p&&i(n,p),t}(),d=(0,n.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(p)
e.default=d}),define("tco-app/src/components/preview-elements/ClassicRow",["exports","react","lodash","tco-app/src/components/preview-elements/ElementBase","react-redux"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,u(t).apply(this,arguments))}var r,a,d
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,o.default),r=t,(a=[{key:"generateStyles",value:function(){var e={backgroundColor:this.props.bg_color||"transparent"}
if(Array.isArray(this.props.padding)){var t=i(this.props.padding)
t.pop(),e.padding=t.join(" ")}if(Array.isArray(this.props.margin)){var o=i(this.props.margin)
o.pop(),e.margin=o.join(" ")}if("none"!==this.props.border_style&&Array.isArray(this.props.border_width)){var r=i(this.props.border_width)
r.pop()
var a=(0,n.uniq)(r)
1===a.length&&"0px"===a[0]||(e.borderWidth=r.join(" "),e.borderColor=this.props.border_color,e.borderStyle=this.props.border_style)}return e}},{key:"generateContainerClass",value:function(){var e=[]
return this.props.inner_container&&e.push("max width"),this.props.marginless_columns&&e.push("marginless-columns"),e.join(" ")}},{key:"generateTextAlignClass",value:function(){return(window.csAppData&&window.csAppData.css_class_map&&window.csAppData.css_class_map.text_align||{})[this.props.text_align]||""}},{key:"generateClass",value:function(){return"".concat(c(u(t.prototype),"generateClass",this).call(this)," x-container ").concat(this.generateTextAlignClass()," ").concat(this.generateContainerClass()," ").concat(this.generateVisibilityClass("visibility"))}}])&&s(r.prototype,a),d&&s(r,d),t}(),f=(0,r.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(d)
e.default=f}),define("tco-app/src/components/preview-elements/ClassicSection",["exports","react","lodash","tco-app/src/components/preview-elements/ElementBase","react-redux"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),l(this,u(r).apply(this,arguments))}var a,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(r,o.default),a=r,(d=[{key:"generateStyles",value:function(){var e={},t=this.props.bg_type
if(["color","image"].includes(t)?(e.backgroundColor=this.props.bg_color||"transparent","image"===t&&(e.backgroundImage='url("'.concat(this.props.bg_image,'")')),this.props.parallax&&(e.backgroundAttachment="fixed")):"video"===t&&(e.backgroundImage='url("'.concat(this.props.bg_video_poster,'")'),e.backgroundColor="white",e.backgroundSize="cover"),Array.isArray(this.props.padding)){var o=i(this.props.padding)
o.pop(),e.padding=o.join(" ")}if(Array.isArray(this.props.margin)){var r=i(this.props.margin)
r.pop(),e.margin=r.join(" ")}if("none"!==this.props.border_style&&Array.isArray(this.props.border_width)){var a=i(this.props.border_width)
a.pop()
var s=(0,n.uniq)(a)
1===s.length&&"0px"===s[0]||(e.borderWidth=a.join(" "),e.borderColor=this.props.border_color,e.borderStyle=this.props.border_style)}return e}},{key:"generateBgClass",value:function(){var e=[]
switch(this.props.bg_type){case"video":e.push("bg-video")
break
case"image":e.push(this.props.bg_pattern_toggle?"bg-pattern":"bg-image"),this.props.parallax&&e.push("parallax")
break
case"color":e.push("bg-color")}return e.join(" ")}},{key:"generateTextAlignClass",value:function(){return(window.csAppData&&window.csAppData.css_class_map&&window.csAppData.css_class_map.text_align||{})[this.props.text_align]||""}},{key:"generateClass",value:function(){return"".concat(c(u(r.prototype),"generateClass",this).call(this)," x-section ").concat(this.generateTextAlignClass()," ").concat(this.generateBgClass()," ").concat(this.generateVisibilityClass("visibility")," ").concat(this.generateVisibilityClass("visibility"))}},{key:"makeSeparator",value:function(e){var n,o,r,a=e.edge,i=e.type,s=e.height,l=e.inset,c=e.angle,u=(r=l,(o=a)in(n={})?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r,n)
u.height=s||"0px"
var p=this.props.bg_color||"transparent"
return t.default.createElement("div",{className:"x-section-separator x-section-separator-".concat(a," x-section-separator-").concat(i),style:u},function(e,n,o){switch(e){case"top-angle-out":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"angle-top-out",style:{fill:n}},t.default.createElement("polygon",{points:"".concat(o,",0 100,100 0,100")}))
case"top-angle-in":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"angle-top-in",style:{fill:n}},t.default.createElement("polygon",{points:"0,100 ".concat(o,",100 0,0")}),t.default.createElement("polygon",{points:"".concat(o,",100 100,100 100,0")}))
case"top-curve-out":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 50",preserveAspectRatio:"none",className:"curve-top-out",style:{fill:n}},t.default.createElement("path",{d:"M0,50C0,50,22.4,0,50,0s50,50,50,50"}))
case"top-curve-in":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 50",preserveAspectRatio:"none",className:"curve-top-in",style:{fill:n}},t.default.createElement("path",{d:"M0,0v50h50C22.4,50,0,0,0,0z"}),t.default.createElement("path",{d:"M50,50h50V0C100,0,77.6,50,50,50z"}))
case"bottom-angle-out":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"angle-bottom-out",style:{fill:n}},t.default.createElement("polygon",{points:"".concat(o,",100 100,0 0,0")}))
case"bottom-angle-in":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"angle-bottom-in",style:{fill:n}},t.default.createElement("polygon",{points:"0,0 ".concat(o,",0 0,100")}),t.default.createElement("polygon",{points:"".concat(o,",0 100,0 100,100")}))
case"bottom-curve-out":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 50",preserveAspectRatio:"none",className:"curve-bottom-out",style:{fill:n}},t.default.createElement("path",{d:"M0,0c0,0,22.4,50,50,50s50-50,50-50"}))
case"bottom-curve-in":return t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 50",preserveAspectRatio:"none",className:"curve-bottom-in",style:{fill:n}},t.default.createElement("path",{d:"M0,50V0h50C22.4,0,0,50,0,50z"}),t.default.createElement("path",{d:"M50,0h50v50C100,50,77.6,0,50,0z"}))}return""}("".concat(a,"-").concat(i),p,c||0))}},{key:"bottomSeperator",value:function(){}},{key:"renderBefore",value:function(){return t.default.createElement(t.default.Fragment,null,"none"!==this.props.separator_top_type&&this.makeSeparator({edge:"top",type:this.props.separator_top_type,height:this.props.separator_top_height,inset:this.props.separator_top_inset,angle:this.props.separator_top_angle_point}),"none"!==this.props.separator_bottom_type&&this.makeSeparator({edge:"bottom",type:this.props.separator_bottom_type,height:this.props.separator_bottom_height,inset:this.props.separator_bottom_inset,angle:this.props.separator_bottom_angle_point}))}}])&&s(a.prototype,d),f&&s(a,f),r}(),f=(0,r.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(d)
e.default=f}),define("tco-app/src/components/preview-elements/Column",["exports","react","tco-app/src/components/preview-elements/DragDropContainer","react-redux"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,l(t).apply(this,arguments))}var o,r,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,n.default),o=t,(r=[{key:"generateClass",value:function(){var e=s(l(t.prototype),"generateClass",this).call(this)
return e.includes("x-column")||(e+=" x-column"),"".concat(e," x-").concat(this.props.size.replace("/","-"))}}])&&a(o.prototype,r),u&&a(o,u),t}(),p=(0,o.connect)((0,n.dragDropMakeMapStateToProps)(),n.dragDropMapDispatchToProps)(u)
e.default=p}),define("tco-app/src/components/preview-elements/Container",["exports","react","tco-app/src/components/preview-elements/DragDropContainer","react-redux"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,l(t).apply(this,arguments))}var o,r,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,n.default),o=t,(r=[{key:"generateClass",value:function(){var e=s(l(t.prototype),"generateClass",this).call(this)
e.includes("x-bar-container")||(e+=" x-bar-container")
var n=["left","right"].includes(this.props._region)?"container_col_flex_direction":"container_row_flex_direction",o="row"===this.props[n]?"cs-drag-h":"cs-drag-v"
return"".concat(e," ").concat(o)}}])&&a(o.prototype,r),u&&a(o,u),t}(),p=(0,o.connect)((0,n.dragDropMakeMapStateToProps)(),n.dragDropMapDispatchToProps)(u)
e.default=p}),define("tco-app/src/components/preview-elements/DragDropContainer",["exports","react","tco-app/src/components/preview-elements/ElementBase","tco-app/src/actions/elements","tco-app/src/actions/ui","tco-app/src/components/common/Icon"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function u(e,t,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.dragDropMapDispatchToProps=e.dragDropMakeMapStateToProps=void 0
e.dragDropMakeMapStateToProps=function(){var e=(0,n.makeMapStateToProps)()
return function(t,n){var o=t.builder.incomingElement,r=t.ui.liftedElement
return Object.assign({incomingElement:o,liftedElement:r},e(t,n))}}
e.dragDropMapDispatchToProps=function(e){return(0,n.mapDispatchToProps)(e)}
var f=function(e){function i(){var e
return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=c(this,p(i).apply(this,arguments))).state=Object.assign({},e.state,{isReceiving:!1,tempMinHeight:null,tempMinWidth:null,didLiftLastElement:!1}),e}var f,m,h
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(i,n.default),f=i,(m=[{key:"getDragulaEvents",value:function(){return u(p(i.prototype),"getDragulaEvents",this).call(this).concat(["container"])}},{key:"dragulaOverContainer",value:function(){this.setState({isReceiving:!0})}},{key:"dragulaCancelContainer",value:function(){this.setState({didLiftLastElement:!1})}},{key:"dragulaOutContainer",value:function(){this.setState({isReceiving:!1})}},{key:"dragulaDragLift",value:function(){try{var e=this.rootElement.current.getBoundingClientRect(),t=e.height,n=e.width
this.setState({tempMinHeight:parseFloat(t),tempMinWidth:parseFloat(n),didLiftLastElement:1===this.props._modules.length})}catch(o){console.log("unable to lift element",o)}}},{key:"dragulaCancelSource",value:function(e,t,n,o){n===o&&this.sourceDragComplete()}},{key:"dragulaDropFrom",value:function(){this.sourceDragComplete()}},{key:"sourceDragComplete",value:function(){this.setState({tempMinWidth:null,tempMinHeight:null})}},{key:"dragulaDropInto",value:function(e,t,n,a,i){this.setState({didLiftLastElement:!1})
var l=i&&i.parentElement&&s(i.parentElement.children).indexOf(i)-1
if(this.props.liftedElement&&this.props.liftedElement.id){var c=(0,o.elementMove)(this.props.liftedElement.id,l,this.props._id)
return this.props.dispatch(c),void this.props.dispatch((0,r.uiResetLiftedElement)())}this.props.incomingElement&&this.props.incomingElement.type&&this.props.dispatch(this.props.incomingElement.preset?(0,o.elementAddFromPreset)(this.props._id,this.props.incomingElement.preset,l,{inspect:!0}):(0,o.elementAdd)(this.props._id,{_type:this.props.incomingElement.type},l,{inspect:!0}))}},{key:"childrenProps",value:function(){return Object.assign({},u(p(i.prototype),"childrenProps",this).call(this),{parentIsDragContainer:!0})}},{key:"doesAppearEmpty",value:function(){return 0===(this.props._modules||[]).length||this.state.didLiftLastElement}},{key:"generateClass",value:function(){return"".concat(u(p(i.prototype),"generateClass",this).call(this)," cs-drop-target ").concat(this.state.isReceiving?"cs-receiving":""," ").concat(this.doesAppearEmpty()?"cs-empty":"")}},{key:"generateStyle",value:function(){var e=u(p(i.prototype),"generateStyle",this).call(this)||""
return this.state.tempMinHeight&&(e+=" min-height: ".concat(this.state.tempMinHeight,"px;")),this.state.tempMinWidth&&(e+=" min-width: ".concat(this.state.tempMinWidth,"px;")),e}},{key:"renderAdditionalChildren",value:function(){return this.doesAppearEmpty()?t.default.createElement("div",{className:"cs-empty-target"},t.default.createElement(a.default,{icon:"nav-elements-solid"})):null}},{key:"observerAttribute",value:function(){return Object.assign({insetOutline:!0},u(p(i.prototype),"observerAttribute",this).call(this))}}])&&l(f.prototype,m),h&&l(f,h),i}()
e.default=f}),define("tco-app/src/components/preview-elements/DragulaMixin",["exports","lodash"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=["dragula-drag","dragula-dragend","dragula-drop","dragula-cancel","dragula-remove","dragula-shadow","dragula-over","dragula-out","dragula-cloned","dragula-cloned-original","dragula-copy","dragula-copy-original","dragula-mirror","dragula-mirror-original"],c=["dragula-dragend","dragula-drop","dragula-cancel","dragula-remove","dragula-shadow","dragula-over","dragula-out"],u=["dragula-drag-lift","dragula-drop-into","dragula-drop-from","dragula-cancel-container","dragula-cancel-source","dragula-remove-container","dragula-remove-source","dragula-shadow-container","dragula-shadow-source","dragula-over-container","dragula-over-source","dragula-out-container","dragula-out-source"],p=function(e){return function(n){function p(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),a(this,i(p).apply(this,arguments))}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(p,e),d=p,(f=[{key:"dragulaSetupInitialHandlers",value:function(e){var t=e.events,n=e.elementEl,o=e.containerEl
this.dragulaTeardown()
var r=[].concat(this.dragulaHandlers||[])
t.includes("element")&&n&&(r=r.concat(this.dragulaSetupEvents(n,l))),t.includes("container")&&o&&(r=r.concat(this.dragulaSetupEvents(o,u))),r.length>0&&(this.dragulaHandlers=r)}},{key:"dragulaSetupEvents",value:function(e,n,r){var a=this
if(e){var i=[]
return n.forEach(function(n){return function t(n,r){0!==r.indexOf("_")&&t(n,"_".concat(r))
var s=a[r]
if("function"==typeof s){var l=function(e){return s.apply(a,[e].concat(o(e.detail.args)))}
e.addEventListener(n,l),i.push({event:n,handler:l,el:e})}}(n,(0,t.camelCase)(r?n+"-"+r:n))}),i}}},{key:"dragulaTeardown",value:function(){this.dragulaTeardownHandlers(this.dragulaHandlers)}},{key:"dragulaTeardownHandlers",value:function(e){e&&e.forEach(function(e){var t=e.el,n=e.event,o=e.handler
return t.removeEventListener(n,o)})}},{key:"dragulaCloned",value:function(e,n,o,r){this[(0,t.camelCase)("dragula-".concat(r,"-handlers"))]=this.dragulaSetupEvents(n,c,r)}},{key:"_dragulaDragendMirror",value:function(){var e=this
setTimeout(function(){return e.dragulaTeardownHandlers(e.dragulaMirrorHandlers)},0)}},{key:"_dragulaDragendCopy",value:function(){var e=this
setTimeout(function(){return e.dragulaTeardownHandlers(e.dragulaCopyHandlers)},0)}}])&&r(d.prototype,f),m&&r(d,m),p}()}
e.default=p}),define("tco-app/src/components/preview-elements/ElementBase",["exports","react","lodash","tco-app/src/lib/html-to-react","tco-app/src/selectors/elements","tco-app/src/actions/ui","tco-app/src/components/common/ElementIcon","tco-app/src/util/idle-callback","tco-app/src/components/preview-elements/ElementBaseChildren","tco-app/src/components/preview-elements/DragulaMixin","tco-app/src/components/preview-elements/InlineEditingMixin","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s,l,c,u,p){function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function v(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),e}function b(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?_(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.mapDispatchToProps=e.makeMapStateToProps=void 0
var k=function(e){var n=e.message,o=void 0===n?"":n,r=e.className,a=void 0===r?"":r
return t.default.createElement("div",{className:"cs-empty-element ".concat(a)},t.default.createElement("p",{className:"cs-empty-element-message"},t.default.createElement("span",{dangerouslySetInnerHTML:{__html:o||(0,p.t)("app.elements-preview-template-error")}})))}
var S=(0,n.memoize)(function(e){return n=(0,o.default)(e.replace(/(\s[\w\-]+?)=\"({{ [\w\.\_]+?}})\"/g,function(e,t,n){return"".concat(t,"=").concat(n)})),r=function(e){function o(){var e,t
h(this,o)
for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a]
return O(_(t=b(this,(e=y(o)).call.apply(e,[this].concat(r)))),"state",{hasError:!1}),t}return w(o,t.default.Component),v(o,[{key:"componentDidMount",value:function(){this.props.onMarkupReady&&this.props.onMarkupReady()}},{key:"componentDidCatch",value:function(e,t){console.warn("Render error",{error:e,info:t,props:this.props})}},{key:"renderError",value:function(){return t.default.createElement("div",{ref:this.props.forwardRef,"data-cs-preview-element-type":this.props._type,"data-cs-observeable-id":this.props._id,"data-cs-observeable":this.props.observer},t.default.createElement(k,null))}},{key:"render",value:function(){if(this.state.hasError||!n)return this.renderError()
var e=this.props,o=e.forwardedRef,r=m(e,["forwardedRef"])
return t.default.createElement(n,f({ref:o},r))||this.renderError()}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}]),o}(),t.default.forwardRef(function(e,n){return t.default.createElement(r,f({},e,{forwardedRef:n}))})
var n,r})
e.makeMapStateToProps=function(){var e=(0,r.makeGetElementWithRender)()
return function(t,n){var o=n.elID
return e(t,{id:o})}}
e.mapDispatchToProps=function(e){return{dispatch:e}}
var P=function(e){function n(){return h(this,n),b(this,y(n).apply(this,arguments))}return w(n,t.default.Component),v(n,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this.props._tagName||"div",n=["e".concat(this.props._id),this.props.class]
return this.props._def.options._no_server_render||this.props._def.options.can_preview||n.push("is-loading"),this.props._def.options.can_preview||n.push("cs-no-preview"),t.default.createElement(e,{ref:this.props._ref,id:this.props.id,className:n.join(" "),style:this.props.style,"data-cs-preview-element-type":this.props._type,"data-cs-observeable-id":this.props._id,"data-cs-observeable":this.props.observer},this.props.children)}}]),n}(),C=function(e){function n(){return h(this,n),b(this,y(n).apply(this,arguments))}return w(n,t.default.PureComponent),v(n,[{key:"render",value:function(){return t.default.createElement(P,this.props,t.default.createElement("p",null,"This element could not render due to invalid template markup. This could be due to changes introduced by a third party plugin. The front end of your site should still function normally"))}}]),n}(),j=function(e){function n(){var e,o
h(this,n)
for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i]
return O(_(o=b(this,(e=y(n)).call.apply(e,[this].concat(a)))),"state",{canInlineEdit:!1,showEmpty:!1,renderKey:0,meta:{}}),O(_(o),"rootElement",t.default.createRef()),O(_(o),"onMarkupReady",function(){o.wakeupScripts(),o.inlineEditingSetup(),o.maybeShowEmpty(),o.setupDragula(),o.rootElement.current&&window.cornerstoneApp.lookup("service:preview").responsiveTextUpdate(o.rootElement.current)}),o}return w(n,(0,u.default)((0,c.default)(t.default.Component))),v(n,[{key:"getDragulaEvents",value:function(){return this.isDraggable()?["element"]:[]}},{key:"wakeupScripts",value:function(){this.rootElement.current&&this.rootElement.current.querySelectorAll("script").forEach(function(e){try{window.jQuery(e).after(e.outerHTML),e.remove()}catch(t){console.warn("Error running inline script",{script:e,e:t})}})}},{key:"componentDidMount",value:function(){!this.props._def.options._no_server_render&&this.props._def.options.can_preview||this.onMarkupReady()}},{key:"componentDidUpdate",value:function(e){e.isInlineEditing&&!this.props.isInlineEditing&&this.setState(function(e){return{renderKey:e.renderKey+1}})}},{key:"componentWillUnmount",value:function(){(0,s.cancelIdleCallback)(this.shadowHeightCheck),this.dragulaTeardown(),this.inlineEditingComponentWillUnmount()}},{key:"setupDragula",value:function(){var e=this.getDragulaEvents()
e&&e.length>0&&this.dragulaSetupInitialHandlers({events:e,elementEl:this.rootElement.current,containerEl:this.rootElement.current})}},{key:"dragulaDrag",value:function(){this.props.dispatch((0,a.uiLiftElement)(this.props._id,this.props._type))}},{key:"transformMarkup",value:function(e){return e}},{key:"generateClasses",value:function(){return null}},{key:"isDraggable",value:function(){return this.props.parentIsDragContainer&&!1!==this.props._def.options.is_draggable}},{key:"generateClass",value:function(){var e=["cs-element-preview"]
return this.isDraggable()&&e.push("cs-draggable"),this.props.isDragging&&e.push("cs-is-dragging"),this.props.isInlineEditing&&e.push("cs-is-inline-editing"),this.props._bg_contrast&&e.push("cs-bg-".concat("dark"===this.props._bg_contrast?"dark":"light")),this.props._def.options.is_classic&&!0!==this.props._def.options.classic.safe_container||e.push(this.props.class),e.join(" ")}},{key:"generateVisibilityClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hide_bp"
if(!e||!this.props[e])return""
var t=window.csAppData&&window.csAppData.css_class_map&&window.csAppData.css_class_map.visibility||{},n=this.props[e]||""
return Array.isArray(n)||(n=n.split(" ")),n.map(function(e){return t[e]||""}).join(" ")}},{key:"generateStyle",value:function(){return null}},{key:"generateStyles",value:function(){return null}},{key:"generateProps",value:function(){var e="",t="",n=[],o={}
try{o=this.generateStyles()||{}}catch(r){}try{e=this.generateStyle()||""}catch(r){}try{n=this.generateClasses()||[]}catch(r){}try{t=this.generateClass().split(" ")||[]}catch(r){}return Object.assign({observer:JSON.stringify(this.observerAttribute()),_ref:this.rootElement},this.props,{class:[].concat(x(n),x(t)).filter(function(e){return!!e}).join(" "),style:this.parseStyle(o,e?"".concat(e," ").concat(this.props.style||""):this.props.style)},this.generateExtraProps())}},{key:"observerAttribute",value:function(){var e="inspect"
this.state.canInlineEdit&&!this.state.showEmpty&&(e="inline-editing")
var t=document.createElement("div")
return t.innerHTML=this.props._label,{mode:e,label:t.innerText}}},{key:"generateExtraProps",value:function(){return{}}},{key:"childrenProps",value:function(){return{}}},{key:"canShow",value:function(){return this.props._markup&&this.props._scripts_loaded}},{key:"renderDraggingState",value:function(){return t.default.createElement("div",{className:"cs-empty-element-transit"})}},{key:"renderAdditionalChildren",value:function(){return this.props.isDragging?this.renderDraggingState():"undefined"===this.props._type?t.default.createElement(k,{className:"cs-undefined-element",message:(0,p.t)("elements-undefined-preview")}):!1===this.props._def.options.can_preview?t.default.createElement(k,{message:(0,p.t)("app.formatting-colon",{prefix:(this.props._def.title||this.props._type).replace("Classic ",""),content:(0,p.t)("app.elements-preview-unavailable",{url:this.props.viewSiteURL})})}):this.state.showEmpty||this.shouldShowPlaceholder(!this.canShow()&&!this.props._def.options._no_server_render)?t.default.createElement("div",{className:"cs-empty-element"},t.default.createElement("div",{className:"cs-empty-element-icon"},t.default.createElement(i.default,{icon:this.props._iconPath}))):void 0}},{key:"maybeShowEmpty",value:function(){var e=this
if(this.state.showEmpty&&this.setState({showEmpty:!1}),!1!==this.props._def.options.empty_placeholder){x(this.rootElement.current.querySelectorAll("img")).length<=0&&((0,s.cancelIdleCallback)(e.shadowHeightCheck),e.shadowHeightCheck=(0,s.requestIdleCallback)(function(){var t=e.props._def.options.empty_preview_min_height||10;(function(e){var t=document.createElement("div")
t.setAttribute("style","position:fixed;top:-100%;visibility:hidden;height:100vh;width:100vw;display:block;"),t.innerHTML=e.outerHTML
var n=t.children[0]||null
if(!n)return 0
var o=function(e){return["x-hide-xl","x-hide-lg","x-hide-md","x-hide-sm","x-hide-xs"].forEach(function(t){return e.classList.remove(t)})}
o(n),x(n.querySelectorAll(".x-hide-xl, .x-hide-lg, .x-hide-md, .x-hide-sm, .x-hide-xs")).map(o),document.body.append(t)
var r=getComputedStyle(n),a=n.offsetHeight+parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)
return t.remove(),a})(e.rootElement.current)<t+1&&e.setState({showEmpty:!0})}))}}},{key:"shouldShowPlaceholder",value:function(e){return e}},{key:"getRenderComponent",value:function(){return this.canShow()?(this.props.isInlineEditing||(this.lastComponent=S(this.transformMarkup(this.props._markup))),this.lastComponent||C):P}},{key:"shouldComponentUpdate",value:function(e){return!this.props.isInlineEditing||!e.isInlineEditing}},{key:"render",value:function(){var e=this.generateProps(),n=this.getRenderComponent(),o=this.props._def.options.render_children
return t.default.createElement(n,f({},e,{key:this.state.renderKey,onMarkupReady:this.onMarkupReady}),this.renderBefore(),!o&&t.default.createElement(l.default,{elID:this.props._id,childrenProps:this.childrenProps()}),this.renderAdditionalChildren(),this.renderAfter())}},{key:"parseStyle",value:function(){return Object.assign.apply(Object,[{}].concat(x(Array.prototype.slice.call(arguments).map(function(e){return"string"==typeof e?(0,o.styleStringToObject)(e):(0,o.normalizeStyleKeys)(e)}))))}},{key:"renderBefore",value:function(){}},{key:"renderAfter",value:function(){}}]),n}()
e.default=j}),define("tco-app/src/components/preview-elements/ElementBaseChildren",["exports","react","lodash","react-redux","tco-app/src/components/preview-elements/index"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d,f,m,h=(0,n.memoize)(function(e){return r.default[(0,n.upperFirst)((0,n.camelCase)(e))]||r.default.Base}),g=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),l(this,c(n).apply(this,arguments))}var o,r,a
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t.default.Component),o=n,(r=[{key:"render",value:function(){var e=this
return t.default.createElement(t.default.Fragment,null,this.props.children.map(function(n){var o=n.elID,r=n.type,a=h(r)
return t.default.createElement(a,i({key:o,elID:o},e.props.childrenProps))}))}}])&&s(o.prototype,r),a&&s(o,a),n}()
m={childrenProps:{}},(f="defaultProps")in(d=g)?Object.defineProperty(d,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[f]=m
var v,b=(0,o.connect)((v=function(e,t){return e.elements[t]&&e.elements[t]._modules?(n.default.uniq(e.elements[t]._modules).length!==e.elements[t]._modules.length&&window.cornerstoneApp.lookup("service:debug").get("devTools")&&console.warn("Duplicate state key detected",p(e.elements[t]._modules)),n.default.uniq(e.elements[t]._modules).filter(function(t){var n=e.elements[t]._active
return!1!==n&&"false"!==n}).map(function(t){return{type:e.elements[t]._type,elID:t}})):[]},function(e,t){var n=t.elID
return{children:v(e,n)}}))(g)
e.default=b}),define("tco-app/src/components/preview-elements/Gap",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,l(t).apply(this,arguments))}var n,r,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,o.default),n=t,(r=[{key:"shouldShowPlaceholder",value:function(){return!1}},{key:"generateStyles",value:function(){var e={}
return"vertical"===this.props.gap_direction?(e.height=0,e.padding="".concat(this.props.gap_size," 0 0 0")):(e.width=0,e.padding="0 ".concat(this.props.gap_size," 0 0")),e}},{key:"generateClass",value:function(){return"".concat(s(l(t.prototype),"generateClass",this).call(this)," x-line cs-empty-bg cs-gap-preview gap-").concat(this.props.gap_direction," ").concat(this.generateVisibilityClass())}}])&&a(n.prototype,r),u&&a(n,u),t}(),p=(0,n.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(u)
e.default=p}),define("tco-app/src/components/preview-elements/InlineEditingMixin",["exports","tco-app/src/actions/elements","tco-app/src/actions/ui","tco-app/src/lib/i18n"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=e.getAttribute("cs-inline-editing-mode")
return"DIV"===e.tagName&&"simple"!==t||"full"===t}function p(e){var t
function n(){var n=window.tinyMCE.DOM.getRect(e.getBody()),o=t.layoutRect(),r=o.x,a=o.y,i=o.w
t.classes.add("arrow"),t.classes.remove("cs-is-left"),t.classes.remove("cs-is-right"),t.classes.remove("arrow-down"),t.classes.remove("arrow-up")
var s=r+Math.abs(n.w-i)/2*(r===n.x^n.w>i?-1:1)
s<0?t.classes.add("cs-is-left"):s+i>window.innerWidth?t.classes.add("cs-is-right"):t.layoutRect({x:s}),a<0?t.classes.add("cs-is-vp-top"):t.classes.add(a<n.y?"arrow-down":"arrow-up")}(!e.editorManager.ui.FloatPanel.zIndex||e.editorManager.ui.FloatPanel.zIndex<100065535)&&(e.editorManager.ui.FloatPanel.zIndex=100065535),e.addButton("cs-controls",{text:" ",icon:!1,onPostRender:function(e){var o=e.control
o.hide(),t||((t=o.rootControl).on("move",n),t.on("postrender",function(){return t.classes.add("cs-inline-text-editor")}))}}),u(e.targetElm)&&function(e){function t(t){var n=Object.assign({},e.buttons[t])
return delete n.active,n}function n(e){return e.map(t)}function r(e){setTimeout(function(){e.classes.add("cs-inline-text-editor-panel"),e.$el.css("width",""),e.$el.find(".mce-container-body").css("width","")},0)}e.addButton("alignoptions",{type:"menubutton",tooltip:(0,o.t)("common.editor.alignment"),icon:"aligncenter",menu:n(["alignleft","aligncenter","alignright","alignjustify","alignnone"]),onShow:function(e){return r(e.control)}}),e.addButton("listoptions",{type:"menubutton",tooltip:(0,o.t)("common.editor.lists"),icon:"bullist",menu:n(["bullist","numlist","indent","outdent"]),onShow:function(e){return r(e.control)}})}(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=!1
function f(){return!(!window.tinymce||!window.tinymce.PluginManager||!window.tinymce.PluginManager.lookup["cs-inline-editing"]&&(window.tinymce.PluginManager.add("cs-inline-editing",p),0))||(d||(console.warn("Inline editing disabled because TinyMCE was not loaded."),d=!0),!1)}var m=function(e){return function(p){function d(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,d)
for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u]
return n=this,o=(e=i(d)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"onDoubleClick",function(e){return t.maybeStartInlineEditing(e)}),c(s(t),"preventButtonDrag",function(e){t.rootElement.current.contains(e.target)&&e.target.closest("button")&&e.preventDefault()}),c(s(t),"closeOnOutsideFocus",function(e){var n=!t.rootElement.current.contains(e.target),o=!!e.target.closest(".media-modal.wp-core-ui"),r=!!e.target.closest(".mce-container")
!n||o||r||t.stopInlineEditing()}),c(s(t),"onEditorBlur",function(){return t.stopInlineEditing()}),c(s(t),"inlineEditingRemoteMedia",function(e){var n=e.close,o=e.html
if(t.rootElement.current&&t.inlineEditingMediaOpen&&n){t.inlineEditingMediaOpen=!1
var r=t.inlineEditingLastSelection
if("function"===Ember.typeOf(r)&&r(),o){var a=t.inlineEditingInsertImages
"function"===Ember.typeOf(a)&&a(o)}}}),t}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(d,e),m=d,(h=[{key:"inlineEditingSetup",value:function(){var e=this
if(this.rootElement.current&&f()){this.inlineEditingMediaOpen=!1
var t=this.props._def.options.inline||{},n=!1
Object.keys(t).forEach(function(o){if(t[o]){var r=t[o],a=r.selector,i=r.mode
if("root"!==a){var s=e.rootElement.current.querySelector(a)
s&&(n=!0,i&&s.setAttribute("cs-inline-editing-mode",i))}else n=!0}}),this.setState({canInlineEdit:n}),n&&(this.rootElement.current.addEventListener("dblclick",this.onDoubleClick),this.getPreview().on("remote:media",this.inlineEditingRemoteMedia))}}},{key:"getPreview",value:function(){return window.cornerstoneApp.lookup("service:preview")}},{key:"maybeStartInlineEditing",value:function(e){var t=this,n=e.target,o=e.clientX,r=e.clientY
if(!this.props.isInlineEditing){var a=this.props._def.options.inline||{},i=Object.keys(a).map(function(e){var o=a[e].selector
if(!o)return!1
if("root"===a[e].selector)return{key:e,target:t.rootElement.current}
if(n.matches(o))return{key:e,target:n}
var r=n.closest(o)
return!(!r||!t.rootElement.current.contains(r))&&{key:e,target:r}}).map(function(e){var t=e.key,n=e.target
if(!t)return!1
if(!a[t].editing_target)return{key:t,target:n}
var o=n.querySelector(a[t].editing_target)
return!!o&&{key:t,target:o}}).find(function(e){return!!e})
i&&this.inlineEditingInit(i,{clientX:o,clientY:r})}}},{key:"inlineEditingInit",value:function(e,r){var a=this,i=e.target,s=e.key
this.props.dispatch((0,n.uiBeginInlineEditing)(this.props._id)),i.innerHTML=this.props[s]
var l=["bold","italic","strikethrough","underline","forecolor"]
u(i)&&(l.pop(),l.unshift("formatselect"),l=l.concat(["blockquote","forecolor","listoptions","alignoptions","pastetext","removeformat","cs_media","link"])),l.unshift("cs-controls")
var c=l.join(" ")
window.tinymce.init({target:i,toolbar:c,selection_toolbar:c,insert_toolbar:!1,inline:!0,plugins:["textcolor","paste","wordpress","link","lists","cs-inline-editing"].join(" "),menubar:!1,convert_urls:!1,browser_spellcheck:!0,setup:function(e){e.addButton("cs_media",{icon:"image",tooltip:(0,o.t)("common.editor.insert-image"),onclick:function(t){var n=e.selection.getBookmark()
a.inlineEditingLastSelection=function(){e.focus(),e.selection.moveToBookmark(n)},a.inlineEditingInsertImages=function(t){e.focus(),e.selection.moveToBookmark(n),e.execCommand("mceInsertContent",!1,t)},a.inlineEditingMediaOpen=!0,a.getPreview().message("preview:ui-event",{action:"media:open"})}})},init_instance_callback:function(e){if(e&&a.rootElement.current){(function(e,t){var n,o,r=t.clientX,a=t.clientY
if(window.document.caretPositionFromPoint){var i=window.document.caretPositionFromPoint(r,a)
n=i.offsetNode,o=i.offset}else if(window.document.caretRangeFromPoint){var s=window.document.caretRangeFromPoint(r,a)
n=s.startContainer,o=s.startOffset}e.focus(),n?e.selection.setCursorLocation(n,o):e.selection.select(e.getBody(),!0),e.selection.collapse(!1)})(e,r)
var n=e.getElement().closest("a[href]")
n&&n.removeAttribute("href")
var o=function(){a.props.dispatch((0,t.elementUpdateAtt)(a.props._id,s,e.getContent()))},i=function(){var t=e.getElement()
if("SPAN"===t.tagName&&!t.querySelector("br[data-mce-bogus]")){var n=window.document.createElement("br")
n.setAttribute("data-mce-bogus","1"),t.append(n)}}
i(),e.on("keydown",i),e.on("keyup",o),e.on("change",o),e.on("blur",a.onEditorBlur),window.document.addEventListener("blur",a.onEditorBlur),window.document.body.addEventListener("mousedown",a.closeOnOutsideFocus),window.document.body.addEventListener("mousedown",a.preventButtonDrag),window.document.body.addEventListener("focus",a.closeOnOutsideFocus),a.inlineEditor=e}}})}},{key:"stopInlineEditing",value:function(){this.inlineEditingMediaOpen||(this.tearDownInlineEditing(),this.props.dispatch((0,n.uiEndInlineEditing)(this.props._id)))}},{key:"tearDownInlineEditing",value:function(){this.state.canInlineEdit&&(this.inlineEditor&&this.inlineEditor.destroy(),this.rootElement.current&&this.rootElement.current.removeEventListener("dblclick",this.onDoubleClick),this.getPreview().off("remote:media",this.inlineEditingRemoteMedia),window.document.removeEventListener("blur",this.onEditorBlur),window.document.body.removeEventListener("mousedown",this.closeOnOutsideFocus),window.document.body.removeEventListener("mousedown",this.preventButtonDrag),window.document.body.removeEventListener("focus",this.closeOnOutsideFocus))}},{key:"inlineEditingComponentWillUnmount",value:function(){this.tearDownInlineEditing()}}])&&a(m.prototype,h),g&&a(m,g),d}()}
e.default=m}),define("tco-app/src/components/preview-elements/LayoutCell",["exports","react-redux","tco-app/src/components/preview-elements/DragDropContainer"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,i(t).apply(this,arguments))}var o,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,n.default),o=t,(l=[{key:"generateStyles",value:function(){return this.props.cellInteraction&&this.props.cellInteraction.id===this.props._id?this.props.cellInteraction.areaStyles:{}}}])&&r(o.prototype,l),c&&r(o,c),t}(),c=(0,t.connect)((0,n.dragDropMakeMapStateToProps)(),n.dragDropMapDispatchToProps)(l)
e.default=c}),define("tco-app/src/components/preview-elements/LayoutColumn",["exports","react","react-redux","tco-app/src/components/preview-elements/DragDropContainer"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,l(t).apply(this,arguments))}var n,r,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,o.default),n=t,(r=[{key:"generateClass",value:function(){var e=s(l(t.prototype),"generateClass",this).call(this)
return e.includes("x-col")||(e+=" x-col"),e}}])&&a(n.prototype,r),u&&a(n,u),t}(),p=(0,n.connect)((0,o.dragDropMakeMapStateToProps)(),o.dragDropMapDispatchToProps)(u)
e.default=p}),define("tco-app/src/components/preview-elements/LayoutGrid",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase","tco-app/src/components/common/LayoutPresetsGrid","tco-app/src/actions/elements","tco-app/src/components/preview-elements/grid/GridEditor"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function u(e,t,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m,h=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u]
return o=this,r=(e=p(n)).call.apply(e,[this].concat(l)),t=!r||"object"!==s(r)&&"function"!=typeof r?c(o):r,f(c(t),"state",{cellInteraction:null}),f(c(t),"onChooseLayout",function(e,n){n.preventDefault(),n.stopPropagation()
try{var o=JSON.parse(e)
t.props.dispatch((0,a.elementCreateGridLayout)(t.props._id,o))}catch(n){console.warn("Invalid grid template JSON")}}),f(c(t),"onMoveCell",function(e,n,o){var r,a=o.gridColumnStart,i=o.gridColumnEnd,s=o.gridRowStart,l=o.gridRowEnd
t.props.elementUpdateAtts(e,(f(r={},"layout_cell_column_start_".concat(n),a),f(r,"layout_cell_column_end_".concat(n),i),f(r,"layout_cell_row_start_".concat(n),s),f(r,"layout_cell_row_end_".concat(n),l),r)),t.setState({cellInteraction:{id:e,areaStyles:o}})}),f(c(t),"onResetInteraction",function(){return t.setState({cellInteraction:null})}),t}var m,h,g
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(n,o.default),m=n,(h=[{key:"generateClass",value:function(){var e=[u(p(n.prototype),"generateClass",this).call(this)]
return this.props.isEditingGrid&&e.push("is-editing-grid"),this.props._modules.length<=0&&e.push("is-empty"),e.join(" ")}},{key:"renderAfter",value:function(){return this.props.hideWorkspace?null:this.props._modules.length<=0?t.default.createElement("div",{className:"cs-layout-picker is-grid"},t.default.createElement("h1",null,"Choose a Layout"),t.default.createElement(r.default,{onChooseLayout:this.onChooseLayout})):t.default.createElement(i.default,{elID:this.props.elID,key:this.rootElement.current,onMoveCell:this.onMoveCell,onResetInteraction:this.onResetInteraction,rootEl:this.rootElement.current})}},{key:"childrenProps",value:function(){return Object.assign({},u(p(n.prototype),"childrenProps",this).call(this),{cellInteraction:this.state.cellInteraction})}},{key:"observerAttribute",value:function(){return Object.assign({insetOutline:this.props._modules.length<=0},u(p(n.prototype),"observerAttribute",this).call(this))}}])&&l(m.prototype,h),g&&l(m,g),n}(),g=(0,n.connect)((m=(0,o.makeMapStateToProps)(),function(e,t){return Object.assign({hideWorkspace:e.ui.hideWorkspace,isEditingGrid:e.ui.editingGrid===t.elID},m(e,t))}),function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){f(e,t,n[t])})}return e}({elementUpdateAtts:function(t,n){return e((0,a.elementUpdateAtts)(t,n))}},(0,o.mapDispatchToProps)(e))})(h)
e.default=g}),define("tco-app/src/components/preview-elements/LayoutRow",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase","tco-app/src/components/preview-elements/RowResizer","tco-app/src/components/common/LayoutPresets","tco-app/src/actions/elements","tco-app/src/actions/ui"],function(e,t,n,o,r,a,i,s){function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t,n){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t)
if(o){var r=Object.getOwnPropertyDescriptor(o,t)
return r.get?r.get.call(n):r.value}})(e,t,n||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var h,g=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,c=new Array(a),p=0;p<a;p++)c[p]=arguments[p]
return o=this,r=(e=d(n)).call.apply(e,[this].concat(c)),t=!r||"object"!==l(r)&&"function"!=typeof r?u(o):r,m(u(t),"onChooseLayout",function(e,n){n.preventDefault(),n.stopPropagation(),t.props.dispatch((0,i.elementCreateRowLayout)(t.props._id,e))}),m(u(t),"onUpdateLayout",function(e){return t.props.dispatch((0,i.elementUpdateAtt)(t.props._id,"layout_row_layout_".concat(t.props.breakpoint),e.join(" ")))}),m(u(t),"onResizeBegin",function(){return t.props.dispatch((0,s.uiBeginRowResize)(t.props._id))}),m(u(t),"onResizeEnd",function(){return t.props.dispatch((0,s.uiEndRowResize)())}),t}var h,g,v
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,o.default),h=n,(g=[{key:"getLayout",value:function(){return(this.props["layout_row_layout_".concat(this.props.breakpoint)]||"").split(" ")}},{key:"renderAfter",value:function(){if(this.props._markup&&!this.props.hideWorkspace){if(this.props._modules.length<=0)return t.default.createElement("div",{className:"cs-layout-picker is-row"},t.default.createElement("h1",null,"Choose a Layout"),t.default.createElement(a.default,{onClick:this.onChooseLayout}))
var e=this.getLayout()
return e.length>0?t.default.createElement(r.default,{layout:e,gapSize:this.props.layout_row_gap_column||"0",elementID:this.props._id,key:this.rootElement.current,rootEl:this.rootElement.current,onUpdate:this.onUpdateLayout,onResizeBegin:this.onResizeBegin,onResizeEnd:this.onResizeEnd}):null}}},{key:"observerAttribute",value:function(){return Object.assign({insetOutline:this.props._modules.length<=0},p(d(n.prototype),"observerAttribute",this).call(this))}}])&&c(h.prototype,g),v&&c(h,v),n}(),v=(0,n.connect)((h=(0,o.makeMapStateToProps)(),function(e,t){var n=e.builder.previewBreakpoint,o=e.ui.hideWorkspace
return Object.assign({hideWorkspace:o,breakpoint:n},h(e,t))}),o.mapDispatchToProps)(g)
e.default=v})
define("tco-app/src/components/preview-elements/RowResizer",["exports","react","react-dom","classnames","tco-app/src/util/scrollbar-width","tco-app/src/components/common/Style"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f=function(e){var n=e.label,r=e.active
return t.default.createElement("div",{className:(0,o.default)("cs-row-resizer-label",{"is-active":r})},t.default.createElement("span",null,n))},m=function(e){var n=e.onMouseDown,r=e.reverse,a=e.active,i=e.width,s=void 0===i?0:i,l={width:s}
return l[r?"marginLeft":"marginRight"]="calc(".concat(s," / 2 * -1)"),t.default.createElement("div",{onMouseDown:n,className:(0,o.default)("cs-row-resizer-handle",{"is-active":a}),style:l})},h=8,g=function(e){function g(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,g)
for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l]
return n=this,o=(e=c(g)).call.apply(e,[this].concat(s)),t=!o||"object"!==i(o)&&"function"!=typeof o?u(n):o,d(u(t),"state",{active:!1,showLabels:!1,minSize:h,draggingIndex:null,updatedLayout:null,position:{},reverse:!1}),d(u(t),"onMouseOverEnter",function(e){e.target===t.props.rootEl&&(t.didLeave=!1,t.setState({active:!0}))}),d(u(t),"onMouseLeave",function(e){e.target===t.props.rootEl&&(t.didLeave=!0,null===t.state.draggingIndex&&t.deactivate())}),d(u(t),"onScrollOrResize",function(){return t.reposition()}),d(u(t),"reposition",function(){if(t.props.rootEl&&t.state.active){var e=t.props.rootEl.getBoundingClientRect(),n=e.top,o=e.left,a=e.bottom,i=e.right,s=e.width,l=t.props.rootEl.querySelector(".x-row-inner"),c=!!l&&"row-reverse"===window.getComputedStyle(l)["flex-direction"],u={top:Math.max(0,n),bottom:window.innerHeight-a,right:window.innerWidth-(0,r.scrollBarOffset)()-i,left:o,width:s}
t.setState({position:u,reverse:c}),t.updateGapSizing()}}),d(u(t),"onDrag",function(e){var n=t.state,o=n.updatedLayout,r=n.draggingIndex,a=Array.from(o||t.props.layout,parseFloat),i=e.clientX,s=t.props.rootEl.getBoundingClientRect(),l=s.left,c=s.width,u=Math.min(Math.max(i-l,0),c)/c*100
t.state.reverse&&(u=100-u)
var p=function(e,t){return e+parseFloat(t)},d=a.slice(0,r).reduce(p,0),f=a.slice(r+2).reduce(p,0),m=Math.min(Math.max(u,d+t.state.minSize),100-f-t.state.minSize)
a[r]=Math.round(100*(m-d))/100,a[r+1]=100-(d+f+a[r]),t.setState({updatedLayout:a.map(function(e){return"".concat(e.toFixed(2),"%").replace(".00","")})})}),d(u(t),"endDrag",function(e){e.preventDefault(),t.didLeave&&t.deactivate(),t.setState({showLabels:!1,draggingIndex:null}),t.props.onResizeEnd(),window.document.body.removeEventListener("mousemove",t.onDrag,!0),window.document.body.removeEventListener("mouseup",t.endDrag,!0),t.state.updatedLayout&&t.state.updatedLayout.join(" ")!==t.props.layout.join(" ")&&t.props.onUpdate(t.state.updatedLayout)}),t}var v,b,y
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(g,t.default.Component),v=g,(b=[{key:"componentDidMount",value:function(){this.props.rootEl&&(window.document.body.addEventListener("mouseenter",this.onMouseOverEnter,!0),window.document.body.addEventListener("mouseover",this.onMouseOverEnter,!0),window.document.body.addEventListener("mouseleave",this.onMouseLeave,!0),this.updateGapSizing())}},{key:"componentDidUpdate",value:function(e,t){t.active!==this.state.active&&(this.state.active?(window.addEventListener("resize",this.onScrollOrResize),window.addEventListener("scroll",this.onScrollOrResize),this.reposition()):(window.removeEventListener("resize",this.onScrollOrResize),window.removeEventListener("scroll",this.onScrollOrResize))),e.gapSize!==this.props.gapSize&&this.updateGapSizing()}},{key:"componentWillUnmount",value:function(){window.document.body.removeEventListener("mouseenter",this.onMouseOverEnter,!0),window.document.body.removeEventListener("mouseover",this.onMouseOverEnter,!0),window.document.body.removeEventListener("mouseleave",this.onMouseLeave,!0),window.document.body.removeEventListener("mousemove",this.onDrag,!0),window.document.body.removeEventListener("mouseup",this.endDrag,!0),window.removeEventListener("resize",this.onScrollOrResize),window.removeEventListener("scroll",this.onScrollOrResize),null!==this.state.draggingIndex&&this.props.uiEndRowResize()}},{key:"deactivate",value:function(){this.setState({active:!1,position:{},updatedLayout:null})}},{key:"updateGapSizing",value:function(){if(this.props.rootEl){var e=this.props.rootEl.querySelectorAll(".x-col"),t=s(e).reduce(function(e,t){return e+=t.getBoundingClientRect().width},0),n=this.props.rootEl.getBoundingClientRect().width,o=(n-t)/(e.length-1)/n,r=h
o>h/100/e.length&&(r=Math.round(r+100*o)),r!==this.state.minSize&&this.setState({minSize:r})}}},{key:"beginDrag",value:function(e,t){e.preventDefault(),this.props.onResizeBegin(),this.setState({showLabels:!0,draggingIndex:t}),window.document.body.addEventListener("mouseup",this.endDrag,!0),window.document.body.addEventListener("mousemove",this.onDrag,!0)}},{key:"renderColumn",value:function(e){var n=this,o=this.state.updatedLayout?this.state.updatedLayout[e]:this.props.layout[e]
return t.default.createElement("div",{key:e,className:"cs-row-resizer-col"},e<this.props.layout.length-1&&t.default.createElement(m,{reverse:this.state.reverse,active:e===this.state.draggingIndex,width:this.props.gapSize,onMouseDown:function(t){return n.beginDrag(t,e)}}),t.default.createElement(f,{label:o,active:this.state.showLabels}))}},{key:"renderStyle",value:function(){var e=this
if(null===this.state.updatedLayout)return null
var n=this.state.updatedLayout.length
return t.default.createElement(a.default,null,this.state.updatedLayout.reduce(function(t,o,r){var a="".concat(n,"n - ").concat(n-(r+1))
return t+=".e".concat(e.props.elementID,".cs-element-preview .x-row-inner > *:nth-child(").concat(a,") { flex-basis: calc(").concat(o," - ").concat(e.props.gapSize,")}\n")},""))}},{key:"renderResizer",value:function(){var e=this,n=this.state.position,r=n.top,a=n.right,i=n.bottom,s=n.left
return t.default.createElement("div",{className:(0,o.default)("cs-row-resizer x-row-inner",{"has-inside-label":this.state.position.top<=40,"is-dragging":null!==this.state.draggingIndex,"is-reversed":this.state.reverse}),style:{top:r,right:a,bottom:i,left:s}},this.props.layout.map(function(t,n){return e.renderColumn(n)}),this.renderStyle())}},{key:"canResize",value:function(){var e=this
if(this.props.layout.filter(function(e){return!e.match(/^[\d.]+%$/)}).length>0)return!1
var t=this.props.layout.map(parseFloat)
return!(t.filter(function(t){return t<e.state.minSize}).length>0)&&!(Math.abs(t.reduce(function(e,t){return e+=t},0)-100)>.02)}},{key:"render",value:function(){return this.state.active&&this.props.rootEl&&this.canResize()?n.default.createPortal(this.renderResizer(),this.props.rootEl):null}}])&&l(v.prototype,b),y&&l(v,y),g}()
e.default=g}),define("tco-app/src/components/preview-elements/Tabs",["exports","react","react-redux","tco-app/src/components/preview-elements/ElementBase"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,s(t).apply(this,arguments))}var n,r,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,o.default),n=t,(r=[{key:"getInlineEditingModel",value:function(e,t){return(e.classList.contains("x-tabs-panel")?e:e.parentElement).getAttribute("data-x-toggleable").replace("tab-item-","")}}])&&a(n.prototype,r),c&&a(n,c),t}(),u=(0,n.connect)((0,o.makeMapStateToProps)(),o.mapDispatchToProps)(c)
e.default=u}),define("tco-app/src/components/preview-elements/grid/GridEditor",["exports","react","react-redux","classnames","tco-app/src/util/idle-callback","tco-app/src/actions/ui","tco-app/src/actions/inspector","tco-app/src/selectors/elements","tco-app/src/actions/elements","tco-app/src/components/preview-elements/grid/GridEditorCell","tco-app/src/components/preview-elements/grid/GridEditorTrackOverlay","tco-app/src/components/preview-elements/grid/helpers"],function(e,t,n,o,r,a,i,s,l,c,u,p){function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){m(e,t,n[t])})}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function y(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),e}function _(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?w(e):t}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var k=function(e){function n(){return v(this,n),_(this,E(n).apply(this,arguments))}return O(n,t.default.Component),y(n,[{key:"render",value:function(){var e=this.props,n=e.activeCell,r=e.gridTemplateRows,a=e.gridTemplateColumns,i=e.padding
return t.default.createElement("div",{className:(0,o.default)("cs-grid-editor-overlay","is-cells",{"is-interacting-cell":!!n}),style:{gridTemplateRows:r,gridTemplateColumns:a,padding:i}},this.props.children)}}]),n}(),S=function(e,t,n){var o=h(e.map(function(e,n){return{index:n,distance:Math.abs(t-e)}}).sort(function(e,t){return e.distance-t.distance}).map(function(e){return e.index}),2),r=o[0],a=o[1],i=n%2==0,s=(i?n:n+1)/2,l=i&&r>=a?0:1,c=Math.max(0,r+l-s),u=c+n-1
return u>e.length-1?[Math.max(0,e.length-n),e.length-1]:[c,u]}
var P={uiBeginGridEditor:a.uiBeginGridEditor,uiEndGridEditor:a.uiEndGridEditor,elementUpdateAtts:l.elementUpdateAtts,inspect:i.inspect},C=function(e){function n(){var e,o
v(this,n)
for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s]
return m(w(o=_(this,(e=E(n)).call.apply(e,[this].concat(i)))),"state",{gridTemplateColumns:"",gridTemplateRows:"",padding:"",xGap:0,yGap:0,activeCell:null,interaction:{},cellRects:{},cellRefs:{},updating:{id:null,cellRect:{}},gridTrackDimensions:[],gridTrackActiveCells:[],gridTrackOriginCells:[],hasTrackDimensions:!1}),m(w(o),"overlayRef",t.default.createRef()),m(w(o),"idleUpdateComputedStyles",(0,r.debounceIdleCallback)(function(){return o.updateComputedStyles()},15)),m(w(o),"idleResetInteraction",(0,r.debounceIdleCallback)(function(){o.resetInteraction()})),m(w(o),"idleUpdateCellRects",(0,r.debounceIdleCallback)(function(){o.updateCellRects()},100)),m(w(o),"onUpdateGridTrackDimensions",function(e){o.setState({gridTrackDimensions:e,hasTrackDimensions:!0}),o.updateCellRects()}),m(w(o),"onResize",function(){o.props.isEditingGrid&&(o.idleUpdateComputedStyles(),o.idleUpdateCellRects())}),m(w(o),"onMouseEnterButton",function(){o.props.isEditingGrid||o.idleUpdateComputedStyles()}),m(w(o),"onToggleEditor",function(e){e.stopPropagation(),o.props.isEditingGrid?o.props.uiEndGridEditor():o.props.uiBeginGridEditor(o.props.elID)}),m(w(o),"onUpdateCellRef",function(e,t){o.state.updating&&o.state.updating.id===e&&o.softResetInteraction(),o.setState(function(n){return{cellRefs:f({},n.cellRefs,m({},e,t)),cellRects:f({},n.cellRects,m({},e,o.locateCellRect(t,o.getCurrentGridBounds())))}})}),m(w(o),"onCellActionBegin",function(e,t,n){o.interactionOffsetX=0,o.interactionOffsetY=0
var r=o.locateCellRects(o.getCurrentGridBounds())
o.idleResetInteraction.cancel()
var a=f({},n,{position:o.positionCellFromInteraction(e,t,n,r,!0)}),i=t?o.identifyActiveTrackCells(a):[]
o.setState({cellRects:r,activeCell:t,gridTrackActiveCells:i,gridTrackOriginCells:i,interaction:a})}),m(w(o),"onCellActionContinue",function(e,t){o.idleResetInteraction.cancel(),o.setState(function(n){var r=o.positionCellFromInteraction(e,t,n.interaction,n.cellRects),a=f({},n.interaction,{position:r}),i=t?o.identifyActiveTrackCells(a):[]
return{activeCell:t,gridTrackActiveCells:i,interaction:a}})}),m(w(o),"onCellActionEnd",function(e,t){var n,r,a,i=o.state,s=i.interaction,l=i.cellRects,c=i.activeCell,u=i.gridTrackOriginCells
if(c){var p=o.identifyActiveTrackCells(f({},s,{position:o.positionCellFromInteraction(e,c,s,l)})),d=p.reduce(function(e,t){var n=t.inner,o=t.x,r=t.y
return e.x1=void 0===e.x1?o:Math.min(e.x1,o),e.y1=void 0===e.y1?r:Math.min(e.y1,r),e.x2=void 0===e.x2?o:Math.max(e.x2,o),e.y2=void 0===e.y2?r:Math.max(e.y2,r),e.x1===o&&(e.left=n.left),e.y1===r&&(e.top=n.top),e.x2===o&&(e.right=n.right),e.y2===r&&(e.bottom=n.bottom),e},{}),m=d.x1,g=d.y1,v=d.x2,b=d.y2,y=d.top,_=d.left,w=d.bottom,E=d.right,O=o.props.breakpoint,x=o.getCurrentGridBounds(),k={top:y+x.topBound,left:_+x.leftBound,height:w-y,width:E-_}
p.length>=0&&(n=h([p,u].map(function(e){return e.map(function(e){return e.index}).sort()}),2),r=n[0],a=n[1],r.join("")!==a.join(""))?(o.props.onMoveCell(c,O,{gridColumnStart:m+1,gridColumnEnd:v+2,gridRowStart:g+1,gridRowEnd:b+2}),o.setState({updating:{id:c,cellRect:l[t]},interaction:f({},s,{position:k}),gridTrackOriginCells:[],gridTrackActiveCells:p}),o.idleResetInteraction()):o.resetInteraction()}else o.idleResetInteraction()
o.props.inspect(t)}),o}return O(n,t.default.Component),y(n,[{key:"componentDidMount",value:function(){this.idleUpdateComputedStyles(),window.addEventListener("resize",this.onResize)}},{key:"componentDidUpdate",value:function(e){this.props.isEditingGrid&&(e.isEditingGrid===this.props.isEditingGrid&&this.props.gridCounter===e.gridCounter||(this.idleUpdateComputedStyles(),this.idleUpdateCellRects())),this.props.element!==e.element&&this.idleUpdateComputedStyles()}},{key:"componentWillUnmount",value:function(){this.idleUpdateComputedStyles.cancel(),this.idleResetInteraction.cancel(),this.idleUpdateCellRects.cancel(),window.removeEventListener("resize",this.onResize)}},{key:"getCurrentGridBounds",value:function(){if(!this.props.rootEl||!this.props.isEditingGrid)return{topBound:0,leftBound:0}
var e=this.props.rootEl.getBoundingClientRect()
return{topBound:e.top,leftBound:e.left}}},{key:"softResetInteraction",value:function(){this.setState({activeCell:null,gridTrackActiveCells:[],gridTrackOriginCells:[],interaction:{}})}},{key:"resetInteraction",value:function(){this.setState({updating:{id:null,cellRect:{}},activeCell:null,gridTrackActiveCells:[],gridTrackOriginCells:[],interaction:{}}),this.updateCellRects(),this.props.onResetInteraction()}},{key:"locateCellRects",value:function(e){var t=this,n=this.state.cellRefs
return Object.keys(n).reduce(function(o,r){return o[r]=t.locateCellRect(n[r],e),o},{})}},{key:"locateCellRect",value:function(e,t){var n=t.topBound,o=t.leftBound,r=e.getBoundingClientRect(),a=r.top,i=r.left,s=r.bottom,l=r.right
return{width:r.width,height:r.height,top:a-n,left:i-o,bottom:s-n,right:l-o}}},{key:"positionCellFromInteraction",value:function(e,t,n,o,r){var a=n.isResizing,i=n.isMoving
return t?a?this.calculateCellResize(e,t,a,o,r):i?this.calculateCellMove(e,t,o,r):{}:{}}},{key:"calculateCellResize",value:function(e,t,n,o,r){var a=e.clientX,i=e.clientY,s=o[t],l=s.top,c=s.left,u=s.bottom,p=s.right,d=s.height,f=s.width,m=this.getCurrentGridBounds(),h=m.topBound,g=m.leftBound,v={x:c,y:l,top:l+h,left:c+g,height:d,width:f}
if(n.includes("n")){r&&(this.interactionOffsetY=i-(l+h))
var b=u+h,y=i-this.interactionOffsetY
i>=b?(v.top=b,v.height=y-b+2*this.interactionOffsetY):(v.top=y,v.height=b-y),v.y=v.top-h}if(n.includes("w")){r&&(this.interactionOffsetX=a-(c+g))
var _=p+g,w=a-this.interactionOffsetX
a>=_?(v.left=_,v.width=w-_+2*this.interactionOffsetX):(v.left=w,v.width=_-w),v.x=v.left-g}if(n.includes("s")){r&&(this.interactionOffsetY=u+h-i)
var E=i+this.interactionOffsetY,O=l+h
if(i<=O){var x=E-2*this.interactionOffsetY
v.top=x,v.y=x-h,v.height=O-x}else v.height=E-O}if(n.includes("e")){r&&(this.interactionOffsetX=p+g-a)
var k=a+this.interactionOffsetX,S=c+g
if(a<=c){var P=k-2*this.interactionOffsetX
v.left=P,v.x=P-h,v.width=S-P}else v.width=k-S}return v}},{key:"calculateCellMove",value:function(e,t,n,o){var r=e.clientX,a=e.clientY,i=n[t],s=i.top,l=i.left,c=i.height,u=i.width,p=this.getCurrentGridBounds(),d=p.topBound,f=p.leftBound
o&&(this.interactionOffsetY=a-(s+d),this.interactionOffsetX=r-(l+f))
var m=a-this.interactionOffsetY,h=r-this.interactionOffsetX
return{x:h-f,y:m-d,left:h,top:m,height:c,width:u,position:"fixed"}}},{key:"identifyNextMovement",value:function(e){var t,n,o,r=this.state,a=r.gridTrackDimensions,i=r.gridTrackOriginCells,s=i.length>0?i:a.filter(function(t){var n=t.inner
return(0,p.getRectangleOverlapRatio)(n,e)>.75}),l=a.reduce(function(e,t){var n=t.x,o=t.y,r=t.inner
return 0===n&&e.yTracks.push(r.top+(r.bottom-r.top)/2),0===o&&e.xTracks.push(r.left+(r.right-r.left)/2),e},{xTracks:[],yTracks:[]}),c=l.xTracks,u=l.yTracks,d=(t=s.reduce(function(e,t){var n=e.minX,o=e.minY,r=e.maxX,a=e.maxY,i=t.x,s=t.y
return{minX:void 0!==n?Math.min(n,i):i,minY:void 0!==o?Math.min(o,s):s,maxX:void 0!==r?Math.max(r,i):i,maxY:void 0!==a?Math.max(a,s):s}},{}),n=t.minX,o=t.minY,{colSpan:1+t.maxX-n,rowSpan:1+t.maxY-o}),f=d.colSpan,m=d.rowSpan,g=e.left+(e.right-e.left)/2,v=e.top+(e.bottom-e.top)/2,b=h(S(c,g,f),2),y=b[0],_=b[1],w=h(S(u,v,m),2),E=w[0],O=w[1]
return a.reduce(function(e,t){var n=t.x,o=t.y,r=t.index
return function(e,t){return e>=y&&e<=_&&t>=E&&t<=O}(n,o)&&e.push(r),e},[])}},{key:"identifyActiveTrackCells",value:function(e){var t=e.isMoving,n=e.position,o=void 0===n?{}:n,r=o.x,a=o.y,i={top:a+1,left:r+1,bottom:a+o.height-1,right:r+o.width-1}
if(t){var s=this.identifyNextMovement(i)
return this.state.gridTrackDimensions.filter(function(e){var t=e.index
return s.includes(t)})}return this.state.gridTrackDimensions.filter(function(e){var t=e.inner
return(0,p.areRectanglesOverlapping)(t,i)})}},{key:"updateCellRects",value:function(){this.setState({cellRects:this.locateCellRects(this.getCurrentGridBounds())})}},{key:"updateComputedStyles",value:function(){if(this.props.rootEl){var e=window.getComputedStyle(this.props.rootEl),t=e.gridTemplateColumns,n=e.gridTemplateRows,o=e.gridRowGap,r=e.gridColumnGap,a=e.padding,i=t.split(" ").length,s=n.split(" ").length
this.setState({gridTemplateColumns:t,gridTemplateRows:n,columnCount:i,rowCount:s,padding:a,xGap:parseFloat(r)||0,yGap:parseFloat(o)||0})}}},{key:"renderCellsOverlay",value:function(){var e=this
if(!this.props.isEditingGrid)return null
var n=this.state,o=n.gridTemplateRows,r=n.gridTemplateColumns,a=n.padding
return t.default.createElement(k,{activeCell:this.state.activeCell,gridTemplateRows:o,gridTemplateColumns:r,padding:a},this.props.cells.map(function(n){var o=n.id,r=n.areaStyles
return t.default.createElement(c.default,d({key:o,elID:o,areaStyles:r,updating:e.state.updating,onUpdateCellRef:e.onUpdateCellRef,onCompleteCellAction:e.onCompleteCellAction,onCellAction:e.onCellAction,onCellActionBegin:e.onCellActionBegin,onCellActionContinue:e.onCellActionContinue,onCellActionEnd:e.onCellActionEnd},e.state.activeCell===o?e.state.interaction:{}))}))}},{key:"renderTrackOverlay",value:function(){if(!this.props.isEditingGrid)return null
var e=this.state,n=e.gridTemplateRows,o=e.gridTemplateColumns,r=e.rowCount,a=e.columnCount,i=e.padding,s=e.xGap,l=e.yGap
return t.default.createElement(u.default,{ref:this.overlayRef,key:"".concat(n,":").concat(o,":").concat(s,":").concat(l),activeCell:this.state.activeCell,gridTemplateRows:n,gridTemplateColumns:o,padding:i,columnCount:a,rowCount:r,xGap:s,yGap:l,updating:this.state.updating,cellRects:this.state.cellRects,gridTrackActiveCells:this.state.gridTrackActiveCells,gridTrackDimensions:this.state.gridTrackDimensions,onUpdateGridTrackDimensions:this.onUpdateGridTrackDimensions})}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,t.default.createElement("button",{className:(0,o.default)("cs-grid-editor-toggle",{"is-active":this.props.isEditingGrid}),"data-cs-preview-ui":!0,onMouseEnter:this.onMouseEnterButton,onClick:this.onToggleEditor},this.props.isEditingGrid?t.default.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.default.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.035,12.035,0,0,0,12,0ZM10,17.414,4.586,12,6,10.586l4,4,8-8L19.414,8Z"})):t.default.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.default.createElement("path",{d:"M22,1H2A1,1,0,0,0,1,2V22a1,1,0,0,0,1,1H22a1,1,0,0,0,1-1V2A1,1,0,0,0,22,1ZM11,19H5V13h6Zm0-8H5V5h6Zm8,8H13V5h6Z"}))),this.renderCellsOverlay(),this.renderTrackOverlay())}}]),n}()
m(C,"defaultProps",{gridCounter:0})
var j,T=(0,n.connect)((j=(0,s.makeGetElement)(),function(e,t){var n=e.builder.previewBreakpoint,o=e.ui.editingGrid===t.elID?function(e,t){var n=t.elID,o=e.builder.previewBreakpoint
return((e.elements[n]||{})._modules||[]).map(function(t,n){var r=e.elements[t]||{},a=r["layout_cell_column_start_".concat(o)],i=r["layout_cell_column_end_".concat(o)],s=r["layout_cell_row_start_".concat(o)]
return{id:t,areaStyles:{gridColumnEnd:i,gridColumnStart:a,gridRowEnd:r["layout_cell_row_end_".concat(o)],gridRowStart:s}}})}(e,t):[],r=j(e,{id:t.elID})
return Object.assign({breakpoint:n,element:r,gridCounter:e.ui.gridCounter,isEditingGrid:e.ui.editingGrid===t.elID,cells:o})}),P)(C)
e.default=T}),define("tco-app/src/components/preview-elements/grid/GridEditorCell",["exports","react","react-dom","classnames"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var a=arguments.length,l=new Array(a),p=0;p<a;p++)l[p]=arguments[p]
return n=this,o=(e=i(u)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"onMouseDown",function(e){if(!(0!==e.button||t.props.updating&&t.props.updating.id===t.props.elID)){var n=e.target.getAttribute("cs-cell-resize"),o=t.actionsEl===e.target;(n||o)&&(e.preventDefault(),e.stopPropagation(),window.addEventListener("mouseup",t.onMouseUp,!0),window.addEventListener("mousemove",t.onMouseMove,!0),window.addEventListener("wheel",t.onMouseMove,!0)),t.props.onCellActionBegin(e,t.props.elID,{isMoving:o,isResizing:n})}}),c(s(t),"onMouseMove",function(e){t.isInteracting()&&t.props.onCellActionContinue(e,t.props.elID)}),c(s(t),"onMouseUp",function(e){t.props.onCellActionEnd(e,t.props.elID),window.removeEventListener("mouseup",t.onMouseUp,!0),window.removeEventListener("mousemove",t.onMouseMove,!0),window.removeEventListener("wheel",t.onMouseMove,!0)}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.Component),p=u,(d=[{key:"componentDidMount",value:function(){this.updateCellRef(),this.props.onUpdateCellRef(this.props.elID,this.rootEl),window.addEventListener("resize",this.onResize)}},{key:"componentDidUpdate",value:function(e){var t=this
this.props.areaStyles&&(Object.keys(this.props.areaStyles||{}).find(function(n){return t.props.areaStyles[n]!==e.areaStyles[n]})&&this.updateCellRef())}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize),window.document.body.removeEventListener("mouseup",this.onMouseUp,!0),window.document.body.removeEventListener("mousemove",this.onMouseMove,!0)}},{key:"updateCellRef",value:function(){this.props.onUpdateCellRef(this.props.elID,this.rootEl)}},{key:"isInteracting",value:function(){return this.props.isMoving||this.props.isResizing}},{key:"isPlaced",value:function(){var e=this.props.areaStyles,t=e.gridColumnStart,n=e.gridColumnEnd,o=e.gridRowStart,r=e.gridRowEnd
return""!==t||""!==n||""!==o||""!==r}},{key:"renderActions",value:function(){var e=this,r=this.props.position||{},a=r.top,i=r.left,s=r.height,l=r.width,c=t.default.createElement("div",{className:(0,o.default)("cs-grid-editor-cell-actions",{"is-fixed":!!this.props.position,"is-interacting":this.isInteracting(),"is-moving":this.props.isMoving,"is-placed":this.isPlaced()}),style:this.props.position&&{top:a,left:i,height:s,width:l}},t.default.createElement("div",{className:"cs-grid-editor-cell-actions-inner",ref:function(t){e.actionsEl=t},onMouseDown:this.onMouseDown},t.default.createElement("a",{className:"cs-grid-editor-cell-action is-resize","data-cs-preview-ui":!0,"cs-cell-resize":"nw"}),t.default.createElement("a",{className:"cs-grid-editor-cell-action is-resize","data-cs-preview-ui":!0,"cs-cell-resize":"ne"}),t.default.createElement("a",{className:"cs-grid-editor-cell-action is-resize","data-cs-preview-ui":!0,"cs-cell-resize":"se"}),t.default.createElement("a",{className:"cs-grid-editor-cell-action is-resize","data-cs-preview-ui":!0,"cs-cell-resize":"sw"})))
return this.props.position?n.default.createPortal(c,document.body):c}},{key:"render",value:function(){var e=this
return t.default.createElement("div",{ref:function(t){e.rootEl=t},className:(0,o.default)("x-cell",{"is-interacting":this.isInteracting(),"is-moving":this.props.isMoving,"is-placed":this.isPlaced()}),style:this.props.areaStyles,"data-cs-observeable-id":this.props.elID,"data-cs-observeable":JSON.stringify({mode:"inspect"})},this.renderActions())}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{isResizing:!1,isMoving:!1,position:null})}),define("tco-app/src/components/preview-elements/grid/GridEditorTrackOverlay",["exports","react","classnames","tco-app/src/components/preview-elements/grid/helpers"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function u(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,u)
for(var a=arguments.length,l=new Array(a),p=0;p<a;p++)l[p]=arguments[p]
return n=this,o=(e=i(u)).call.apply(e,[this].concat(l)),t=!o||"object"!==r(o)&&"function"!=typeof o?s(n):o,c(s(t),"trackRefs",[]),c(s(t),"onResize",function(){return t.updateTrackDimensions()}),t}var p,d,f
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,t.default.Component),p=u,(d=[{key:"componentDidMount",value:function(){this.updateTrackDimensions(),window.addEventListener("resize",this.onResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize)}},{key:"updateTrackDimensions",value:function(){var e=this
this.props.onUpdateGridTrackDimensions(this.trackRefs.map(function(e){var t=e.offsetTop,n=e.offsetLeft
return{top:t,left:n,bottom:t+e.offsetHeight,right:n+e.offsetWidth}}).map(function(t,n){var r=t.top,a=t.left,i=t.bottom,s=t.right,l=e.props,c=l.rowCount,u=l.columnCount,p=l.xGap,d=l.yGap,f=(0,o.convertIndexToCoord)(n,e.props.columnCount),m=f.x,h=f.y,g=p/2,v=d/2
return{index:n,inner:t,outer:{top:0===h?r:r-v,left:0===m?a:a-g,bottom:h===c-1?i:i+v,right:m===u-1?s:s+g},x:m,y:h}}))}},{key:"render",value:function(){var e=this,r=new Array(this.props.columnCount*this.props.rowCount).fill().map(function(e,t){return t}),a=this.props.updating.id?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){c(e,t,n[t])})}return e}({},this.props.cellRects,c({},this.props.updating.id,this.props.updating.cellRect)):this.props.cellRects,i=(0,o.identifyOccupiedCells)(a,this.props.gridTrackDimensions,[this.props.activeCell]).map(function(e){return e.index}),s=this.props.gridTrackActiveCells.map(function(e){return e.index}),l=this.props,u=l.gridTemplateRows,p=l.gridTemplateColumns,d=l.padding
return t.default.createElement("div",{key:"track-overlay",className:"cs-grid-editor-overlay is-tracks",style:{gridTemplateRows:u,gridTemplateColumns:p,padding:d}},r.map(function(o){return t.default.createElement("div",{key:o,ref:function(t){e.trackRefs[o]=t},className:(0,n.default)("x-cell",{"is-occupied":i.includes(o),"is-active":s.includes(o)})},t.default.createElement("i",null),t.default.createElement("span",{className:"is-underlay-bg"}),t.default.createElement("span",{className:"is-overlay-bg"}),t.default.createElement("span",{className:"is-overlay-border"}))}))}}])&&a(p.prototype,d),f&&a(p,f),u}()
e.default=u,c(u,"defaultProps",{columnCount:0,rowCount:0})}),define("tco-app/src/components/preview-elements/grid/helpers",["exports"],function(e){function t(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0
return!(e.left>t.right-n)&&(!(t.left>e.right-n)&&(!(e.top>t.bottom-n)&&!(t.top>e.bottom-n)))}Object.defineProperty(e,"__esModule",{value:!0}),e.convertIndexToCoord=function(e,t){if(0===t)return{x:0,y:0}
var n=Math.floor(e/t)
return{x:e%t,y:n}},e.areRectanglesOverlapping=t,e.getRectangleOverlapRatio=function(e,n){if(!t(e,n))return 0
var o=Math.max(e.top,n.top),r=Math.max(e.left,n.left),a=Math.min(e.bottom,n.bottom),i=Math.min(e.right,n.right),s=(e.right-e.left)*(e.bottom-e.top),l=(n.right-n.left)*(n.bottom-n.top),c=(i-r)*(a-o)
return s+l-c<=0?0:Math.max(c/s,c/l)},e.identifyOccupiedCells=void 0
e.identifyOccupiedCells=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=Object.keys(e)
return n.filter(function(n){var a=n.inner
return!!r.find(function(n){return!o.includes(n)&&t(a,e[n],5)})})}}),define("tco-app/src/components/preview-elements/index",["exports","react-redux","tco-app/src/components/preview-elements/ElementBase","tco-app/src/components/preview-elements/LayoutRow","tco-app/src/components/preview-elements/LayoutColumn","tco-app/src/components/preview-elements/LayoutGrid","tco-app/src/components/preview-elements/LayoutCell","tco-app/src/components/preview-elements/Container","tco-app/src/components/preview-elements/Column","tco-app/src/components/preview-elements/ClassicSection","tco-app/src/components/preview-elements/ClassicRow","tco-app/src/components/preview-elements/ClassicColumn","tco-app/src/components/preview-elements/ClassicBlockGridItem","tco-app/src/components/preview-elements/ClassicPricingTableColumn","tco-app/src/components/preview-elements/ClassicGap","tco-app/src/components/preview-elements/Gap","tco-app/src/components/preview-elements/Tabs"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var v={Base:(0,t.connect)((0,n.makeMapStateToProps)(),n.mapDispatchToProps)(n.default),LayoutRow:o.default,LayoutColumn:r.default,LayoutGrid:a.default,LayoutCell:i.default,Container:s.default,Column:l.default,ClassicSection:c.default,ClassicRow:u.default,ClassicColumn:p.default,ClassicGap:m.default,ClassicBlockGridItem:d.default,ClassicPricingTableColumn:f.default,Gap:h.default,Tabs:g.default}
e.default=v}),define("tco-app/src/components/preview/BreakpointDetection",["exports","react","react-redux","lodash"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),i(this,s(n).apply(this,arguments))}var r,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t.default.PureComponent),r=n,(c=[{key:"componentDidMount",value:function(){var e,t,n,r,a
this.teardown=(e=this.props.update,t={xl:!1,lg:!1,md:!1,sm:!1,xs:!1},n=[window.matchMedia("(min-width: 1200px)"),window.matchMedia("(min-width: 980px) and (max-width: 1199px)"),window.matchMedia("(min-width: 768px) and (max-width: 979px)"),window.matchMedia("(min-width: 481px) and (max-width: 767px)"),window.matchMedia("(max-width: 480px)")],r=(0,o.debounce)(function(){e(Object.keys(t).find(function(e){return t[e]})||"",t)},1),a=function(){t.xl=n[0].matches,t.lg=n[1].matches,t.md=n[2].matches,t.sm=n[3].matches,t.xs=n[4].matches,r()},n.forEach(function(e){return e.addListener(a)}),a(),function(){n.forEach(function(e){return e.removeListener(a)})})}},{key:"componentWillUnmount",value:function(){this.teardown()}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}])&&a(r.prototype,c),u&&a(r,u),n}(),u=(0,n.connect)(function(e,t){return t.id,{}},function(e){return{update:function(t){e({type:"BUILDER:PREVIEW_BREAKPOINT",payload:{active:t},xfr:!0})}}})(c)
e.default=u}),define("tco-app/src/components/preview/ElementObserver",["exports","react","react-redux","tco-app/src/components/preview/Observer","tco-app/src/actions/ui","tco-app/src/actions/inspector","tco-app/src/util/idle-callback","tco-app/src/components/common/Icon","tco-app/components/react-bridge/preview-manager/component"],function(e,t,n,o,r,a,i,s,l){function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var h={uiObserveStart:r.uiObserveStart,uiObserveEnd:r.uiObserveEnd,inspect:a.inspect},g=function(e){function n(){var e,t,o,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l]
return o=this,r=(e=p(n)).call.apply(e,[this].concat(s)),t=!r||"object"!==c(r)&&"function"!=typeof r?d(o):r,m(d(t),"state",{observing:null}),m(d(t),"maybeUpdateState",(0,i.debounceIdleCallback)(function(e){e?t.props.uiObserveStart(e,!0):t.props.uiObserveEnd(!0)},100)),m(d(t),"updateTarget",function(e){t.setState({observing:e})}),m(d(t),"onClick",function(e){var n=t.props.actionContext,o=n.id,r=n.children
o&&e!==o&&!r.includes(e)||t.props.inspect(e)}),t}var r,a,l
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,t.default.Component),r=n,(a=[{key:"componentWillUnmount",value:function(){this.maybeUpdateState.cancel()}},{key:"getObserving",value:function(){return this.state.observing&&!this.props.contextMenu.active?this.state.observing:this.props.observing}},{key:"renderLabel",value:function(e){var n=e.label
return"inline-editing"===e.mode?t.default.createElement("span",null,t.default.createElement(s.default,{icon:"fa-pencil-alt"}),t.default.createElement("span",{dangerouslySetInnerHTML:{__html:n}})):t.default.createElement("span",{dangerouslySetInnerHTML:{__html:n}})}},{key:"render",value:function(){return this.props.disable?null:t.default.createElement(o.default,{hide:this.props.hide,attribute:"data-cs-observeable-id",observing:this.getObserving(),renderLabel:this.renderLabel,updateTarget:this.updateTarget,onClick:this.onClick})}}])&&u(r.prototype,a),l&&u(r,l),n}(),v=(0,n.connect)(function(e,t){return t.id,{observing:e.ui.observing,contextMenu:e.ui.contextMenu,disable:e.ui.liftedElement||e.ui.resizingRow,hide:e.ui.inlineEditing||e.ui.editingGrid,actionContext:e.ui.editingGrid?{id:e.ui.editingGrid,children:e.elements[e.ui.editingGrid]._modules}:{}}},h)(g)
e.default=v}),define("tco-app/src/components/preview/Observer",["exports","react","react-dom","classnames","lodash","tco-app/src/util/idle-callback","tco-app/src/util/scrollbar-width"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var f={edgeClass:"top left",meta:{},style:{display:"none"},active:!1},m=function(e){function m(){var e,t,n,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,m)
for(var i=arguments.length,l=new Array(i),p=0;p<i;p++)l[p]=arguments[p]
return n=this,o=(e=c(m)).call.apply(e,[this].concat(l)),t=!o||"object"!==s(o)&&"function"!=typeof o?u(n):o,d(u(t),"state",f),d(u(t),"delayUpdatePosition",(0,a.debounceIdleCallback)(function(){return t.updatePosition()},180)),d(u(t),"delayUpdatePositionSoft",(0,a.debounceIdleCallback)(function(){return t.updatePosition(!0)},180)),d(u(t),"throttleUpdate",(0,r.throttle)(function(e){if(!e)return t.props.updateTarget(null)
var n=e.hasAttribute(t.props.targetAttribute)?e:e.closest("[".concat(t.props.targetAttribute,"]")),o=n?n.getAttribute(t.props.targetAttribute):null
t.props.observing!==o&&(t.delayUpdatePosition.cancel(),t.delayUpdatePositionSoft.cancel(),t.props.updateTarget(o))},125)),d(u(t),"onScroll",function(){return t.updatePosition(!0)}),d(u(t),"onMouseMove",function(e){return t.throttleUpdate(e.target)}),d(u(t),"onMouseLeave",function(e){return t.throttleUpdate(e.toElement||e.relatedTarget)}),d(u(t),"onMouseDown",function(e){1!==e.which&&0!==e.button||(window.document.body.addEventListener("mouseup",t.onMouseUp),window.document.body.addEventListener("mousemove",t.onMouseMoveAfterClick))}),d(u(t),"onMouseUp",function(e){if((1===e.which||0===e.button)&&!(e.target.hasAttribute("data-cs-preview-ui")?e.target:e.target.closest("[data-cs-preview-ui]"))){var n=e.target.hasAttribute(t.props.targetAttribute)?e.target:e.target.closest("[".concat(t.props.targetAttribute,"]")),o=n&&n.getAttribute("data-cs-observeable-id")
o&&t.props.onClick(o)}}),d(u(t),"onMouseMoveAfterClick",function(e){window.document.body.removeEventListener("mouseup",t.onMouseUp),window.document.body.removeEventListener("mousemove",t.onMouseMoveAfterClick)}),t}var h,g,v
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(m,t.default.Component),h=m,(g=[{key:"componentDidMount",value:function(){var e=this
window.addEventListener("scroll",this.onScroll),window.document.body.addEventListener("mousemove",this.onMouseMove,!0),window.document.body.addEventListener("mouseenter",this.onMouseMove,!0),window.document.body.addEventListener("mouseleave",this.onMouseLeave,!0),this.autoResizeInterval=setInterval(function(){return e.delayUpdatePositionSoft()},650),this.setInitialBorderWidth(),this.updatePosition(),window.document.body.addEventListener("mouseup",this.onMouseUp)}},{key:"componentDidUpdate",value:function(e){this.props.observing!==e.observing&&(this.props.observing?this.updatePosition():this.delayUpdatePosition())}},{key:"componentWillUnmount",value:function(){clearInterval(this.autoResizeInterval),this.delayUpdatePosition.cancel(),this.delayUpdatePositionSoft.cancel(),this.throttleUpdate.cancel(),window.document.body.removeEventListener("mousemove",this.onMouseMove,!0),window.document.body.removeEventListener("mouseenter",this.onMouseMove,!0),window.document.body.removeEventListener("mouseleave",this.onMouseLeave,!0),window.removeEventListener("scroll",this.onScroll),window.document.body.removeEventListener("mouseup",this.onMouseUp),window.document.body.removeEventListener("mousedown",this.onMouseDown),window.document.body.removeEventListener("mousemove",this.onMouseMoveAfterClick)}},{key:"setInitialBorderWidth",value:function(){this.borderWidth=2}},{key:"updatePosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]
this.delayUpdatePositionSoft.cancel()
var t=this.state.meta
if((!this.targetEl||!e)&&(this.targetEl=document.querySelector("[".concat(this.props.targetAttribute,'="').concat(this.props.observing,'"]')),this.targetEl&&this.targetEl.hasAttribute(this.props.metaAttribute)))try{t=JSON.parse(this.targetEl.getAttribute(this.props.metaAttribute))}catch(y){console.warn(y)}if(e||this.delayUpdatePosition.cancel(),this.targetEl){var n=this.targetEl.getBoundingClientRect(),o=n.top,r=n.right,a=n.bottom,s=n.left,l=window,c=l.innerWidth,u=l.innerHeight,p=c-(0,i.scrollBarOffset)(),d=u,m=[]
o-22>=0&&m.push("top"),r>p&&m.push("right"),a+22<d&&m.push("bottom"),s>=0&&m.push("left")
var h=m.includes("top")?"top":"bottom"
m.includes("top")||m.includes("bottom")||(h="top-inside")
var g="".concat(h," ").concat(m.includes("left")?"left":"right"),v=t.insetOutline?0:this.borderWidth,b={top:Math.max(0,o-v),left:Math.max(0,s-v),right:r>=p?0:p-(r+v),bottom:a>=d?0:d-(a+v)}
this.state.style.top===b.top&&this.state.style.left===b.left&&this.state.style.right===b.right&&this.state.style.bottom===b.bottom&&this.state.style.edgeClass===g&&this.state.meta.label===t.label&&this.state.meta.mode===t.mode||this.setState({style:b,edgeClass:g,active:!0,meta:t})}else this.state.active&&this.setState(f)}},{key:"renderLabel",value:function(){var e=this.props.renderLabel?this.props.renderLabel(this.state.meta):t.default.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.meta.label}})
return e&&t.default.createElement("div",{className:"cs-observer-label"},e)}},{key:"render",value:function(){return this.props.hide?null:n.default.createPortal(t.default.createElement("div",{className:(0,o.default)("cs-observer",this.state.edgeClass,this.state.meta.mode||""),style:this.state.style},this.renderLabel(),this.props.children),window.document.body)}}])&&l(h.prototype,g),v&&l(h,v),m}()
e.default=m,d(m,"defaultProps",{targetAttribute:"data-cs-observeable-id",metaAttribute:"data-cs-observeable",observing:null,renderLabel:null,updateTarget:function(){}})}),define("tco-app/src/components/preview/PreviewKeys",["exports","react","react-redux","tco-app/src/lib/keybindings","tco-app/src/actions/ui"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u={uiRemoteKeybinding:r.uiRemoteKeybinding},p=function(e){function n(){var e,t,o,r,i,c,u;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n)
for(var p=arguments.length,d=new Array(p),f=0;f<p;f++)d[f]=arguments[f]
return o=this,t=!(r=(e=s(n)).call.apply(e,[this].concat(d)))||"object"!==a(r)&&"function"!=typeof r?l(o):r,i=l(t),u=function(){},(c="onEsc")in i?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u,t}var r,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.Component),r=n,(u=[{key:"componentDidMount",value:function(){var e=this,t={esc:this.onEsc,save:function(){}}
this.unbindKeys=(0,o.default)(["delete","quick-delete","copy","paste","paste-style"].reduce(function(t,n){return t[n]=(0,o.makeSafeHandler)(function(){return e.props.uiRemoteKeybinding(n)}),t},t))}},{key:"componentWillUnmount",value:function(){this.unbindKeys&&this.unbindKeys()}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}])&&i(r.prototype,u),p&&i(r,p),n}(),d=(0,n.connect)(function(){return{}},u)(p)
e.default=d}),define("tco-app/src/components/preview/PreviewUi",["exports","react","react-redux"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),a(this,i(n).apply(this,arguments))}var o,l,c
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,t.default.Component),o=n,(l=[{key:"componentDidMount",value:function(){this.updatePreviewCursor(),this.updateHideWorkspace(),this.updateUiTheme()}},{key:"componentDidUpdate",value:function(e){this.props.previewCursor!==e.previewCursor&&this.updatePreviewCursor(),this.props.hideWorkspace!==e.hideWorkspace&&this.updateHideWorkspace(),this.props.uiTheme!==e.uiTheme&&this.updateUiTheme()}},{key:"updatePreviewCursor",value:function(){document.body.style.cursor="auto"===this.props.previewCursor?"":this.props.previewCursor,document.body.classList.toggle("cs-force-cursor","auto"!==this.props.previewCursor)}},{key:"updateHideWorkspace",value:function(){document.body.classList.toggle("cs-editor-inactive",this.props.hideWorkspace)}},{key:"updateUiTheme",value:function(){document.documentElement.classList.remove("cs-ui-theme-light"),document.documentElement.classList.remove("cs-ui-theme-dark"),document.documentElement.classList.add("cs-ui-theme-".concat(this.props.uiTheme))}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}])&&r(o.prototype,l),c&&r(o,c),n}(),u=(0,n.connect)(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){l(e,t,n[t])})}return e}({},e.ui,{uiTheme:e.builder.preferences.uiTheme})})(c)
e.default=u}),define("tco-app/src/components/preview/RegionOutput",["exports","react","react-dom","react-redux","tco-app/src/components/preview-elements/ElementBaseChildren","tco-app/src/selectors/elements"],function(e,t,n,o,r,a){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p,d=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),l(this,c(o).apply(this,arguments))}var a,i,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.default.PureComponent),a=o,(i=[{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.props.regionsWithIds.map(function(e){var o=e.id,a=e.zone
return t.default.createElement(t.default.Fragment,{key:o},n.default.createPortal(t.default.createElement(r.default,{elID:o}),a))}))}}])&&s(a.prototype,i),p&&s(a,p),o}(),f=(0,o.connect)((p=(0,a.makeGetRegionElementId)(),function(e,t){return{regionsWithIds:t.regions.map(function(t){return Object.assign({id:p(e,t.name)},t)})}}))(d)
e.default=f}),define("tco-app/src/components/preview/StyleManager",["exports","react","react-redux"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}function s(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var p=function(e){function n(){return r(this,n),s(this,l(n).apply(this,arguments))}return c(n,t.default.PureComponent),i(n,[{key:"componentDidMount",value:function(){this.updateCSS()}},{key:"componentDidUpdate",value:function(){this.updateCSS()}},{key:"componentWillUnmount",value:function(){this.removeExisting()}},{key:"removeExisting",value:function(){var e=document.getElementById("el-css-".concat(this.props.id))
e&&e.remove()}},{key:"updateCSS",value:function(){var e=window.cornerstoneApp.lookup("service:preview")
this.removeExisting()
var t=document.createElement("style")
t.setAttribute("id","el-css-".concat(this.props.id)),t.innerHTML=this.props.css
var n,o,r=document.querySelector(e.get("initialRouteConfig.dynamic_css_selector")||"style#x-generated-css")
r?(n=t,(o=r).nextSibling?o.parentNode.insertBefore(n,o.nextSibling):o.parentNode.append(n)):document.head.append(t),e.triggerResize()}},{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null)}}]),n}(),d=(0,n.connect)(function(e,t){var n=t.id
return{css:e.render.elements[n]?e.render.elements[n]._dynamic_css:""}})(p),f=function(e){function n(){return r(this,n),s(this,l(n).apply(this,arguments))}return c(n,t.default.PureComponent),i(n,[{key:"render",value:function(){return t.default.createElement(t.default.Fragment,null,this.props.ids.map(function(e){return t.default.createElement(d,{key:e,id:e})}))}}]),n}(),m=(0,n.connect)(function(e){return{ids:Object.keys(e.elements)}})(f)
e.default=m}),define("tco-app/src/components/routes/HomeRoute",["exports","react","tco-app/src/components/interface/Window","tco-app/src/components/interface/Canvas","tco-app/src/components/common/WelcomeMessage","tco-app/src/components/global/Launchpad","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var d=function(e){function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),c(this,u(s).apply(this,arguments))}var d,f,m
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(s,t.default.Component),d=s,(f=[{key:"render",value:function(){return t.default.createElement(n.default,{screen:"index"},t.default.createElement(o.default,null,t.default.createElement(r.default,{title:(0,i.t)("app.welcome-app")},t.default.createElement(a.default,null))))}}])&&l(d.prototype,f),m&&l(d,m),s}()
e.default=d}),define("tco-app/src/components/workspace/NavigationBar",["exports","react","react-redux","tco-app/src/components/inspector/InspectorNavigation","tco-app/src/components/inspector/InspectorBreadcrumbs"],function(e,t,n,o,r){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var a,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,t.default.PureComponent),a=n,(u=[{key:"render",value:function(){return this.props.active?t.default.createElement("div",{className:"cs-navigation-bar"},t.default.createElement(o.default,null),t.default.createElement(r.default,null)):null}}])&&i(a.prototype,u),p&&i(a,p),n}(),p=(0,n.connect)(function(e){return{active:"inline"!==e.builder.preferences.controlNav}})(u)
e.default=p}),define("tco-app/src/components/workspace/WorkspaceActionOverlay",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){return t.default.createElement("div",{className:(0,n.default)("cs-workspace-action-overlay",{"cs-active":this.props.active})},t.default.createElement("button",{onClick:this.props.onClose,className:"cs-workspace-actions-overlay-close"},"×"),this.props.children)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={active:!1,onClose:function(){}},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/workspace/WorkspaceActions",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){return t.default.createElement("div",{className:(0,n.default)("cs-workspace-actions",{"cs-active":this.props.active})},this.props.items.map(function(e){return t.default.createElement("a",{key:e.label,className:(0,n.default)("cs-workspace-action-item",e.class),onClick:function(t){t.stopPropagation(),e.onClick&&e.onClick()},onMouseEnter:function(){e.onMouseEnter&&e.onMouseEnter()}},e.content,e.quickConfirmLabel&&t.default.createElement("span",{className:"quick-confirm-label",dangerouslySetInnerHTML:{__html:e.quickConfirmLabel||""}}),t.default.createElement("span",{dangerouslySetInnerHTML:{__html:e.label||""}}))}),this.props.hasToggle&&t.default.createElement("button",{className:"cs-workspace-actions-toggle",onClick:this.props.onClickToggle},t.default.createElement("span",null,"▼")),this.props.children)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={hasToggle:!1,items:[],onClickToggle:function(){},active:!1},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/workspace/WorkspaceButton",["exports","react","classnames","tco-app/src/components/common/Icon"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c,u,p,d=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default.PureComponent),c=r,(u=[{key:"render",value:function(){var e=this.props,r=e.before,a=e.onClick,i=e.icon,s=e.label,l=e.buttonRef,c=e.after
return t.default.createElement("button",{ref:l,className:(0,n.default)("cs-workspace-full-button"),onClick:a},r,i&&t.default.createElement(o.default,{icon:i}),s&&t.default.createElement("span",{dangerouslySetInnerHTML:{__html:s}}),c,this.props.children)}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=d,p={small:!1,icon:"",label:"",before:null,after:null,buttonRef:null,onClick:function(){}},(u="defaultProps")in(c=d)?Object.defineProperty(c,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[u]=p}),define("tco-app/src/components/workspace/WorkspaceMessage",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l,c,u,p=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){var e=this.props,o=e.small,r=e.before,a=e.title,i=e.message,s=e.after
return t.default.createElement("div",{className:(0,n.default)("cs-workspace-message",{small:o})},r,a&&t.default.createElement("h3",{dangerouslySetInnerHTML:{__html:a}}),i&&t.default.createElement("p",{dangerouslySetInnerHTML:{__html:i}}),s,this.props.children)}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=p,u={small:!1,title:"",message:"",before:null,after:null},(c="defaultProps")in(l=p)?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u}),define("tco-app/src/components/workspace/WorkspaceNav",["exports","react","classnames"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default.PureComponent),l=o,(c=[{key:"render",value:function(){return t.default.createElement("nav",{className:"cs-workspace-nav"},t.default.createElement("ul",null,this.props.items.map(function(e){return t.default.createElement("li",{key:e.id},t.default.createElement("a",{href:e.href,onClick:e.onClick,className:(0,n.default)(e.class,{"cs-active":e.active})},e.label))})))}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/control-transforms/atts",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="group",e.controls=[],e.keys.id&&e.controls.push({key:e.keys.id,type:"text",label:(0,t.t)("app.controls.id"),options:{monospace:!0}})
e.keys.class&&e.controls.push({key:e.keys.class,type:"text",label:(0,t.t)("app.controls.class"),options:{monospace:!0}})
e.keys.style&&e.controls.push({key:e.keys.style,type:"textarea",label:(0,t.t)("app.controls.inline-css"),options:{height:5-e.controls.length,monospace:!0}})}}),define("tco-app/src/control-transforms/audio",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="group",e.controls=[],e.keys.url&&e.controls.push({key:e.keys.url,type:"text",label:(0,t.t)("app.controls.media.audio-url"),options:{placeholder:"http://example.com/a.mp3"}})
e.keys.preload&&e.controls.push({key:e.keys.preload,type:"select",label:(0,t.t)("app.controls.media.preload-content"),options:{choices:[{value:"none",label:(0,t.t)("app.controls.media.none")},{value:"auto",label:(0,t.t)("app.controls.media.auto")},{value:"metadata",label:(0,t.t)("app.controls.media.metadata")}]}})
var n=["advanced","loop","autoplay"]
if(Object.keys(e.keys).find(function(e){return n.includes(e)})){var o=[]
e.keys.advanced&&o.push({key:"advanced",label:(0,t.t)("app.controls.media.advanced")}),e.keys.loop&&o.push({key:"loop",label:(0,t.t)("app.controls.media.loop")}),e.keys.autoplay&&o.push({key:"autoplay",label:(0,t.t)("app.controls.media.autoplay")})
var r={}
for(var a in e.keys)n.includes(a)&&(r[a]=e.keys[a])
e.controls.push({keys:r,type:"checkbox-list",label:(0,t.t)("app.controls.media.display-function"),options:{list:o}})}delete e.keys}}),define("tco-app/src/control-transforms/border-radius",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="dimensions",e.options.labels||(e.options.labels={top:(0,t.t)("app.controls.box.top-left"),right:(0,t.t)("app.controls.box.top-right"),bottom:(0,t.t)("app.controls.box.bttm-right"),left:(0,t.t)("app.controls.box.bttm-left")})
var n={valid_keywords:["inherit","calc"],ranges:{em:{max:10},rem:{max:10}}}
e.default_options={top:n,right:n,bottom:n,left:n}}}),define("tco-app/src/control-transforms/bp-hide",["exports","tco-app/src/lib/i18n","tco-app/src/components/common/Icon"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="multi-choose",e.label||(e.label=(0,t.t)("app.controls.hide-bp"))
e.options={off_value:"none",choices:[{value:"xl",tooltip:(0,t.t)("app.breakpoints.size.xl"),children:React.createElement(n.default,{icon:"preview-sizer-xl"})},{value:"lg",tooltip:(0,t.t)("app.breakpoints.size.lg"),children:React.createElement(n.default,{icon:"preview-sizer-lg"})},{value:"md",tooltip:(0,t.t)("app.breakpoints.size.md"),children:React.createElement(n.default,{icon:"preview-sizer-md"})},{value:"sm",tooltip:(0,t.t)("app.breakpoints.size.sm"),children:React.createElement(n.default,{icon:"preview-sizer-sm"})},{value:"xs",tooltip:(0,t.t)("app.breakpoints.size.xs"),children:React.createElement(n.default,{icon:"preview-sizer-xs"})}]}}}),define("tco-app/src/control-transforms/choose",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose-single"}}),define("tco-app/src/control-transforms/font-style",["exports","react","tco-app/src/lib/i18n"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose",e.label=(0,n.t)("app.controls.font-style"),e.options={choices:[{value:"normal",label:(0,n.t)("app.controls.font-style.normal")},{value:"italic",children:t.default.createElement("i",null,(0,n.t)("app.controls.font-style.italic"))}]}}}),define("tco-app/src/control-transforms/index",["exports","tco-app/src/lib/i18n","tco-app/src/util/conditionals","tco-app/src/control-transforms/atts","tco-app/src/control-transforms/audio","tco-app/src/control-transforms/border-radius","tco-app/src/control-transforms/bp-hide","tco-app/src/control-transforms/choose","tco-app/src/control-transforms/font-style","tco-app/src/control-transforms/info","tco-app/src/control-transforms/margin","tco-app/src/control-transforms/menu","tco-app/src/control-transforms/multi-choose","tco-app/src/control-transforms/omega","tco-app/src/control-transforms/padding","tco-app/src/control-transforms/post-picker","tco-app/src/control-transforms/sidebar","tco-app/src/control-transforms/single-choose","tco-app/src/control-transforms/slider","tco-app/src/control-transforms/text-align","tco-app/src/control-transforms/text-decoration","tco-app/src/control-transforms/text-format","tco-app/src/control-transforms/text-transform"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f,m,h,g,v,b,y,_,w,E){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var O={atts:o.default,audio:r.default,"border-radius":a.default,"bp-hide":i.default,choose:s.default,"font-style":l.default,info:c.default,margin:u.default,menu:p.default,"multi-choose":d.default,omega:f.default,padding:m.default,"post-picker":h.default,sidebar:g.default,"single-choose":v.default,slider:b.default,"text-align":y.default,"text-decoration":_.default,"text-format":w.default,"text-transform":E.default,"classic:_columns":function(e){e.type="_columns"},"classic:choose":function(e){e.type="choose-single",e.options&&(e.options.choices&&(e.options.choices=e.options.choices.map(function(e){return e.title&&!e.label&&(e.label=e.title),e.icon&&(e.icon=window.cornerstoneApp.lookup("service:font-awesome").unicodeToName(e.icon)),e})),(0,n.isNone)(e.options.offValue)||(e.options.off_value=e.options.offValue))},"classic:color":function(e){e.type="color",e.options||(e.options={}),!0!==e.options.palette&&(e.options.palette=!1)},"classic:editor":function(e){e.type="text-editor",e.options||(e.options={}),e.options.height=5},"classic:sortable":function(e){e.type="sortable"
var t={}
e.options&&(e.options.element&&(t.element="classic:".concat(e.options.element)),e.options.floor&&(t.floor=e.options.floor),e.options.capacity&&(t.capacity=e.options.capacity),e.options.newTitle&&(t.title_format=e.options.newTitle),e.options.add_label&&(t.add_label=e.options.add_label)),e.options=t},"classic:title":function(e){e.type="text",e.label||(e.label=(0,t.t)("app.controls.classic.title"))},"classic:bp-hide":i.default,"classic:multi-choose":function(e){e.type="choose-multi"},"classic:dimensions":function(e){e.type="classic-dimensions"},"classic:icon-choose":function(e){e.type="icon"},"classic:image":function(e){e.type="image-source"},"classic:number":function(e){e.type="number"},"classic:select":function(e){e.type="select"},"classic:text":function(e){e.type="text"},"classic:textarea":function(e){e.type="textarea"},"classic:toggle":function(e){e.type="toggle"}}
e.default=O}),define("tco-app/src/control-transforms/info",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="group",e.controls=[],e.keys.type&&e.controls.push({key:e.keys.type,type:"choose",label:(0,t.t)("app.controls.info.type"),options:{choices:[{value:"tooltip",label:(0,t.t)("app.controls.info.normal")},{value:"popover",label:(0,t.t)("app.controls.info.popover")}]}})
e.keys.placement&&e.controls.push({key:e.keys.placement,type:"choose",label:(0,t.t)("app.controls.info.placement"),options:{choices:[{value:"top",icon:"arrow-up",tooltip:(0,t.t)("app.controls.box.top")},{value:"right",icon:"arrow-right",tooltip:(0,t.t)("app.controls.box.right")},{value:"bottom",icon:"arrow-down",tooltip:(0,t.t)("app.controls.box.bottom")},{value:"left",icon:"arrow-left",tooltip:(0,t.t)("app.controls.box.left")}]}})
e.keys.trigger&&e.controls.push({key:e.keys.trigger,type:"select",label:(0,t.t)("app.controls.info.trigger"),options:{choices:[{value:"hover",label:(0,t.t)("app.controls.info.hover")},{value:"focus",label:(0,t.t)("app.controls.info.focus")},{value:"click",label:(0,t.t)("app.controls.info.click")}]}})
e.keys.title&&e.controls.push({key:e.keys.title,type:"text",label:(0,t.t)("app.controls.info.title"),options:{placeholder:e.options.title_placeholder&&""!==e.options.title_placeholder?e.options.title_placeholder:""}})
e.keys.content&&e.controls.push({key:e.keys.content,type:"text",label:(0,t.t)("app.controls.info.content"),options:{placeholder:e.options.content_placeholder&&""!==e.options.title_placeholder?e.options.content_placeholder:""},condition:{key:e.keys.type,value:"popover"}})}}),define("tco-app/src/control-transforms/margin",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="dimensions",e.options.labels||(e.options.labels={bottom:(0,t.t)("app.controls.box.bttm")})
var n={available_units:["px","em","rem","%","vw","vh"],valid_keywords:["auto","calc"],ranges:{px:{min:-50,max:50},em:{min:-2.5},rem:{min:-2.5},"%":{min:-50,max:50},vw:{min:1,max:100},vh:{min:1,max:100}}}
e.default_options={top:n,right:n,bottom:n,left:n}}})
define("tco-app/src/control-transforms/menu",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="select",e.options={choices:"dynamic:menus"}}}),define("tco-app/src/control-transforms/multi-choose",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose-multi"}}),define("tco-app/src/control-transforms/omega",["exports","react","tco-app/src/lib/i18n"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="group",e.label||(e.label=(0,n.t)("app.controls.setup"))
e.controls=[],e.keys.toggle_hash&&e.controls.push({key:e.keys.toggle_hash,type:"text",label:(0,n.t)("app.controls.toggle-hash"),condition:e.options.toggle_hash_condition||null})
e.keys.id&&e.controls.push({key:e.keys.id,type:"text",label:(0,n.t)("app.controls.id"),options:{dynamic:!1}})
e.keys.class&&e.controls.push({key:e.keys.class,type:"text",label:(0,n.t)("app.controls.class"),options:{dynamic:!1}})
e.keys.style&&e.controls.push({key:e.keys.style,type:"text",label:(0,n.t)("app.controls.inline-css"),options:{dynamic:!1}})
e.keys.css&&e.controls.push({key:e.keys.css,type:"code-editor",label:(0,n.t)("app.controls.element-css"),options:{button_label:(0,n.t)("app.controls.edit-css"),header_label:(0,n.t)("app.controls.element-css"),disable_input_preview:!0,placeholder:(0,n.t)("app.controls.element-css-placeholder")}})
e.keys.bp&&e.controls.push({key:e.keys.bp,type:"bp-hide"})}}),define("tco-app/src/control-transforms/padding",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="dimensions",e.options.labels||(e.options.labels={bottom:(0,t.t)("app.controls.box.bttm")})
var n={available_units:["px","em","rem","%","vw","vh"],valid_keywords:["calc"],ranges:{"%":{max:25},vw:{min:1,max:100},vh:{min:1,max:100}}}
e.default_options={top:n,right:n,bottom:n,left:n}}}),define("tco-app/src/control-transforms/post-picker",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="select"
var n="dynamic:post-picker:".concat(e.options.post_type),o=e.options.placeholder||(0,t.t)("app.select")
e.options={choices:n,placeholder:o}}}),define("tco-app/src/control-transforms/sidebar",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="select",e.options={choices:"dynamic:sidebars",placeholder:(0,t.t)("app.controls.sidebar.select")}}}),define("tco-app/src/control-transforms/single-choose",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose-single"}}),define("tco-app/src/control-transforms/slider",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="unit-slider"}}),define("tco-app/src/control-transforms/text-align",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose",e.label||(e.label=(0,t.t)("app.controls.text-align.label"))
e.options={off_value:"none",choices:[{value:"left",icon:"align-left",tooltip:(0,t.t)("app.controls.text-align.left")},{value:"center",icon:"align-center",tooltip:(0,t.t)("app.controls.text-align.center")},{value:"right",icon:"align-right",tooltip:(0,t.t)("app.controls.text-align.right")},{value:"justify",icon:"align-justify",tooltip:(0,t.t)("app.controls.text-align.justify")}]}}}),define("tco-app/src/control-transforms/text-decoration",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose",e.label=(0,t.t)("app.controls.text-decoration.label"),e.options={off_value:"none",choices:[{value:"underline",icon:"underline",tooltip:(0,t.t)("app.controls.text-decoration.underline")},{value:"line-through",icon:"strikethrough",tooltip:(0,t.t)("app.controls.text-decoration.line-through")}]}}}),define("tco-app/src/control-transforms/text-format",["exports","tco-app/src/lib/i18n"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="group",e.controls=[],e.keys.font_family&&(e.controls.push({label:(0,t.t)("app.controls.text-format.font-family"),key:e.keys.font_family,type:"font-family"}),e.keys.font_weight&&e.controls.push({label:(0,t.t)("app.controls.text-format.font-weight"),keys:{value:e.keys.font_weight,font_family:e.keys.font_family},type:"font-weight"}))
e.keys.font_size&&e.controls.push({label:(0,t.t)("app.controls.text-format.font-size"),key:e.keys.font_size,type:"unit-slider",options:Object.assign({available_units:["px","em","rem"],valid_keywords:["calc"],ranges:{px:{min:0,max:100,step:1},em:{min:0,max:5,step:.001},rem:{min:0,max:5,step:.001}}},e.options.font_size)})
e.keys.letter_spacing&&e.controls.push({label:(0,t.t)("app.controls.text-format.letter-spacing"),key:e.keys.letter_spacing,type:"unit-slider",options:Object.assign({available_units:["em","rem"],ranges:{em:{min:-.15,max:.5,step:.001},rem:{min:-.15,max:.5,step:.001}}},e.options.letter_spacing)})
e.keys.line_height&&e.controls.push({label:(0,t.t)("app.controls.text-format.line-height"),key:e.keys.line_height,type:"unit-slider",options:Object.assign({unit_mode:"unitless",min:1,max:2.5,step:.1},e.options.line_height)})
e.keys.font_style&&e.controls.push({key:e.keys.font_style,type:"font-style"})
e.keys.text_align&&e.controls.push({key:e.keys.text_align,type:"text-align"})
e.keys.text_decoration&&e.controls.push({key:e.keys.text_decoration,type:"text-decoration"})
e.keys.text_transform&&e.controls.push({key:e.keys.text_transform,type:"text-transform"})
if(e.keys.text_color){var n={value:e.keys.text_color},o={}
e.keys.alt_color&&(n.alt=e.keys.alt_color,o.label=(0,t.t)("app.controls.base"),o.alt_label=(0,t.t)("app.controls.hover")),e.options.color&&(o=Object.assign(o,e.options.color)),e.controls.push({keys:n,type:"color",label:(0,t.t)("app.controls.text.color"),options:o})}}}),define("tco-app/src/control-transforms/text-transform",["exports","react","tco-app/src/lib/i18n"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.type="choose",e.label=(0,n.t)("app.controls.text-transform.label"),e.options={off_value:"none",choices:[{value:"uppercase",children:t.default.createElement("span",{className:"tt"},"TT"),tooltip:(0,n.t)("app.controls.text-transform.uppercase")},{value:"capitalize",children:t.default.createElement("span",{className:"tt"},"Tt"),tooltip:(0,n.t)("app.controls.text-transform.capitalize")},{value:"lowercase",children:t.default.createElement("span",{className:"tt"},"tt"),tooltip:(0,n.t)("app.controls.text-transform.lowercase")}]}}}),define("tco-app/src/lib/coalescence/client",["exports","tco-app/src/lib/coalescence/common","tco-app/src/lib/coalescence/compiler","tco-app/src/lib/coalescence/evaluate"],function(e,t,n,o){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t,n){return(t||[]).reduce(function(e,t){return e.replace(new RegExp("%%\\"+"$".concat(t,"%%"),"g"),n[t])},e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var i=e.template,s=e.selectorPrefix,l=void 0===s?"":s,c=e.postProcessKeys,u=void 0===c?{}:c,p=e.postProcess,d=(0,n.default)(i)
return function(e,n){n||(n={})
var i=n.classPrefix?n.classPrefix:"e",s=function(e){for(var t in e)e.hasOwnProperty(t)&&u[t]&&e[t]&&(e[t]="%%post ".concat(u[t],"%%").concat(e[t],"%%/post%%"))
return e}(e)
s._el="".concat(i).concat(s._id)
var c=function(e,t){return!e.conditions||0===e.conditions.length||0===e.conditions.filter(function(e){var n=e.expression,r=e.negate,a=(0,o.default)(t,n)
return r?a:!a}).length},f=function(e){var t=e.dec,n=e._data
return{selector:a(t.selector,t.keys.selector,n),directive:t.directive?a(t.directive,t.keys.directive,n):"root",value:a(t.value,t.keys.value,n)}},m=d.reduce(function(e,t){if(!t.selector||!t.value)return e
if(t.loops)Object.keys(t.loops).forEach(function(n){var o=t.loops[n],a=o.index,i=o.iterated,l=o.source,u=(s[l]||"").split(" ")
u.forEach(function(n,o){var l,p=Object.assign({},s,(r(l={},i,n),r(l,a,"".concat(u.length,"n - ").concat(u.length-(o+1))),l))
c(t,p)&&e.push(f({dec:t,_data:p}))})})
else{var n=s
c(t,n)&&e.push(f({dec:t,_data:n}))}return e},[]),h={root:{}}
m.forEach(function(e){var t=e.value.indexOf(":")
t===e.value.lastIndexOf(":")&&t===e.value.length-1||(h[e.directive]||(h[e.directive]={}),h[e.directive][e.selector]||(h[e.directive][e.selector]=[]),h[e.directive][e.selector].push(e.value))})
var g=Object.keys(h).reduce(function(e,t){return"root"!==t&&(e+="".concat(t," {")),e+=Object.keys(h[t]).reduce(function(e,n){var o=h[t][n].reduce(function(e,t){return e+="".concat(t,";")},"")
return e+=" ".concat(l).concat(n," { ").concat(o," }")},""),"root"!==t&&(e+="".concat(t,"} ")),e},"")
if("function"==typeof p&&(g=p(g,s,i,n),n.customCssKey&&s[n.customCssKey]&&n.customCssPlaceholder)){var v=new RegExp((0,t.escapeRegExp)(n.customCssPlaceholder),"gi"),b=" ".concat(s[n.customCssKey].replace(v,".".concat(s._el)))
g+=b}return g}}}),define("tco-app/src/lib/coalescence/common",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.escapeRegExp=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},e.findKeys=function(e){var t,n=/%%\$(\w+)%%/g,o=[]
for(;t=n.exec(e);)o.includes(t[1])||o.push(t[1])
return o},e.exists=function(e){return null!=e},e.stringLike=function(e,t){e=e?String(e):"",t=t?String(t):""
var n=!1,o=!1
0===t.indexOf("%")&&(n=!0,t=t.substr(1))
t.length-1===t.indexOf("%")&&(o=!0,t=t.substr(0,t.length-1))
if(n&&o)return-1!==e.indexOf(t)
if(o)return 0===e.indexOf(t)
if(n)return e.length-t.length===e.indexOf(t)
return e===t},e.stripUnit=function(e){return e},e.encode=function(e){for(var t=unescape(encodeURIComponent(e)),n="",o=0;o<t.length;o++)n+=t.charCodeAt(o).toString(16)
return n}}),define("tco-app/src/lib/coalescence/compiler",["exports","tco-app/src/lib/coalescence/declaration","tco-app/src/lib/coalescence/directive"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var o=new n.default,r=0,a=e.trim().replace(new RegExp(/(\/\*(?:.|[\r\n])*?\*\/)/,"g"),"").replace(new RegExp(/\$(\w+)/,"g"),"%%&$1%%").replace(new RegExp(/\${(\w+)}/,"g"),"%%&$1%%").replace(new RegExp(/%%&/,"g"),"%%$").replace(new RegExp(/[\s\r\n]*([{}:;,])[\s\r\n]+/,"g"),"$1").replace(new RegExp(/[\s\r\n][\s\r\n]+(.*)/,"g"),"$1")
function i(e){var t=a.substr(r).match(e)
return!!(t&&t[0]&&t[1])&&(r+=t[0].length,t[1])}function s(){var e=i(/^([^{}]+?(?:\${\w+})*[^{}]*?);/)
if(e)o.add(new t.default(e))
else if(e=i(/^([^;{}]+?(?:\${\w+}.+?)*?){/))o=o.add(new n.default(e))
else{if(!(e=i(/^.*?(})/)))return!0
o=o.parent}}for(;!s(););return o.reduce().map(function(e){return e.serialize()})}}),define("tco-app/src/lib/coalescence/condition",["exports","tco-app/src/lib/coalescence/expression","tco-app/src/lib/coalescence/common"],function(e,t,n){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=function(){function e(o,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.content=r,this.negate="@unless"===o,this.keys=(0,n.findKeys)(r),this.expression=t.default.create(r)}var r,a,i
return r=e,(a=[{key:"getRaw",value:function(){return this.content}},{key:"serialize",value:function(){return{negate:this.negate,keys:this.keys,expression:this.expression.serialize()}}}])&&o(r.prototype,a),i&&o(r,i),e}()
e.default=r}),define("tco-app/src/lib/coalescence/declaration",["exports","tco-app/src/lib/coalescence/node","tco-app/src/lib/coalescence/common"],function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var l=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a(this,i(o).apply(this,arguments))}var l,c,u
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,t.default),l=o,(c=[{key:"setup",value:function(){this.keys={},this.conditions=[],this.loops={},(0,n.exists)(this.value)&&this.addKeysFromString(this.value)}},{key:"addKeysFromString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value"
this.addKeys((0,n.findKeys)(e),t)}},{key:"addKeys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value"
0!==e.length&&(this.keys[n]||(this.keys[n]=[]),e.forEach(function(e){t.keys[n].includes(e)||t.keys[n].push(e)}))}},{key:"addLoop",value:function(e){this.loops[e.getId()]=e,this.updateScope(e.createScope()),this.addKeys([e.getSource()],"loop")}},{key:"addCondition",value:function(e){this.conditions.push(e),this.addKeysFromString(e.getRaw(),"condition")}},{key:"setDirective",value:function(e){this.directive=e,this.addKeysFromString(e)}},{key:"updateSelector",value:function(e){this.selector=e,this.addKeysFromString(e,"selector")}},{key:"serialize",value:function(){var e=this,t={selector:this.selector,value:this.value,scope:this.scope},n=Object.keys(this.loops)
return n.length>0&&(t.loops=n.reduce(function(t,n){return t[n]=e.loops[n].serialize(),t},{})),Object.keys(this.keys).length>0&&(t.keys=this.keys),this.conditions.length>0&&(t.conditions=this.conditions.map(function(e){return e.serialize()})),this.directive&&(t.directive=this.directive),t}}])&&r(l.prototype,c),u&&r(l,u),o}()
e.default=l}),define("tco-app/src/lib/coalescence/directive",["exports","tco-app/src/lib/coalescence/node","tco-app/src/lib/coalescence/condition","tco-app/src/lib/coalescence/loop"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var c=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),i(this,s(r).apply(this,arguments))}var c,u,p
return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function")
e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t.default),c=r,(u=[{key:"setup",value:function(){this.operation=this.detectOperation()}},{key:"detectOperation",value:function(){if("string"!=typeof this.value)return null
var e=this.value.match(/(@each-nth-child) (.*)/)
return e?{method:"addLoop",args:[new o.default(e[1],e[2])]}:(e=this.value.match(/(@if|@unless) (.*)/))?{method:"addCondition",args:[new n.default(e[1],e[2])]}:(e=this.value.match(/@media/))?{method:"setDirective",args:[this.value]}:{method:"updateSelector",args:[this.value]}}},{key:"reduce",value:function(){var e=this,t=[]
return this.nodes.forEach(function(e){e instanceof r?t=t.concat(e.reduce()):t.push(e)}),this.operation&&t.forEach(function(t){return t[e.operation.method].apply(t,e.operation.args)}),this.nodes=null,t}}])&&a(c.prototype,u),p&&a(c,p),r}()
e.default=c}),define("tco-app/src/lib/coalescence/evaluate",["exports","tco-app/src/lib/coalescence/common"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,o){function r(o){var r=o.a,i=o.b,s=o.op
return r=a(r,s),i=a(i,s),"exists"===s?(0,t.exists)(e[r]):(s=n[s]?n[s]:n.nop)(r,i)}function a(n,o){if(n&&(n.a||n.b)&&n.op&&(n=r(n)),n&&"variable"===n.type){if("exists"===o)return n.value
n=!!(0,t.exists)(e[n.value])&&e[n.value]}return n}return r(o)}
var n={eq:function(e,t){return e==t},not_eq:function(e,t){return e!=t},strict_eq:function(e,t){return e===t},not_strict_eq:function(e,t){return e!==t},gt:function(e,n){return(0,t.stripUnit)(e)>(0,t.stripUnit)(n)},lt:function(e,n){return(0,t.stripUnit)(e)<(0,t.stripUnit)(n)},gte:function(e,n){return(0,t.stripUnit)(e)>=(0,t.stripUnit)(n)},lte:function(e,n){return(0,t.stripUnit)(e)<=(0,t.stripUnit)(n)},or:function(e,t){return e||t},and:function(e,t){return e&&t},concat:function(e,t){return"".concat(e).concat(t)},nop:function(e){return e},like:t.stringLike,empty:function(e){return""===(e=e?String(e):"")||0===e.trim().split(" ").filter(function(e){return!e.match(/^0[a-zA-Z%]+|0$|none$/)}).length}}}),define("tco-app/src/lib/coalescence/expression",["exports","tco-app/src/lib/coalescence/common","spark-md5"],function(e,t,n){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){var n=function(e){return e.replace(new RegExp(/(%%\$\w+%%)\?\?/,"g")," ( $1 %%o:empty%% null ) ").replace(new RegExp(/(%%\$\w+%%)\?/,"g")," ( $1 %%o:exists%% null ) ")}(" ".concat(e)),o={true:!0,false:!1,null:null};[{pattern:"s([d.]?d)+",replacement:" %%c:$1%%",prefix:"d"},{pattern:"'(.*?)'",replacement:"%%c:$1%%",prefix:"s"},{pattern:'"(.*?)"',replacement:"%%c:$1%%",prefix:"s"}].forEach(function(e){for(var r,a=e.pattern,i=e.replacement,s=e.prefix,l=new RegExp(a,"g");r=l.exec(n);){var c="".concat(s).concat((0,t.encode)(r[1]));(0,t.exists)(o[c])||(o[c]=r[1])
var u=n.indexOf(r[0])
r[0].length
n=n.substr(0,u)+i.replace("$1",c)+n.substr(u+r[0].length)}})
var r,a,i=[]
for(n=function(e){return[{pattern:"\\s(true)",replacement:" %%c:true%%"},{pattern:"\\s(false)",replacement:" %%c:false%%"},{pattern:"\\s(null)",replacement:" %%c:null%%"},{pattern:"\\s*%%(.+?)%%\\s*",replacement:" %%$1%% "},{pattern:"%%(\\s*)%%",replacement:"%% %%"},{pattern:"\\)(\\s*)%%",replacement:") %%"},{pattern:"%%(\\s*)\\(",replacement:"%% ("},{pattern:"\\s+",replacement:" "},{pattern:"%%s([^()%]*?)s%%",replacement:"%% %%"}].reduce(function(e,t){var n=t.pattern,o=t.replacement
return e.replace(new RegExp(n,"g"),o)},e)}(function(e){return[{op:" == ",token:" %%o:eq%% "},{op:" != ",token:" %%o:not_eq%% "},{op:" === ",token:" %%o:strict_eq%% "},{op:" !== ",token:" %%o:not_strict_eq%% "},{op:" > ",token:" %%o:gt%% "},{op:" < ",token:" %%o:lt%% "},{op:" >= ",token:" %%o:gte%% "},{op:" <= ",token:" %%o:lte%% "},{op:" LIKE ",token:" %%o:like%% "},{op:" . ",token:" %%o:concat%% "},{op:" || ",token:" %%l:or%% "},{op:" && ",token:" %%l:and%% "}].reduce(function(e,n){var o=n.op,r=n.token
return e.replace(new RegExp((0,t.escapeRegExp)(o),"g"),r)},e)}(n));-1!==(r=n.lastIndexOf("("));)a=n.substr(r).indexOf(")")+1,i.push(n.substr(r+1,a-2).trim().replace(new RegExp("%%","g"),"").split(" ")),n="".concat(n.substr(0,r),"%%e:").concat(i.length-1,"%%").concat(n.substr(a+r))
var s=n.trim().replace(new RegExp("%%","g"),"").split(" ")
return{constants:o,tokens:s,expressions:i}}function a(e){for(var n=e.constants,o=e.tokens,r=e.expressions,s=new i;o.length>0;){var l=o.shift()
if(0!==l.indexOf("e:"))if(0!==l.indexOf("$"))if(0!==l.indexOf("c:"))if(0!==l.indexOf("o:")){if(0===l.indexOf("l:")){if(!s.has("a"))continue
s.has("b")||(s.setValue("b",!0),s.setValue("op","eq")),s.expand(),s.setValue("op",l.substr(2)),s.setValue("b",a({tokens:o,expressions:r,constants:n})),o=[]}}else s.has("b")&&s.expand(),s.has("a")&&s.setValue("op",l.substr(2))
else{var c=l.substr(2)
s.setValue(s.has("op")?"b":"a",(0,t.exists)(n[c])?n[c]:null)}else s.setValue(s.has("op")?"b":"a",{type:"variable",value:l.substr(1)})
else{var u=l.substr(2),p=(0,t.exists)(r[u])?a({tokens:r[u],expressions:r,constants:n}):null
s.setValue(s.has("op")?"b":"a",p)}}return s.has("a")||s.setValue("a",!1),s.has("op")||s.setValue("op","nop"),s.has("b")||s.setValue("b",null),s}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var i=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.data={}}var n,i,s
return n=e,s=[{key:"create",value:function(e){return a(r(e))}}],(i=[{key:"setValue",value:function(e,t){this.data[e]=t}},{key:"has",value:function(e){return(0,t.exists)(this.data[e])}},{key:"expand",value:function(){var t=new e
t.setValue("a",this.data.a),t.setValue("b",this.data.b),t.setValue("op",this.data.op),this.data={a:t,b:null,op:null}}},{key:"serialize",value:function(){return{a:this.data.a instanceof e?this.data.a.serialize():this.data.a,b:this.data.b instanceof e?this.data.b.serialize():this.data.b,op:this.data.op}}}])&&o(n.prototype,i),s&&o(n,s),e}()
e.default=i}),define("tco-app/src/lib/coalescence/loop",["exports","tco-app/src/lib/coalescence/expression","tco-app/src/lib/coalescence/common","uuid/v4"],function(e,t,n,o){function r(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=function(){function e(r,a){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=(0,o.default)(),a){var i=new RegExp(/^\%\%\$(\w+)\%\%(?:\s*?,\s*?\%\%\$(\w+)\%\%)?(?:\s+in\s+)(\%\%\$(\w+)\%\%)/)
this.keys=(0,n.findKeys)(a),this.expression=t.default.create(a)
var s=a.match(i)
this.iterated=s[1]||"",this.indexKey=s[2]||"",this.source=s[4]||""}}var a,i,s
return a=e,(i=[{key:"getId",value:function(){return this.id}},{key:"getSource",value:function(){return this.source}},{key:"createScope",value:function(){var e,t,n,o=(e={},t=this.iterated,n="loop:".concat(this.id),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)
return this.indexKey&&(o[this.indexKey]="loop:".concat(this.id)),o}},{key:"serialize",value:function(){return{iterated:this.iterated,index:this.indexKey,source:this.source}}}])&&r(a.prototype,i),s&&r(a,s),e}()
e.default=a}),define("tco-app/src/lib/coalescence/node",["exports"],function(e){function t(e,t){for(var n=0;n<t.length;n++){var o=t[n]
o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.value=t,this.nodes=[],this.scope={},this.setup()}var n,o,r
return n=e,(o=[{key:"setup",value:function(){}},{key:"add",value:function(e){return e.parent=this,e.scope=this.scope,this.nodes.push(e),e}},{key:"updateScope",value:function(e){this.scope=Object.assign({},this.scope,e)}}])&&t(n.prototype,o),r&&t(n,r),e}()
e.default=n}),define("tco-app/src/lib/html-to-react/index",["exports","react","react-dom","lodash","tco-app/src/util/base64","tco-app/src/lib/html-to-react/lib/parser"],function(e,t,n,o,r,a){function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeStyleKeys=c,e.styleStringToObject=u,e.default=function(e){try{var o=d(e,{topLevel:!0,transform:function(e){return e.props.ref="{%%{_ref}%%}",e.props["data-cs-observeable-id"]="{%%{_id}%%}",e.props["data-cs-observeable"]="{%%{observer}%%}",(e.props.className||"").includes("cs-element-preview-classic")||(e.props.className||(e.props.className="{%%{class}%%}"),e.props.style||(e.props.style="{%%{style}%%}")),!s.includes(e.name)&&e.children&&e.children.push("{%%{TOP_LEVEL_CHILDREN}%%}"),e},finalize:function(e){return e.replace(new RegExp(/props\['TOP_LEVEL_CHILDREN'\]/,"g"),-1===e.indexOf("props['children']")?"props['children']":null)}}),r={compiled:new Function("props","return ".concat(o)),createElement:function(){return t.default.createElement.apply(null,arguments)},createFragment:function(e){return t.default.createElement(t.default.Fragment,null,e)},processInlineStyle:function(e){return"string"==typeof e?u(e):c(e)},createPortal:function(e,t){try{var o=document.querySelector('[data-cs-zone="'.concat(t,'"]'))
return n.default.createPortal(e,o)}catch(r){console.warn("Unable to create portal",r)}return null}}
return t.default.forwardRef(function(e,t){return r.compiled(Object.assign({_ref:t},e))})}catch(a){console.warn("Template parse error",a,JSON.stringify({e:a,template:e}))}return null}
var s=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","menuitem"]
function l(e){return 0===e.indexOf("base64content")?function(e){var t=e.match(/base64content\s+?([\w\d\/+=]*)/)
if(!t||!t[1]&&""!==t[1])throw new Error({match:t,content:e})
return t[1]?d((0,r.base64Decode)(t[1].trim())):null}(e):0===e.indexOf("portal")?function(e){var t=e.match(/portal\s+?name=([\w\d+=]+)\s+?content=([\w\d\/+=]*)/)
if(!t||!t[1]||!t[2]&&""!==t[2])throw new Error({message:"Unable to identify portal content",match:t,content:e})
if(!t[2])return null
var n=d((0,r.base64Decode)(t[2]))
if(!n)throw new Error({message:"Unable to decode portal content",match:t,content:e})
return"this.createPortal(".concat(n,", '").concat(t[1],"')")}(e):function(e){var t=e.replace("data.","")
return"props['".concat(t,"']")}(e)}function c(e){return Object.keys(e||{}).reduce(function(t,n){var r=n.trim()
return t[/(^-moz)|(^-o-)|(^-webkit)/gi.test(r)?(0,o.upperFirst)((0,o.camelCase)(r)):(0,o.camelCase)(r)]=e[n],t},{})}function u(e){if("string"!=typeof e)return e
try{return c(e.split(/;(?!base64)/).reduce(function(e,t){var n=t.split(":")
n.length>2&&(n[1]=n.slice(1).join(":"))
var o=i(n,2),r=o[0],a=o[1]
return null!=r&&"string"==typeof a&&r.length>0&&a.length>0&&(e[r]=a.trim()),e},{}))}catch(t){console.warn("Unable to parse style string",{e:t,style:e})}return{}}function p(e,t){var n='{%%{([-&;\\w\\d\\s_/."+=]+)}%%}'
if("string"==typeof e){for(var r,a=new RegExp(n,"gi"),i=[],s=0;r=a.exec(e);){var c=e.substring(s,r.index)
c&&i.push(c),i.push(r[0]),s=a.lastIndex}var u=e.substring(s)
u&&i.push(u)
var d=JSON.stringify(i.length>0?i:[e]).replace(/"{%%{([-&;\\\w\d\s\\/."+=]+)}%%}"/gi,function(e,t){return l(t)})
return d.substring(1,d.length-1)}var f,m=function(e){return JSON.stringify(e).replace(/"?{%%{(.+?)}%%}"?/gi,function(e,t){var n=0===e.indexOf('"')?"":'" + ',o=e.lastIndexOf('"')===e.length-1?"":' + "'
return"".concat(n).concat(t).concat(o)})},h=(0,o.mapValues)(e.props,function(e){return"string"==typeof e?e.replace(new RegExp(n,"gi"),function(e,t){return"{%%{".concat(l(t),"}%%}")}):e}),g=h.style?"this.processInlineStyle(".concat(m(h.style),")"):"null"
h.style="{%%{STYLE_PLACEHOLDER}%%}",h.dangerouslySetInnerHTML&&(f=JSON.stringify(h.dangerouslySetInnerHTML),h.dangerouslySetInnerHTML="{%%{HTML_PLACEHOLDER}%%}")
var v=m(h).replace("STYLE_PLACEHOLDER",g).replace("HTML_PLACEHOLDER",f),b=e.children&&e.children.length>0?e.children.map(p).join(","):"null"
return'this.createElement("'.concat(e.name,'", ').concat(v,", ").concat(b,")")}function d(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.topLevel,r=void 0!==o&&o,i=n.transform,s=n.finalize
try{var l=document.createElement("div")
l.innerHTML=e,t=(0,a.default)("<div data-cs-template-wrapper>".concat(l.innerHTML,"</div>"))}catch(d){throw new Error("Unrecoverable HTML Syntax error",d)}if(t.children.length<=0)return null
if(!t)throw new Error("Parser returned non string value",{template:e,topLevel:r})
if(r){var c=t.children.findIndex(function(e){return e&&e.props});-1===c&&(t.children=[{name:"div",children:t.children,props:{}}],c=0),"function"==typeof i&&(t.children[c]=i(t.children[c]))}var u=t.children.length>1?"this.createFragment([".concat(t.children.map(p),"])"):p(t.children[0])
return"function"==typeof s?s(u):u}}),define("tco-app/src/lib/html-to-react/lib/parser",["exports","htmlparser2/lib/Parser","domhandler"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var r=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","menuitem"],a=[].concat(r,[[]]),i=[].concat(["accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","capture","cellPadding","cellSpacing","challenge","charSet","checked","cite","classID","className","colSpan","cols","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","encType","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","height","hidden","high","href","hrefLang","htmlFor","httpEquiv","icon","id","inputMode","integrity","is","keyParams","keyType","kind","label","lang","list","loop","low","manifest","marginHeight","marginWidth","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","nonce","open","optimum","pattern","placeholder","poster","preload","profile","radioGroup","readOnly","rel","required","reversed","role","rowSpan","rows","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","spellCheck","src","srcDoc","srcLang","srcSet","start","step","style","summary","tabIndex","target","title","type","useMap","value","width","wmode","wrap"],["autoCapitalize","autoCorrect","color","itemProp","itemScope","itemType","itemRef","itemID","security","unselectable","results","autoSave"],["accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baseProfile","baselineShift","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","ideographic","imageRendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","viewBox","viewTarget","visibility","widths","wordSpacing","writingMode","x","x1","x2","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlns","xmlnsXlink","xmlBase","xmlLang","xmlSpace","y","y1","y2","yChannelSelector","z","zoomAndPan"]).reduce(function(e,t){var n=t.toLowerCase()
return n!==t&&(e[n]=t),e},{})
function s(e,t,n,r){var a={key:t}
return e.attribs&&(a=Object.keys(e.attribs).reduce(function(t,n){var o=e.attribs[n],r=i[n.replace(/[-:]/,"")]||n
if("style"===r);else if("class"===r)r="className"
else if("for"===r)r="htmlFor"
else if("data-dangerously-set-inner-html"===r)return t.dangerouslySetInnerHTML={__html:o},t
return t[r]="string"==typeof o?o:r,t},a)),{name:e.name,props:a,children:[].concat(o(n||[]),o(r||[]))}}function l(e){return Object.keys(e).reduce(function(t,n){var o=Ember.String.htmlSafe(e[n]).string.replace(new RegExp("&","g"),"&amp;").replace(new RegExp('"',"g"),"&quot;").replace(new RegExp("'","g"),"&apos;").replace(new RegExp("'","g"),"&apos;").replace(new RegExp("<","g"),"&lt;").replace(new RegExp(">","g"),"&gt;")
return t+=e[n]?" ".concat(n,'="').concat(o,'"'):" ".concat(n)},"")}var c=function(){return!0}
var u='{%%{([\\w\\d\\s_/."+=]+)}%%}'
function p(e){return!e.pure||"text"===e.type||"comment"===e.type||"tag"===e.type&&r.includes(e.name)?e:(e.attribs["data-dangerously-set-inner-html"]=function e(t){return(t||[]).reduce(function(t,n){switch(n.type){case"text":n.data&&"string"==typeof n.data&&(t+=n.data)
break
case"comment":n.data&&"string"==typeof n.data&&(t+="\x3c!--".concat(n.data,"--\x3e"))
break
case"style":t+="<style".concat(l(n.attribs),">").concat(e(n.children),"</style>")
break
case"script":t+="<script".concat(l(n.attribs),">").concat(e(n.children),"<\/script>")
break
case"tag":a.includes(n.name)?t+="<".concat(n.name).concat(l(n.attribs),">"):t+="<".concat(n.name).concat(l(n.attribs),">").concat(e(n.children),"</").concat(n.name,">")}return t},"")}(e.children),e.children=[],e)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
return e.children&&e.children.length>0&&(e.children=e.children.map(function(e){return d(e)})),t?(e.children=e.children.map(p),e):function(e){if(e.parent&&"script"===e.parent.name||"script"===e.type)return e.pure=!0,e
if("text"===e.type||"comment"===e.type)return e.pure=!(e.data||"").match(new RegExp(u,"gi")),e
var t=0
return e.children&&e.children.length>0?(t=e.children.filter(function(e){return e.pure}).length,e.pure=t===e.children.length):e.pure=!0,e.pure=e.pure&&!(JSON.stringify(e.attribs)||"").match(new RegExp(u,"gi")),!e.pure&&t>0&&(e.children=e.children.map(p)),e}(e)}function f(e,t){return function(e,t,n){return!!c(e)&&("text"===e.type?e.data:"comment"!==e.type&&(r.includes(e.name)?s(e,n):s(e,n,e.data,t)))}(e,(e.children||[]).map(function(e,t){return f(e,t)}).filter(function(e){return!!e}),t)}var m=function(e,o){var r=new n.default
new t.default(r,Object.assign({},o||{},{decodeEntities:!0})).parseComplete(e)
var a=r.dom.filter(function(e){return!!e&&"directive"!==e.type}).map(function(e){return d(e,!0)}).map(f)
return a.length<=1?a[0]:a}
e.default=m}),define("tco-app/src/lib/http",["exports","lodash","tco-app/src/util/base64","tco-app/src/util/gzip"],function(e,t,n,o){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(e,"__esModule",{value:!0}),e.setupHttp=function(e){s=Object.assign(s,e)},e.remoteUpload=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"json"
return new window.Promise(function(o,r){var a=new XMLHttpRequest
a.open("POST",e,!0),a.responseType=n,a.onload=function(){if(a.status>=200&&a.status<300)try{o(a)}catch(e){r({error:"Failed to upload",e:e,xhr:a})}else r({error:"Failed to upload",xhr:a})},a.onerror=function(e){return r({error:"Failed to download file",xhrError:e})},a.send(t)})},e.downloadFile=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.responseType,o=void 0===n?"blob":n,r=t.cors,a=void 0!==r&&r,i=t.headers,s=void 0===i?{}:i
return new window.Promise(function(t,n){var r=new XMLHttpRequest
r.open("GET",e,!0),r.responseType=o,r.withCredentials=a,Object.keys(s).forEach(function(e){r.setRequestHeader(e,s[e])}),r.onload=function(){if(r.status>=200&&r.status<300)try{t(r)}catch(e){n({error:"Failed to download file",e:e,xhr:r})}else n({error:"Failed to download file",xhr:r})},r.onerror=function(e){return n({error:"Failed to download file",xhrError:e})},r.send()})},e.request=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
return new window.Promise(function(n,o){c["".concat(e,"::").concat(Object.keys(c).length)]={request:t,resolve:n,reject:o},p()})},e.requestOne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
return new window.Promise(function(o,r){var a=[{name:e,request:t}],i=u({resolve:o,reject:r}),s=i.attempt,l=i.fail
f({action:"controllers",request:{actions:a},resolve:function(e){return s(e[0])},reject:l,options:n})})}
var i=!1,s={nonce:"",nonce_key:"",legacy:!1,canGzip:!0},l=!1,c={}
var u=function(e){var t=e.resolve,n=e.reject,r=function(e){console.warn("Rejecting Controller promise",e),"function"==typeof n&&n(e.data||e)}
return{fail:r,attempt:function(e){var n=e.success,a=e.name,s=e.data,l=e.gzip
if(!n)return r(e)
var c=l?(0,o.uncompress)(s):s
i&&console.log("Resolving AJAX Job",a,c),"function"==typeof t&&t(c)}}},p=(0,t.debounce)(function(){var e=Object.keys(c).map(function(e){return{name:e,request:c[e].request||{}}}),t=Object.keys(c).reduce(function(e,t){return e[t]=u(c[t]),e},{})
c={},f({action:"controllers",request:{actions:e},resolve:function(e){return e.forEach(function(e){return t[e.name].attempt(e)})},reject:function(e){return Object.keys(t).forEach(function(n){return t[n].fail(e)})}})},15)
function d(e){var t=e.action,n=e.request,o=e.response,r=e.resolve,a=e.reject,s=e.options
if(o.debug&&function(e){e.extraneous&&console.warn("Cornerstone has recovered from extraneous output found in an AJAX response. Logging original response.",{original:e.extraneous})
if(e.php_errors){var t=Array.isArray(e.php_errors)?e.php_errors.reduce(function(e,t){return"".concat(e+t,"\n")},""):e.php_errors
console.warn("Cornerstone detected PHP Errors while generating an AJAX response. Logging errors...",t)}}(o.debug),!l&&o.failed_php_input)return l=!0,void f({action:t,request:n,resolve:r,reject:a,options:s})
var c=o.data||{}
o.success?(i&&console.log("AJAX Response",o,n),r(c)):(c.invalid_user&&window.wp&&window.wp.heartbeat&&window.wp.heartbeat.connectNow(),console.warn("Rejecting AJAX promise",c),a(c))}function f(e){var t=e.action,i=e.request,c=e.resolve,u=e.reject,p=e.options,m=function(e){if(s.legacy)return console.warn("Unhandled AJAX error. Expecting valid JSON from response.",e),u({unrecoverable:!0})
console.warn("Failed AJAX request. Switching to fallback.",e),s.legacy=!0,f({action:t,request:i,resolve:c,reject:u,options:p})}
window.fetch(window.csAppData[s.legacy?"fallbackAjaxUrl":"ajaxUrl"],function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=(a(r={},s.nonce_key,s.nonce),a(r,"action","cs_".concat(e)),r)
if(i.useFormData){var u=i.fileKey||"files",p=new FormData,d=0,f=function(e){if(!e[u])return e
var t=[]
return e[u].forEach(function(e){p.append("_".concat(u,"_").concat(d),e.value,e.filename)
var n={index:d++}
Object.keys(e).forEach(function(t){"value"!==t&&(n[t]=e[t])}),t.push(n)}),e[u]=t,e}
t&&Array.isArray(t.actions)&&(t.actions=t.actions.map(function(e){return e.request&&(e.request=f(e.request)),e}))
var m=JSON.stringify(f(t))
return c.request=(0,n.base64Encode)(m),Object.keys(c).forEach(function(e){return p.append(e,c[e])}),{method:"POST",body:p}}if(c.request=t||{},s.canGzip&&(c.gzip=!0,c.request=(0,o.compress)(t)),s.legacy||l){s.canGzip||(c.request=(0,n.base64Encode)(JSON.stringify(t)))
var h=new FormData
return Object.keys(c).forEach(function(e){return h.append(e,c[e])}),{method:"POST",body:h}}return{method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"application/json"}}}(t,i,p)).then(function(e){e.text().then(function(n){try{d({action:t,request:i,response:JSON.parse(n),resolve:c,reject:u,options:p})}catch(s){var o=n.match(/{"success":\w*?,"data.*/),a={}
try{if("object"!==r((a=JSON.parse(o[0])).data)||!0!==a.success&&!1!==a.success)throw"Failed to recover from malformed AJAX response:"
console.warn("Recovered from malformed AJAX response: ",e),d({action:t,request:i,response:a,resolve:c,reject:u,options:p})}catch(s){console.warn("Failed to recover from malformed AJAX response: ",{response:e,request:i}),m()}}}).catch(m)}).catch(m)}}),define("tco-app/src/lib/i18n",["exports"],function(e){function t(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.addStrings=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
Object.keys(e).forEach(function(t){return n[t]=e[t]})},e.t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
if(!n[e])return console.warn("Unable to locate i18n string",e,t),e
return Object.keys(t).reduce(function(e,n){return e.replace(new RegExp("{{".concat(n,"}}"),"g"),t[n])},n[e])},e.I18n=void 0
var n={}
e.I18n=function(e){var n=e.t
return n(n,t(e,["t"]))}}),define("tco-app/src/lib/keybindings",["exports","bowser","hotkeys-js"],function(e,t,n){function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){a(e,t,n[t])})}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.bindKey=f,e.default=function(e){var t=Object.keys(e).reduce(function(t,n){return"function"==typeof e[n]?t.push(f(n,{handler:e[n]})):t.push(f(n,e[n])),t},[])
return function(){return t.map(function(e){return e()})}},e.triggerBinding=m,e.setScope=function(e){return n.default.setScope(e)},e.getScope=function(){return n.default.getScope()},e.clearScope=function(){return n.default.deleteScope()},e.displayBinding=function(e){return(p[e]||{}).display||""},e.makeSafeHandler=function(e){return{handler:e,allowInputs:!1,allowIframe:!1}},e.registerKeyMap=void 0,n.default.filter=function(){return!0}
var s="macOS"===t.default.getParser(window.navigator.userAgent).getOSName(),l=s?"command":"ctrl",c=s?"option":"alt",u=function(e){return e.replace(new RegExp("shift","g"),"⇧").replace(new RegExp("command","g"),"⌘").replace(new RegExp("ctrl","g"),"⌃").replace(new RegExp("option","g"),"⌥").replace(new RegExp("alt","g"),"⎇").replace(new RegExp("return","g"),"↵︎").replace(new RegExp("delete","g"),"⌫").replace(new RegExp("del","g"),"⌫").replace(new RegExp("\\+","g")," ").toUpperCase()},p={},d={}
function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=p[e]||{},r=o.keys,a=o.keyup,i=void 0!==a&&a,s=o.keydown,l=void 0!==s&&s,c=t.handler,u=t.scope,f=void 0===u?"all":u,m=t.element,h=t.preventDefault,g=void 0===h||h,v=t.allowInputs,b=void 0===v||v,y=t.allowIframe,_=void 0===y||y
if("function"!=typeof c)return function(){}
var w={keyup:i,keydown:l,scope:f,element:m}
d[e]||(d[e]=[])
var E=function(){return c({synthentic:!0},{synthentic:!0})}
if(d[e].push(E),!r)return function(){}
var O=g&&!(i||l),x=function(e,t){if(!(l&&"keydown"!==e.type||i&&"keyup"!==e.type)){if(!b){var n=e.target||e.srcElement||{},o=n.isContentEditable,r=n.tagName
if(o||["INPUT","SELECT","TEXTAREA"].includes(r))return}(_||"IFRAME"!==document.activeElement.tagName)&&(O&&e.preventDefault(),c(e,t))}}
return(0,n.default)(r,w,x),function(){d[e]=d[e].filter(function(e){return e!==E}),n.default.unbind(r,f,x)}}function m(e){d[e]&&d[e].forEach(function(e){return e()})}e.registerKeyMap=function(e){Object.keys(e).forEach(function(t){var n=e[t].replace(new RegExp("mod","g"),l).replace(new RegExp("option","g"),c).replace(new RegExp("alt","g"),c).replace(new RegExp("cmd","g"),"command").replace(new RegExp("escape","g"),"esc").replace(new RegExp("control","g"),"ctrl").replace("keyup:","").replace("keydown:","")
p[t]={keys:n,display:u(n),keyup:0===e[t].indexOf("keyup:"),keydown:0===e[t].indexOf("keydown:")}})}
var h=12,g=function(e){return e.reduce(function(e,t){var n=t.type,o=t.key,r=t.meta
return e.up.includes(o)?e:("up"===n&&e.up.push(o),"down"!==n||e.down.includes(o)||(e.down.push(o),r.shiftKey||e.up.push("shift")),e)},{down:[],up:[]}).down},v=function(e){var t=null,n={metaKey:e.metaKey}
if(e.key)t=e.key.toLowerCase(),n.original=e.key
else{var o=(e.code||e.keyCode||e.which,null)
t=o.toLowerCase(),n.original=o}return t?{key:t,meta:n}:null},b=s?"meta":"control";(function(){var e=regeneratorRuntime.mark(c),t=[],n=[],a=function(e,t){n.includes(b)&&!e.includes(b)&&m("mod-keyup"),e.includes(b)&&!n.includes(b)&&m("mod-keydown"),n.includes("shift")&&!e.includes("shift")&&m("shift-keyup"),e.includes("shift")&&!n.includes("shift")&&m("shift-keydown")},l=function(){var e,o
o=g(t=[]),a(o,e),n=o}
function c(){var l
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,!0
case 2:l=regeneratorRuntime.mark(function e(){var l,c,u,p,d,f,m,b,y,_
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2)
case 2:if(l=e.sent,c=i(l,2),u=c[0],p=c[1],d=v(p),f=d.key,m=d.meta,f&&("down"!==u||!t[0]||"down"!==t[0].type||t[0].key!==f)){e.next=9
break}return e.abrupt("return","continue")
case 9:b=[{type:u,key:f,meta:m}],s&&"meta"===f&&"up"===u&&-1!==(y=t.findIndex(function(e){var t=e.type,n=e.key
return"down"===t&&"meta"===n}))&&t.slice(0,y).filter(function(e){var t=e.type,n=e.key
return"down"===t&&!["shift","control"].includes(n)}).forEach(function(e){b.unshift(r({},e,{type:"up"}))}),p.isSynthetic,t=[].concat(b,o(t)).slice(0,h),_=g(t),a(_,p),n=_
case 16:case"end":return e.stop()}},e)})
case 3:return e.delegateYield(l(),"t0",5)
case 5:if("continue"!==e.t0){e.next=8
break}return e.abrupt("continue",3)
case 8:e.next=3
break
case 10:case"end":return e.stop()}},e)}var u=c(),p=function e(){window.removeEventListener("focus",e,!1),l()},d=function(e){return u.next(["down",e])},f=function(e){return u.next(["up",e])}
document.addEventListener("keydown",d,!1),document.addEventListener("keyup",f,!1)
var y=function(e){document.activeElement instanceof HTMLIFrameElement||window.addEventListener("focus",p,!1)}
window.self===window.top&&window.addEventListener("blur",y,!1)})()}),define("tco-app/src/lib/notify",["exports","lodash"],function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.notify=r,e.notifySuccess=function(e,t){return r(e,Object.assign({type:"success"},t))},e.notifyError=function(e,t){return r(e,Object.assign({type:"success"},t))}
var o=(0,t.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")})
function r(e,t){var r="string"==typeof t?t:"notice",a="object"===n(t)?t:{}
o().notify(Object.assign({},{message:e,type:r},a))}}),define("tco-app/src/lib/permissions",["exports","lodash","tco-app/src/util/conditionals"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.currentUserCan=s,e.canUseBuilder=e.canUseFooters=e.canUseHeaders=e.allowedPostTypes=void 0
var o={}
Object.keys(window.csAppData.permissions).forEach(function(e){return o[e.replace(/\./g,"::")]=window.csAppData.permissions[e]})
var r=(0,t.memoize)(function(){return window.cornerstoneApp.lookup("service:ui")}),a=(0,t.memoize)(function(){return window.cornerstoneApp.lookup("service:preview")}),i=(0,t.memoize)(function(e){for(var t=e.split("."),r=[],a={content:"{post-type}",element:"{id}",preference:"{id}"},i=["element","preference"];t.length;){var s=t.shift(),l=[].concat(r,[s]).join("::")
if((0,n.isNone)(o[l])&&!(0,n.isNone)(a[r[0]])){var c=[r[0],a[r[0]]]
r.length>1&&c.push(s),l=c.join("::")}r.push(s)
var u=(0,n.isNone)(o[l])?null:o[l]
if(i.includes(r[0])||(u=!!u),(0,n.isNone)(a[s])&&!1===u)return!1}return!0})
function s(e,t){return"string"==typeof e&&(0===e.indexOf("{context}")?function(e,t){var n=s("".concat(function(){var e,t=a().get("isPreview")
e=t?a().get("initialRouteConfig.mode"):r().get("primaryRoute.routeName").split(".")[0]
if("content"===e){var n=t?a().get("initialRouteConfig.post_type"):r().get("primaryRoute.controller.model.content.postType")
e="".concat(e,".").concat(n)}else"global-blocks"===e&&(e="content.cs_global_block")
return e}(),".").concat(e))
if(n&&t&&t.get){var o=t.get("constructor.modelName")
"element/definition"===o&&(n=s("element.".concat(t.get("id"),".").concat(e)))}return n}(e.replace("{context}.",""),t):i(e))}var l=(0,t.memoize)(function(){return Object.keys(o).reduce(function(e,t){if(0===t.indexOf("content::")){var n=t.split("::")
2!==n.length||["{post-type}","cs_global_block"].includes(n[1])||e.push(n[1])}return e},[])})
e.allowedPostTypes=l
var c="pro"===window.csAppData.env.product,u=(0,t.memoize)(function(){return c&&s("headers")})
e.canUseHeaders=u
var p=(0,t.memoize)(function(){return c&&s("footers")})
e.canUseFooters=p
var d=(0,t.memoize)(function(){return l().length>0})
e.canUseBuilder=d}),define("tco-app/src/middleware/expose",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return function(e){var t=e.getState
return function(e){return function(n){var o=t(),r=o.elements,a=o.ui,i=void 0===a?{}:a,s=o.builder,l=void 0===s?{}:s,c=o.definitions,u=void 0===c?{}:c
return e(Object.assign({},n,{elements:r,ui:i,builder:l,definitions:u}))}}}}})
define("tco-app/src/middleware/index",["exports","redux-saga","tco-app/src/sagas/index","tco-app/src/middleware/expose","tco-app/src/middleware/thunk","tco-app/src/middleware/xfr","tco-app/src/middleware/performance"],function(e,t,n,o,r,a,i){Object.defineProperty(e,"__esModule",{value:!0}),e.setupMiddleware=function(e){s.run(n.default),u(e)},e.middleware=void 0
var s=(0,t.default)(),l=(0,a.default)({isFrame:window.csAppData.isPreview,session:window.csPreviewSession,keys:["definitions","elements","render","builder","ui"]}),c=l.xfrMiddleware,u=l.setupXfrMiddleware,p=[(0,r.default)(),(0,o.default)(),s,c]
e.middleware=p}),define("tco-app/src/middleware/performance",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return function(e){return function(e){return function(t){console.log("%c Dispatching ","background: #222; color: #bada55",t)
var n=performance.now(),o=e(t),r=performance.now()
return console.log('%c "'.concat(t.type,'" took ').concat((r-n).toFixed(2)," ms."),"background: #bada55; color: #222"),o}}}}}),define("tco-app/src/middleware/thunk",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return function(e){var t=e.dispatch,n=e.getState
return function(e){return function(o){return"function"==typeof o?o(t,n):e(o)}}}}}),define("tco-app/src/middleware/xfr",["exports","uuid/v4","tco-app/src/util/idle-callback"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=e.isFrame,a=void 0===r||r,i=e.session,s=e.keys,l=function(){return console.warn("sending before port is ready",{isFrame:a,session:i,keys:s})},c=function(e,t){return function(n){e===n.data.session&&n.data.message&&n.data.message.type&&t(n.data.message)}}
return{xfrMiddleware:function(){return function(e){return function(t){if(a&&0!==t.type.indexOf("XFR:")&&!1!==t.xfr){var r=t.type,i=t.payload,s={type:r,payload:i,xfr:!1}
if(o&&console.log("XFR",t),t.local)return e(t)
if(t.lazy)return(0,n.requestIdleCallback)(function(){return l(s)},{fallback:!0}),e(t)
l(s)}e(t),t.patches&&(0,n.requestIdleCallback)(function(){return l({type:"XFR:APPLY_PATCHES",toApply:t.patches})},{fallback:!0})}}},setupXfrMiddleware:function(e){return a?function(e){window.parent.postMessage("cs-request-port::".concat(i),"*")
var t=c(i,e.dispatch)
window.addEventListener("message",function n(r){if(!r.data||r.data.session!=="cs-init-port::".concat(i))return
window.removeEventListener("message",n,!1)
var a=r.ports[0]
a.addEventListener("message",t,!1),a.start(),l=function(e){o&&console.log("XFR SEND",e),a.postMessage({session:i,message:e})},e.dispatch({type:"XFR:INIT_FRAME",payload:Object.assign({xfr:{ready:!0}},r.data.state||{})})},!0)}(e):function(e){var n=(0,t.default)(),o=c(n,e.dispatch),r={}
l=function(e){return Object.keys(r).forEach(function(t){r[t].postMessage({session:n,message:e})})}
e.dispatch({type:"XFR:SETUP",payload:{isFrame:!1,ready:!0,session:n,subscribe:function(a){var i=(0,t.default)(),l=new MessageChannel
l.port1.addEventListener("message",o,!1),l.port1.start(),r[i]=l.port1
var c=function(){l.port1.removeEventListener("message",o,!1),l.port1.close(),r[i]=null,delete r[i]}
return window.addEventListener("message",function t(o){if("cs-request-port::".concat(n)===o.data){var r=e.getState(),i=Object.keys(r).filter(function(e){return s.includes(e)}).reduce(function(e,t){return e[t]=r[t],e},{})
a&&a.contentWindow?a.contentWindow.postMessage({session:"cs-init-port::".concat(n),state:i},"*",[l.port2]):c(),window.removeEventListener("message",t)}},!1),c}}})}(e)}}}
var o=!1}),define("tco-app/src/reducers/builder",["exports","immer","lodash","tco-app/src/reducers/helpers","tco-app/src/actions/builder"],function(e,t,n,o,r){function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e={selected:[],expanded:[],activePanel:"layout",incomingElement:null,observing:null,renderContext:{},previewBreakpoint:"",previewSwitcher:!1,permissionContext:"",homeRoute:null,routePrefix:null,orientation:null,preferences:{}}
return function(r,i){return(0,t.produce)(r||e,function(e){var t=i.type,r=i.payload,s=i.elements
function l(e){for(var t=[e],n=e;s[n]&&s[n]._parent&&s[s[n]._parent];)n=s[n]._parent,t.push(n)
return t.reverse()}var c=function(e){return s[e]&&s[e]._modules&&s[e]._modules.length>0},u=function(){e.expanded=(0,n.uniq)([].concat(a(e.expanded),a(l(r.id)),a(r.expandAll?(0,o.flattenChildren)(s,r.id):[])).filter(c)),r.reset&&(e.selected=[]),e.selected=l(r.deep?function(e){var t=e
for(;c(t);)t=s[t]._modules[0]
return t}(r.id):r.id)},p=function(){var t=e.selected.indexOf(r.id)
t>=0&&e.selected.splice(t)
var n=e.expanded.indexOf(r.id)
if(n>=0&&e.expanded.splice(n,1),r.collapseAll){var i=[r.id].concat(a((0,o.flattenChildren)(s,r.id)))
e.expanded=e.expanded.filter(function(e){return!i.includes(e)})}}
switch(t){case"BUILDER:TOGGLE_SELECT":e.expanded.includes(r.id)?p():u()
break
case"BUILDER:SELECT":u()
break
case"BUILDER:DESELECT":p()
break
case"BUILDER:SET_CONTEXT":e.selected=[],e.activePanel="layout",e.previewBreakpoint="",e.orientation=function(e){if("undefined"!=typeof Storage)try{var t={},n=window.localStorage.getItem("csUIPreferences")
if(n&&(t=JSON.parse(n)),t.orientations&&t.orientations[e])return t.orientations[e]}catch(o){console.warn("unable to locate initial orientation",e)}return{header:"horizontal",footer:"horizontal",globalBlocks:"vertical",content:"vertical"}[e]}(r.builder),Object.assign(e,r)
break
case"BUILDER:NAVIGATE":e.activePanel=r.panel
break
case"BUILDER:UPDATE_ORIENTATION":r.toggle&&(e.orientation="vertical"===e.orientation?"horizontal":"vertical"),r.orientation&&(e.orientation=r.orientation)
break
case"BUILDER:UPDATE_PREFERENCES":Object.keys(r).forEach(function(t){e.preferences[t]=r[t]})
break
case"BUILDER:PREVIEW_BREAKPOINT":e.previewBreakpoint=r.active||""
break
case"BUILDER:PREVIEW_SWITCHER":e.previewSwitcher=r.active||!1
break
case"BUILDER:SET_INCOMING_ELEMENT":e.incomingElement=r
break
case"BUILDER:CLEAR_INCOMING_ELEMENT":e.incomingElement=null}},function(e){e.length<=0||(i.patches||(i.patches={}),i.patches.builder=e)})}}}),define("tco-app/src/reducers/clipboard",["exports","immer","tco-app/src/reducers/helpers"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return function(e,o){return(0,t.produce)(e||{},function(e){var t=o.type,r=o.payload,a=(r=void 0===r?{}:r).id,i=r.scope,s=r.context,l=void 0===s?{}:s,c=o.elements
switch(t){case"CLIPBOARD_COPY":e[i]={context:l}
break
case"CLIPBOARD_COPY:ELEMENT":e[i]={atts:(0,n.copyElement)(c,a),context:l}
break
case"CLIPBOARD_CLEAR":e[i]=null}},function(e){e.length<=0||(o.patches||(o.patches={}),o.patches.clipboard=e)})}}}),define("tco-app/src/reducers/data",["exports","immer"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e={}
return function(n,o){var r=o.type,a=o.payload
return(0,t.produce)(n||e,function(e){switch(r){case"DATA:INVALIDATE":(a.keys||[]).forEach(function(t){delete e[t]})
break
case"DATA:UPDATE":e[a.key]=a.result}})}}}),define("tco-app/src/reducers/definitions",["exports","tco-app/src/util/prime-inspector"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e={}
return window.csAppData.models.elements.data.forEach(function(t){var n=t.id,o=t.attributes
e[n]=Object.assign({id:n},o)}),(0,t.default)(e),function(t){return t||e}}}),define("tco-app/src/reducers/elements",["exports","reselect","immer","lodash","tco-app/src/selectors/elements","tco-app/src/lib/i18n","tco-app/src/reducers/helpers"],function(e,t,n,o,r,a,i){function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.makeHorizontalLayoutItems=e.makeVerticalLayoutItems=e.makeCanMoveChildIntoParent=e.makeIsParentAtCapacity=e.makeGetAncestors=e.areElementTypesCompatiblePreCheck=e.areElementTypesCompatible=void 0
var u=["_type","_id","_modules","_parent"],p=["section","classic:section","layout-column","layout-cell","column","classic:column","bar","container","region","root"],d=["section","classic:section","bar"],f=[].concat(p,["layout-grid","layout-row","row","classic:row"]),m=(0,o.memoize)(function(e,t,n){if(!(e&&t&&n[e]&&n[t]))return!1
if("region"===e)return d.includes(t)
var o=n[e].options.valid_children||[],r=n[t].options.child
return!!o.includes(t)||!(r||p.includes(t)||!o.includes("*"))},function(e,t){return"".concat(e,"||").concat(t)})
e.areElementTypesCompatible=m
var h=(0,o.memoize)(function(e,t){return!(!e||!t)&&("bar"===t&&"region"===e||("container"!==t||"container"!==e)&&(!d.includes(t)&&f.includes(e)))},function(e,t){return"".concat(e,"||").concat(t)})
e.areElementTypesCompatiblePreCheck=h
var g=function(e,t){var n=(0,o.memoize)(function(o){return e[o]&&e[o]._parent&&!t(o,e)?[e[o]._parent].concat(c(n(e[o]._parent))):[]})
return function(e){return n(e)}}
e.makeGetAncestors=g
var v=function(e){return(0,o.memoize)(function(t){if(!e[t])return!1
var n=e[t],o=n._type,r=n._modules,a=n._region
return["row","classic:row"].includes(o)?r&&r.filter(function(t){return e[t]&&!1!==e[t]._active}).length>=6:!("region"!==o||!["left","right","bottom"].includes(a))&&(r&&r.length>=1)})}
e.makeIsParentAtCapacity=v
var b=function(e){var t=e.elements,n=e.definitions,o=v(t),r=function(e){return function(t,n){return[n].concat(c((0,i.flattenChildren)(e,n))).includes(t)}}(t)
return function(e,a,i){return!(!t[e]||!t[a])&&(i&&t[a]._modules&&t[a]._modules.length>0?!r(e,a)&&h(t[a]._type,t[e]._type):!!m(t[a]._type,t[e]._type,n)&&(t[e]._parent===a||!o(a)))}}
e.makeCanMoveChildIntoParent=b
var y=function(){return(0,t.createSelector)(function(e){return e.elements},function(e){return e.definitions},function(e){return e.builder.expanded},(0,r.makeGetSelectedRegionId)(),function(e,t,n,o){var r=function(e){return["root","region"].includes(e)},a=g(e,function(t){return r(e[t]._type)}),i=b({elements:e,definitions:t}),s=[],l={}
o&&function t(o){if(e[o]&&e[o]._type){var a=e[o],i=a._modules,l=a._active,c=a._type,u=r(c),p=u||n.includes(o)
u||!1===l||s.push(o),!i||i.length<=0||!p||i.forEach(t)}}(o)
return s.forEach(function(t,o){var r=a(t),c=e[t]._parent,u=e[c],p={ancestors:r,level:r.length-1,isExpanded:n.includes(t),parent:c,isFirst:u._modules[0]===t,isLast:u._modules[u._modules.length-1]===t,siblingAbove:s[o-1],siblingBelow:s[o+1]}
p.isEligible=function(e,t){var n=t.parent,o=t.siblingBelow,r=t.isExpanded,a=t.ancestors
return function(t){var s=t.incoming,c=t.after,u=t.into,p=t.preCheck
return!(!s||!l[s])&&s!==e&&!a.includes(s)&&(u?i(s,e,p):(!c||o!==s)&&(!c||!r)&&i(s,n))}}(t,p),l[t]=p}),{list:s,items:l,regionId:o}})}
e.makeVerticalLayoutItems=y
var _=y
e.makeHorizontalLayoutItems=_
var w=function(){return function(e,t){return(0,n.produce)(e||{},function(n){var r=t.type,p=t.payload,d=t.builder,f=void 0===d?{}:d,m=t.definitions,h=f.preferences,g=(p||{}).id
if("root"!==g&&r){var b=v(n),y=function(e,t){var o=(0,i.getSizesFromLayout)(t)
if(o){n[e]._modules||(n[e]._modules=[])
for(var r=o.length-n[e]._modules.length;--r>=0;)re(e,(0,i.makeElement)({definitions:m,preferences:h,parentType:n[e]._type},{_type:"row"===n[e]._type?"column":"classic:column"}),{reflow:!1})
n[e]._modules.forEach(function(e){var t=o.pop()
n[e]._active=!!t,n[e].size=t||""})}},_=function(e){if(n[e]&&n[e]._modules&&["row","classic:row"].includes(n[e]._type)){var t=n[e]._modules.filter(function(e){return!1!==n[e]._active}),o=t.map(function(e){return n[e].size}).join("+")
if((0,i.isColumnLayoutValid)(o))return
var r=t.slice(0,6),a=r.map(function(){return"1/".concat(r.length)}).join("+")
y(e,a)}},w=function(e,t){var o=n[g]._parent,r=n[o]._modules.indexOf(g)
if(e!==o&&e)n[o]._modules.splice(r,1),oe(g,e,t),_(o)
else{var a=Number.isInteger(t)?t:n[o]._modules.length-1
n[o]._modules.splice(a,0,n[o]._modules.splice(r,1)[0])}_(e)},E=function(e){n[e]&&((0,i.flattenChildren)(n,e).forEach(function(e){return delete n[e]}),n[e]._modules=[])},O=function(e){var t=(0,o.pickBy)(e,function(e,t){return!u.includes(t)})
Object.keys(t).forEach(function(e){n[g][e]=t[e]}),e._modules&&(E(g),ae(g,e._modules),_(g))},x=function(e){var t="all"===e?["xs","sm","md","lg","xl"]:e
return Array.isArray(t)?t:[t]}
switch(r){case"ELEMENT_RESET":return(0,i.normalizeElement)(m,p,{resetIds:!0}).entities.element
case"ELEMENT_ADD":var k=p.atts,S=p.index,P=Number.isInteger(S)?S:n[g]._modules.length
k&&k._type&&re(g,(0,i.makeElement)({parentType:n[g]._type,definitions:m,preferences:h},Object.assign({},k),{index:P}),{index:P})
break
case"ELEMENT_ADD:SIBLING":var C=p.atts,j=p.after,T=n[g]._parent,M=n[T]._modules.indexOf(g),D=j?M+1:M
re(T,(0,i.makeElement)({parentType:n[T]._type,definitions:m,preferences:h},C||{_type:n[g]._type},{index:D}),{index:D})
break
case"ELEMENT_MOVE":w(p.parent,p.index)
break
case"ELEMENT_SHIFT":var A=p.shift,I=n[g]._parent
w(I,function(e,t){if("start"===t)return 0
var o=n[e]._modules.indexOf(g)
return-1===o?null:"up"===t?Math.max(0,o-1):"down"===t?Math.min(n[e]._modules.length-1,o+1):null}(I,A))
break
case"ELEMENT_MOVE:BEFORE":var R=p.sibling,L=n[R]._parent,N=n[L]._modules.indexOf(R),U=n[g]._parent,F=n[U]._modules.indexOf(g)
w(L,L===U&&N>F?N-1:N)
break
case"ELEMENT_MOVE:AFTER":var B=p.sibling,z=n[B]._parent,H=n[z]._modules.indexOf(B),V=n[g]._parent,W=n[V]._modules.indexOf(g)
w(z,(z===V&&H>W?H-1:H)+1)
break
case"ELEMENT_DUPLICATE":if(b(n[g]._parent))break
var q=(0,i.toTree)(n,g,{removeIds:!0,withoutAtts:["id"]}),G=n[n[g]._parent],$=G._modules.indexOf(g)+1
if(q._label)for(var K=1,Y=q._label,X=function(e){return G._modules.find(function(t){return e===n[t]._label})};X(q._label);)q._label=(0,a.t)("app.copy-of-numeric",{title:Y,index:K++})
re(n[g]._parent,q,{index:$})
break
case"ELEMENT_DELETE":E(g)
var J=n[g]._parent
p.parent=J,delete n[g],J&&n[J]._modules&&(n[J]._modules.splice(n[J]._modules.indexOf(g),1),_(J))
break
case"ELEMENT_DELETE_CHILDREN":E(g),_(g)
break
case"ELEMENT_ADD:INSERT_CHILDREN":var Q=p.children,Z=p.sibling,ee=p.after
ae(g,Q,Z,ee)
break
case"ELEMENT_UPDATE:SET_ATTRIBUTES":O(p.atts)
break
case"ELEMENT_UPDATE:SET_ATTRIBUTE":O(s({},p.key,p.value))
break
case"ELEMENT_UPDATE:SET_LABEL":var te=(0,i.getLabelKey)(m[e[g]._type]||m.undefined)
u.includes(te)||(n[g][te]=p.label)
break
case"ELEMENT_UPDATE:REMOVE_SPACING":p.updatedElements=[g].concat(c((0,i.flattenChildren)(n,g))).map(function(t){switch(e[t]._type){case"section":return n[t].section_margin="0em",n[t].section_padding="0em",t
case"classic:section":return n[t].margin=["0px","0px","0px","0px","unlinked"],n[t].padding=["0px","0px","0px","0px","unlinked"],t
case"row":return n[t].row_margin="0em",n[t].row_padding="0em",n[t].row_inner_container=!1,n[t].row_marginless_columns=!0,n[t].row_width="auto",n[t].row_max_width="none",t
case"layout-row":return n[t].layout_row_margin="0em",n[t].layout_row_padding="0em",n[t].layout_row_global_container=!1,n[t].layout_row_width="auto",n[t].layout_row_max_width="none",n[t].layout_row_gap_column="0rem",n[t].layout_row_gap_row="0rem",t
case"layout-column":return n[t].layout_column_padding="0em",t
case"classic:row":return n[t].margin=["0px","0px","0px","0px","unlinked"],n[t].padding=["0px","0px","0px","0px","unlinked"],n[t].inner_container=!1,n[t].marginless_columns=!0,t
case"column":return n[t].column_padding="0em",t
case"classic:column":return n[t].padding=["0px","0px","0px","0px","unlinked"],t}}).filter(function(e){return!!e})
break
case"ELEMENT_UPDATE:SET_COLUMN_LAYOUT":y(g,p.layout)
break
case"ELEMENT_CREATE_ROW_LAYOUT":(function(t,o){var r={},a=o.split(" ");["xs","sm","md","lg","xl"].forEach(function(e){r["layout_row_layout_".concat(e)]=o}),"xs"!==f.previewBreakpoint&&(r.layout_row_layout_xs="100%"),!["xs","sm"].includes(f.previewBreakpoint)&&a.length>1&&(r.layout_row_layout_sm="50% 50%"),["xs","sm"].includes(f.previewBreakpoint)||a.length%2==0||(r.layout_row_grow=!0)
var s=e[t]._type,l=(0,i.getDefaultAddNewElement)(s,m,h)
a.forEach(function(){return re(t,(0,i.makeElement)({parentType:s,definitions:m,preferences:h},l))}),Object.keys(r).forEach(function(e){n[t][e]=r[e]})})(g,p.layout),p.updatedElements=[g].concat(c((0,i.flattenChildren)(n,g)))
break
case"ELEMENT_CREATE_GRID_LAYOUT":(function(e,t){var o=t._modules,r=(t._type,l(t,["_modules","_type"]))
o.forEach(function(t){return re(e,(0,i.makeElement)({parentType:"layout-grid",definitions:m,preferences:h},t))})
var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){s(e,t,n[t])})}return e}({},(0,i.getElementDefaults)({definition:m["layout-grid"],parentType:n[n[e]._parent]._type}),r)
Object.keys(a).forEach(function(t){n[e][t]=a[t]})})(g,p.template),p.updatedElements=[g].concat(c((0,i.flattenChildren)(n,g)))
break
case"ELEMENT_UPDATE_CELL_POSITION":(function(e,t,o){var r=e["layout_cell_column_start_".concat(t)],a=e["layout_cell_column_end_".concat(t)],i=e["layout_cell_row_start_".concat(t)],s=e["layout_cell_row_end_".concat(t)],l=e["layout_cell_justify_self_".concat(t)],c=e["layout_cell_align_self_".concat(t)],u=x(o).reduce(function(e,t){return e["layout_cell_column_start_".concat(t)]=r,e["layout_cell_column_end_".concat(t)]=a,e["layout_cell_row_start_".concat(t)]=i,e["layout_cell_row_end_".concat(t)]=s,e["layout_cell_justify_self_".concat(t)]=l,e["layout_cell_align_self_".concat(t)]=c,e},{})
Object.keys(u).forEach(function(e){n[g][e]=u[e]})})(p.source,p.from,p.to),p.updatedElements=[g].concat(c((0,i.flattenChildren)(n,g)))
break
case"ELEMENT_UPDATE_GRID_LAYOUT":(function(e,t,o){var r=e["layout_grid_template_columns_".concat(t)],a=e["layout_grid_template_rows_".concat(t)],i=x(o).reduce(function(e,t){return e["layout_grid_template_columns_".concat(t)]=r,e["layout_grid_template_rows_".concat(t)]=a,e},{})
Object.keys(i).forEach(function(e){n[g][e]=i[e]})})(p.source,p.from,p.to),p.updatedElements=[g].concat(c((0,i.flattenChildren)(n,g)))}}function ne(e){var t=n[e]._parent
n[e]._region=n[t]._region,(0,i.flattenChildren)(n,e).forEach(function(e){n[e]._region=n[t]._region})}function oe(e,t,o){n[e]._parent=t,ne(e),n[t]._modules||(n[t]._modules=[]),Number.isInteger(o)?n[t]._modules.splice(o,0,e):n[t]._modules.push(e)}function re(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.index,a=o.reflow,s=void 0===a||a
if(t&&t._type){var l=(0,i.normalizeElement)(m,t),u=l.result,d=l.entities
Object.keys(d.element).forEach(function(e){n[e]=d.element[e]}),oe(u,e,r),s&&_(e),p.newElements||(p.newElements=[]),p.newElements=[].concat(c(p.newElements),[u])}}function ae(e,t,o,r){var a
if(e&&t&&!(t.length<=0)){var s=[]
t.forEach(function(t){var o=(0,i.normalizeElement)(m,t),r=o.result,a=o.entities
Object.keys(a.element).forEach(function(e){return n[e]=a.element[e]}),n[r]._parent=e,s.push(r)}),n[e]._modules||(n[e]._modules=[])
var l=-1
o&&-1!==(l=n[e]._modules.indexOf(o))&&r&&l++,(a=n[e]._modules).splice.apply(a,[l,0].concat(s)),s.map(ne),p.newElements||(p.newElements=[]),p.newElements=[].concat(c(p.newElements),s)}}},function(e){e.length<=0||(t.patches||(t.patches={}),t.patches.elements=e)})}}
e.default=w}),define("tco-app/src/reducers/filter",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=t(n)?n:function(e){return n.indexOf(e.type)>=0},r=e(void 0,{})
return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,n=arguments.length>1?arguments[1]:void 0
return o(n)?e(t,n):t}}
var t=function(e){return!!(e&&e.constructor&&e.call&&e.apply)}}),define("tco-app/src/reducers/helpers",["exports","uuid/v4","normalizr","lodash","tco-app/src/util/conditionals","tco-app/src/lib/i18n"],function(e,t,n,o,r,a){Object.defineProperty(e,"__esModule",{value:!0}),e.reduceColumnFractions=l,e.isColumnLayoutValid=c,e.getSizesFromLayout=function(e){var t=l(e)
if(!s.includes(t))return!1
var n=t.split("+")
return n.reverse(),n},e.cleanMalformedChildren=u,e.normalizeElement=function(e,o){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).resetIds,a=void 0!==r&&r
return(0,n.normalize)(function n(o){var r=o?p(e[o._type]||{}):{}
var i=Object.assign({},r,o)
i._id&&!a||(i._id=(0,t.default)())
i.title&&!i._label&&(i._label=i.title)
if(i._modules){var s=i._region?i._region:null
i._modules=u(i._modules.map(function(e){return n(Object.assign({},e,{_parent:i._id},s?{_region:s}:{}))}),i)}return i}(o),d)},e.flattenChildren=function(e,t){return(e[t]&&e[t]._modules||[]).reduce(function t(n,o){n.push(o)
return n.concat((e[o]._modules||[]).reduce(t,[]))},[])},e.getLabelKey=m,e.getElementDefaults=_,e.makeElement=function(e,t){var n=e.definitions,o=e.parentType,r=e.preferences,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).index
try{if(!t||!t._type)throw new Error("No type specified")
return function e(t,o){var s=n[t._type]||n.undefined
var l=Object.assign({},_({definition:s,parentType:o}),t)
if(Number.isInteger(i)){var c=m(s)
if(!l[c]||"_label"!==c)if(s.options.title_format)l[c]=s.options.title_format.replace("%s",i+1)
else if(s.options.child){var u=s.title||l._type
l[c]===u&&(l[c]=(0,a.t)("app.indexed",{label:u,index:i+1}))}}if(!l._modules){var p=b(l._type,n,r)
l._modules=p?p.map(function(t){return e(t,l._type)}):[]}return l}(t,o)}catch(s){console.warn("Unabled to make element",s)}return{}},e.toTree=w,e.toTreeFromRoot=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]
return w(e,Object.keys(e).find(function(t){return"root"===e[t]._type}),{removeIds:t})},e.copyElement=function(e,t){return w(e,t,{removeIds:!0,withoutAtts:["_region"]})},e.getDesignations=e.getDefaultAddNewElement=e.locateDefinition=e.getDefaultsFromDefinition=e.cleanAttsNoId=e.cleanAtts=void 0
e.cleanAtts=function(e,t){return!["_parent","_modules"].includes(t)}
var i=function(e,t){return!["_id","_parent","_modules"].includes(t)}
e.cleanAttsNoId=i
var s=["1/1","1/2+1/2","2/3+1/3","1/3+2/3","1/3+1/3+1/3","3/4+1/4","1/4+3/4","1/2+1/2","1/2+1/4+1/4","1/4+1/2+1/4","1/4+1/4+1/2","1/4+1/4+1/4+1/4","4/5+1/5","1/5+4/5","3/5+2/5","2/5+3/5","3/5+1/5+1/5","1/5+3/5+1/5","1/5+1/5+3/5","2/5+2/5+1/5","2/5+1/5+2/5","1/5+2/5+2/5","2/5+1/5+1/5+1/5","1/5+2/5+1/5+1/5","1/5+1/5+2/5+1/5","1/5+1/5+1/5+2/5","1/5+1/5+1/5+1/5+1/5","5/6+1/6","1/6+5/6","2/3+1/3","1/3+2/3","2/3+1/6+1/6","1/6+2/3+1/6","1/6+1/6+2/3","1/2+1/2","1/2+1/3+1/6","1/2+1/6+1/3","1/3+1/2+1/6","1/3+1/6+1/2","1/6+1/2+1/3","1/6+1/3+1/2","1/2+1/6+1/6+1/6","1/6+1/2+1/6+1/6","1/6+1/6+1/2+1/6","1/6+1/6+1/6+1/2","1/3+1/3+1/3","1/3+1/3+1/6+1/6","1/3+1/6+1/3+1/6","1/3+1/6+1/6+1/3","1/6+1/3+1/3+1/6","1/6+1/3+1/6+1/3","1/6+1/6+1/3+1/3","1/3+1/6+1/6+1/6+1/6","1/6+1/3+1/6+1/6+1/6","1/6+1/6+1/3+1/6+1/6","1/6+1/6+1/6+1/3+1/6","1/6+1/6+1/6+1/6+1/3","1/6+1/6+1/6+1/6+1/6+1/6"]
function l(e){return[{f:"2/4",r:"1/2"},{f:"2/6",r:"1/3"},{f:"3/6",r:"1/2"},{f:"4/6",r:"2/3"}].reduce(function(e,t){var n=t.f,o=t.r
return e.replace(new RegExp(n,"g"),o)},e).replace(new RegExp(/\s/,"g"),"")}function c(e){return s.includes(l(e))}function u(e,t){if(t&&["row","classic:row"].includes(t._type)){var n=!1
return e.reduce(function(e,t){if(t._active&&!n){var o=e.map(function(e){return e.size}).join("+")
c("".concat(o,"+").concat(t.size).replace(/^[+]+|[+]+$/g,""))&&(n=!0),e.push(t)}return e},[])}return e}var p=(0,o.memoize)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(e.id,e.values)
return Object.keys(t||{}).reduce(function(e,n){return void 0!==t[n].default&&(e[n]=t[n].default),e},{})})
e.getDefaultsFromDefinition=p
var d=new n.schema.Entity("element",void 0,{idAttribute:"_id"}),f=new n.schema.Array(d)
function m(e){return e.options.label_key||"_label"}d.define({_modules:f})
var h=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:element")}),g=(0,o.memoize)(function(e){return h().getDefinitionByType(e)})
e.locateDefinition=g
var v=function(e){return g(e.id).getWithDefault("defaultPreset.atts",{})},b=function(e,t,n){if(!t[e])return null
var o=t[e]
return"section"===e&&n.contentLayoutElement?[{_type:n.contentLayoutElement}]:o.options.default_children?o.options.default_children:null}
e.getDefaultAddNewElement=function(e,t,n){return"section"===e&&n.contentLayoutElement?{_type:n.contentLayoutElement}:(t[e]||t.undefined).options.add_new_element||{}}
var y={row:{row_inner_container:!0},"layout-row":{layout_row_global_container:!0},"layout-grid":{layout_grid_global_container:!0}}
function _(e){var t=e.definition,n=e.parentType,r=void 0===n?null:n,a=e.honorDefaultPreset,s=void 0===a||a
if(!t)throw new Error("no definition")
var l=p(t),c=function(e,t){return"section"===t&&y[e.id]?y[e.id]:{}}(t,r),u=s?v(t):{}
return(0,o.pickBy)(Object.assign({},l,c,u),i)}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeIds,a=void 0!==r&&r,i=n.withoutAtts,s=void 0===i?[]:i
if(!t)return{}
var l=function(e){return Object.assign({},(0,o.pickBy)(e,function(e,t){return!(a&&["_id","_parent"].includes(t)||s.includes(t))}))},c=l(e[t])
return c._modules&&(c._modules=u(c._modules.map(function t(n){var o=l(e[n])
return o._modules&&(o._modules=u(o._modules.map(t),o)),o}),c)),c}var E=(0,o.memoize)(function(e){if(!e||!e.values)return{}
var t=e.values
return Object.keys(t).reduce(function(e,n){return e[n]=(0,r.isNone)(t[n].designation)?null:t[n].designation,e},{})})
e.getDesignations=E}),define("tco-app/src/reducers/index",["exports","redux","tco-app/src/reducers/filter","tco-app/src/reducers/elements","tco-app/src/reducers/builder","tco-app/src/reducers/inspector","tco-app/src/reducers/clipboard","tco-app/src/reducers/ui","tco-app/src/reducers/definitions","tco-app/src/reducers/data","tco-app/src/reducers/xfr","tco-app/src/reducers/render","tco-app/src/reducers/preferences","tco-app/src/reducers/undo"],function(e,t,n,o,r,a,i,s,l,c,u,p,d,f){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var m=(0,u.xfrReducer)(window.csAppData.isPreview?(0,t.combineReducers)({ui:(0,n.default)(s.default,function(e){return e.type.match(/^UI/)}),data:function(e){return e||{}},builder:function(e){return e||{}},clipboard:function(e){return e||{}},inspector:function(e){return e||{}},elements:function(e){return e||{}},definitions:function(e){return e||{}},render:function(e){return e||{}},xfr:function(e){return e||u.xfrInitialState}}):(0,f.default)((0,t.combineReducers)({elements:(0,n.default)((0,o.default)(),function(e){var t=e.type
return t.match(/^ELEMENT/)||t.match(/^@@/)}),render:(0,n.default)((0,p.default)(),function(e){return e.type.match(/^RENDER/)}),preferences:(0,n.default)((0,d.default)(),function(e){return e.type.match(/^PREFERENCES/)}),builder:(0,n.default)((0,r.default)(),function(e){return e.type.match(/^BUILDER/)}),inspector:(0,n.default)((0,a.default)(),function(e){return e.type.match(/^INSPECTOR/)}),data:(0,n.default)((0,c.default)(),function(e){return e.type.match(/^DATA/)}),definitions:(0,n.default)((0,l.default)(),function(e){return e.type.match(/^DEFINITIONS/)}),ui:(0,n.default)(s.default,function(e){return e.type.match(/^UI/)}),clipboard:(0,n.default)((0,i.default)(),function(e){return e.type.match(/^CLIPBOARD/)}),history:function(e){return e||{}},xfr:function(e){return e||u.xfrInitialState}})))
e.default=m}),define("tco-app/src/reducers/inspector",["exports","immer","tco-app/src/lib/permissions","tco-app/src/util/control-conditions","tco-app/src/selectors/elements"],function(e,t,n,o,r){function a(e,t){return l(e)||s(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(e,t){var n=[],o=true,r=false,a=undefined
try{for(var i=e[Symbol.iterator](),s;!(o=(s=i.next()).done);o=true){n.push(s.value)
if(t&&n.length===t)break}}catch(l){r=true
a=l}finally{try{if(!o&&i["return"]!=null)i["return"]()}finally{if(r)throw a}}return n}function l(e){if(Array.isArray(e))return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e={empty:!0,controls:{},conditions:{},groups:[],groupNames:[],conditionResults:{},hiddenGroups:[],hiddenControls:[],activeGroup:"",activeSubGroup:"",inspecting:null},i={user_can:function(e,t){var o=t.value,r=t.or
return{a:o,b:(0,n.currentUserCan)(e),op:"==",or:r}}}
return function(s,l){return(0,t.produce)(s||e,function(e){var t=l.type,c=l.payload,u=l.builder,p=l.definitions,d=l.elements
function f(t){var n=t.state,r=t.element,a=t.keys,s=Object.keys(n.conditions),l=a?s.filter(function(e){return n.conditions[e].conditions.filter(function(e){return a.includes(e).length>0})}):s,c={}
s.forEach(function(e){c[e]="boolean"==typeof n.conditionResults[e]||l.includes(e)?function(e,t){return(0,o.checkConditions)(e.map(function(e){var n=e.value,o=e.key,r=e.op,a=e.or
if(-1!==o.indexOf(":")){var s=o.split(":")
if("function"==typeof i[s[0]])return i[s[0]](s[1],{value:n,key:o,op:r,or:a})}return{a:n,b:t[o],op:r,or:a}}))}(n.conditions[e].conditions,r):n.conditionResults[e]}),e.conditionResults=c
var u,p=Object.keys(n.controls),d=p.filter(function(e){return!1===c[n.controls[e].conditions]}),f=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(u=d)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}(),[])
e.hiddenControls=f
var m=n.controls.root?Object.keys(n.controls.root.controls.filter(function(e){return!f.includes(e)}).reduce(function(e,t){var o=n.controls[t].group,r=o.top,a=o.full
return r&&(e[r]=!0),a&&(e[a]=!0),e},{})):[],h=n.groupNames.filter(function(e){return!m.includes(e)})
e.hiddenGroups=h}function m(){var t=e.groups.find(function(t){var n=t.name
return!e.hiddenGroups.includes(n)})
e.activeGroup=t&&t.name?t.name:"",e.activeSubGroup=t&&t.children&&t.children.length>0?t.children[0].name:""}function h(t){if(t||(t=e.inspecting),t){var n=function(){var e=d[t]&&d[t]._type||"undefined"
if(u.preferences.advancedMode){var n=(0,r.getDefinitionNormalizedControlsAdv)(e,p)
if(n&&n.controls)return n}var o=(0,r.getDefinitionNormalizedControls)(e,p)||{}
return o.controls?o:(0,r.getDefinitionNormalizedControlsAdv)(e,p)||{}}(),o=n.controls,a=void 0===o?{}:o,i=n.groups,s=void 0===i?[]:i,l=n.groupNames,c=void 0===l?[]:l,h=n.conditions,g=void 0===h?{}:h
e.controls=a,e.conditions=g,e.groups=s,e.groupNames=c
var v=!a.root||!a.root.controls||a.root.controls.length<=0
e.empty=v,f({state:{conditions:g,conditionResults:{},controls:a,groupNames:c},element:d[t]}),m()}}switch(t){case"INSPECTOR:INSPECT":(0,n.currentUserCan)("".concat(u.permissionContext,".elements_inspect"))&&d[c.id]&&"root"!==d[c.id]._type&&(e.inspecting!==c.id&&(h(c.id),e.inspecting=c.id),m())
break
case"INSPECTOR:SETUP":s.inspecting&&h()
break
case"INSPECTOR:SELECT_GROUP":(function(t){if(!t)return
var n=a(t.split(":"),2),o=n[0],r=n[1]
if(o&&!e.hiddenGroups.includes(o))if(e.activeGroup=o,r)e.activeSubGroup=t
else{var i=e.groups.find(function(e){var t=e.name,n=e.children
return t===o&&n.length>0})
i&&(e.activeSubGroup=i.children[0].name)}})(c.group)
break
case"INSPECTOR:UPDATE_CONDITIONS":e.inspecting===c.id&&f({state:s,element:d[c.id],keys:c.keys})}},function(e){e.length<=0||(l.patches||(l.patches={}),l.patches.inspector=e.filter(function(e){var t=e.path
return t.includes("inspecting")}))})}}}),define("tco-app/src/reducers/preferences",["exports","immer"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e={favoriteElements:function(){try{return(window.localStorage.getItem("csElementFavorites")||"").match(new RegExp(/{{[\w\d|-]+}}/,"g")).map(function(e){return e.substr(2,e.length-4)})}catch(e){}return[]}()}
return function(n,o){var r=o.type,a=o.payload
return(0,t.produce)(n||e,function(e){switch(r){case"PREFERENCES:TOGGLE_FAVORITE_ELEMENT":n.favoriteElements.includes(a.id)?e.favoriteElements=n.favoriteElements.filter(function(e){return e!==a.id}):e.favoriteElements.push(a.id)}})}}}),define("tco-app/src/reducers/render",["exports","immer","lodash","spark-md5","fast-json-stable-stringify","tco-app/src/lib/coalescence/client","tco-app/src/reducers/helpers"],function(e,t,n,o,r,a,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e=this,s={debounce:25,elements:{},waitQueue:{},inFlight:{},primeQueue:{},requiredFonts:[],requiredScripts:{},requiredScriptHandles:[],requiredStyles:{},requiredStyleHandles:[]},l=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:font-manager")}),c=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:color-manager")}),u={fontWeight:function(e){return l().resolveFontWeight(e)},fontFamily:function(e){return l().resolveFontFamilyStack(e)},color:function(e){return c().lookupColor(e)},globalColor:function(e){return c().lookupColor(e)}},p=function(e){return e.replace(/%%post ([\w-:]+?)%%(.*?)%%\/post%%/g,function(e,t,n){var o=window.Ember.String.camelize(t)
return u[o]?u[o](n):n})},d=(0,n.memoize)(function(t){var n=(0,i.getDesignations)(t)
return Object.keys(n).reduce(function(t,o){if("string"==typeof n[o]){if("style:raw"!==n[o]){var r=n[o].split(":"),a=r.shift(),i=r.join(":")
"style"===a&&i&&(t[o]=i)}}else console.warn("Invalid mapping of values for ".concat(e.get("id"),"."))
return t},{})}),f=(0,n.memoize)(function(e){return(0,a.default)({template:e.style,postProcessKeys:d(e),selectorPrefix:window.csAppData.coalescenceSelectorPrefix,postProcess:p})}),m=function(e,t,n){var o=n&&n.length>0?n:Object.keys((0,i.getDesignations)(t))||[],r=[],a=o.reduce(function(t,n){if(e[n]&&"string"==typeof e[n]){var o="string"!=typeof(a=e[n])?a:a.replace(/^([\w-]+?):(.*?)$/g,function(e,t){var n=window.Ember.String.camelize(t)
return u[n]?u[n](a):a})
o!==e[n]?t[n]=o:r.push(n)}var a
return t},{})
return{updates:a,remove:r}}
function h(e,t,a){if(!e[t]||!e[t]._type||["root","region"].includes(e[t]._type))return!1
var s=(0,n.pickBy)(e[t],i.cleanAtts),l=a[s._type]||a.undefined
if(!l||l.options._no_server_render||!1===l.options.can_preview)return!1
if(s._transient={},l.options.child){var c=e[e[t]._parent]
s._transient.parent=(0,n.pickBy)(c,i.cleanAtts),s._order=c._modules.indexOf(t)}l.options.render_children&&(s._transient.children=(e[t]._modules||[]).map(function(t){return(0,n.pickBy)(e[t],i.cleanAtts)})),s._transient.children_count=(e[t]._modules||[]).length
var u=(0,n.pickBy)(s,function(e,t){return!["_id","_order"].includes(t)})
u._envVersion=window.csAppData.env.version,u._transient.parent&&(u._transient.parent._id=null)
var p=(0,r.default)(u,function(e,t){return e.key>t.key?1:-1}),d=!1===l.options.cache||p.match(/\[[\d\w]+.*?\]/i)||p.match(/{{acf:[a-z0-9_-]*?}}/i),f={data:s,hash:o.default.hash(p)}
return d&&(f.noCache=!0),f}return function(e,o){return(0,t.produce)(e||s,function(e){var t=o.type,r=o.payload,a=o.definitions,s=o.elements,l=o.builder,c=void 0===l?{}:l,u=c.preferences
function p(t,o){if(s[t]&&s[t]._type){e.elements[t]||(e.elements[t]={})
var r=a[s[t]._type]||a.undefined
if(r){var l=f(a[s[t]._type]||a.undefined)((0,n.pickBy)(s[t],i.cleanAtts),{customCssKey:"css",customCssPlaceholder:"$el"})
o&&(e.elements[t]._inline_css=o)
var c="".concat(l||"").concat(e.elements[t]._inline_css||"")
e.elements[t]._dynamic_css=c}else console.warn("Could not generated CSS for undefined element",s[t])}}function d(t,n){if(s[t||!s[t]._type]){e.elements[t]||(e.elements[t]={}),e.elements[t]._post||(e.elements[t]._post={})
var o=m(s[t],a[s[t]._type]||a.undefined,n),r=o.remove,i=o.updates
e.elements[t]._post=Object.assign(e.elements[t]._post,i),(r||[]).forEach(function(n){return delete e.elements[t]._post[n]})}}switch(t){case"RENDER:QUEUE_UPDATE_MARKUP":e.debounce=r.debounce||25,(r.elements||[]).forEach(function(t){var n=h(s,t,a)
n&&(e.waitQueue[t]=n)})
break
case"RENDER:BATCH_UPDATE_MARKUP":var g=Date.now()
Object.keys(e.waitQueue).forEach(function(t){var n=e.waitQueue[t],o=n.data,r=n.hash
e.inFlight[r]?(e.inFlight[r].ids.push(t),e.inFlight[r].ts=g):e.inFlight[r]={data:o,ts:g,ids:[t]},delete e.waitQueue[t]})
break
case"RENDER:UPDATE_DYNAMIC_CSS":(r.elements||[]).forEach(function(e){return p(e)})
break
case"RENDER:POST_PROCESS_ATTRIBUTES":var v=r.primary,b=r.keys
v&&d(v,b),(r.elements||[]).forEach(function(e){e!==v&&d(e)})
break
case"RENDER:COMPLETE":(r.hashes||[]).forEach(function(t){delete e.inFlight[t]}),(r.completed||[]).forEach(function(t){var n=t.id,o=t.response
e.elements[n]||(e.elements[n]={}),(o.template||""===o.template)&&(e.elements[n]._markup=o.template),(o.inline_css||""===o.inline_css)&&p(n,o.inline_css),o.extractions&&(o.extractions.scripts&&(e.elements[n]._required_scripts=o.extractions.scripts),o.extractions.styles&&(e.elements[n]._required_styles=o.extractions.styles))}),r.scripts&&r.scripts.forEach(function(t){e.requiredScripts[t.handle]||(e.requiredScriptHandles.push(t.handle),e.requiredScripts[t.handle]=t)}),r.styles&&r.styles.forEach(function(t){e.requiredStyles[t.handle]||(e.requiredStyleHandles.push(t.handle),e.requiredStyles[t.handle]=t)})
break
case"RENDER:UPDATE_ASSETS":(r.assets||[]).forEach(function(t){var n=t.type,o=t.handle,r=t.state
switch(n){case"script":e.requiredScripts[o]&&(e.requiredScripts[o].state=r)
break
case"style":e.requiredStyles[o]&&(e.requiredStyles[o].state=r)}})
break
case"RENDER:PRIME_ELEMENTS":var y,_=c.selected.find(function(e){return"region"===s[e]._type})
_&&(y=s[_]._region),(r.elements||[]).forEach(function(t){var n=t.atts,o=t.options
if(y||n._region){var r=Object.assign({_region:y},n),s=(0,i.normalizeElement)(a,(0,i.makeElement)({definitions:a,preferences:u},r,o||{})),l=s.entities
Object.keys(l.element).forEach(function(t){var n=Date.now(),o=h(l.element,t,a)
o&&(e.primeQueue[t]=Object.assign({ts:n},o))})}})
break
case"RENDER:PRIME_COMPLETE":(r.completed||[]).forEach(function(t){return delete e.primeQueue[t.id]})
break
case"RENDER:UPDATE_META":(r.elements||[]).forEach(function(t){var n=t.id,o=t.contrast;(o||""===o)&&(e.elements[n]._bg_contrast=o)})}},function(e){e.length<=0||(o.patches||(o.patches={}),o.patches.render=e)})}}}),define("tco-app/src/reducers/ui",["exports","immer"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n={quickConfirm:!1,modKey:!1,liftedElement:null,inlineEditing:null,elementCursor:!1,observing:null,suspendDrag:!1,previewSuspendDrag:!1,viewSiteURL:null,disablePreviewPointer:!1,previewCursor:"auto",contextMenu:{},editingGrid:null,gridCounter:0,hideWorkspace:!1,hideWorkspaceFull:!1,confirm:{active:!1}},o=function(e,o){return(0,t.produce)(e||n,function(t){var n=o.type,r=o.payload
switch(n){case"UI:DISABLE_PREVIEW_POINTER":t.disablePreviewPointer=!!r.state
break
case"UI:MOD_KEY":t.modKey=!!r.state
break
case"UI:UPDATE":Object.keys(r).forEach(function(e){t[e]=r[e]})
break
case"UI:QUICK_CONFIRM":t.quickConfirm=!!r.enabled
break
case"UI:CONFIRM":t.confirm=Object.assign({active:!0},r)
break
case"UI:OBSERVE_START":t.observing=r.id
break
case"UI:OBSERVE_END":t.observing=null
break
case"UI:CONFIRM_DISMISS":t.confirm.active=!1,t.confirm.onAccept=e.confirm.onAccept?{}:null,t.confirm.onDecline=e.confirm.onDecline?{}:null
break
case"UI:BEGIN_ROW_RESIZE":t.resizingRow=r.id
break
case"UI:END_ROW_RESIZE":t.resizingRow=null
break
case"UI:BEGIN_GRID_EDITOR":t.editingGrid=r.id
break
case"UI:END_GRID_EDITOR":t.editingGrid=null
break
case"UI:BEGIN_INLINE_EDITING":t.inlineEditing=r.id
break
case"UI:END_INLINE_EDITING":t.inlineEditing=null
break
case"UI:UPDATE_GRID_COUNTER":t.gridCounter+=1
break
case"UI:TOGGLE_CONTEXT_MENU":if(!e.contextMenu.active){t.contextMenu=r
break}e.contextMenu.handle===r.handle&&(r.active?t.contextMenu=r:t.contextMenu={})
break
case"UI:HIDE_WORKSPACE":if(r.toggle){if(r.full&&!e.hideWorkspaceFull){t.hideWorkspace=!0,t.hideWorkspaceFull=!0
break}t.hideWorkspace=!e.hideWorkspace}else t.hideWorkspace=!!r.hidden
t.hideWorkspaceFull=t.hideWorkspace&&r.full}},function(e){e.length<=0||(o.patches||(o.patches={}),o.patches.ui=e)})}
e.default=o}),define("tco-app/src/reducers/undo",["exports","immer","fast-json-stable-stringify","tco-app/src/selectors/elements","tco-app/src/lib/i18n"],function(e,t,n,o,r){function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return function(u,p){var d,f=u||{},m=f.elements,h=f.history,g=function(e,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=r?(0,n.default)(r):null
h=(0,t.produce)(h,function(t){a&&a===l||t.past.push({meta:t.meta,data:m}),l=a,t.meta={type:e,label:o,time:Date.now()},t.future=[],t.past.length>c-1&&t.past.shift()})},v=function(e){m=(0,t.produce)(m,function(t){Object.keys(e).forEach(function(n){t[n]=e[n]}),Object.keys(t).forEach(function(e){h.next[e]||delete t[e]})},function(e){e.length<=0||(p.patches||(p.patches={}),p.patches.elements=e)})}
if(p&&0===p.type.indexOf("ELEMENT")||0===p.type.indexOf("HISTORY")){var b=p.type.split(":"),y=function(e){if(Array.isArray(e))return e}(d=b)||s(d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),_=y[0],w=y.slice(1)
switch(_){case"HISTORY_STEP_FORWARD":var E=p.payload.index
h=(0,t.produce)(h,function(e){e.next=e.future[E].data
var t=e.future.splice(0,E+1),n={meta:e.meta,data:m}
e.meta=t.pop().meta,e.past=[].concat(i(e.past),[n],i(t))}),v(h.next)
break
case"HISTORY_STEP_BACKWARD":var O=p.payload.index
h=(0,t.produce)(h,function(e){e.next=e.past[O].data
var t=e.past.splice(O,e.past.length),n={meta:e.meta,data:m}
e.meta=t.shift().meta,e.future=[].concat(i(t),[n],i(e.future))}),v(h.next)
break
case"ELEMENT_RESET":h={past:[],meta:{type:"initial",label:(0,r.t)("app.history.builder-loaded"),time:Date.now()},future:[]}
break
case"ELEMENT_ADD":var x,k
switch(w[0]){case"INSERT_CHILDREN":x=(0,r.t)("app.added",{context:(0,r.t)("app.templates.entity")})
break
default:k=p.payload.atts&&p.payload.atts._type?p.payload.atts._type:m[p.payload.id]._type}var S=(0,o.getDefinitionLabelByType)(u,k)
k&&(x=(0,r.t)("app.added",{context:S})),x&&g("add",x)
break
case"ELEMENT_MOVE":case"ELEMENT_SHIFT":g("move",(0,r.t)("app.moved",{context:(0,o.getElementLabelById)(u,{id:p.payload.id})}))
break
case"ELEMENT_DUPLICATE":g("duplicate",(0,r.t)("app.duplicated",{context:(0,o.getElementLabelById)(u,{id:p.payload.id})}))
break
case"ELEMENT_DELETE":var P="CHILDREN"===w[0]?"app.history.contents-deleted":"app.deleted"
g("delete",(0,r.t)(P,{context:(0,o.getElementLabelById)(u,{id:p.payload.id})}))
break
case"ELEMENT_UPDATE":var C="app.updated"
switch(w[0]){case"SET_COLUMN_LAYOUT":C="app.history.column-layout-updated"
break
case"REMOVE_SPACING":C="app.history.spacing-removed"
break
case"RESET_STYLE":C="app.history.reset-style"
break
case"SET_LABEL":C="app.history.set-label"}var j=p.payload,T=j.id,M=j.keys,D=j.key
g("update",(0,r.t)(C,{context:(0,o.getElementLabelById)(u,{id:p.payload.id})}),{id:T,keys:M,key:D})
break
case"ELEMENT_CREATE_ROW_LAYOUT":g("create-row-layout",(0,r.t)("app.history.create-row-layout"))}}return e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){a(e,t,n[t])})}return e}({},u,{elements:m,history:h}),p)}}
var l=null,c=Number.isNaN(window.Number(window.csAppData.max_action_history_items))?5e3:window.Number(window.csAppData.max_action_history_items)}),define("tco-app/src/reducers/xfr",["exports","immer"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.xfrReducer=function(e){return function(n,o){var r=o.type,a=o.payload
switch(r){case"XFR:SETUP":return(0,t.produce)(n||{},function(e){Object.keys(a).forEach(function(t){e.xfr[t]=a[t]})})
case"XFR:INIT_FRAME":return(0,t.produce)(n||{},function(e){Object.keys(o.payload).forEach(function(t){e[t]=o.payload[t]})})
case"XFR:APPLY_PATCHES":return(0,t.produce)(n||{},function(e){Object.keys(o.toApply).forEach(function(n){e[n]=(0,t.applyPatches)(e[n],o.toApply[n])})})}return e(n,o)}},e.xfrInitialState=void 0
e.xfrInitialState={isFrame:!0,ready:!1,session:null,subscribe:function(){}}}),define("tco-app/src/sagas/bg-contrast",["exports","lodash","color-blend","color","redux-saga/effects"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeContrastKeys=f,e.updateBgContrastForElements=v,e.maybeUpdateBgContrastForElements=b
var a=regeneratorRuntime.mark(h),i=regeneratorRuntime.mark(g),s=regeneratorRuntime.mark(v),l=regeneratorRuntime.mark(b)
function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0
try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(l){r=!0,a=l}finally{try{o||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var p=(0,t.memoize)(function(){return window.cornerstoneApp.lookup("service:color-manager")}),d=function(e){var t=u(e)
if(t.length<=0)return!1
for(var r,a=t.shift();r=t.shift();)a=(0,n.normal)(a,r)
try{var i=a,s=i.r,l=i.g,c=i.b,p=i.a
return(0,o.default)("rgba(".concat(s,",").concat(l,",").concat(c,",").concat(p,")"))}catch(d){console.warn("Unable to blend colors",e)}return(0,o.default)("rgba(0,0,0,0)")}
function f(e,t){return e.options.contrast_keys?e.options.contrast_keys.reduce(function(e,n){if(0===n.indexOf("bg:")){var o=c(n.split(":"),3),r=o[1],a=o[2],i=void 0===a?"":a
if(void 0===t[r])return e
if(e.push(r),t[r]){var s=i?"".concat(i,"_"):"",l=t["".concat(s,"bg_lower_type")],u=t["".concat(s,"bg_upper_type")]
e.push("".concat(s,"bg_lower_type")),e.push("".concat(s,"bg_upper_type")),"image"===u&&e.push("".concat(s,"bg_upper_image")),"color"===u&&e.push("".concat(s,"bg_upper_color")),"image"===l&&e.push("".concat(s,"bg_lower_image")),"color"===l&&e.push("".concat(s,"bg_lower_color"))}return e}return e.push(n),e},[]):[]}var m=function(e){return(e||"").match(/.*?\.(?:jpe?g|gif|png)/)}
function h(e,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,!1
case 2:return e.abrupt("return",e.sent)
case 3:case"end":return e.stop()}},a)}function g(e,t,n){var a,s,l,c,u,f,g,v,b,y,_,w,E
return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(n.elements[e]){i.next=2
break}return i.abrupt("return",{id:e,contrast:""})
case 2:a=n.elements[e],s=[],l=t.map(function(e){return a[e]})
case 5:if(!(c=l.pop())){i.next=18
break}if("string"==typeof c&&!["none","color","image","video"].includes(c)){i.next=8
break}return i.abrupt("continue",5)
case 8:if(!m(c)){i.next=14
break}return i.next=11,(0,r.call)(h,c,e)
case 11:return(u=i.sent)&&s.push(u),i.abrupt("continue",5)
case 14:0===c.indexOf("global-color:")&&(c=p().lookupColor(c))
try{f=(0,o.default)(c).rgb().object(),g=f.r,v=f.g,b=f.b,y=f.alpha,(_=void 0===y?1:y)>0&&s.push({r:g,g:v,b:b,a:_})}catch(O){console.warn(O)}i.next=5
break
case 18:if(!(s.length>0)){i.next=25
break}if(w=d([{r:255,g:255,b:255,a:1}].concat(s)),E=d([{r:0,g:0,b:0,a:1}].concat(s)),!w||!w.isDark()){i.next=23
break}return i.abrupt("return",{contrast:"dark",id:e})
case 23:if(!E||!E.isLight()){i.next=25
break}return i.abrupt("return",{contrast:"light",id:e})
case 25:return i.abrupt("return",{id:e,contrast:""})
case 26:case"end":return i.stop()}},i)}function v(e,t){var n
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,r.all)(t.map(function(t){var n=t.id,o=t.keys
return(0,r.call)(g,n,o,e)}))
case 2:return n=o.sent,o.next=5,(0,r.put)({type:"RENDER:UPDATE_META",payload:{elements:n}})
case 5:case"end":return o.stop()}},s)}function b(e,t){var n
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(n=[],t.forEach(function(t){var o=f(e.definitions[e.elements[t]._type]||e.definitions.undefined,e.elements[t])
o.length>0&&n.push({id:t,keys:o})}),!(n.length>0)){o.next=5
break}return o.next=5,(0,r.fork)(v,e,n)
case 5:case"end":return o.stop()}},l)}}),define("tco-app/src/sagas/builder",["exports","redux-saga/effects","tco-app/src/lib/keybindings","tco-app/src/actions/builder","tco-app/src/actions/inspector"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var a=regeneratorRuntime.mark(f),i=regeneratorRuntime.mark(m),s=regeneratorRuntime.mark(h),l=regeneratorRuntime.mark(g),c=regeneratorRuntime.mark(v),u=regeneratorRuntime.mark(b),p=regeneratorRuntime.mark(y)
function d(e){window.cornerstoneApp.lookup("service:preview").get("xfr").message("preview:scroll-to-element",e)}function f(e){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if("undefined"===e.payload.advancedMode){n.next=4
break}return n.next=4,(0,t.put)((0,r.inspectorSetup)())
case 4:case"end":return n.stop()}},a)}function m(e){var n,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=e.payload,a.next=3,(0,t.select)()
case 3:if((r=a.sent).inspector.inspecting){a.next=6
break}return a.abrupt("return")
case 6:return a.next=8,(0,t.put)((0,o.builderSelect)(n.id))
case 8:if(!1!==n.navigate){a.next=10
break}return a.abrupt("return")
case 10:if(r.inspector.empty){a.next=17
break}return a.next=13,(0,t.put)((0,o.builderNavigate)("inspector"))
case 13:return a.next=15,(0,t.call)(d,n.id)
case 15:a.next=19
break
case 17:return a.next=19,(0,t.put)((0,o.builderNavigate)("layout"))
case 19:window.cornerstoneApp.lookup("service:ui").afterInspect()
case 20:case"end":return a.stop()}},i)}function h(e){var n
return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(n=e.payload).id){r.next=4
break}return r.next=4,(0,t.call)(d,n.id)
case 4:if(!0===n.navigate){r.next=6
break}return r.abrupt("return")
case 6:return r.next=8,(0,t.put)((0,o.builderNavigate)("layout"))
case 8:window.cornerstoneApp.lookup("service:ui").afterInspect()
case 9:case"end":return r.stop()}},s)}function g(){var e
return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,t.select)()
case 2:n.sent.ui.hideWorkspace&&((e=window.cornerstoneApp.lookup("service:ui")).setProperties({showCustomCSS:!1,showCustomJS:!1,showActionHistory:!1}),e.closeReactExpanders())
case 4:case"end":return n.stop()}},l)}function v(){var e,n,o
return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,t.select)()
case 2:if(e=r.sent,window.cornerstoneApp.lookup("service:ui").set("workspaceOrientation",e.builder.orientation),"undefined"!=typeof Storage)try{n={},(o=window.localStorage.getItem("csUIPreferences"))&&(n=JSON.parse(o)),n.orientations||(n.orientations={}),n.orientations[e.builder.builder]=e.builder.orientation,window.localStorage.setItem("csUIPreferences",JSON.stringify(n))}catch(a){console.warn("unable to set UI preference",e.builder)}case 5:case"end":return r.stop()}},c)}function b(){var e,n
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,(0,t.select)()
case 3:e=o.sent,n=(e.preferences.favoriteElements||[]).map(function(e){return"{{".concat(e,"}}")}).join(""),window.localStorage.setItem("csElementFavorites",n),o.next=10
break
case 8:o.prev=8,o.t0=o.catch(0)
case 10:case"end":return o.stop()}},u,null,[[0,8]])}function y(){var e,n,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,t.select)()
case 2:if(e=a.sent,n="horizontal"===e.builder.orientation,e.builder.selected&&e.builder.selected[1]&&(o=e.builder.selected[1]),r=Object.keys(e.elements).find(function(t){return"root"===e.elements[t]._type}),!o&&r&&(o=r,e.elements[r]._modules&&e.elements[r]._modules.length>0&&(o=e.elements[r]._modules[0])),!o){a.next=10
break}return a.next=10,(0,t.put)({type:"BUILDER:SELECT",payload:{id:o,deep:n}})
case 10:case"end":return a.stop()}},p)}var _=[(0,t.takeEvery)("ELEMENT_RESET",y),(0,t.takeEvery)("INSPECTOR:INSPECT",m),(0,t.takeEvery)("BUILDER:UPDATE_ORIENTATION",y),(0,t.takeEvery)("BUILDER:UPDATE_ORIENTATION",v),(0,t.takeEvery)("ELEMENT_RESET",v),(0,t.takeEvery)("BUILDER:SELECT",h),(0,t.takeEvery)("BUILDER:UPDATE_PREFERENCES",f),(0,t.takeEvery)("PREFERENCES:TOGGLE_FAVORITE_ELEMENT",b),(0,t.takeEvery)("UI:REMOTE_KEY_BINDING",function(e){var t=e.payload.binding;(0,n.triggerBinding)(t)}),(0,t.takeEvery)("UI:HIDE_WORKSPACE",g)]
e.default=_}),define("tco-app/src/sagas/clipboard",["exports","redux-saga/effects","tco-app/src/actions/elements","tco-app/src/util/elements","tco-app/src/selectors/elements","tco-app/src/reducers/elements"],function(e,t,n,o,r,a){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var i=regeneratorRuntime.mark(u),s=regeneratorRuntime.mark(p)
function l(e,t,n,o){if(!n)return!1
var r=n._type
if(!e[o])return!1
var a=e[o]._type
return t[a]&&r===a}function c(e,t,n,o){if(!n)return!1
var r=n._type
if(!e[o])return!1
var i=e[o]._type
return t[i]&&(0,a.areElementTypesCompatible)(i,r,t)}function u(e){var o,r,a,s,u
return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=e.payload.id,i.next=3,(0,t.select)()
case 3:if(r=i.sent,a=r.elements,s=r.definitions,u=r.clipboard.element.atts,!l(a,s,u,o)){i.next=12
break}return i.next=10,(0,t.put)((0,n.elementUpdateAtts)(o,u))
case 10:i.next=15
break
case 12:if(!c(a,s,u,o)){i.next=15
break}return i.next=15,(0,t.put)((0,n.elementAdd)(o,u))
case 15:case"end":return i.stop()}},i)}function p(e){var a,i,c,u,p,d,f
return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=e.payload.id,s.next=3,(0,t.select)()
case 3:if(i=s.sent,c=i.elements,u=i.definitions,p=i.clipboard.element.atts,!l(c,u,p,a)){s.next=12
break}return s.next=10,(0,t.put)((0,n.elementUpdateAtts)(a,(0,o.getElementStyleDiff)(p,c[a],u[c[a]._type])))
case 10:s.next=19
break
case 12:d=(0,r.getDescendantsOfType)(c,a,p._type)
case 13:if(!(d.length>0)){s.next=19
break}return f=d.pop(),s.next=17,(0,t.put)((0,n.elementUpdateAtts)(f,(0,o.getElementStyleDiff)(p,c[f],u[c[f]._type])))
case 17:s.next=13
break
case 19:case"end":return s.stop()}},s)}var d=[(0,t.takeEvery)("CLIPBOARD_PASTE:ELEMENT",u),(0,t.takeEvery)("CLIPBOARD_PASTE:ELEMENT_STYLE",p)]
e.default=d}),define("tco-app/src/sagas/elements",["exports","redux-saga/effects","lodash","tco-app/src/reducers/helpers","tco-app/src/util/elements","tco-app/src/lib/i18n","tco-app/src/actions/ui","tco-app/src/actions/elements"],function(e,t,n,o,r,a,i,s){function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=regeneratorRuntime.mark(k),p=regeneratorRuntime.mark(S),d=regeneratorRuntime.mark(P),f=regeneratorRuntime.mark(C),m=regeneratorRuntime.mark(j),h=regeneratorRuntime.mark(T),g=regeneratorRuntime.mark(M),v=regeneratorRuntime.mark(D),b=regeneratorRuntime.mark(A),y=regeneratorRuntime.mark(I),_=regeneratorRuntime.mark(R),w=regeneratorRuntime.mark(L)
function E(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var O=(0,n.memoize)(function(){return window.cornerstoneApp.lookup("service:store")})
function x(e){window.cornerstoneApp.lookup("service:preview").get("xfr").message("preview:scroll-to-element",e)}function k(e){var n,o,r,a,i,s
return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.payload,o=n.preset,r=E(n,["preset"]),a=function(){var e=O().peekRecord("element/preset",o)
return!!e&&e.get("values")},l.next=5,(0,t.call)(a)
case 5:if(i=l.sent){l.next=13
break}return s=function(){return O().query("element/preset",{id:o})},l.next=10,(0,t.call)(s)
case 10:return l.next=12,(0,t.call)(a)
case 12:i=l.sent
case 13:if(!i){l.next=16
break}return l.next=16,(0,t.put)({type:"ELEMENT_ADD",payload:Object.assign({atts:i},r)})
case 16:case"end":return l.stop()}},u)}function S(e){var n,o,r,a,i,s
return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.payload,o=n.preset,r=E(n,["preset"]),a=function(){var e=O().peekRecord("element/preset",o)
return!!e&&e.get("values")},l.next=5,(0,t.call)(a)
case 5:if(i=l.sent){l.next=13
break}return s=function(){return O().query("element/preset",{id:o})},l.next=10,(0,t.call)(s)
case 10:return l.next=12,(0,t.call)(a)
case 12:i=l.sent
case 13:if(!i){l.next=16
break}return l.next=16,(0,t.put)({type:"ELEMENT_ADD:SIBLING",payload:Object.assign({atts:i},r)})
case 16:case"end":return l.stop()}},p)}function P(e){var n
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!((n=e.payload).inspect&&n.newElements&&n.newElements[0])){o.next=4
break}return o.next=4,(0,t.put)({type:"INSPECTOR:INSPECT",payload:{id:n.newElements[0]}})
case 4:case"end":return o.stop()}},d)}function C(e){var n,r,a,i,s,l
return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return n=e.payload,u.next=3,(0,t.select)()
case 3:if(r=u.sent,a=n.newElements&&n.newElements[0]){u.next=7
break}return u.abrupt("return")
case 7:if(i=r.elements[a],s=r.elements[i._parent],!(r.builder.selected.length<=0||r.builder.selected.includes(i._parent))||"root"===s._type||"region"===s._type&&"vertical"===r.builder.orientation){u.next=12
break}return u.next=12,(0,t.put)({type:"BUILDER:SELECT",payload:{id:a}})
case 12:return u.next=14,(0,t.call)(x,a)
case 14:return l=[a].concat(c((0,o.flattenChildren)(r.elements,a))),u.next=17,(0,t.put)({type:"RENDER:QUEUE_UPDATE_MARKUP",payload:{elements:l}})
case 17:return u.next=19,(0,t.put)({type:"RENDER:UPDATE_DYNAMIC_CSS",payload:{elements:l}})
case 19:return u.next=21,(0,t.put)({type:"RENDER:POST_PROCESS_ATTRIBUTES",payload:{elements:l}})
case 21:case"end":return u.stop()}},f)}function j(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,t.select)()
case 2:if(!e.sent.builder.incomingElement){e.next=6
break}return e.next=6,(0,t.put)({type:"BUILDER:CLEAR_INCOMING_ELEMENT"})
case 6:case"end":return e.stop()}},m)}function T(){var e,n,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,t.put)((0,i.uiObserveEnd)())
case 2:return a.next=4,(0,t.select)()
case 4:if(!((e=a.sent).builder.selected&&e.builder.selected.length>0)){a.next=11
break}return n=Object.keys(e.elements),o=[].concat(e.builder.selected).reverse().find(function(e){return n.includes(e)}),r=o?{id:o,navigate:!1}:{reset:!0},a.next=11,(0,t.put)({type:"BUILDER:SELECT",payload:r})
case 11:case"end":return a.stop()}},h)}function M(e){var n,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=e.payload,o=n.newElements,r=n.atts,!(o&&o.length>0||r&&r._modules)){a.next=4
break}return a.next=4,(0,t.call)(D,e)
case 4:case"end":return a.stop()}},g)}function D(e){var n,r,a
return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!((n=e.payload).newElements&&n.newElements.length>0)){i.next=6
break}return i.next=4,(0,t.select)()
case 4:a=i.sent,r=n.newElements.reduce(function(e,t){return e.concat([t].concat(c((0,o.flattenChildren)(a.elements,t))))},[])
case 6:if(n.updatedElements&&n.updatedElements.length>0&&(r=n.updatedElements),!r){i.next=14
break}return i.next=10,(0,t.put)({type:"RENDER:QUEUE_UPDATE_MARKUP",payload:{elements:r}})
case 10:return i.next=12,(0,t.put)({type:"RENDER:UPDATE_DYNAMIC_CSS",payload:{elements:r}})
case 12:return i.next=14,(0,t.put)({type:"RENDER:POST_PROCESS_ATTRIBUTES",payload:{elements:r}})
case 14:case"end":return i.stop()}},v)}function A(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:window.cornerstoneApp.lookup("service:ui").set("unsavedData",!0)
case 1:case"end":return e.stop()}},b)}function I(e){var n,o,r,a,i,s
return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n=e.payload,o=n.atts,r=n.key,a=n.value,i=n.id,r?l({},r,a):o,!((s=r?[r]:Object.keys(o||{})).length<=0)){c.next=6
break}return c.abrupt("return")
case 6:return c.next=8,(0,t.put)({type:"INSPECTOR:UPDATE_CONDITIONS",payload:{keys:s,id:i}})
case 8:case"end":return c.stop()}},y)}function R(e){var n,o,r,l,c,u,p,d,f
return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return n=e.type,o=e.payload.id,m.next=3,(0,t.select)()
case 3:r=m.sent,l=r.ui.quickConfirm,c=r.elements,u=r.definitions,m.t0=n,m.next="ELEMENT_DELETE:CONFIRM"===m.t0?8:"ELEMENT_DELETE_CHILDREN:CONFIRM"===m.t0?11:14
break
case 8:return p=(0,s.elementDelete)(o),d="app.elements-confirm-delete",m.abrupt("break",14)
case 11:return p=(0,s.elementDeleteChildren)(o),d="app.elements-confirm-erase",m.abrupt("break",14)
case 14:if(p&&d){m.next=16
break}return m.abrupt("return")
case 16:return f=function(){var e=(c[o]||{})._type
return u[e].title||"Element"},m.next=19,(0,t.put)(l?p:(0,i.uiConfirm)({message:(0,a.t)(d,{title:f()}),action:p,acceptClass:"sad"}))
case 19:case"end":return m.stop()}},_)}function L(e){var n,a,i,l,c,u,p
return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return n=e.payload.id,d.next=3,(0,t.select)()
case 3:if(a=d.sent,i=a.elements,l=a.definitions,(c=i[n])&&c._type){d.next=9
break}return d.abrupt("return")
case 9:return u=l[c._type],p=(0,r.getElementStyleDiff)((0,o.getElementDefaults)({definition:u}),c,u),d.next=13,(0,t.put)((0,s.elementUpdateAtts)(n,p))
case 13:case"end":return d.stop()}},w)}var N=[(0,t.takeEvery)(function(e){return e&&e.type&&0===e.type.indexOf("ELEMENT")&&"ELEMENT_RESET"!==e.type},A),(0,t.takeEvery)("ELEMENT_ADD",C),(0,t.takeEvery)("ELEMENT_ADD_FROM_PRESET",k),(0,t.takeEvery)("ELEMENT_ADD_FROM_PRESET:SIBLING",S),(0,t.takeEvery)("ELEMENT_ADD",j),(0,t.takeEvery)("ELEMENT_ADD_FROM_PRESET",j),(0,t.takeEvery)("ELEMENT_ADD_FROM_PRESET:SIBLING",j),(0,t.takeEvery)("ELEMENT_ADD",P),(0,t.takeEvery)("ELEMENT_ADD:SIBLING",C),(0,t.takeEvery)("ELEMENT_DUPLICATE",C),(0,t.takeEvery)("ELEMENT_DELETE",T),(0,t.takeEvery)("ELEMENT_DELETE_CHILDREN",T),(0,t.takeEvery)("ELEMENT_DELETE:CONFIRM",R),(0,t.takeEvery)("ELEMENT_DELETE_CHILDREN:CONFIRM",R),(0,t.takeEvery)("ELEMENT_ADD:INSERT_CHILDREN",D),(0,t.takeEvery)("ELEMENT_UPDATE:SET_COLUMN_LAYOUT",D),(0,t.takeEvery)("ELEMENT_CREATE_ROW_LAYOUT",D),(0,t.takeEvery)("ELEMENT_CREATE_GRID_LAYOUT",D),(0,t.takeEvery)("ELEMENT_UPDATE:REMOVE_SPACING",D),(0,t.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTES",I),(0,t.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTE",I),(0,t.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTES",M),(0,t.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTE",M),(0,t.takeEvery)("ELEMENT_UPDATE:RESET_STYLE",L)]
e.default=N}),define("tco-app/src/sagas/index",["exports","redux-saga/effects","tco-app/src/sagas/elements","tco-app/src/sagas/render","tco-app/src/sagas/builder","tco-app/src/sagas/clipboard","tco-app/src/sagas/preview"],function(e,t,n,o,r,a,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c
var s=regeneratorRuntime.mark(c)
function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.csAppData.isPreview){e.next=5
break}return e.next=3,(0,t.all)(l(i.default))
case 3:e.next=7
break
case 5:return e.next=7,(0,t.all)([].concat(l(n.default),l(a.default),l(o.default),l(r.default)))
case 7:case"end":return e.stop()}},s)}}),define("tco-app/src/sagas/preview",["exports","redux-saga/effects"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=regeneratorRuntime.mark(i),o=regeneratorRuntime.mark(s)
function r(e,t){var n,o,r=t.tag,a=t.href
try{if(!window.document.querySelector('link[href*="'.concat(a.split("?").shift(),'"]'))){var i=(n=r,(o=document.createElement("template")).innerHTML=n.trim(),o.content.firstChild)
document.querySelector("head").append(i)}}catch(s){console.warn("Failed to load style",s)}}function a(e,t){return new Promise(function(n){if(window.document.querySelector('script[src*="'.concat(t.src.split("?").shift(),'"]')))return n()
if(t.before){var o=window.document.createElement("script")
o.setAttribute("data-cs-script-extra",e),o.innerHTML=t.before,window.document.body.append(o)}var r=document.createElement("script")
window.document.body.append(r),r.onload=function(){return n()},r.onerror=function(e){console.warn("Error loading script",e),n()},r.src=t.src})}function i(e){var o,i,s,l,c,u,p,d,f,m,h,g,v,b,y,_
return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(o=e.payload,i=(o=void 0===o?{}:o).xfr,s=void 0===i?{}:i,l=e.toApply,c=void 0===l?{}:l,u=s&&s.ready,c&&c.render||u){n.next=7
break}return n.abrupt("return")
case 7:return n.next=9,(0,t.select)()
case 9:if(p=n.sent,d=p.render,f=d.requiredScripts,m=d.requiredScriptHandles,h=d.requiredStyles,g=d.requiredStyleHandles,(v=g.filter(function(e){return h[e]&&"loaded"!==h[e].state})).forEach(function(e){return r(0,h[e])}),!(v.length>0)){n.next=16
break}return n.next=16,(0,t.put)({type:"RENDER:UPDATE_ASSETS",payload:{assets:v.map(function(e){return{type:"style",handle:e,state:"loaded"}})}})
case 16:if(!((b=m.filter(function(e){return f[e]&&(!f[e].state||!["loaded","loading"].includes(f[e].state))})).length>0)){n.next=20
break}return n.next=20,(0,t.put)({type:"RENDER:UPDATE_ASSETS",payload:{assets:b.map(function(e){return{type:"script",handle:e,state:"loading"}})}})
case 20:y=[]
case 21:if(!(b.length>0)){n.next=28
break}return _=b.shift(),n.next=25,(0,t.call)(a,_,f[_])
case 25:y.push(_),n.next=21
break
case 28:if(!(y.length>0)){n.next=31
break}return n.next=31,(0,t.put)({type:"RENDER:UPDATE_ASSETS",payload:{assets:y.map(function(e){return{type:"script",handle:e,state:"loaded"}})}})
case 31:case"end":return n.stop()}},n)}function s(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,t.put)({type:"RENDER:REFRESH_CSS"})
case 2:case"end":return e.stop()}},o)}var l=[(0,t.takeEvery)("XFR:APPLY_PATCHES",i),(0,t.takeEvery)("XFR:INIT_FRAME",i),(0,t.takeEvery)("XFR:INIT_FRAME",s)]
e.default=l}),define("tco-app/src/sagas/render",["exports","color","redux-saga/effects","lodash","color-blend","tco-app/src/reducers/helpers","tco-app/src/actions/ui","tco-app/src/lib/http","tco-app/src/sagas/bg-contrast"],function(e,t,n,o,r,a,i,s,l){function c(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=regeneratorRuntime.mark(C),p=regeneratorRuntime.mark(j),d=regeneratorRuntime.mark(T),f=regeneratorRuntime.mark(M),m=regeneratorRuntime.mark(D),h=regeneratorRuntime.mark(A),g=regeneratorRuntime.mark(I),v=regeneratorRuntime.mark(R),b=regeneratorRuntime.mark(L),y=regeneratorRuntime.mark(N),_=regeneratorRuntime.mark(U),w=regeneratorRuntime.mark(F),E=regeneratorRuntime.mark(B),O=regeneratorRuntime.mark(z),x=regeneratorRuntime.mark(V),k=new window.Map
function S(e,t,n){var o=n.hash,r=n.response
return function(e,t,n,o){var r=n.extractions,a=n.template,i=n.inline_css,s=n.type,l=e.definitions[s]
!l||!1===l.options.cache||r.scripts.length>0||r.styles.length>0||k.set(t,{ts:o,updated:Date.now(),value:{template:a,inline_css:i,type:s}})}(e,o,r,n.ts),{id:t,response:r}}function P(e){return(0,s.request)("render::elementBatch",e)}function C(){var e,t
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,n.select)()
case 2:return e=o.sent,t=Object.keys(e.elements),o.next=6,(0,n.put)({type:"RENDER:QUEUE_UPDATE_MARKUP",payload:{elements:t}})
case 6:return o.next=8,(0,n.put)({type:"RENDER:UPDATE_DYNAMIC_CSS",payload:{elements:t}})
case 8:return o.next=10,(0,n.put)({type:"RENDER:POST_PROCESS_ATTRIBUTES",payload:{elements:t}})
case 10:return o.next=12,(0,n.call)(l.maybeUpdateBgContrastForElements,e,t)
case 12:case"end":return o.stop()}},u)}function j(){var e,t
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,n.select)()
case 2:return e=o.sent,t=Object.keys(e.elements),o.next=6,(0,n.put)({type:"RENDER:UPDATE_DYNAMIC_CSS",payload:{elements:t}})
case 6:case"end":return o.stop()}},p)}function T(){var e,t
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,n.select)()
case 2:e=o.sent,o.t0=e.builder.builder,o.next="content"===o.t0?6:"globalBlocks"===o.t0?6:"header"===o.t0?8:"footer"===o.t0?10:12
break
case 6:return t=[{atts:{_region:"content",_type:"section"}},{atts:{_region:"content",_type:"row"}},{atts:{_region:"content",_type:"layout-row"}},{atts:{_region:"content",_type:"layout-column"}},{atts:{_region:"content",_type:"layout-grid"}},{atts:{_region:"content",_type:"layout-cell"}},{atts:{_region:"content",_type:"column",size:"1/1"}},{atts:{_region:"content",_type:"column",size:"1/2"}},{atts:{_region:"content",_type:"column",size:"1/3"}},{atts:{_region:"content",_type:"column",size:"2/3"}},{atts:{_region:"content",_type:"column",size:"1/4"}},{atts:{_region:"content",_type:"column",size:"3/4"}},{atts:{_region:"content",_type:"column",size:"1/5"}},{atts:{_region:"content",_type:"column",size:"2/5"}},{atts:{_region:"content",_type:"column",size:"3/5"}},{atts:{_region:"content",_type:"column",size:"4/5"}},{atts:{_region:"content",_type:"column",size:"1/6"}},{atts:{_region:"content",_type:"column",size:"5/6"}}],o.abrupt("break",12)
case 8:return t=[{atts:{_region:"top",_type:"bar"}},{atts:{_region:"left",_type:"bar"}},{atts:{_region:"bottom",_type:"bar"}},{atts:{_region:"right",_type:"bar"}},{atts:{_region:"top",_type:"container"}},{atts:{_region:"left",_type:"container"}},{atts:{_region:"bottom",_type:"container"}},{atts:{_region:"right",_type:"container"}}],o.abrupt("break",12)
case 10:return t=[{atts:{_region:"footer",_type:"bar"}},{atts:{_region:"footer",_type:"container"}}],o.abrupt("break",12)
case 12:return o.next=14,(0,n.put)({type:"RENDER:PRIME_ELEMENTS",payload:{elements:t}})
case 14:case"end":return o.stop()}},d)}function M(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,n.delay)(15)
case 2:return e.next=4,(0,n.put)((0,i.uiUpdateGridCounter)())
case 4:case"end":return e.stop()}},f)}function D(){var e,t
return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,n.select)()
case 2:return e=o.sent,t=(e.render.debounce||25)+Object.keys(e.render.waitQueue||{}).length,o.next=6,(0,n.delay)(t)
case 6:return o.next=8,(0,n.put)({type:"RENDER:BATCH_UPDATE_MARKUP"})
case 8:case"end":return o.stop()}},m)}function A(){var e,t,o,r,a,i,s,l,c,u,p,d,f
return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,(0,n.select)()
case 2:if(e=m.sent,t={},o=[],r=[],[],Object.keys(e.render.inFlight).forEach(function(n){var a=e.render.inFlight[n],i=a.ids,s=a.ts,l=a.data,c=k.get(n)
if("global-block"==l._type){var u=window.location.hash.match(/^#\/(?:content|headers|footers|global-blocks)\/\w+\?lang=(\w+)$/i)
l.lang=null==u?window.csAppData.wpmlDefault:u[1]}if(c){if(o.push(n),c.ts>s)return
i.forEach(function(e){return r.push({id:e,response:c.value})})}else t[n]=e.render.inFlight[n]}),!(o.length>0)){m.next=11
break}return m.next=11,(0,n.put)({type:"RENDER:COMPLETE",payload:{hashes:o,completed:r}})
case 11:if(!(Object.keys(t).length<=0)){m.next=13
break}return m.abrupt("return")
case 13:return m.prev=13,m.next=16,(0,n.call)(P,{context:e.builder.renderContext,batch:t})
case 16:return a=m.sent,i=a.extractions||{},s=i.fonts,l=i.scripts,c=i.styles,m.next=20,(0,n.select)()
case 20:return u=m.sent,p=[],d=[],a.batch.forEach(function(e){var t=e.ts,n=e.hash
u.render.inFlight[n]&&u.render.inFlight[n].ts<=t&&(p.push(e),d.push(n))}),f=p.reduce(function(t,n){return t.concat(n.ids.map(function(t){return S(e,t,n)}))},[]),m.next=27,(0,n.put)({type:"RENDER:COMPLETE",payload:{hashes:d,completed:f,fonts:s,scripts:l,styles:c}})
case 27:m.next=32
break
case 29:m.prev=29,m.t0=m.catch(13),console.log(m.t0)
case 32:case"end":return m.stop()}},h,null,[[13,29]])}function I(){var e,t,o,r,a,i,s,l,c,u
return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,(0,n.select)()
case 2:if(e=p.sent,t={},o=[],Object.keys(e.render.primeQueue).forEach(function(n){var r=e.render.primeQueue[n],a=r.hash,i=r.ts,s=r.data,l=k.get(a)
if(l){if(l.ts>i)return
return o.push({id:n,response:l.value})}t[a]?t[a].ids.push(n):t[a]={data:s,ts:i,ids:[n]}}),!(o.length>0)){p.next=9
break}return p.next=9,(0,n.put)({type:"RENDER:PRIME_COMPLETE",payload:{completed:o}})
case 9:if(!(Object.keys(t).length<=0)){p.next=11
break}return p.abrupt("return")
case 11:return p.prev=11,p.next=14,(0,n.call)(P,{context:e.builder.renderContext,batch:t})
case 14:return r=p.sent,a=r.extractions||{},i=a.fonts,s=a.scripts,l=a.styles,p.next=18,(0,n.select)()
case 18:return c=p.sent,u=r.batch.filter(function(e){var t=e.ts
return 0===e.ids.filter(function(e){return c.render.primeQueue[e].ts>t}).length}).reduce(function(t,n){return t.concat(n.ids.map(function(t){return S(e,t,n)}))},[]),p.next=22,(0,n.put)({type:"RENDER:PRIME_COMPLETE",payload:{completed:u,fonts:i,scripts:s,styles:l}})
case 22:p.next=27
break
case 24:p.prev=24,p.t0=p.catch(11),console.log(p.t0)
case 27:case"end":return p.stop()}},g,null,[[11,24]])}function R(e,t){var r,i,s,c,u,p,d,f,m,h,g,b,y,_,w,E
return regeneratorRuntime.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(r=t.id,i=t.keys,s=void 0===i?[]:i,c=t.debounce,u=t.updateMarkup,p=void 0!==u&&u,d=t.updateStyles,f=void 0!==d&&d,m=e.elements[r],h=e.definitions[m._type]||e.definitions.undefined,g=(0,a.getDesignations)(h),s.forEach(function(e){var t=(g[e]||"").split(":")[0]
"all"!==t&&"markup"!==t||(p=!0),"all"!==t&&"style"!==t||(f=!0)}),b=[r],e.elements[r]._modules&&e.elements[r]._modules.length>0&&e.elements[r]._modules.forEach(function(t){var n=e.definitions[e.elements[t]._type]
n&&n.options.child&&b.push(t)}),y=e.elements[r]._parent,(_=e.definitions[e.elements[y]._type])&&_.options.render_children&&b.push(y),!((w=(0,l.normalizeContrastKeys)(h,e.elements[r])).length>0&&(0,o.intersection)(s,w).length>0)){v.next=14
break}return v.next=14,(0,n.call)(l.updateBgContrastForElements,e,[{id:r,keys:w}])
case 14:if(E=e.ui.inlineEditing===r,!p||E){v.next=18
break}return v.next=18,(0,n.put)({type:"RENDER:QUEUE_UPDATE_MARKUP",payload:{elements:b,debounce:c}})
case 18:if(!f){v.next=21
break}return v.next=21,(0,n.put)({type:"RENDER:UPDATE_DYNAMIC_CSS",payload:{elements:b}})
case 21:return v.next=23,(0,n.put)({type:"RENDER:POST_PROCESS_ATTRIBUTES",payload:{elements:b,primary:r,keys:s}})
case 23:case"end":return v.stop()}},v)}function L(e){var t,o
return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.payload,r.next=3,(0,n.select)()
case 3:return o=r.sent,r.next=6,(0,n.call)(R,o,{id:t.id,updateStyles:!0})
case 6:case"end":return r.stop()}},b)}function N(e){var t,o,r
return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.payload,o=[],i.next=4,(0,n.select)()
case 4:return r=i.sent,t.label&&o.push((0,a.getLabelKey)(r.definitions[r.elements[t.id]._type]||r.definitions.undefined)),t.atts&&(o=[].concat(c(o),c(Object.keys(t.atts)))),t.key&&o.push(t.key),i.next=10,(0,n.call)(R,r,{id:t.id,keys:o,debounce:t.debounce})
case 10:case"end":return i.stop()}},y)}function U(e){var t,o
return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.payload.id,r.next=3,(0,n.select)()
case 3:return o=r.sent,r.next=6,(0,n.call)(R,o,{id:t,updateMarkup:!0})
case 6:case"end":return r.stop()}},_)}function F(e){var t,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.payload,a.next=3,(0,n.select)()
case 3:if(o=a.sent,r=t.parent||t.id,!o.definitions[o.elements[r]._type]||!o.definitions[o.elements[r]._type].options.render_children){a.next=8
break}return a.next=8,(0,n.call)(R,o,{id:r,updateMarkup:!0,updateStyles:!0})
case 8:case"end":return a.stop()}},w)}function B(e){var t,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e.payload,o=t.newElements,r=t.atts,!(o&&o.length>0||r&&r._modules)){a.next=4
break}return a.next=4,(0,n.call)(z,e)
case 4:case"end":return a.stop()}},E)}function z(e){var t,o,r
return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.payload,a.next=3,(0,n.select)()
case 3:if(o=a.sent,r=o.elements[t.id]._parent,!o.definitions[o.elements[r]._type]||!o.definitions[o.elements[r]._type].options.render_children){a.next=8
break}return a.next=8,(0,n.call)(R,o,{id:r,updateMarkup:!0,updateStyles:!0})
case 8:case"end":return a.stop()}},O)}var H=(0,o.memoize)(function(){return window.cornerstoneApp.lookup("service:store")})
function V(e){var t,o,r,a,i
return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.payload,o=t.id,r=function(){var e=H().peekRecord("element/preset",o)
return!!e&&e.get("values")},s.next=5,(0,n.call)(r)
case 5:if(a=s.sent){s.next=13
break}return i=function(){return H().query("element/preset",{id:o})},s.next=10,(0,n.call)(i)
case 10:return s.next=12,(0,n.call)(r)
case 12:a=s.sent
case 13:if(!a){s.next=16
break}return s.next=16,(0,n.put)({type:"RENDER:PRIME_ELEMENTS",payload:{elements:[{atts:a}]}})
case 16:case"end":return s.stop()}},x)}var W=[(0,n.takeEvery)("ELEMENT_RESET",T),(0,n.takeEvery)("ELEMENT_RESET",C),(0,n.takeEvery)("HISTORY_STEP_FORWARD",C),(0,n.takeEvery)("HISTORY_STEP_BACKWARD",C),(0,n.takeEvery)("ELEMENT_UPDATE:SET_LABEL",N),(0,n.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTE",N),(0,n.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTES",N),(0,n.takeEvery)("ELEMENT_UPDATE:SET_ATTRIBUTES",B),(0,n.takeEvery)("ELEMENT_CREATE_ROW_LAYOUT",N),(0,n.takeEvery)("ELEMENT_CREATE_GRID_LAYOUT",N),(0,n.takeEvery)("ELEMENT_UPDATE_GRID_LAYOUT",L),(0,n.takeEvery)("ELEMENT_UPDATE_CELL_POSITION",L),(0,n.takeEvery)("ELEMENT_MOVE",z),(0,n.takeEvery)("ELEMENT_SHIFT",z),(0,n.takeEvery)("ELEMENT_DELETE",F),(0,n.takeEvery)("ELEMENT_DELETE_CHILDREN",F),(0,n.takeEvery)("ELEMENT_ADD:SIBLING",z),(0,n.takeEvery)("ELEMENT_DUPLICATE",z),(0,n.takeEvery)("UI:END_INLINE_EDITING",U),(0,n.takeLatest)("RENDER:QUEUE_UPDATE_MARKUP",D),(0,n.takeEvery)("RENDER:BATCH_UPDATE_MARKUP",A),(0,n.takeEvery)("RENDER:PRIME_ELEMENTS",I),(0,n.takeEvery)("RENDER:PRIME_PRESET",V),(0,n.takeEvery)("RENDER:REFRESH_CSS",j),(0,n.takeLatest)(["RENDER:COMPLETE","RENDER:POST_PROCESS_ATTRIBUTES","RENDER:UPDATE_DYNAMIC_CSS"],M)]
e.default=W}),define("tco-app/src/selectors/element-workspace",["exports","tco-app/src/lib/permissions"],function(e,t){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(e,t){var n=e.title.toUpperCase(),o=t.title.toUpperCase()
return n>o?1:n<o?-1:0}function r(e,t){var n=0===e.descriptor.indexOf("standard|classic:"),o=0===t.descriptor.indexOf("standard|classic:")
return n&&!o?1:o&&!n?-1:0}Object.defineProperty(e,"__esModule",{value:!0}),e.getElementLibrary=function(e,a){var i=e.builder.builder,s=e.preferences.favoriteElements,l=e.definitions,c=["globalBlocks"].includes(i)?"content":i,u=function(e){return!a||a.includes("*")||a.includes(e)},p=function(e){var t=l[e].options.library
return Array.isArray(t)?t.includes(c):!1!==t},d=Object.keys(l).filter(function(e){return l[e]&&!1!==l[e].active&&u(e)&&p(e)&&!(0===e.indexOf("classic:")&&"content"!==c)&&(0,t.currentUserCan)("element.".concat(e,".show_in_library"))}).map(function(e){var t=l[e],n=t.title,o=t.icon,r="standard|".concat(e)
return{descriptor:r,title:n,icon:"native"===o?"elements/".concat(e):o,favorite:s.includes(r)}}),f=[],m=e.data&&e.data.presets||{},h=Object.keys(m).filter(function(e){var n=m[e]||{},o=n.element
return o&&l[o]&&!1!==l[o].active&&u(o)&&p(o)&&!(0===o.indexOf("classic:")&&"content"!==c)&&(0,t.currentUserCan)("element.".concat(o,".show_in_library"))}).map(function(e){var t=m[e]||{},n=t.title,o=t.element,r=l[o],a=r.title,i=r.icon,c="preset|".concat(o,"|").concat(e)
return{descriptor:c,title:n,elementTitle:a,icon:"native"===i?"elements/".concat(o):i,favorite:s.includes(c)}})
return h.sort(o),d.sort(o),d.sort(r),{favorites:[].concat(n(d),f,n(h)).filter(function(e){var t=e.descriptor
return s.includes(t)}),standard:d,dynamic:f,presets:h}}}),define("tco-app/src/selectors/elements",["exports","reselect","lodash","tco-app/src/selectors/render","tco-app/src/reducers/helpers","tco-app/src/lib/permissions","tco-app/src/util/normalize-controls","tco-app/src/lib/i18n"],function(e,t,n,o,r,a,i,s){function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.makeGetActiveColumns=e.makeGetSelected=e.getDescendantsOfType=e.makeGetLayoutSections=e.getAddNewElementFromId=e.getAddNewElementForParent=e.getDefinitionNormalizedControls=e.getDefinitionNormalizedControlsAdv=e.getElementLabelById=e.getDefinitionLabelByType=e.makeGetBreadcrumbs=e.makeInspectElement=e.makeGetElementWithRender=e.makeGetElement=e.makeGetRegionElementId=e.makeGetSelectedRegionType=e.makeGetSelectedRegionId=e.makeGetContentRegionId=e.getElementIconByType=e.getIndexById=e.getParentElementById=e.getSiblingsById=e.getChildrenById=e.getRegions=void 0
var c={top:(0,s.t)("app.regions.top"),left:(0,s.t)("app.regions.left"),right:(0,s.t)("app.regions.right"),bottom:(0,s.t)("app.regions.bottom"),footer:(0,s.t)("app.regions.footer")},u=function(e,t,n){if(!e)return""
if("region"===e._type&&c[e._region])return c[e._region]
var o=n.options,r=n.title,a=o.label_key,i=void 0===a?"_label":a,l=o.index_labels
return e[i]?e[i]:l&&-1!==t?(0,s.t)("app.indexed",{label:r,index:t+1}):r},p=function(e,t,n){return e&&Object.assign({},e,{_iconPath:"native"===n.icon?"elements/".concat(e._type):n.icon,_label:u(e,t,n),_order:-1===t?null:t,_def:n})},d=function(e){return e.elements},f=function(e,t){return t.ids},m=function(e,t){return t.id},h=function(e){return e.builder.selected},g=function(e){return e.inspector.empty?null:e.inspector.inspecting},v=["top","left","right","bottom"],b=function(e){return l((e.elements[function(e){return Object.keys(e.elements).find(function(t){return"root"===e.elements[t]._type})}(e)]||{})._modules||[]).sort(function(t,n){var o=v.indexOf(e.elements[t]._region||""),r=v.indexOf(e.elements[n]._region||"")
return o<r?-1:o>r?1:0})}
e.getRegions=b
e.getChildrenById=function(e,t){return e.elements[t.id]&&e.elements[t.id]._modules||[]}
var y=function(e,t){return e.elements[t.id]&&e.elements[t.id]._parent&&e.elements[e.elements[t.id]._parent]._modules||[]}
e.getSiblingsById=y
var _=function(e,t){var n=w(e,t)
return n&&n._parent&&e.elements[n._parent]?e.elements[n._parent]:null}
e.getParentElementById=_
var w=function(e,t){return e.elements[t.id]||null},E=function(e,t){return(w(e,t)||{})._region},O=function(e,t){return y(e,t).indexOf(t.id)}
e.getIndexById=O
var x=function(e){return e.definitions||{}},k=function(e){return e.builder&&e.builder.preferences||{}},S=function(e,t){var n=x(e)
return t&&n[t._type]||n.undefined}
e.getElementIconByType=function(e,t){var n=S(e,{_type:t})
return"native"===n.icon?"elements/".concat(t):n.icon}
var P=function(e,t){return S(e,w(e,t))},C=function(e){return w(e,{id:g(e)})},j=function(e){var t=g(e)
return t?y(e,{id:t}).indexOf(t):-1},T=function(e){return P(e,{id:g(e)||{}})},M=function(e,t){return(0,n.intersection)(e,t)[0]},D=function(e,t){return t.find(function(t){return"content"===e[t]._region})}
e.makeGetContentRegionId=function(){return(0,t.createSelector)(d,b,D)}
e.makeGetSelectedRegionId=function(){return(0,t.createSelector)(b,h,M)}
e.makeGetSelectedRegionType=function(){return(0,t.createSelector)(d,b,h,function(e,t,n){return e[M(t,n)]._region})}
e.makeGetRegionElementId=function(){return(0,t.createSelector)(d,function(e,t){return t},function(e,t){return Object.keys(e).find(function(n){return"region"===e[n]._type&&e[n]._region===t})})}
e.makeGetElement=function(){return(0,t.createSelector)(w,O,P,p)}
e.makeGetElementWithRender=function(){return(0,t.createSelector)(w,O,P,o.getElementRenderById,o.getRequiredScripts,o.getRequiredStyles,o.getElementUIForId,function(e,t,n,r,a,i,s){return Object.assign(p(e,t,n),(0,o.renderElement)(r,a,i),s)})}
e.makeInspectElement=function(){return(0,t.createSelector)(C,j,T,function(e,t,n){return e?p(e,t,n):null})}
e.makeGetBreadcrumbs=function(){return(0,t.createSelector)(d,x,g,function(e,t,n){return function(e,t){for(var n=[],o=t;o&&e[o]&&!["region","root"].includes(e[o]._type);)(0,a.currentUserCan)("element.".concat(e[o]._type,".inspect"))&&n.unshift(o),o=e[o]._parent||!1
return n}(e,n).map(function(n){return{id:n,label:u(e[n],e[e[n]._parent]._modules.indexOf(n),t[e[n]._type])}})})}
e.getDefinitionLabelByType=function(e,t){var n=S(e,{_type:t})
return n&&n.title||""}
var A=(0,t.createSelector)(w,O,P,u)
e.getElementLabelById=A
var I=(0,n.memoize)(function(e,t){return Object.assign((0,i.normalizeControls)(t[e]&&t[e].controls||[])||{},(0,i.normalizeControlGroups)(t[e]&&t[e]["control-nav"]||{})||{})})
e.getDefinitionNormalizedControlsAdv=I
var R=(0,n.memoize)(function(e,t){return Object.assign((0,i.normalizeControls)(t[e]&&t[e]["controls-std"]||[])||{},t[e]?(0,i.normalizeControlGroups)({std:{title:t[e].title},"std:content":{title:(0,s.t)("app.inspector.group.content")},"std:design":{title:(0,s.t)("app.inspector.group.design")},"std:customize":{title:(0,s.t)("app.inspector.group.customize")}}):{})})
e.getDefinitionNormalizedControls=R
var L=function(e,t){var n=t.id,o=e.elements[n]
return!!o&&!("region"===o._type&&["left","right","bottom"].includes(o._region)&&o._modules.length>=1)},N=function(e,t,n,o,a,i){var l,c=""
if("region"!==e.id||i||(c=(0,s.t)("app.regions.single-bar")),!i)return{addElementMessage:c}
var u={}
"region"===e.id?l="content"===t?o?"classic:section":"section":"bar":!e.options.add_new_element||!e.options.add_new_element._type||o&&["section"].includes(e.id)||(l=(u=(0,r.getDefaultAddNewElement)(e.id,n,a))._type)
var p=e.options.valid_children,d=l?n[l].title:(0,s.t)("app.elements.entity"),f=(0,s.t)("app.add-thing",{context:d})
return l?{addElementLabel:(0,s.t)("app.add-thing",{context:d}),addElementAtts:Object.assign({_type:l},u),addElementValidChildren:p,addElementMessage:c}:{addElementLabel:f,addElementValidChildren:p,addElementMessage:c}},U=(0,t.createSelector)(function(e,t){return S(e,_(e,t))},E,x,function(e){return e.ui.modKey},k,function(e,t){var n=t.id
return L(e,{id:e.elements[n]._parent})},N)
e.getAddNewElementForParent=U
var F=(0,t.createSelector)(P,E,x,function(e){return e.ui.modKey},k,L,N)
e.getAddNewElementFromId=F
e.makeGetLayoutSections=function(){return(0,t.createSelector)(d,x,h,function(e,t,n){return n.filter(function(n){return!!e[n]&&("region"===e[n]._type||((t[e[n]._type]||t.undefined).options.valid_children||[]).length>0)})})}
function B(e,t,n){if(!e||!t||!e[t])return null
var o=e[t]
return p(o,e[o._parent]._modules.indexOf(t),n[o._type])}e.getDescendantsOfType=function(e,t,n){return(0,r.flattenChildren)(e,t).filter(function(t){return e[t]&&e[t]._type===n})}
e.makeGetSelected=function(){return(0,t.createSelector)(d,h,f,x,function(e,t,n,o){return B(e,n.find(function(e){return t.includes(e)}),o)})}
e.makeGetActiveColumns=function(){return(0,t.createSelector)(d,m,x,function(e,t,n){return e[t]?(e[t]._modules||[]).map(function(t){return B(e,t,n)}).filter(function(e){return!1!==e._active&&"false"!==e._active}):[]})}}),define("tco-app/src/selectors/render",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.renderElement=e.getElementUIForId=e.getRequiredScripts=e.getRequiredStyles=e.getElementRenderById=void 0
e.getElementRenderById=function(e,t){var n=t.id
return e.render.elements[n]||{}}
e.getRequiredStyles=function(e){return e.render.requiredStyles}
e.getRequiredScripts=function(e){return e.render.requiredScripts}
e.getElementUIForId=function(e,t){var n=t.id,o=e.ui,r=o.liftedElement,a=o.inlineEditing,i=o.viewSiteURL
return{isDragging:r&&r.id===n,isInlineEditing:n===a,viewSiteURL:i}}
e.renderElement=function(e,t,n){var o=e._markup,r=e._dynamic_css,a=e._required_scripts,i=void 0===a?[]:a,s=e._required_styles,l=void 0===s?[]:s,c=e._post,u=e._bg_contrast,p=!0
i.length>0&&(p=i.filter(function(e){return t[e]&&"loaded"===t[e].state}).length===i.length)
var d=!0
return l.length>0&&(d=l.filter(function(e){return n[e]&&"loaded"===n[e].state}).length===l.length),Object.assign({_markup:o,_dynamic_css:r,_scripts_loaded:p,_styles_loaded:d,_bg_contrast:u},c||{})}}),define("tco-app/src/store",["exports","redux","tco-app/src/reducers/index","redux-devtools-extension","tco-app/src/middleware"],function(e,t,n,o,r){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return s}
var a,i={name:"Pro",actionSanitizer:function(e){return Object.assign({},e,{elements:"<<HIDDEN FOR PERFORMANCE>>",builder:"<<HIDDEN FOR PERFORMANCE>>",definitions:"<<HIDDEN FOR PERFORMANCE>>"})},stateSanitizer:function(e){return e.data?Object.assign({},e,{data:"<<HIDDEN FOR PERFORMANCE>>"}):e}},s=(0,t.createStore)(n.default,(0,o.composeWithDevTools)(i)(t.applyMiddleware.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(a=r.middleware)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}())));(0,r.setupMiddleware)(s)}),define("tco-app/src/svg/cell-auto-placement",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return React.createElement("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{strokeLinecap:"square",strokeWidth:"2",stroke:"currentColor"},React.createElement("rect",{height:"18",width:"18",fill:"none",x:"7",y:"7"}),React.createElement("line",{fill:"none",x1:"1",x2:"3",y1:"7",y2:"7"}),React.createElement("line",{fill:"none",x1:"1",x2:"3",y1:"25",y2:"25"}),React.createElement("line",{fill:"none",x1:"29",x2:"31",y1:"7",y2:"7"}),React.createElement("line",{fill:"none",x1:"29",x2:"31",y1:"25",y2:"25"}),React.createElement("line",{fill:"none",x1:"7",x2:"7",y1:"1",y2:"3"}),React.createElement("line",{fill:"none",x1:"25",x2:"25",y1:"1",y2:"3"}),React.createElement("line",{fill:"none",x1:"7",x2:"7",y1:"29",y2:"31"}),React.createElement("line",{fill:"none",x1:"25",x2:"25",y1:"29",y2:"31"})))}})
define("tco-app/src/util/base64",["exports","base64-js","js-base64"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.base64Encode=function(e){return n.default.Base64.encode(e)},e.base64Decode=function(e){return n.default.Base64.decode(e)},e.base64EncodeFromByteArray=function(e){return t.default.fromByteArray(e)},e.base64DecodeToByteArray=function(e){return t.default.toByteArray(e)}}),define("tco-app/src/util/conditionals",["exports"],function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){var n=null==e
if(n)return n
var o=t(e)
return"number"==typeof e.length&&"function"!==o?!e.length:"object"===o&&"number"==typeof e.length&&!length}function o(e){return n(e)||"string"==typeof e&&!1===/\S/.test(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.isNone=function(e){return null==e},e.isEmpty=n,e.isBlank=o,e.isPresent=function(e){return!o(e)}}),define("tco-app/src/util/control-conditions",["exports","tco-app/src/util/conditionals"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.checkCondition=a,e.normalizeControlCondition=function e(r){if((0,t.isEmpty)(r))return{}
var a=r.key,i=r.value,s=r.op,l=r.or;(0,t.isNone)(l)&&(l=!1)
!(0,t.isNone)(r.option)&&(0,t.isNone)(a)&&(a=r.option)
o.includes(s)&&(i=!1)
return(0,t.isPresent)(a)&&(0,t.isPresent)(i)?((0,t.isPresent)(s)&&n.includes(s)||(s="=="),{key:a,value:i,op:s,or:l}):(a=Object.keys(r)[0],e({key:a,value:r[a]}))},e.validateControlConditions=function(e){var n=e.key,o=e.value,r=e.op
return!(0,t.isNone)(n)&&!(0,t.isNone)(o)&&!(0,t.isNone)(r)},e.checkConditions=function(e){return e.map(function(e){var t=e.a,n=e.b,o=e.op
return a(t,n,o)}).reduce(function(t,n,o){return e[o].or?t||n:t&&n})},e.default=void 0
var n=["=","==","!=",">",">=","<","<=","LIKE","NOT LIKE","IN","NOT IN","BETWEEN","NOT BETWEEN","EMPTY","NOT EMPTY"],o=["EMPTY","NOT EMPTY"]
function r(e){return""===(e=e?String(e):"")||0===e.trim().split(" ").filter(function(e){return!e.match(/^0[a-zA-Z%]+|0$|none$/)}).length}function a(e,t,n){return"IN"===n?e.includes(t):"NOT IN"===n?!e.includes(t):"EMPTY"===n?r(t):"NOT EMPTY"===n?!r(t):("boolean"!=typeof e&&"boolean"!=typeof t||(e=!!e,t=!!t),"="===n||"=="===n?e==t:"!="!==n||e!=t)}var i=a
e.default=i}),define("tco-app/src/util/convert-php-date-format",["moment"],function(e){var t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:function(){return"["+this.format("Do").replace(/\d*/g,"")+"]"},w:"d",z:function(){return this.format("DDD")-1},W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:function(){return this.daysInMonth()},L:function(){return this.isLeapYear()?1:0},o:"GGGG",Y:"YYYY",y:"YY",a:"a",A:"A",B:function(){var e=this.clone().utc(),t=(e.hours()+1)%24+e.minutes()/60+e.seconds()/3600
return Math.floor(1e3*t/24)},g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"[u]",e:"[e]",I:function(){return this.isDST()?1:0},O:"ZZ",P:"Z",T:"[T]",Z:function(){return 36*parseInt(this.format("ZZ"),10)},c:"YYYY-MM-DD[T]HH:mm:ssZ",r:"ddd, DD MMM YYYY HH:mm:ss ZZ",U:"X"},n=/[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g;(0,e.default)().__proto__.convertPHPFormat=function(e){var o=this
return e.replace(n,function(e){return"function"==typeof t[e]?t[e].call(o):t[e]})},(0,e.default)().__proto__.formatPHP=function(e){return this.format(this.convertPHPFormat(e))}}),define("tco-app/src/util/debug",["exports","tco-app/src/reducers/helpers","tco-app/src/util/elements"],function(e,t,n){function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i(e){if(!document.querySelector(".cs-color-workspace.cs-active"))return console.warn("Please open the color manager first")
e||(e=prompt("Enter the ID of the color you wish to restore"))
try{window.cornerstoneApp.lookup("service:store").createRecord("color-manager/selection",{id:e,title:"Recovered Color",value:"transparent"}),console.log("Color recovered. Save colors to persist.")}catch(t){console.warn("Unable to recover color",t)}}function s(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=window.cornerstoneApp.lookup("service:redux").getState(),i=r.elements,s=r.inspector,l=r.definitions
if(!s.inspecting)return console.warn("Inspect an element first")
var c=(0,t.toTree)(i,s.inspecting,{removeIds:!0,withoutAtts:["_label","_region"]})
function u(e){var r=e._modules,i=void 0===r?[]:r,s=a(e,["_modules"]),c=i.map(u),p=l[e._type],d=(0,n.diffValues)(s,(0,t.getElementDefaults)({definition:p,honorDefaultPreset:!1}))
return c.length>0?o({},d,{_modules:c}):d}return e?JSON.stringify(u(c),null,2):JSON.stringify(u(c))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){window.csAppDebug=o({diffElement:s,recoverColor:i},window.csAppDebug||{})}}),define("tco-app/src/util/decode-entities",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){t||(t=document.createElement("textarea"))
return t.innerHTML=e,t.value}
var t=null}),define("tco-app/src/util/dragula",["exports","tco-app/src/vendor/dragula"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o]
function r(e,t){e&&e.dispatchEvent(new CustomEvent(t,{bubbles:!1,detail:{args:arguments.length<=2?void 0:arguments[2]}}))}var a=t.default.apply(this,n)
return a.on("drag",function(e,t){r(e,"dragula-drag",arguments),r(t,"dragula-drag-lift",arguments)}),a.on("dragend",function(e){r(e,"dragula-dragend",arguments)}),a.on("drop",function(e,t,n,o){r(e,"dragula-drop",arguments),r(t,"dragula-drop-into",arguments),r(n,"dragula-drop-from",arguments),r(o,"dragula-drop-before",arguments)}),a.on("cancel",function(e,t,n){r(e,"dragula-cancel",arguments),r(t,"dragula-cancel-container",arguments),r(n,"dragula-cancel-source",arguments)}),a.on("remove",function(e,t,n){r(e,"dragula-remove",arguments),r(t,"dragula-remove-container",arguments),r(n,"dragula-remove-source",arguments)}),a.on("shadow",function(e,t,n){r(e,"dragula-shadow",arguments),r(t,"dragula-shadow-container",arguments),r(n,"dragula-shadow-source",arguments)}),a.on("over",function(e,t,n){r(e,"dragula-over",arguments),r(t,"dragula-over-container",arguments),r(n,"dragula-over-source",arguments)}),a.on("out",function(e,t,n){r(e,"dragula-out",arguments),r(t,"dragula-out-container",arguments),r(n,"dragula-out-source",arguments)}),a.on("cloned",function(e,t,n){r(t,"dragula-cloned",arguments),"copy"===n?r(t,"dragula-copy",arguments):"mirror"===n&&r(t,"dragula-mirror",arguments)}),a.teardown=function(){return a.destroy()},a}}),define("tco-app/src/util/elements",["exports"],function(e){function t(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.getElementStyleDiff=e.diffValues=e.omitProtectedKeys=e.hasProtectedKeys=void 0
var n=function(e){return Object.keys(e).reduce(function(t,n){return e[n].protected&&t.push(n),t},[])}
e.hasProtectedKeys=function(e){var t=e.values
return n(t).length>0}
var o=function(e,o){var r=o.values
return e&&r?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]
return Object.keys(e||{}).filter(function(e){return!t.includes(e)}).reduce(function(t,n){return t[n]=e[n],t},{})}(e,["_modules","_type","_label","id"].concat(t(n(r)))):{}}
e.omitProtectedKeys=o
var r=function(e,t){return Object.keys(e).reduce(function(n,o){return void 0!==t[o]&&e[o]===t[o]||(n[o]=e[o]),n},{})}
e.diffValues=r
e.getElementStyleDiff=function(e,t,n){return r(o(e,n),t)}}),define("tco-app/src/util/gzip",["exports","pako","tco-app/src/util/base64"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.uncompress=function(e){try{return JSON.parse(t.default.inflate((0,n.base64DecodeToByteArray)(e),{to:"string"}))}catch(o){console.warn("Failed to inflate gzip data",o)}return e},e.compress=function(e){try{return(0,n.base64EncodeFromByteArray)(t.default.gzip("string"==typeof e?e:JSON.stringify(e)))}catch(o){console.warn("Failed to compress gzip data",o)}return e}}),define("tco-app/src/util/idle-callback",["exports","lodash"],function(e,t){function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n)
"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if(null==e)return{}
var n,o,r=function(e,t){if(null==e)return{}
var n,o,r={},a=Object.keys(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n])
return r}(e,t)
if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fallback,o=void 0!==n&&n,a=r(t,["fallback"])
return window.requestIdleCallback&&!window.requestIdleCallback.isPolyfill||!o?window.requestIdleCallback(e,a):setTimeout(e,a.timeout||1)}function i(e){return(window.cancelIdleCallback||clearTimeout)(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.requestIdleCallback=a,e.cancelIdleCallback=i,e.debounceIdleCallback=function(e){var o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0,c=(0,t.debounce)(function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s]
return i(o),o=a(function(){return e.apply(void 0,r)},n({fallback:!0},l))},r,n({leading:!1},s)),u=c.cancel
return c.cancel=function(){u(),i(o)},c}}),define("tco-app/src/util/ie11",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window
for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)});(function(e){try{return new t("test"),!1}catch(n){}var t=function(t,n){n=n||{bubbles:!1,cancelable:!1}
var o=document.createEvent("MouseEvent")
return o.initMouseEvent(t,n.bubbles,n.cancelable,e,0,n.screenX||0,n.screenY||0,n.clientX||0,n.clientY||0,!1,!1,!1,!1,0,null),o}
t.prototype=Event.prototype,e.MouseEvent=t})(window)},window.requestIdleCallback||(window.requestIdleCallback=function(e){var t=Date.now()
return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.requestIdleCallback.isPolyfill=!0),window.cancelIdleCallback||(window.cancelIdleCallback=function(e){clearTimeout(e)}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment()
e.forEach(function(e){var n=e instanceof Node
t.appendChild(n?e:document.createTextNode(String(e)))}),this.insertBefore(t,this.firstChild)}})}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment()
e.forEach(function(e){var n=e instanceof Node
t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}})})}),define("tco-app/src/util/memoize",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.memoizeAll=function(e){var t={},n=[],o=0
return function(){for(var r="",a=0;arguments.length>a;a++)n[a]||(n[a]=new WeakMap),n[a].has(arguments[a])||n[a].set(arguments[a],o++),r+="".concat(n[a].get(arguments[a]),":")
return t.hasOwnProperty(r)||(t[r]=e.apply(null,arguments)),t[r]}},e.memoize=function(e,t){var n=new WeakMap
return function(){var o="function"==typeof t?t.apply(null,arguments):arguments[0]
return n.hasOwnProperty(o)||(n[o]=e.apply(null,arguments)),n[o]}}}),define("tco-app/src/util/merge-options",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){for(var e=u(s(a),this!==r&&this||{},a),n={},o=0;o<arguments.length;o++){var i=arguments[o]
if(void 0!==i){if(!t(i))throw new TypeError("`".concat(i,"` is not an Option Object"))
n=u(n,i,e)}}return n}
var t=function(e){var t
return"[object Object]"===Object.prototype.toString.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))},n=Object.prototype.hasOwnProperty,o=Object.propertyIsEnumerable,r=void 0,a={concatArrays:!1},i=function(e){var t=[]
for(var r in e)n.call(e,r)&&t.push(r)
if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),i=0;i<a.length;i++)o.call(e,a[i])&&t.push(a[i])
return t}
function s(e){return Array.isArray(e)?(o=(n=e).slice(0,0),i(n).forEach(function(e){o[e]=s(n[e])}),o):t(e)?function(e){var t=null===Object.getPrototypeOf(e)?Object.create(null):{}
return i(e).forEach(function(n){t[n]=s(e[n])}),t}(e):e
var n,o}var l=function(e,t,n,o){return n.forEach(function(n){e[n]=n in e?u(e[n],t[n],o):s(t[n])}),e},c=function(e,t,o){var r=e.slice(0,0),a=0
return[e,t].forEach(function(t){for(var c=[],u=0;u<t.length;u++)n.call(t,u)&&(c.push(String(u)),r[a++]=t===e?t[u]:s(t[u]))
r=l(r,t,i(t).filter(function(e){return-1===c.indexOf(e)}),o)}),r}
function u(e,n,o){return o.concatArrays&&Array.isArray(e)&&Array.isArray(n)?c(e,n,o):t(n)&&t(e)?l(e,n,i(n),o):s(n)}}),define("tco-app/src/util/normalize-controls",["exports","immer","uuid/v4","spark-md5","normalizr","tco-app/src/util/control-conditions","tco-app/src/util/merge-options","tco-app/src/control-transforms"],function(e,t,n,o,r,a,i,s){function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeControls=function(e){if(!e||!Array.isArray(e))return console.warn("normalizeControls passed invalid control list",e),{}
var u={}
try{var p=e.map(function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
if(!r||!r.type)return!1
var c=r.type,p=r.key,d=r.keys,f=void 0===d?{}:d,m=r.group,h=void 0===m?"":m,g=r.label,v=void 0===g?"":g,b=r.label_prefix,y=void 0===b?"":b,_=r.label_vars,w=void 0===_?{}:_,E=r.title,O=void 0===E?"":E,x=r.description,k=void 0===x?"":x,S=r.conditions,P=void 0===S?[]:S,C=r.index,j=r.condition,T=r.controls
var M=r.options&&!Array.isArray(r.options)?r.options:{}
var D=r.default_options&&!Array.isArray(r.default_options)?r.default_options:{}
Array.isArray(P)||console.warn("Control conditions must be an array",{type:c,conditions:P})
var A=(j?[].concat(l(P),[j]):l(P)).map(a.normalizeControlCondition).filter(a.validateControlConditions)
var I=A.length>0?o.default.hash(JSON.stringify(A)):null
I&&(u[I]={result:!1,conditions:A})
var R=p?{value:p}:f||{}
if(!R.value){var L=Object.keys(R)
L.length>0&&(r.keys.value=R[L[0]])}var N=Object.assign({},w)
y&&(N.prefix=y)
var U=(v||O).replace(new RegExp(/{{([-\w\d]+)}}/,"g"),function(e,t){return N[t]||""}).trim()
var F={id:(0,n.default)(),type:c,keys:R,label:U,description:k,conditions:I,options:(0,i.default)(D,M),group:{full:h,top:(h||"").split(":").shift()},controls:Array.isArray(T)?T.map(e).filter(function(e){return!!e}):[]}
C&&(F.searchIndex=C)
if(!F.options._originalType&&"function"==typeof s.default[c])return F.options._originalType=c,e((0,t.produce)(F,function(e){s.default[c](e),e.conditions=P,e.condition=j,e.group=h}))
return F}).filter(function(e){return!!e})
if(p.length<=0)return null
var d=(0,r.normalize)({id:"root",controls:p},c).entities.control
return{controls:d,conditions:u}}catch(f){return console.warn(f),null}},e.normalizeControlGroups=function(e){var t={},n=Object.keys(e),o=[]
return n.forEach(function(n){var r="string"==typeof e[n]?e[n]:e[n].title||"",a=!n.includes(":"),i=a?n:n.substring(0,n.indexOf(":"))
t[i]||(t[i]={name:i,children:[]}),a?(t[i].title=r,o.push(i)):t[i].children.push({name:n,title:r,parent:i})}),{groups:Object.values(t),groupNames:[].concat(l(n),o)}}
var c=new r.schema.Entity("control",void 0,{idAttribute:"id"}),u=new r.schema.Array(c)
c.define({controls:u})}),define("tco-app/src/util/passive",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return t}
var t=!1
try{var n={get passive(){t=!0}}
window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch(o){t=!1}}),define("tco-app/src/util/prime-inspector",["exports","tco-app/src/selectors/elements","tco-app/src/util/idle-callback"],function(e,t,n){function o(e,t,n,o,r,a,i){try{var s=e[a](i),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(o,r)}function r(e){return function(){var t=this,n=arguments
return new Promise(function(r,a){var i=e.apply(t,n)
function s(e){o(i,r,a,s,l,"next",e)}function l(e){o(i,r,a,s,l,"throw",e)}s(void 0)})}}function a(e){var t
if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e)
if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}function i(e){var t,n
function o(t,n){try{var a=e[t](n),i=a.value,l=i instanceof s
Promise.resolve(l?i.wrapped:i).then(function(e){l?o("next",e):r(a.done?"return":"normal",e)},function(e){o("throw",e)})}catch(c){r("throw",c)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0})
break
case"throw":t.reject(r)
break
default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,i){var s={key:e,arg:r,resolve:a,reject:i,next:null}
n?n=n.next=s:(t=n=s,o(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function l(e,t,n){return c.apply(this,arguments)}function c(){return(c=r(regeneratorRuntime.mark(function e(o,r,a){var i
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=a?t.getDefinitionNormalizedControlsAdv:t.getDefinitionNormalizedControls,e.abrupt("return",new Promise(function(e){(0,n.requestIdleCallback)(function(){e(i(o,r))})}))
case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function u(e){return p.apply(this,arguments)}function p(){var e
return e=regeneratorRuntime.mark(function e(t){var n,o
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=Object.keys(t)
case 1:if(!(n.length>0)){e.next=9
break}return o=n.pop(),e.next=5,l(o,t,!1)
case 5:return e.next=7,l(o,t,!0)
case 7:e.next=1
break
case 9:case"end":return e.stop()}},e)}),(p=function(){return new i(e.apply(this,arguments))}).apply(this,arguments)}function d(){return(d=r(regeneratorRuntime.mark(function e(t){var n,o,r,i,s,l
return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,o=!1,e.prev=2,i=a(u(t))
case 4:return e.next=6,i.next()
case 6:return s=e.sent,n=s.done,e.next=10,s.value
case 10:if(l=e.sent,n){e.next=16
break}l
case 13:n=!0,e.next=4
break
case 16:e.next=22
break
case 18:e.prev=18,e.t0=e.catch(2),o=!0,r=e.t0
case 22:if(e.prev=22,e.prev=23,n||null==i.return){e.next=27
break}return e.next=27,i.return()
case 27:if(e.prev=27,!o){e.next=30
break}throw r
case 30:return e.finish(27)
case 31:return e.finish(22)
case 32:case"end":return e.stop()}},e,null,[[2,18,22,32],[23,,27,31]])}))).apply(this,arguments)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){(0,n.requestIdleCallback)(function(){return function(e){return d.apply(this,arguments)}(e)})},"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)}}),define("tco-app/src/util/promise-hash",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var t=Object.keys(e)
return Promise.all(t.map(function(t){return e[t]})).then(function(e){return e.reduce(function(e,n,o){return e[t[o]]=n,e},{})})}}),define("tco-app/src/util/scrollbar-width",["exports","lodash"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.scrollBarOffset=e.scrollBarWidth=void 0
var n=(0,t.memoize)(function(){var e=document.createElement("div")
e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e)
var t=e.offsetWidth
e.style.overflow="scroll"
var n=document.createElement("div")
n.style.width="100%",e.appendChild(n)
var o=n.offsetWidth
return e.parentNode.removeChild(e),t-o})
e.scrollBarWidth=n
e.scrollBarOffset=function(){return document.body.clientHeight>window.innerHeight?n():0}}),define("tco-app/src/util/string",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.splitOnWhitespace=function(e){if(!e)return[]
if("string"!=typeof e)return[e]
var t,n=[],o=e.split(" ").reverse(),r=0,a=""
for(;void 0!==(t=o.pop());)r+=(t.match(/\(/g)||[]).length-(t.match(/\)/g)||[]).length,a+="".concat(t," "),0===r&&(n.push(a.trim()),r=0,a="")
return n},e.splitCssValue=function(e){if(!e)return[]
if("string"!=typeof e)return[e]
var t,n=[],o=e.replace(/\s*(\/\*)(.*?)/g,function(e,t,n){return" ".concat(t).concat(n)}).replace(/(.*?)(\*\/)\s*/g,function(e,t,n){return"".concat(t).concat(n," ")}).trim().split(" ").reverse(),r=0,a=0,i=""
for(;void 0!==(t=o.pop());)if(r+=(t.match(/\/\*/g)||[]).length-(t.match(/\*\//g)||[]).length,i+="".concat(t," "),0===r){var s=t.replace(/.*?\*\/(.*)/,function(e,t){return t})
0===(a+=(s.match(/\(/g)||[]).length-(s.match(/\)/g)||[]).length)&&(n.push(i.trim()),i="")}return n}}),define("tco-app/src/util/unique",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueID=function(){return"id-".concat(t++)}
var t=0}),define("tco-app/src/util/url",["exports","url-parse"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.sameOrigin=function(e,n){if(e===n)return!0
var o=(0,t.default)(e),r=(0,t.default)(n),a=0|o.port||("https"===o.protocol?443:80),i=0|r.port||("https"===r.protocol?443:80)
return o.protocol===r.protocol&&o.host===r.host&&a===i}}),define("tco-app/src/vendor/dragula",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t={add:function(e,t,n,o){return e.addEventListener(t,n,o)},remove:function(e,t,n,o){return e.removeEventListener(t,n,o)}},n=function(e){var t={}
return e.on=function(n,o){return t[n]?t[n].push(o):t[n]=[o],e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(n,o){var r=arguments.length
if(1===r)delete t[n]
else if(0===r)t={}
else{var a=t[n]
if(!a)return e
a.splice(a.indexOf(o),1)}return e},e.emit=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o]
return e.emitterSnapshot(n.shift()).apply(this,n)},e.emitterSnapshot=function(n){var o=(t[n]||[]).slice(0)
return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a]
var i=this||e
if("error"===n&&!o.length)throw 1===r.length?r[0]:r
return o.forEach(function(t){t.apply(i,r),t._once&&e.off(n,t)}),e}},e},o=document,r=o.documentElement,a=window
function i(e,n,o,r){a.navigator.pointerEnabled?t[n](e,{mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"}[o],r):a.navigator.msPointerEnabled?t[n](e,{mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"}[o],r):(t[n](e,{mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"}[o],r),t[n](e,o,r))}function s(e){if(void 0!==e.touches)return e.touches.length
if(void 0!==e.which&&0!==e.which)return e.which
if(void 0!==e.buttons)return e.buttons
var t=e.button
return void 0!==t?1&t?1:2&t?3:4&t?2:0:void 0}function l(e,t){return void 0!==a[t]?a[t]:r.clientHeight?r[e]:o.body[e]}function c(e,t,n){var r,a=e||{},i=a.className
return a.className+=" gu-hide",r=o.elementFromPoint(t,n),a.className=i,r}function u(){return!1}function p(){return!0}function d(e){return e}function f(e){return e.width||e.right-e.left}function m(e){return e.height||e.bottom-e.top}function h(e){return e.parentNode===o?null:e.parentNode}function g(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||function e(t){if(!t)return!1
if("false"===t.contentEditable)return!1
if("true"===t.contentEditable)return!0
return e(h(t))}(e)}function v(e){return e.nextElementSibling||function(){var t=e
do{t=t.nextSibling}while(t&&1!==t.nodeType)
return t}()}function b(e,t){return t.targetTouches&&t.targetTouches.length?t.targetTouches[0][e]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0][e]:t[e]}var y=function(e,a){var y,_,w,E,O,x,k,S,P,C,j
1===arguments.length&&!1===Array.isArray(e)&&(a=e,e=[])
var T,M=null,D=a||{}
void 0===D.moves&&(D.moves=p),void 0===D.accepts&&(D.accepts=p),void 0===D.invalid&&(D.invalid=function(){return!1}),void 0===D.containers&&(D.containers=e||[]),void 0===D.isContainer&&(D.isContainer=u),void 0===D.copy&&(D.copy=!1),void 0===D.copySortSource&&(D.copySortSource=!1),void 0===D.revertOnSpill&&(D.revertOnSpill=!1),void 0===D.removeOnSpill&&(D.removeOnSpill=!1),void 0===D.direction&&(D.direction="vertical"),void 0===D.hideIndicator&&(D.hideIndicator=!1),void 0===D.ignoreInputTextSelection&&(D.ignoreInputTextSelection=!0),void 0===D.mirrorContainer&&(D.mirrorContainer=o.body),void 0===D.offset&&(D.offset=d)
var A=n({containers:D.containers,start:function(e){var t=z(e)
t&&H(t)},end:V,cancel:K,remove:$,destroy:function(){R(!0),q({clientX:-1,clientY:-1})},canMove:function(e){return!!z(e)},dragging:!1})
return!0===D.removeOnSpill&&A.on("over",function(e){e.classList.remove("gu-hide")}).on("out",function(e){A.dragging&&e.classList.add("gu-hide")}),R(),A
function I(e){return-1!==A.containers.indexOf(e)||D.isContainer(e)}function R(e){var t=e?"remove":"add"
i(r,t,"mousedown",F),i(r,t,"mouseup",q)}function L(e){i(r,e?"remove":"add","mousemove",B)}function N(e){var n=e?"remove":"add"
t[n](r,"selectstart",U),t[n](r,"click",U)}function U(e){T&&e.preventDefault()}function F(e){if(x=e.clientX,k=e.clientY,1===s(e)&&!e.metaKey&&!e.ctrlKey){var t=e.target,n=z(t)
n&&(T=n,L(),"mousedown"===e.type&&(g(t)?t.focus():e.preventDefault()))}}function B(e){if(T)if(0!==s(e)){if(void 0===e.clientX||e.clientX!==x||void 0===e.clientY||e.clientY!==k){if(D.ignoreInputTextSelection){var t=b("clientX",e),n=b("clientY",e)
if(g(o.elementFromPoint(t,n)))return}var a=T
L(!0),N(),V(),H(a)
var c,u={left:(c=w.getBoundingClientRect()).left+l("scrollLeft","pageXOffset"),top:c.top+l("scrollTop","pageYOffset")},p=D.offset({x:b("pageX",e)-u.left,y:b("pageY",e)-u.top},e,w)
E=p.x,O=p.y,(C||w).classList.add("gu-transit"),function(){if(!y){var e=w.getBoundingClientRect()
y=w.cloneNode(!0),D.hideIndicator||(y.style.width="".concat(f(e),"px"),y.style.height="".concat(m(e),"px"),y.classList.remove("gu-transit"),y.classList.add("gu-mirror"),D.mirrorContainer.appendChild(y)),i(r,"add","mousemove",Q),D.mirrorContainer.classList.add("gu-unselectable"),A.emit("cloned",y,w,"mirror")}}(),Q(e)}}else q({})}function z(e){if(!(A.dragging&&y||I(e))){for(var t=e;h(e)&&!1===I(h(e));){if(D.invalid(e,t))return
if(!(e=h(e)))return}var n=h(e)
if(n&&!D.invalid(e,t)&&D.moves(e,n,t,v(e)))return{item:e,source:n}}}function H(e){var t,n
t=e.item,n=e.source,("boolean"==typeof D.copy?D.copy:D.copy(t,n))&&(C=e.item.cloneNode(!0),A.emit("cloned",C,e.item,"copy")),_=e.source,w=e.item,S=P=v(e.item),A.dragging=!0,A.emit("drag",w,_)}function V(){if(A.dragging){var e=C||w
G(e,h(e))}}function W(){T=!1,L(!0),N(!0)}function q(e){if(W(),A.dragging){var t=C||w,n=b("clientX",e),r=b("clientY",e),a=J(D.hideIndicator?o.elementFromPoint(n,r):c(y,n,r),n,r)
a&&(C&&D.copySortSource||!C||a!==_)?G(t,a):D.removeOnSpill?$():K()}}function G(e,t){var n=h(e)
C&&D.copySortSource&&t===_&&n.removeChild(w),X(t)?A.emit("cancel",e,_,_):A.emit("drop",e,t,_,P),Y()}function $(){if(A.dragging){var e=C||w,t=h(e)
t&&t.removeChild(e),A.emit(C?"cancel":"remove",e,t,_),Y()}}function K(e){if(A.dragging){var t=arguments.length>0?e:D.revertOnSpill,n=C||w,o=h(n),r=X(o)
!1===r&&t&&(C?o&&o.removeChild(C):_.insertBefore(n,S)),r||t?A.emit("cancel",n,_,_):A.emit("drop",n,o,_,P),Y()}}function Y(){var e=C||w
W(),y&&(D.mirrorContainer.classList.remove("gu-unselectable"),i(r,"remove","mousemove",Q),D.hideIndicator||h(y).removeChild(y),y=null),e&&e.classList.remove("gu-transit"),j&&clearTimeout(j),A.dragging=!1,M&&A.emit("out",e,M,_),A.emit("dragend",e),_=w=C=S=P=j=M=null}function X(e,t){var n
return n=void 0!==t?t:y?P:v(C||w),e===_&&n===S}function J(e,t,n){for(var o=e;o&&!r();)o=h(o)
return o
function r(){if(!1===I(o))return!1
var r=Z(o,e),a=ee(o,r,t,n)
return!!X(o,a)||D.accepts(w,o,_,a)}}function Q(e){if(y){e.preventDefault()
var t=b("clientX",e),n=b("clientY",e),o=t-E,r=n-O
D.hideIndicator||(y.style.left="".concat(o,"px"),y.style.top="".concat(r,"px"))
var a=C||w,i=c(y,t,n),s=J(i,t,n),l=null!==s&&s!==M;(l||null===s)&&(M&&f("out"),M=s,l&&f("over"))
var u=h(a)
if(s!==_||!C||D.copySortSource){var p,d=Z(s,i)
if(null!==d)p=ee(s,d,t,n)
else{if(!0!==D.revertOnSpill||C)return void(C&&u&&u.removeChild(a))
p=S,s=_}(null===p&&l||p!==a&&p!==v(a))&&(P=p,s.insertBefore(a,p),A.emit("shadow",a,s,_))}else u&&u.removeChild(a)}function f(e){A.emit(e,a,M,_)}}function Z(e,t){for(var n=t;n!==e&&h(n)!==e;)n=h(n)
return n===r?null:n}function ee(e,t,n,o){var r,a="horizontal"===D.direction
return"function"==typeof D.direction&&(a=!!D.direction(e,t,n,o)),t!==e?(r=t.getBoundingClientRect(),i(a?n>r.left+f(r)/2:o>r.top+m(r)/2)):function(){var t,r,i,s=e.children.length
for(t=0;t<s;t++){if(r=e.children[t],i=r.getBoundingClientRect(),a&&i.left+i.width/2>n)return r
if(!a&&i.top+i.height/2>o)return r}return null}()
function i(e){return e?v(t):t}}}
e.default=y}),define("tco-app/template-manager/controller",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Controller.extend({templateStubs:Ember.computed.filterBy("modelTemplateStubs","isDeleted",!1),presetTemplateStubs:Ember.computed.filterBy("templateStubs","type","preset")})
e.default=t}),define("tco-app/template-manager/route",["exports","tco-app/mixins/route-authorization","tco-app/src/lib/http"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=Ember.Route.extend(t.default,{templateService:Ember.inject.service("template-manager"),acl:["templates"],routeUI:{bar:["cheatsheet"]},deactivate:function(){},beforeModel:function(){this.permissionCheck()},model:function(){var e=this
return new Ember.RSVP.Promise(function(t,o){var r=e.store.findAll("element/definition"),a=e.store.findAll("template-manager/stub"),i=e.store.findAll("color-manager/selection"),s=e.store.findAll("font-manager/selection"),l=e.get("config").fetch("template-manager")
r.then(function(e){var c=new Ember.RSVP.Promise(function(t,o){var r={}
e.forEach(function(e){e.get("canSetDefault")&&(r[e.get("id")]="none")}),(0,n.request)("presets::get_default_presets").then(function(e){var n=e.defaultPresets
Ember.isArray(n)&&n.forEach(function(e){var t=e.type,n=e.id
Ember.isNone(r[t])||(r[t]=n)}),t(Ember.Object.create(r))},o)})
Ember.RSVP.hash({elementDefinitions:r,defaultPresets:c,templateStubs:a,colors:i,fonts:s,config:l}).then(function(e){return t(e)},o)},o)})},setupController:function(e,t){this._super.apply(this,arguments),this.get("ui").setRouteUI(this),e.set("modelTemplateStubs",t.templateStubs)
var n=t.templateStubs.find(function(e){return!!e.get("packageSignature")})
e.set("hideImportStarterPack",t.config.hide_starter_pack||n),e.set("isImporting",!1)},renderTemplate:function(){this.render("partials/settings/template-manager",{outlet:"settings",into:"application"}),this._super(this,arguments)},actions:{importStarterPack:function(e){var t=this
if(this.get("currentUser").can("templates.import")){this.get("ui").beginSaveProgress(3),this.get("ui").notify(this.get("i18n").t("app.templates.notify.importing-starter")),this.controllerFor(this.routeName).set("isImporting",!0)
var n="".concat(window.csAppData.designCloudApiUrl,"/starter-pack")
this.get("templateService").importStarterPack(n).then(function(n){if(t.get("ui").endSaveProgress(),n&&n.abort)return e("abort"),void t.controllerFor(t.routeName).set("isImporting",!1)
t.get("ui").notify(t.get("i18n").t("app.templates.notify.imported-starter"),"success"),e(),Ember.run.next(function(){t.get("ui").set("noTransitionProgress",!0),t.refresh()})},function(n){t.get("ui").endSaveProgress(),console.warn(n),t.get("ui").notify("i18n.app.templates.notify.upload-error","error"),e(!0)})}},dismissStarterPack:function(){var e=this
this.get("currentUser").can("templates.import")&&this.get("ui").confirm({message:this.get("i18n").t("app.templates.confirm-hide-starter"),accept:function(){e.get("templateService").dismissStarterPack().then(function(){Ember.set(e.modelFor(e.routeName),"config.hide_starter_pack",!0),e.controllerFor(e.routeName).set("hideImportStarterPack",!0)})},acceptClass:"sad"})},importTemplates:function(e,t){var n=this
this.get("currentUser").can("templates.import")&&(this.get("ui").beginSaveProgress(3),this.controllerFor(this.routeName).set("isImporting",!0),this.get("templateService").importTemplateFiles(e).then(function(e){if(n.get("ui").endSaveProgress(),e&&e.abort)return t("abort"),void n.controllerFor(n.routeName).set("isImporting",!1)
n.get("ui").notify(n.get("i18n").t("app.templates.notify.uploaded"),"success"),t(),Ember.run.next(function(){n.get("ui").set("noTransitionProgress",!0),n.refresh()})},function(e){n.get("ui").endSaveProgress(),console.warn(e),n.get("ui").notify("i18n.app.templates.notify.upload-error","error"),t(!0)}))},saveElementDefaults:function(){var e=this
if(this.get("currentUser").can("templates.manage_default_presets")){var t=this.modelFor(this.routeName).defaultPresets,o=this.get("i18n").t("app.templates.element-defaults.entity")
this.get("ui").beginSaveProgress(),(0,n.request)("presets::update_default_presets",{defaultPresets:t}).then(function(){e.store.unloadAll("element/preset"),e.get("ui").endSaveProgress(),e.get("ui").notify(e.get("i18n").t("app.notify.saved",{context:o}),"success")},function(t){e.get("ui").endSaveProgress(),console.warn(t),e.get("ui").notify(e.get("i18n").t("app.notify.failed-to-save",{context:o}),"error")})}}}})
e.default=o}),define("tco-app/template-manager/service",["exports","file-saver","jszip","spark-md5","pako","url-parse","tco-app/src/util/base64","tco-app/src/lib/http"],function(e,t,n,o,r,a,i,s){function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t]
return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(e){return e.reduce(function(e,t){return e.then(function(e){return t().then(function(t){return[].concat(l(e),[t])})})},Ember.RSVP.Promise.resolve([]))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var u=["img","global-blocks"],p=Ember.Service.extend({store:Ember.inject.service(),elementService:Ember.inject.service("element"),i18n:Ember.inject.service(),ui:Ember.inject.service(),compress:!0,exportVersion:"1.0",alwaysHotlinkWhitelist:Ember.A(["theme.co","themeco-design-cloud.s3.amazonaws.com"]),deleteSelection:function(e){var t=this,n=e.slice(0)
return n.forEach(function(e){var n=t.get("store").peekRecord("template-manager/stub",e)
n&&n.deleteRecord()}),(0,s.request)("templates::manager_delete",{ids:n})},downloadSelection:function(e,n){var o=this,r=e.includes("_")?"underscore":"dasherize",a="".concat(Ember.String[r](e),".").concat("tco")
return new Ember.RSVP.Promise(function(e,r){o.exportSelection(n).then(function(n){n.zip.generateAsync({type:"blob"}).then(function(n){t.default.saveAs(n,a),e()},r)},r)})},exportSelection:function(e){var t=this,n=e.slice(0)
return new Ember.RSVP.Promise(function(e,o){(0,s.request)("templates::prepare_export",{ids:n}).then(function(n){var r=n.templates
t.constructZip(r).then(function(t){return e(t)},o)},o)})},asyncWriteJsonFileToZip:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4?arguments[4]:void 0
return new Ember.RSVP.Promise(function(i){Ember.run(function(){n.writeJsonFileToZip(e,t,o,r,a),i()})})},writeJsonFileToZip:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4?arguments[4]:void 0
"string"!==Ember.typeOf(t)&&(t=JSON.stringify(t,null,2))
var l=(s="undefined"===Ember.typeOf(s)?this.get("compress"):s)?"tco-tmpl":"tco-tmpl-json",c=s?(0,i.base64EncodeFromByteArray)(r.default.gzip(t)):t
n||(n=o.default.hash(c)),a||(a=""),e.file("".concat(a).concat(n,".").concat(l),c,{type:"text/plain;charset=utf-8"})},constructZip:function(e){var t=this
return new Ember.RSVP.Promise(function(o,r){var a=t.normalizeTemplates(e)
t.preprocessExtractions(a).then(function(e){var a=e.extractionQueue,i=e.preprocessedFiles,s=new n.default
t.processExtractions(a,s).then(function(e){var n=e.validExtractions,a=e.failedExtractions
t.handleFailedExtractions(a,i).then(function(e){var r=e.outputFiles,a={fileTypeCount:{},templateTypeCount:{}}
c(r.map(function(e){var n=e.json,o=e.type,r=e.templateType,i=e.name
return function(){a.fileTypeCount[o]||(a.fileTypeCount[o]=0),a.fileTypeCount[o]++,r&&(a.templateTypeCount[r]||(a.templateTypeCount[r]=0),a.templateTypeCount[r]++)
var e="global-block"===o?"global-blocks/":""
return t.asyncWriteJsonFileToZip(s,n,i,e)}})).then(function(){n.v=t.get("exportVersion"),t.writeJsonFileToZip(s,JSON.stringify(n,null,2),"manifest"),o({zip:s,info:a})})},r)},r)},r)})},normalizeTemplates:function(e){return e.filter(function(e){var t=e.type,n=e.title,o=e.meta
return t&&n&&o}).map(function(e){var t=e.title,n=e.type,o=e.subtype,r=e.preview,a=e.meta,i={title:t,type:n}
return o&&(i.subtype=o),r&&(i.preview=r),i.meta=a,{type:"template",templateType:n,json:JSON.stringify(i,null,2)}})},preprocessExtractions:function(e){var t={},n={},r=this.get("store").peekAll("font-manager/selection").map(function(e){return e.get("_id")})
function a(e){var n=e.json.match(/(?:https?:)?\/\/[a-zA-Z0-9\-\%\_\s\\\.\/]*(?:jpg|jpeg|jpe|gif|png|bmp|tif|tiff|ico|svg)/gi)
return n&&n.forEach(function(n){var r=o.default.hash("image:".concat(n))
t[r]={type:"image",value:n},e.json=e.json.replace(new RegExp(n,"g"),"_cs-tmpl:".concat(r,":cs-tmpl_"))}),e}function i(e){var n=e.json.match(/(global-color:[\w\d\-\_]+)/gi)
return n&&n.forEach(function(n){var r=o.default.hash("color:".concat(n))
t[r]={type:"color",value:n},e.json=e.json.replace(new RegExp(n,"g"),"_cs-tmpl:".concat(r,":cs-tmpl_"))}),e}function l(e){var n=r.join("|"),a=e.json.match(new RegExp('":\\s?"('.concat(n,')(?:\\:\\d+)?"'),"gi"))
return a&&a.forEach(function(r){var a=r.match("(".concat(n,")"))[0],i=o.default.hash("font:".concat(a))
t[i]={type:"font",value:a},e.json=e.json.replace(new RegExp(r,"g"),r.replace(new RegExp(a,"g"),"_cs-tmpl:".concat(i,":cs-tmpl_")))}),e}function c(e){var t='"global_block_id":\\s+(\\d+),',r=e.json.match(new RegExp(t,"gi"))
return r&&r.forEach(function(r){var a=new RegExp(t,"i").exec(r)[1],i=o.default.hash("global-block:".concat(a))
n[i]={type:"global-block",value:a},e.json=e.json.replace(new RegExp(r,"g"),r.replace(new RegExp(a,"g"),'"_cs-tmpl:'.concat(i,':cs-tmpl_"')))}),e}var u=e.map(c),p=Object.values(n).map(function(e){return e.value})
return new Ember.RSVP.Promise(function(e,n){(0,s.request)("templates::prepare_global_blocks_export",{ids:p}).then(function(n){n.globalBlocks.forEach(function(e){var t=e.id,n=e.title,r=e.elements,a=e.settings,i={name:o.default.hash("global-block:".concat(t)),type:"global-block",json:JSON.stringify({title:n,elements:r,settings:a},null,2)}
u.push(c(i))}),u=u.map(a).map(i).map(l),e({extractionQueue:t,preprocessedFiles:u})},n)})},extractImages:function(e,t){var n=this
return e.map(function(e){var o=e.key,r=e.value,i=r.split("/").pop(),l="img/".concat(o,"/").concat(i)
return n.get("alwaysHotlinkWhitelist").includes((0,a.default)(r,!0).host)?Ember.RSVP.reject({key:o,error:"Hotlinking Themeco Design Cloud image.",reason:r}):new Ember.RSVP.Promise(function(e,n){(0,s.downloadFile)(r).then(function(n){var r=n.response
t.file(l,r),e({key:o,data:{filename:i}})},function(e){n({key:o,error:"Failed to download image",reason:e})})})})},extractColors:function(e){var t=this.get("store").peekAll("color-manager/selection")
return e.map(function(e){var n=e.key,o=e.value,r=o.replace("global-color:",""),a=t.find(function(e){return r===Ember.get(e,"id")})
if(!a)return Ember.RSVP.reject({error:"Could not find color record for ".concat(o),key:n})
var i={_id:a.get("id"),title:a.get("title"),value:a.get("value")}
return Ember.RSVP.resolve({key:n,data:i})})},extractFonts:function(e){var t=this.get("store").peekAll("font-manager/selection")
return e.map(function(e){var n=e.key,o=e.value,r=t.find(function(e){return o===Ember.get(e,"_id")})
if(!r)return Ember.RSVP.reject({error:"Could not find font record for ".concat(o),key:n})
var a={_id:r.get("_id"),title:r.get("title"),family:r.get("family"),stack:r.get("stack"),source:r.get("source"),weights:r.get("weights")}
return Ember.RSVP.resolve({key:n,data:a})})},processExtractions:function(e,t){var n=this,o={},r={}
return new Ember.RSVP.Promise(function(a,i){var s=[],l={}
Object.keys(e).forEach(function(t){e[t].type&&(l[e[t].type]||(l[e[t].type]=[]),l[e[t].type].push({key:t,value:e[t].value}))}),Object.keys(l).forEach(function(e){var o=n.get(Ember.String.camelize("extract-".concat(e,"s")))
o||(o=function(e){return e.map(function(e){var t=e.key
Ember.RSVP.reject({error:"Unsupported Type",key:t})})}),o.bind(n)(l[e],t).forEach(function(e){return s.push(e)})}),Ember.RSVP.allSettled(s).then(function(t){t.forEach(function(t){var n=t.state,a=t.reason,i=t.value
"fulfilled"===n?r[i.key]={type:e[i.key].type,data:i.data}:o[a.key]=e[a.key]}),a({validExtractions:r,failedExtractions:o})},i)})},handleFailedExtractions:function(e,t){var n=t.map(function(t){return Object.keys(e).forEach(function(n){t=function(e,t,n){var o="_cs-tmpl:".concat(t,":cs-tmpl_")
return e.json=e.json.replace(new RegExp(o,"g"),n),e}(t,n,e[n].value)}),t})
return Ember.RSVP.resolve({outputFiles:n})},importTemplateFiles:function(e){var t=this,n=l(e),o=function(e){return e&&e.name.match(/.+\.csl/)}
return n.filter(function(e){return e&&(e.name.match(new RegExp(".+.".concat("tco"),"g"))||o(e))}).length!==n.length?Ember.RSVP.reject({error:"Invalid file",files:e}):Promise.all(n.map(function(e){return o(e)?t.importClassicTemplate(e):t.importTemplates(e)}))},proccessImport:function(e){var t=this,n=e.manifest,o=e.images,r=e.rawTemplates,a=e.globalBlocks,i=e.packageSignature,l=[],u=this.get("store").peekAll("template-manager/stub").filter(function(e){return!e.get("isDeleted")}).map(function(e){return e.get("title")})
return r.forEach(function(e){for(var n=e.data.title,o=1;u.includes(e.data.title);)e.data.title=t.get("i18n").t("app.copy-of-numeric",{title:n,index:o++}).string
u.push(e.data.title),l.push(e)}),new Ember.RSVP.Promise(function(e,r){c(Object.keys(n).map(function(e){return function(){var r=n[e]
return["v"].includes(e)?Ember.RSVP.resolve(null):"image"===r.type?t.importJobImage({id:e,filename:r.data.filename,imageData:o[e]}):"color"===r.type?t.importJobColor({id:e,data:r.data}):"font"===r.type?t.importJobFont({id:e,data:r.data}):Ember.RSVP.resolve({error:!0,message:"Unknown job type",job:r,key:e})}})).then(function(n){var o,c={},u=!1
if(n.forEach(function(e){"null"!==Ember.typeOf(e)&&(e.error?u=e:c[e.id]=e.data?e.data:"")}),u)return r(u)
if(a.length>0){var p=a.map(function(e){var t=e.id
return{title:e.data.title,id:t}})
o=new Ember.RSVP.Promise(function(e,t){(0,s.requestOne)("templates::prepare_global_blocks_import",{globalBlockRequests:p}).then(function(t){var n=t.globalBlockIDs
a.forEach(function(e){n[e.id]&&(e.data.id=n[e.id],c[e.id]=n[e.id],l.push(e))}),e()},t)})}else o=Ember.RSVP.resolve()
o.then(function(){Ember.RSVP.all(l.map(function(e){return t.fillPlaceholders(e,c)})).then(function(t){(0,s.requestOne)("templates::import_templates",{files:t,packageSignature:i}).then(function(t){console.log("Upload complete",t),e()},r)},r)},r)})})},importTemplates:function(e,t,n){var o=this
return new Ember.RSVP.Promise(function(r,a){return o.readZipFile(e,t).then(function(e){var t=function(){o.proccessImport(e).then(r,a)}
!n&&o.get("store").peekAll("template-manager/stub").find(function(t){return e.packageSignature===t.get("packageSignature")&&!t.get("isDeleted")})?o.get("ui").confirm({message:o.get("i18n").t("app.templates.confirm-reimport"),acceptClass:"sad",accept:t,decline:function(){r({abort:!0})}}):t()},a)})},fillPlaceholders:function(e,t){return new Ember.RSVP.Promise(function(n,o){Ember.run.next(function(){var r=JSON.stringify(e),a=r.match(new RegExp(/_cs-tmpl:[\d\w]+:cs-tmpl_/,"g"))
if(!a)return n(e)
var i=!1
if(a=a.map(function(e){var n=e.replace("_cs-tmpl:","").replace(":cs-tmpl_","")
return t.hasOwnProperty(n)?{id:n,value:t[n]}:(i=n,null)}),i)return o({error:"Unmatched template id",unmatched:i})
a.forEach(function(e){var t=e.id,n=e.value,o="_cs-tmpl:".concat(t,":cs-tmpl_")
r=r.replace(new RegExp(o,"g"),n)}),n(JSON.parse(r))})})},importClassicTemplate:function(e){var t=this
return new Ember.RSVP.Promise(function(n,o){var r=new FileReader
r.onload=function(){var a=null
try{a=JSON.parse(r.result)}catch(i){return o({message:"Unable to parse template",logObject:r.result})}if(!a||"array"!==Ember.typeOf(a.elements))return o({message:"Unable to parse template",logObject:r.result});(0,s.request)("element-migration::migrate_elements",{elements:a.elements}).then(function(r){var i=r.elements,s=a.title?a.title:e.name.replace(".csl","")
t.get("store").createRecord("content/template",{title:s,elements:i}).save().then(n,o)},function(e){return o({message:"Error uploading template",error:e})})},Ember.run.next(function(){try{r.readAsText(e)}catch(t){return o({message:"Unable to read template file",file:e})}})})},readZipFile:function(e,t){var r=this,a={},i=[],s=[],l=[]
return new Ember.RSVP.Promise(function(c,u){n.default.loadAsync(e).then(function(e){var n=[]
e.forEach(function(e,t){var o=r.readFile(e,t)
!1!==o&&n.push(o)}),Ember.RSVP.allSettled(n).then(function(e){if(e.forEach(function(t){var n=t.state,o=t.value,c=t.reason
if("rejected"!==n&&o){if("manifest"!==o.type)return"image"===o.type?(r.get("ui").addSaveJob(),void(i[o.id]=o.imageData)):void("template"===o.type&&o.checksum&&o.data?s.push({id:o.checksum,type:o.type,data:o.data}):"global-block"===o.type&&o.checksum&&o.data?l.push({id:o.checksum,type:o.type,data:o.data}):console.warn("Template file not handled:",o,e))
a=o.data}else console.warn("Unable to process template file:",c,e)}),Ember.isEmpty(Object.keys(a)))return u({error:"Zip manifest could not be read",settled:e})
var n="string"===Ember.typeOf(t)?t:o.default.hash(JSON.stringify([a,i,s.map(function(e){return e.id}),l.map(function(e){return e.id})]))
c({manifest:a,images:i,rawTemplates:s,globalBlocks:l,packageSignature:n})},function(e){u({error:"Something prevented zip file from being read",reason:e})})},function(t){u({message:"Unable to unzip file",zipFile:e,error:t})})})},importJobImage:function(e){var t=this,n=e.id,o=e.filename,r=e.imageData
return new Ember.RSVP.Promise(function(e){(0,s.requestOne)("templates::upload_media",{files:[{key:n,value:r,filename:o}]},{useFormData:!0}).then(function(o){t.get("ui").incrementSaveProgress(),e({id:n,type:"image",data:o.url})},function(t){e({error:!0,reason:t})})})},importJobColor:function(e){var t=this,n=e.id,o=e.data
return new Ember.RSVP.Promise(function(e){if(t.get("store").peekAll("color-manager/selection").map(function(e){return e.get("_id")}).includes(o._id))return e({id:n,type:"color",data:"global-color:".concat(o._id)})
var r=t.get("store").push({data:[{id:o._id,type:"color-manager/selection",attributes:o,relationships:{}}]})
if(!(r&&r[0]&&r[0].get("id")))return e({error:!0,reason:"Unable to save color"})
r[0].save().then(function(){return e({id:n,type:"color",data:"global-color:".concat(o._id)})},function(t){return e({error:!0,reason:t})})})},importJobFont:function(e){var t=this,n=e.id,o=e.data
return new Ember.RSVP.Promise(function(e){if(t.get("store").peekAll("font-manager/selection").map(function(e){return e.get("_id")}).includes(o._id))return e({id:n,type:"font",data:o._id})
var r=t.get("store").push({data:[{id:o._id,type:"font-manager/selection",attributes:o,relationships:{}}]})
if(!(r&&r[0]&&r[0].get("id")))return e({error:!0,reason:"Unable to save font"})
r[0].save().then(function(){return e({id:n,type:"font",data:o._id})},function(t){return e({error:!0,reason:t})})})},readFile:function(e,t){if(t.dir)return!1
var n=e.split("/")
if(n.length>1&&!u.includes(n[0]))return!1
var a=n[n.length-1].split(".")
return new Ember.RSVP.Promise(function(s,l){if("img"===n[0]){var c=n.slice(-2)
return t.async("blob").then(function(e){try{s({type:"image",id:c[0],filename:c[1],imageData:e})}catch(n){l({error:"Unable to load image",logObject:{e:n,file:t}})}},l)}if(a[1].includes("tco-tmpl"))return t.async("string").then(function(e){try{var t=e
a[1].includes("tco-tmpl-json")||(t=r.default.inflate((0,i.base64DecodeToByteArray)(e),{to:"string"}))
var c=JSON.parse(t)
if("manifest"===a[0])return s({data:c,type:"manifest"})
var u,p="template"
"global-blocks"===n[0]?(p="global-block",u=a[0]):u=o.default.hash(e),a[0]===u?s({checksum:u,data:c,type:p}):l({error:"Template failed checksum",logObject:{checksum:u,rawdata:e}})}catch(d){l({error:"Unable to parse JSON for template",logObject:{e:d,rawdata:e}})}},l)
l({error:"Unknown filetype",path:e,file:t})})},remoteTemplateVersion:Ember.computed(function(){return"".concat(window.csAppData.env.product,"-").concat(window.csAppData.env.version)}),importStarterPack:function(e){var t=this
return new Ember.RSVP.Promise(function(n,o){(0,s.downloadFile)(e,{responseType:"json"}).then(function(e){var r=e.response,a="default",i=t.get("remoteTemplateVersion")
Ember.isNone(r[i])||(a=i),t.remoteImport(r[a],"dc-starter-pack").then(n,o)},o)})},remoteImport:function(e,t){var n=this
return new Ember.RSVP.Promise(function(o,r){(0,s.downloadFile)(e).then(function(e){var a=e.response
n.importTemplates(a,t).then(o,r)},r)})},dismissStarterPack:function(){return(0,s.request)("templates::hide_starter_pack")},savePreset:function(e,t){var n=this
return new Ember.RSVP.Promise(function(o,r){var a=n.get("i18n").t("app.templates.preset.entity")
if(!e)return n.get("ui").notify(n.get("i18n").t("app.notify.name-required",{context:a}),"error"),r()
if(!t||!t._type)return r()
var i=n.get("store").peekAll("element/preset").find(function(n){return n.get("element.id")===t._type&&e===n.get("title")})
i?(n.get("ui").beginSaveProgress(),n.get("ui").confirm({message:n.get("i18n").t("app.notify.name-overwrite-confirm",{context:a}),acceptClass:"sad",accept:function(){i.set("atts",t),i.save().then(function(e){n.get("ui").endSaveProgress(),o(e),n.get("ui").notify(n.get("i18n").t("app.notify.updated",{context:a}),"success")},function(e){n.get("ui").endSaveProgress(),r(e),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-update",{context:a}),"error")})}})):(n.get("ui").beginSaveProgress(),n.get("store").createRecord("element/preset",{element:n.get("elementService").getDefinitionByType(t._type),title:e,atts:t}).save().then(function(e){o(e),n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.saved",{context:a}),"success")},function(e){r(e),n.get("ui").endSaveProgress(),n.get("ui").notify(n.get("i18n").t("app.notify.failed-to-save",{context:a}),"error")}))})}})
e.default=p}),define("tco-app/template-manager/stub/adapter",["exports","tco-app/adapters/cs-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=t.default.extend({shouldReloadAll:function(){return!0},shouldReload:function(){return!0}})
e.default=n}),define("tco-app/template-manager/stub/model",["exports","ember-data","ember-data/attr"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var o=t.default.Model.extend({title:(0,n.default)(),type:(0,n.default)(),subtype:(0,n.default)(),packageSignature:(0,n.default)(),preview:(0,n.default)(),hidden:(0,n.default)(),meta:(0,n.default)({defaultValue:function(){return{}}}),elementService:Ember.inject.service("element"),typeLabel:Ember.computed("type","subtypeLabel",function(){var e=this.get("i18n").t("app.templates.type-".concat(this.get("type"))),t=this.get("subtypeLabel"),n="<strong>".concat(e,"</strong>")
return t&&(n=this.get("i18n").t("app.templates.subtype-format",{type:e,subtype:t})),Ember.String.htmlSafe(n)}),unformattedSubTypeLabel:Ember.computed("type","subtypeLabel",function(){return this.get("i18n").t("app.templates.type-".concat(this.get("type")))+this.get("subtypeLabel")}),subtypeLabel:Ember.computed("subtype","type",function(){var e=this.get("subtype")
return"preset"===this.get("type")&&e?this.get("elementService").getDefinitionByType(e).get("title"):""})})
e.default=o}),define("tco-app/template-manager/template",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"z1Y5+4pb",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["template-manager"]],{"statements":[[4,"workspace/cs-workspace",null,null,{"statements":[[4,"workspace/workspace-header",null,null,{"statements":[[7,"h2"],[11,"class","cs-workspace-title"],[9],[1,[27,"t",["app.templates.manager"],null],false],[10],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-content",null,null,{"statements":[[0,"\\n"],[4,"if",[[27,"user-can",["templates.import"],null]],null,{"statements":[[1,[27,"template-manager/template-importer",null,[["onImportStarterPack","onNewSubmission"],[[27,"route-action",["importStarterPack"],null],[27,"route-action",["importTemplates"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[1,[27,"workspace/workspace-message",null,[["message"],[[27,"t",["app.templates.unauthorized"],null]]]],false],[0,"\\n"]],"parameters":[]}],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[4,"global/cs-canvas",null,null,{"statements":[[1,[27,"template-manager/template-manager",null,[["isImporting","hideImportStarterPack","onDismissStarterPack","myTemplates"],[[23,["isImporting"]],[23,["hideImportStarterPack"]],[27,"route-action",["dismissStarterPack"],null],[27,"filter-by",["isDeleted",false,[23,["templateStubs"]]],null]]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/template-manager/template.hbs"}})
e.default=t}),define("tco-app/templates/head",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"kuwNY/zq",block:'{"symbols":[],"statements":[[7,"title"],[9],[1,[23,["model","title"]],false],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/head.hbs"}})
e.default=t}),define("tco-app/templates/iframe-loaders/content",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"2Xfz8Uka",block:'{"symbols":[],"statements":[[7,"div"],[11,"class","cs-pre-loader-logo"],[9],[0,"\\n  "],[1,[27,"icon",[[23,["ui","contentLogoPath"]]],null],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/iframe-loaders/content.hbs"}})
e.default=t})
define("tco-app/templates/iframe-loaders/default",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"A2ZsYKdd",block:'{"symbols":[],"statements":[[7,"div"],[12,"class",[28,["cs-pre-loader-logo ",[23,["ui","preloaderLogoClass"]]]]],[9],[0,"\\n  "],[1,[27,"icon",[[23,["ui","optionsLogoPath"]],[23,["ui","optionsLogoExtra"]]],null],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/iframe-loaders/default.hbs"}})
e.default=t}),define("tco-app/templates/iframe-loaders/footers",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"72ipMr/v",block:'{"symbols":[],"statements":[[7,"div"],[11,"class","cs-pre-loader-logo"],[9],[0,"\\n  "],[1,[27,"icon",["logo-pro-inherit"],null],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/iframe-loaders/footers.hbs"}})
e.default=t}),define("tco-app/templates/iframe-loaders/headers",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"fvT+c5m7",block:'{"symbols":[],"statements":[[7,"div"],[11,"class","cs-pre-loader-logo"],[9],[0,"\\n  "],[1,[27,"icon",["logo-pro-inherit"],null],false],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/iframe-loaders/headers.hbs"}})
e.default=t}),define("tco-app/templates/iframe-loaders/options",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Vp2jHt1/",block:'{"symbols":[],"statements":[[15,"iframe-loaders/default",[]],[0,"\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/templates/iframe-loaders/options.hbs"}})
e.default=t}),define("tco-app/templates/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"6BXZsknU",block:'{"symbols":[],"statements":[[1,[21,"global/launch-screen"],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/index.hbs"}})
e.default=t}),define("tco-app/templates/not-found",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"tgeO4gRK",block:'{"symbols":[],"statements":[[1,[21,"outlet"],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/not-found.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/content",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"iWjlqUwj",block:'{"symbols":[],"statements":[[4,"if",[[27,"or",[[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_css"],null]],null],[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_js"],null]],null]],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n    "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_css"],null]],null]],null,{"statements":[[0,"        "],[15,"partials/bar/css",[]],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_js"],null]],null]],null,{"statements":[[0,"        "],[15,"partials/bar/js",[]],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[7,"li"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showActionHistory"]],[27,"action",[[22,0,[]],"toggle","showActionHistory"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"      "],[1,[27,"icon",["fa-history"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/templates/partials/bar/content.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/css",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"5AfPahXP",block:'{"symbols":[],"statements":[[4,"global/bar-button",null,[["class","active","onClick"],["cs-action-toggle-custom-css",[23,["ui","showCustomCSS"]],[27,"action",[[22,0,[]],"toggle","showCustomCSS"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"CSS"]],"parameters":[]},null],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/bar/css.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/fonts",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"9uELCeHj",block:'{"symbols":[],"statements":[[7,"li"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["class","active","onClick"],["cs-action-toggle-font-config",[23,["ui","showFontConfig"]],[27,"action",[[22,0,[]],"toggle","showFontConfig"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"      "],[1,[27,"icon",["fa-cogs"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/bar/fonts.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/footer",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"p1K0MR/F",block:'{"symbols":[],"statements":[[4,"if",[[27,"or",[[27,"user-can",["footers.edit_custom_css"],null],[27,"user-can",["footers.edit_custom_js"],null]],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n    "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"user-can",["footers.edit_custom_css"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/css",[]],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["footers.edit_custom_js"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/js",[]],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"li"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showActionHistory"]],[27,"action",[[22,0,[]],"toggle","showActionHistory"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"      "],[1,[27,"icon",["fa-history"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/templates/partials/bar/footer.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/global-blocks",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"HUMF8mIN",block:'{"symbols":[],"statements":[[4,"if",[[27,"or",[[27,"user-can",["content.cs_global_block.edit_custom_css"],null],[27,"user-can",["content.cs_global_block.edit_custom_js"],null]],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n    "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"user-can",["content.cs_global_block.edit_custom_css"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/css",[]],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["content.cs_global_block.edit_custom_js"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/js",[]],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"li"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showActionHistory"]],[27,"action",[[22,0,[]],"toggle","showActionHistory"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"      "],[1,[27,"icon",["fa-history"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/templates/partials/bar/global-blocks.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/header",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Xa1jmDM/",block:'{"symbols":[],"statements":[[4,"if",[[27,"or",[[27,"user-can",["headers.edit_custom_css"],null],[27,"user-can",["headers.edit_custom_js"],null]],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n    "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"user-can",["headers.edit_custom_css"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/css",[]],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["headers.edit_custom_js"],null]],null,{"statements":[[0,"        "],[15,"partials/bar/js",[]],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[7,"li"],[9],[0,"\\n  "],[7,"ul"],[9],[0,"\\n"],[4,"global/bar-button",null,[["active","onClick"],[[23,["ui","showActionHistory"]],[27,"action",[[22,0,[]],"toggle","showActionHistory"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"      "],[1,[27,"icon",["fa-history"],null],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"],[10],[0,"\\n"]],"hasEval":true}',meta:{moduleName:"tco-app/templates/partials/bar/header.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/js",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"9EoTkG1N",block:'{"symbols":[],"statements":[[4,"if",[[27,"user-can",["unfiltered_html"],null]],null,{"statements":[[0,"  "],[4,"global/bar-button",null,[["class","active","onClick"],["cs-action-toggle-custom-js",[23,["ui","showCustomJS"]],[27,"action",[[22,0,[]],"toggle","showCustomJS"],[["target"],[[23,["ui"]]]]]]],{"statements":[[0,"JS"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/bar/js.hbs"}})
e.default=t}),define("tco-app/templates/partials/bar/options",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"EW1R0nul",block:'{"symbols":[],"statements":[[4,"if",[[27,"or",[[27,"and",[[23,["model","customCSS"]],[27,"user-can",["theme_options.edit_custom_css"],null]],null],[27,"and",[[23,["model","customJS"]],[27,"user-can",["theme_options.edit_custom_js"],null]],null]],null]],null,{"statements":[[0,"  "],[7,"li"],[9],[0,"\\n    "],[7,"ul"],[9],[0,"\\n"],[4,"if",[[27,"and",[[23,["model","customCSS"]],[27,"user-can",["theme_options.edit_custom_css"],null]],null]],null,{"statements":[[0,"        "],[15,"partials/bar/css",[]],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"and",[[23,["model","customJS"]],[27,"user-can",["theme_options.edit_custom_js"],null]],null]],null,{"statements":[[0,"        "],[15,"partials/bar/js",[]],[0,"\\n"]],"parameters":[]},null],[0,"    "],[10],[0,"\\n  "],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":true}',meta:{moduleName:"tco-app/templates/partials/bar/options.hbs"}})
e.default=t}),define("tco-app/templates/partials/global/content",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"b/QU7c+u",block:'{"symbols":["&default"],"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[7,"div"],[11,"class","cs-external"],[9],[0,"\\n"],[4,"if",[[27,"and",[[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_js"],null]],null],[27,"user-can",["unfiltered_html"],null]],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","run","hasToggle","placeholder","mode"],[[27,"t",["app.context-js"],[["context"],[[27,"t",["common.content.entity"],null]]]],[23,["ui","showCustomJS"]],[23,["model","content","settings","general","custom_js"]],[27,"action",[[22,0,[]],"runCustomJs"],null],false,[27,"t",["app.code-editors.custom_js_placeholder"],null],"javascript"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".edit_custom_css"],null]],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","hasToggle","placeholder","mode"],[[27,"t",["app.context-css"],[["context"],[[27,"t",["common.content.entity"],null]]]],[23,["ui","showCustomCSS"]],[23,["model","content","settings","general","custom_css"]],false,[27,"t",["app.code-editors.custom_css_placeholder"],null],"css"]]],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[4,"workspace/workspace-expander",null,[["headerLabel","open","closeOnFocusLoss","canExpandFull"],[[27,"t",["app.history.title"],null],[23,["ui","showActionHistory"]],false,false]],{"statements":[[0,"  "],[1,[21,"global/action-history"],false],[0,"\\n"]],"parameters":[]},null],[0,"\\n  "],[14,1],[0,"\\n"],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/global/content.hbs"}})
e.default=t}),define("tco-app/templates/partials/global/footer",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"phjkCUuB",block:'{"symbols":[],"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[7,"div"],[11,"class","cs-external"],[9],[0,"\\n"],[4,"if",[[27,"and",[[27,"user-can",["footers.edit_custom_js"],null],[27,"user-can",["unfiltered_html"],null]],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","run","hasToggle","placeholder","mode"],[[27,"t",["app.context-js"],[["context"],[[27,"t",["common.footers.entity"],null]]]],[23,["ui","showCustomJS"]],[23,["model","footer","settings","customJS"]],[27,"action",[[22,0,[]],"runCustomJs"],null],false,[27,"t",["app.code-editors.custom_js_placeholder"],null],"javascript"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["footers.edit_custom_css"],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","hasToggle","placeholder","mode"],[[27,"t",["app.context-css"],[["context"],[[27,"t",["common.footers.entity"],null]]]],[23,["ui","showCustomCSS"]],[23,["model","footer","settings","customCSS"]],false,[27,"t",["app.code-editors.custom_css_placeholder"],null],"css"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-expander",null,[["headerLabel","open","closeOnFocusLoss","canExpandFull"],[[27,"t",["app.history.title"],null],[23,["ui","showActionHistory"]],false,false]],{"statements":[[0,"  "],[1,[21,"global/action-history"],false],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/global/footer.hbs"}})
e.default=t}),define("tco-app/templates/partials/global/global-blocks",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"Q3RUG71k",block:'{"symbols":[],"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-external"],[9],[0,"\\n"],[4,"if",[[27,"and",[[27,"user-can",["content.cs_global_block.edit_custom_js"],null],[27,"user-can",["unfiltered_html"],null]],null]],null,{"statements":[[0,"    "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","run","hasToggle","placeholder","mode"],[[27,"t",["app.context-js"],[["context"],[[27,"t",["common.global-blocks.entity"],null]]]],[23,["ui","showCustomJS"]],[23,["model","content","settings","general","custom_js"]],[27,"action",[[22,0,[]],"runCustomJs"],null],false,[27,"t",["app.code-editors.custom_js_placeholder"],null],"javascript"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["content.cs_global_block.edit_custom_css"],null]],null,{"statements":[[0,"    "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","hasToggle","placeholder","mode"],[[27,"t",["app.context-css"],[["context"],[[27,"t",["common.global-blocks.entity"],null]]]],[23,["ui","showCustomCSS"]],[23,["model","content","settings","general","custom_css"]],false,[27,"t",["app.code-editors.custom_css_placeholder"],null],"css"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-expander",null,[["headerLabel","open","closeOnFocusLoss","canExpandFull"],[[27,"t",["app.history.title"],null],[23,["ui","showActionHistory"]],false,false]],{"statements":[[0,"      "],[1,[21,"global/action-history"],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/global/global-blocks.hbs"}})
e.default=t}),define("tco-app/templates/partials/global/header",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"0Utz2s+Q",block:'{"symbols":[],"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"\\n"],[7,"div"],[11,"class","cs-external"],[9],[0,"\\n"],[4,"if",[[27,"and",[[27,"user-can",["headers.edit_custom_js"],null],[27,"user-can",["unfiltered_html"],null]],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","run","hasToggle","placeholder","mode"],[[27,"t",["app.context-js"],[["context"],[[27,"t",["common.headers.entity"],null]]]],[23,["ui","showCustomJS"]],[23,["model","header","settings","customJS"]],[27,"action",[[22,0,[]],"runCustomJs"],null],false,[27,"t",["app.code-editors.custom_js_placeholder"],null],"javascript"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"user-can",["headers.edit_custom_css"],null]],null,{"statements":[[0,"  "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","hasToggle","placeholder","mode"],[[27,"t",["app.context-css"],[["context"],[[27,"t",["common.headers.entity"],null]]]],[23,["ui","showCustomCSS"]],[23,["model","header","settings","customCSS"]],false,[27,"t",["app.code-editors.custom_css_placeholder"],null],"css"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"workspace/workspace-expander",null,[["headerLabel","open","closeOnFocusLoss","canExpandFull"],[[27,"t",["app.history.title"],null],[23,["ui","showActionHistory"]],false,false]],{"statements":[[0,"  "],[1,[21,"global/action-history"],false],[0,"\\n"]],"parameters":[]},null],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/global/header.hbs"}})
e.default=t}),define("tco-app/templates/partials/global/options",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"jlgNeWlZ",block:'{"symbols":[],"statements":[[4,"unless",[[23,["noTranslation"]]],null,{"statements":[[0,"  "],[7,"div"],[11,"class","cs-external"],[9],[0,"\\n"],[4,"if",[[27,"and",[[23,["model","customJS"]],[27,"and",[[27,"user-can",["theme_options.edit_custom_js"],null],[27,"user-can",["unfiltered_html"],null]],null]],null]],null,{"statements":[[0,"      "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","run","hasToggle","placeholder","mode"],[[27,"t",["app.context-js"],[["context"],[[27,"t",["app.global"],null]]]],[23,["ui","showCustomJS"]],[23,["model","customJS","value"]],[27,"action",[[22,0,[]],"runCustomJs"],null],false,[27,"t",["app.code-editors.custom_js_placeholder"],null],"javascript"]]],false],[0,"\\n"]],"parameters":[]},null],[4,"if",[[27,"and",[[23,["model","customCSS"]],[27,"user-can",["theme_options.edit_custom_css"],null]],null]],null,{"statements":[[0,"      "],[1,[27,"forms/expandable-code-editor",null,[["headerLabel","active","value","hasToggle","placeholder","mode"],[[27,"t",["app.context-css"],[["context"],[[27,"t",["app.global"],null]]]],[23,["ui","showCustomCSS"]],[23,["model","customCSS","value"]],false,[27,"t",["app.code-editors.custom_css_placeholder"],null],"css"]]],false],[0,"\\n"]],"parameters":[]},null],[0,"  "],[10],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/global/options.hbs"}})
e.default=t}),define("tco-app/templates/partials/settings/content",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"aWI2ELxz",block:'{"symbols":[],"statements":[[4,"if",[[27,"and",[[27,"not",[[23,["noTranslation"]]],null],[27,"user-can",[[27,"concat",["content.",[23,["model","content","postType"]],".settings"],null]],null]],null]],null,{"statements":[[0,"  "],[1,[27,"content/settings-modal-tab",null,[["model","onSettingsChanged","onSave"],[[23,["model"]],[27,"action",[[22,0,[]],"refreshPreview"],null],[27,"route-action",["save"],null]]]],false],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/settings/content.hbs"}})
e.default=t}),define("tco-app/templates/partials/settings/template-manager",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"y+n8RupU",block:'{"symbols":[],"statements":[[4,"if",[[27,"user-can",["templates.manage_default_presets"],null]],null,{"statements":[[0,"  "],[1,[27,"template-manager/settings-modal-tab",null,[["tabData","onSave","presetTemplateStubs","elementDefinitions","defaultPresets"],[[27,"hash",null,[["name","label","prefer"],["template-manager",[27,"t",["app.templates.manager"],null],true]]],[27,"route-action",["saveElementDefaults"],null],[23,["presetTemplateStubs"]],[23,["model","elementDefinitions"]],[23,["model","defaultPresets"]]]]],false],[0,"\\n"]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/partials/settings/template-manager.hbs"}})
e.default=t}),define("tco-app/templates/redirect",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"u7k64Hv0",block:'{"symbols":[],"statements":[[1,[21,"outlet"],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"tco-app/templates/redirect.hbs"}})
e.default=t}),define("tco-app/templates/unauthorized",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.HTMLBars.template({id:"lQiw1tAY",block:'{"symbols":[],"statements":[[4,"global/cs-window",null,[["screen"],["unauthorized"]],{"statements":[[4,"global/cs-canvas",null,null,{"statements":[[0,"    "],[7,"div"],[11,"class","cs-welcome"],[9],[0,"\\n      "],[7,"h3"],[11,"class","cs-welcome-title"],[9],[1,[27,"t",["app.unauthorized"],null],false],[10],[0,"\\n    "],[10],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"tco-app/templates/unauthorized.hbs"}})
e.default=t}),define("tco-app/util/custom-media-manager",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(t)return
t=!0
var e=window.wp.media,n=e.view.l10n
window.wp.media.view.MediaFrame.Cornerstone=window.wp.media.view.MediaFrame.Post.extend({createStates:function(){var t=this.options
this.states.add([new e.controller.Library({id:"insert",title:n.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:e.query(t.library),multiple:!!t.multiple&&"reset",editable:!0,allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0}),new e.controller.Embed({metadata:t.metadata}),new e.controller.EditImage({model:t.editImage})]),e.view.settings.post.featuredImageId&&this.states.add(new e.controller.FeaturedImage)}})}
var t=!1}),define("tco-app/util/ember-control-factory",["exports","ember-copy","uuid/v4","tco-app/src/util/merge-options","tco-app/src/util/control-conditions"],function(e,t,n,o,r){function a(e){return l(e)||s(e)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function s(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function l(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++){n[t]=e[t]}return n}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){e.owner
var i=e.sourcePath,s=e.controls,l=e.definition,c=e.permissionCheck
e.hashKey
if(!s||Ember.isEmpty(s))return function(){return s||console.warn("makeControlFactory passed invalid control list",s),[]}
var u,p=s.map(function e(s){if(Ember.isNone(s))return null
var u=function(e){if(!e||!Ember.isPresent(e.type))return!1
var n=(0,t.copy)(e,!0),a={type:n.type,keys:Ember.isPresent(n.keys)?n.keys:{},label:"",description:"",conditions:Ember.isPresent(n.conditions)?n.conditions:[],options:Ember.isPresent(n.options)?n.options:{},group:Ember.isPresent(n.group)?n.group:""}
Array.isArray(a.conditions)||(console.warn("Control conditions must be an array",n),a.conditions=[])
if(Ember.isPresent(n.key))a.keys.value=n.key
else{var s=Object.keys(a.keys)
s.length>0&&(a.keys.value=a.keys[s[0]])}Ember.isPresent(n.default_options)&&(a.options=(0,o.default)(n.default_options,a.options))
Ember.isPresent(n.title)&&(a.label=n.title)
Ember.isPresent(n.label)&&(a.label=n.label)
Ember.isPresent(n.description)&&(a.description=n.description)
Ember.isPresent(n.condition)&&a.conditions.push(n.condition)
Ember.isPresent(n.controls)&&(a._controls=n.controls)
Ember.isPresent(n.index)&&(a.searchIndex=n.index)
var l=[]
return a.conditions=a.conditions.map(r.normalizeControlCondition).filter(r.validateControlConditions).map(function(e){return l.includes(e.key)?e.path="source.".concat(e.key.substr(1)):e.path="source.".concat(i,".").concat(e.key),e}),a}(s)
if(!u)return console.warn("Invalid control mapping",s),null
Ember.isPresent(u._controls)&&(u._controls=u._controls.map(e).filter(Ember.isPresent))
var p=!1
if(u.conditions&&u.conditions.length>0){var d={user_can:function(e,t){var n=t.value,o=t.or
return{a:n,b:c(e),op:"==",or:o}}}
p=Ember.computed.apply(Ember,[].concat(a(u.conditions.map(function(e){var t=e.path
return t})),[function(){var e=this
return!(0,r.checkConditions)(u.conditions.map(function(t){var n=t.value,o=t.key,r=t.path,a=t.op,i=t.or
if(-1!==o.indexOf(":")){var s=o.split(":")
if("function"===Ember.typeOf(d[s[0]]))return d[s[0]](s[1],{value:n,key:o,path:r,op:a,or:i})}return{a:n,b:e.get(r),op:a,or:i}}))}]))}var f={id:(0,n.default)(),itemExcluded:p,excluded:Ember.computed("itemExcluded","allChildrenHidden",function(){return this.get("itemExcluded")||this.get("allChildrenHidden")}),allChildrenHidden:Ember.computed("controls.@each.excluded",function(){var e=this.get("controls")
return!Ember.isNone(e)&&e.reduce(function(e,t){return t.get("excluded")&&e--,e},Ember.get(e,"length"))<=0}),indexLabel:Ember.computed("excluded","controls.@each.excluded",function(){var e=this.getWithDefault("searchIndex",this.getWithDefault("label",!1))
if(!this.get("excluded")&&!1!==e)return e+this.getWithDefault("controls",[]).reduce(function(e,t){return"".concat(e," ").concat(t.getWithDefault("indexLabel",""))},"")}),init:function(){this._super.apply(this,arguments)
var e=this.get("_controls")
if(e){var t=this.get("source")
this.set("controls",e.map(function(e){return e.create({source:t})}))}}}
for(var m in u.keys)if(u.keys.hasOwnProperty(m)){var h=Ember.getWithDefault(u,"options.debounce.".concat(m),null)
f[Ember.String.camelize("key-".concat(m))]=g("source.".concat(i,".").concat(u.keys[m]),h)}Object.keys(u.options).forEach(function(e){u.options[e]=function(e,t){if(l&&"string"===Ember.typeOf(t)&&t.includes("{{elementDefinitionTitle}}")){var n=l.get("title")
n&&(t=t.replace("{{elementDefinitionTitle}}",n))}return t}(0,u.options[e])})
function g(e,t){if(Ember.isNone(t))return Ember.computed.alias(e)
var n=parseInt(t)
return n=isNaN(n)?10:n,Ember.computed(e,{get:function(){return this.get(e)},set:function(t,o){return Ember.run.debounce(this,this.set,e,o,n),o}})}return Ember.Object.extend(f,u)}).filter(Ember.isPresent)
return function(e){return u&&u.forEach(function(e){return e.destroy()}),u=p.map(function(t){return t.create({source:e})})}}}),define("tco-app/util/flatten-assignments",["exports","ember-copy"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return(0,t.copy)(e,!0).reduce(function(e,t){var n=!0
return t.title?e[t.name]={title:t.title,url:t.url,highlight:!0,divider:!0}:n=!1,t.items&&t.items.forEach(function(o,r){var a={group:t.name,title:o.title,url:o.url,tag:t.tag,status:o.status}
0!==r||n||(a.divider=!0),e["".concat(t.name,"::").concat(o.value)]=a}),e},{})}}),define("tco-app/util/hex-encode",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return e.split("").reduce(function(e,t){return e+=t.charCodeAt(0).toString(16)},"")}}),define("tco-app/util/search",["exports","fuse.js"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var n=Ember.Object.extend({query:"",isSearching:!1,fuseOptions:{},results:[],queryChanged:Ember.observer("query",function(){this.debounce=Ember.run.debounce(this,"updateQuery",250)}),updateQuery:function(){var e=this,t=this.get("query"),n=!!t
n!==this.get("isSearching")&&this.set("isSearching",n)
var o=this.get("fuse")
if(n&&o){var r=o.search(t)
Ember.run.scheduleOnce("afterRender",this,function(){e.set("results",r)})}else this.set("results",[])},setup:function(e,t){t&&this.updateIndex(t),this.setOptions(e)},setOptions:function(e){this.set("fuseOptions",Object.assign({},e||{}))},updateIndex:function(e){this.set("fuse",new t.default(e,this.get("fuseOptions")))}})
e.default=n}),define("tco-app/xfr/agent",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Mixin.create({xfr:Ember.inject.service(),debug:Ember.inject.service(),xfrOrigin:"unknown",xfrPendingRequests:{},xfrRequestQueue:Ember.A(),xfrResponseQueue:Ember.A(),init:function(){this._super.apply(this,arguments),this.set("xfrOnMessage",this.get("_xfrOnMessage").bind(this)),this.set("xfr.agent",this)},_xfrOnMessage:function(e){var t=this
if(e.data){var n=function(e){if("response"===e.type&&e.ts){var n=t.get("xfrPendingRequests.".concat(e.ts))
"function"===Ember.typeOf(n)&&n(e.data)}else{var o=function(n){t.xfrSendMessage("response",{data:n,ts:e.ts})}
!e.noreply&&t.get("xfr").has(e.action)||o({ack:!0,request:e}),t.get("xfr").trigger(e.action,e.data,e.noreply?null:o,e.ts)}}
Ember.run(function(){e.data.batch?e.data.batch.forEach(n):n(e.data)})}},xfrSendMessage:function(e,t,n){var o=this
if(this.get("xfrMessagePort")){var r=Ember.assign({type:e,origin:this.get("xfrOrigin")},t)
return"response"===e?(this.get("xfrResponseQueue").push({message:r}),void Ember.run.debounce(this,this.flushResponses,0)):(r.ts="ts".concat(Date.now()).concat(this.get("xfrRequestQueue.length")),new Ember.RSVP.Promise(function(e,t){o.get("xfrRequestQueue").push({message:r,resolve:e,reject:t,timeout:n}),Ember.run.debounce(o,o.flushRequests,0)}))}this.get("debug.logging")&&console.warn("Sending before port is ready",e,t)},flushResponses:function(){var e=this.get("xfrResponseQueue").map(function(e){return e.message})
this.get("xfrResponseQueue").clear(),this.get("xfrMessagePort").postMessage({batch:e})},flushRequests:function(){var e=this,t=function(t){var n=e.get("xfrPendingRequests")
delete n[t],e.set("pending",n)},n=this.get("xfrRequestQueue").map(function(n){var o=n.message,r=n.resolve,a=n.reject,i=n.timeout
if(o.noreply)return r(),o
var s=Ember.run.later(e,function(){t(o.ts),a({error:!0,message:"Xfr request made by ".concat(this.get("xfrOrigin")," timed out"),ts:o.ts,params:o})},Ember.isNone(i)?15e3:i)
return e.set("xfrPendingRequests.".concat(o.ts),function(e){Ember.run.cancel(s),r(e),t(o.ts)}),o})
this.get("xfrRequestQueue").clear(),this.get("xfrMessagePort").postMessage({batch:n})},request:function(e,t){return this.xfrSendMessage("request",{action:e,data:t})},message:function(e,t){return this.xfrSendMessage("request",{action:e,data:t,noreply:!0})}})
e.default=t}),define("tco-app/xfr/service",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
var t=Ember.Service.extend(Ember.Evented,{request:function(){var e=this.get("agent"),t=arguments
return e?e.request.apply(e,arguments):new Ember.RSVP.Promise(function(e){Ember.debug("XFR service does not have an agent"),Ember.debug(t.action),e(void 0)})},message:function(){var e=this.get("agent"),t=arguments
return e?e.message.apply(e,arguments):new Ember.RSVP.Promise(function(e){Ember.debug("XFR service does not have an agent"),Ember.debug(t.action),e(void 0)})}})
e.default=t})
define("tco-app/config/environment",[],function(){var e={default:{modulePrefix:"tco-app",environment:"production",rootURL:"/",routerRootURL:"/",locationType:"auto",EmberENV:{FEATURES:{},EXTEND_PROTOTYPES:!1},APP:{name:"tco-app",version:"3.2.3+0ce70e65"},browserify:{transform:[["aliasify",{global:!0}]]},i18n:{defaultLocale:"en"},exportApplicationGlobal:!1}}
return Object.defineProperty(e,"__esModule",{value:!0}),e}),runningTests||require("tco-app/app").default.create({name:"tco-app",version:"3.2.3+0ce70e65"})
