diff --git a/cdn/build/es6/node_modules/@haxtheweb/course-design/lib/learning-component.js b/cdn/build/es6/node_modules/@haxtheweb/course-design/lib/learning-component.js index aee560080..30c36953a 100644 --- a/cdn/build/es6/node_modules/@haxtheweb/course-design/lib/learning-component.js +++ b/cdn/build/es6/node_modules/@haxtheweb/course-design/lib/learning-component.js @@ -159,4 +159,4 @@ import{html as e,css as t}from"../../../lit/index.js";import"../../simple-toolti > `:""} - `}static get haxProperties(){return{type:"grid",canScale:!1,hideDefaultSettings:!0,gizmo:{title:"Learning Component",description:"A card for instructors to communicate pedagogy and instructional strategies.",icon:"icons:bookmark",color:"orange",tags:["Instructional","content","design","presentation","instruction","course","learning","card"],handles:[],meta:{author:"HAXTheWeb core team"}},settings:{configure:[{property:"type",title:"Type",description:"The type of card to be used.",inputMethod:"select",options:{"":"",...learningComponentTypes},required:!1},{property:"subtitle",title:"Sub-Title",description:"The sub-title of the card.",inputMethod:"textfield"},{property:"url",title:"Link",description:"An optional link for the card (Link not available for Learning Objectives).",inputMethod:"url"},{slot:"",title:"Contents"}],advanced:[{property:"title",title:"Title",description:"Set Title, this overrides type based title",inputMethod:"textfield"},{property:"icon",title:"Icon",description:"Set icon, this overrides type based icon",inputMethod:"iconpicker"},{property:"accentColor",title:"Accent color",description:"Set accent color, this overrides type based color",inputMethod:"colorpicker"},{property:"dark",title:"Dark mode",description:"Invert high and low tones",inputMethod:"boolean"}]},saveOptions:{unsetAttributes:["t"]},demoSchema:[{tag:"learning-component",properties:{type:"objectives",subtitle:"Unit 1"},content:"
By the end of this lesson, you should be able to...
"}]}}}customElements.define(LearningComponent.tag,LearningComponent);export{LearningComponent}; \ No newline at end of file + `}static get haxProperties(){return{type:"grid",canScale:!1,hideDefaultSettings:!0,gizmo:{title:"Learning Component",description:"A card for instructors to communicate pedagogy and instructional strategies.",icon:"icons:bookmark",color:"orange",tags:["Instructional","content","design","presentation","instruction","course","learning","card"],handles:[],meta:{author:"HAXTheWeb core team"}},settings:{configure:[{property:"type",title:"Type",description:"The type of card to be used.",inputMethod:"select",options:{"":"",...learningComponentTypes},required:!1},{property:"subtitle",title:"Sub-Title",description:"The sub-title of the card.",inputMethod:"textfield"},{property:"url",title:"Link",description:"An optional link for the card (Link not available for Learning Objectives).",inputMethod:"url"},{property:"title",title:"Title",description:"Set Title, this overrides type based title",inputMethod:"textfield"},{property:"icon",title:"Icon",description:"Set icon, this overrides type based icon",inputMethod:"iconpicker"},{property:"accentColor",title:"Accent color",description:"Set accent color, this overrides type based color",inputMethod:"colorpicker"},{slot:"",title:"Contents"}],advanced:[]},saveOptions:{unsetAttributes:["t"]},demoSchema:[{tag:"learning-component",properties:{subtitle:"Unit 1"},content:"By the end of this lesson, you should be able to...
"}]}}}customElements.define(LearningComponent.tag,LearningComponent);export{LearningComponent}; \ No newline at end of file diff --git a/cdn/build/es6/node_modules/@haxtheweb/course-model/course-model.js b/cdn/build/es6/node_modules/@haxtheweb/course-model/course-model.js index 36a607091..74464d5b7 100644 --- a/cdn/build/es6/node_modules/@haxtheweb/course-model/course-model.js +++ b/cdn/build/es6/node_modules/@haxtheweb/course-model/course-model.js @@ -2,7 +2,7 @@ * Copyright 2023 * @license , see License.md for full text. */ -import{LitElement as e,html as t,css as i}from"../../lit/index.js";import"../../@google/model-viewer/dist/model-viewer.js";import"./lib/model-option.js";import"./lib/model-info.js";class CourseModel extends e{static get tag(){return"course-model"}static get properties(){return{visible:{type:String,reflect:!0},title:{type:String},src:{type:String},alt:{type:String}}}static get haxProperties(){return!this._sent&&window.HaxStore&&window.HaxStore.instance&&window.HaxStore.instance.ready&&(this._sent=!0,window.HaxStore.instance.setHaxProperties({api:"1",canScale:!0,canEditSource:!0,contentEditable:!1,gizmo:{title:"3d Model",description:"3D Model viewer",icon:"icons:android",color:"purple",tags:["Resource","3D","model","viewer"],handles:[],meta:{author:"Google"}},settings:{configure:[{property:"poster",title:"Poster image",inputMethod:"haxupload",noVoiceRecord:!0},{property:"src",title:"Source",inputMethod:"haxupload",noVoiceRecord:!0,noCamera:!0},{property:"alt",title:"Alternate Text",inputMethod:"alt"}],advanced:[{attribute:"environment-image",title:"Environment Image",inputMethod:"haxupload",noVoiceRecord:!0,noCamera:!0},{property:"ar",title:"Augmented Reality",inputMethod:"boolean"},{attribute:"camera-controls",title:"Camera controls",inputMethod:"boolean"},{attribute:"touch-action",title:"Touch action",inputMethod:"textfield"},{attribute:"shadow-intensity",title:"Shadow intensity",inputMethod:"number"}],developer:[]},demoSchema:[{tag:"model-viewer",content:"",properties:{alt:"Neil Armstrong's Spacesuit from the Smithsonian Digitization Programs Office and National Air and Space Museum",src:"https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb",ar:!0,"environment-image":"https://modelviewer.dev/shared-assets/environments/moon_1k.hdr",poster:"https://modelviewer.dev/shared-assets/models/NeilArmstrong.webp","shadow-intensity":"1","camera-controls":!0,"touch-action":"pan-y",style:"height: 500px;"}}]},"model-viewer")),new URL(`./lib/${this.tag}.haxProperties.json`,import.meta.url).href}constructor(){super(),this.visible="model",this.title="",this.src="",this.addEventListener("model-select",this._srcChanged)}static get styles(){return[i` +import{LitElement as e,html as t,css as i}from"../../lit/index.js";import"../../@google/model-viewer/dist/model-viewer.js";import"./lib/model-option.js";import"./lib/model-info.js";class CourseModel extends e{static get tag(){return"course-model"}static get properties(){return{visible:{type:String,reflect:!0},title:{type:String},src:{type:String},alt:{type:String}}}static get haxProperties(){return!this._sent&&window.HaxStore&&window.HaxStore.instance&&window.HaxStore.instance.ready&&(this._sent=!0,window.HaxStore.instance.setHaxProperties({api:"1",canScale:!0,canEditSource:!0,contentEditable:!1,gizmo:{title:"3d Model",description:"3D Model viewer",icon:"3d-rotation",color:"purple",tags:["Resource","3D","model","viewer"],handles:[],meta:{author:"Google"}},settings:{configure:[{property:"poster",title:"Poster image",inputMethod:"haxupload",noVoiceRecord:!0},{property:"src",title:"Source",inputMethod:"haxupload",noVoiceRecord:!0,noCamera:!0},{property:"alt",title:"Alternate Text",inputMethod:"alt"}],advanced:[{attribute:"environment-image",title:"Environment Image",inputMethod:"haxupload",noVoiceRecord:!0,noCamera:!0},{property:"ar",title:"Augmented Reality",inputMethod:"boolean"},{attribute:"camera-controls",title:"Camera controls",inputMethod:"boolean"},{attribute:"touch-action",title:"Touch action",inputMethod:"textfield"},{attribute:"shadow-intensity",title:"Shadow intensity",inputMethod:"number"}],developer:[]},demoSchema:[{tag:"model-viewer",content:"",properties:{alt:"Neil Armstrong's Spacesuit from the Smithsonian Digitization Programs Office and National Air and Space Museum",src:"https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb",ar:!0,"environment-image":"https://modelviewer.dev/shared-assets/environments/moon_1k.hdr",poster:"https://modelviewer.dev/shared-assets/models/NeilArmstrong.webp","shadow-intensity":"1","camera-controls":!0,"touch-action":"pan-y",style:"height: 500px;"}}]},"model-viewer")),new URL(`./lib/${this.tag}.haxProperties.json`,import.meta.url).href}constructor(){super(),this.visible="model",this.title="",this.src="",this.addEventListener("model-select",this._srcChanged)}static get styles(){return[i` :host { display: block; } diff --git a/cdn/build/es6/node_modules/@haxtheweb/course-model/lib/course-model.haxProperties.json b/cdn/build/es6/node_modules/@haxtheweb/course-model/lib/course-model.haxProperties.json index 8d9622b75..dc1430215 100644 --- a/cdn/build/es6/node_modules/@haxtheweb/course-model/lib/course-model.haxProperties.json +++ b/cdn/build/es6/node_modules/@haxtheweb/course-model/lib/course-model.haxProperties.json @@ -7,7 +7,7 @@ "gizmo": { "title": "course model", "description": "", - "icon": "icons:android", + "icon": "3d-rotation", "color": "purple", "tags": ["Other", "Course", "Model", "Eberly"], "handles": [], diff --git a/cdn/build/es6/node_modules/@haxtheweb/fill-in-the-blanks/lib/fill-in-the-blanks.haxProperties.json b/cdn/build/es6/node_modules/@haxtheweb/fill-in-the-blanks/lib/fill-in-the-blanks.haxProperties.json index 53412bc95..5ca8b99f8 100644 --- a/cdn/build/es6/node_modules/@haxtheweb/fill-in-the-blanks/lib/fill-in-the-blanks.haxProperties.json +++ b/cdn/build/es6/node_modules/@haxtheweb/fill-in-the-blanks/lib/fill-in-the-blanks.haxProperties.json @@ -13,7 +13,7 @@ "gizmo": { "title": "Fill in the blanks", "description": "", - "icon": "icons:android", + "icon": "editor:space-bar", "color": "purple", "tags": ["Instructional", "question"], "handles": [], @@ -55,7 +55,8 @@ "answers", "displayed-answers", "t", - "show-answer" + "show-answer", + "edit" ] }, "documentation": { diff --git a/cdn/build/es6/node_modules/@haxtheweb/hax-body/hax-body.js b/cdn/build/es6/node_modules/@haxtheweb/hax-body/hax-body.js index f2eeef6ef..2a444fba1 100755 --- a/cdn/build/es6/node_modules/@haxtheweb/hax-body/hax-body.js +++ b/cdn/build/es6/node_modules/@haxtheweb/hax-body/hax-body.js @@ -340,4 +340,4 @@ import{html as e,css as t,render as i,unsafeCSS as o}from"../../lit/index.js";im :host([edit-mode]) #bodycontainer ::slotted(*[data-hax-lock])::after { background-image: url("${o(this.__lockIconPath)}"); } - `),e}firstUpdated(e){i(this.HAXBODYStyleSheetContent(),this.shadowRoot.querySelector("#hax-body-style-element")),this.dispatchEvent(new CustomEvent("hax-register-body",{bubbles:!0,cancelable:!0,composed:!0,detail:this}));try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){console.warn(e)}this.contextMenus={text:this.shadowRoot.querySelector("#textcontextmenu"),plate:this.shadowRoot.querySelector("#platecontextmenu"),parent:this.shadowRoot.querySelector("#topcontext")},this.shadowRoot.querySelector("slot").addEventListener("mouseup",(e=>{this.editMode&&setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();try{const e=s.getRange();e.cloneRange&&(s._tmpRange=e.cloneRange())}catch(e){console.warn(e)}}),10)})),this.editMode=s.editMode,this.__tabTrap=!1,this.ready=!0,super.firstUpdated&&super.firstUpdated(e)}async updated(e){super.updated&&super.updated(e),e.forEach((async(e,t)=>{"editMode"==t&&void 0!==e&&setTimeout((async()=>{this.__ignoreActive=!0,await this._editModeChanged(this[t],e),setTimeout((()=>{this.__ignoreActive=!1}),100)}),0),"_useristyping"==t&&this[t]&&this.hideContextMenus(),"activeNode"==t&&this.ready&&void 0!==e&&await this._activeNodeChanged(this[t],e)}))}_toggleNodeLocking(e){e.detail.lock?(this.contextMenus.plate.disableDuplicate=!0,this.contextMenus.plate.disableOps=!0,this.contextMenus.plate.disableItemOps=!0,this.contextMenus.plate.canMoveElement=!1,e.detail.node.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")):(this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,e.detail.node.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)),this.requestUpdate()}_keepContextVisible(e=null){this.editMode&&(clearTimeout(this.__contextVisibleLock),this.__contextVisibleLock=setTimeout((()=>{let e=!1;this.contextMenus.plate.classList.contains("hax-context-visible")&&(e=this.contextMenus.plate),e&&this.positionContextMenus()}),100))}_onKeyUp(e){if(["ArrowUp","ArrowDown"].includes(e.key)&&this.activeNode&&s.isTextElement(this.activeNode)&&!E.opened){let t=e.key;if(this[`timesClicked${t}`]++,this[`timesClicked${t}`]>=2&&this.activeNode===this.prevKeyActiveNode)if("ArrowUp"===t){if(this.activeNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode.parentNode!==this&&this.activeNode.parentNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.parentNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.parentNode.previousElementSibling);else if(!this.activeNode.previousElementSibling&&this.activeNode.parentNode===this){let e=document.createElement("p");this.insertBefore(e,this.activeNode)}}else this.activeNode.nextElementSibling||this.children[this.children.length-1]!==this.activeNode?this.activeNode.parentNode&&this.activeNode.parentNode!==this&&!this.activeNode.parentNode.nextElementSibling&&this.children[this.children.length-1]===this.activeNode.parentNode&&this.haxInsert("p","",{},this.activeNode.parentNode):this.haxInsert("p","",{}),this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null;else this.prevKeyActiveNode=this.activeNode;setTimeout((()=>{this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null}),200)}}_onKeyDown(e){if(this.editMode&&"HAX-TRAY"!==document.activeElement.tagName&&"BODY"!==document.activeElement.tagName&&"SIMPLE-MODAL"!==document.activeElement.tagName&&this.getAttribute("contenteditable")){if(this.__dropActiveVisible(),this.__manageFakeEndCap(!1),null!=s.getSelection().anchorNode)switch(e.key){case"Z":case"z":e.ctrlKey&&(e.shiftKey?this.redo():this.undo(),e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());break;case"Tab":this._useristyping=!0,s.isTextElement(this.activeNode)&&(e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),e.shiftKey?this._tabBackKeyPressed():this._tabKeyPressed());break;case"Enter":if(this._useristyping=!0,this.activeNode&&(this.__slot=this.activeNode.getAttribute("slot")),this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");this.keyboardShortCutProcess(e)}break;case"Backspace":case"Delete":this.activeNode&&""==this.activeNode.textContent&&this.activeNode.previousElementSibling&&this.activeNode.previousElementSibling.tagName&&(["TABLE","EDITABLE-TABLE","IFRAME-LOADER","IFRAME","WEBVIEW"].includes(this.activeNode.previousElementSibling.tagName)||"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName&&2===this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0}).length&&this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0})[1]===this.activeNode)&&e.preventDefault(),this._useristyping=!0,this.__delHit=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),100);break;case"Escape":this._useristyping=!0;break;case"/":const t=s.getRange();this.activeNode&&s.isTextElement(this.activeNode)&&""==t.commonAncestorContainer.textContent.trim()&&(e.preventDefault(),E.mini=!0,E.activeRange=t,E.activeSelection=s.getSelection(),E.activeNode=t.commonAncestorContainer,E.runProgram(t.commonAncestorContainer.textContent.trim(),"*"),E.open());break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":this._useristyping=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),0);break;default:this._useristyping=!0,setTimeout((()=>{if(this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");" "===e[e.length-1]&&this.keyboardShortCutProcess(e)}}),0)}}}keyboardShortCutProcess(e){if(s.keyboardShortcuts[e.replace(" ","")]){let t=m(s.keyboardShortcuts[e.replace(" ","")]);this.haxReplaceNode(this.activeNode,t),this.__focusLogic(t),"HR"===t.tagName&&this.haxInsert("p","",{})}}setActiveNode(e,t=!1){e&&this.editMode&&this.activeNode&&(s.isTextElement(this.activeNode)||t)&&(s.activeNode=e,clearTimeout(this.__positionContextTimer),this.__positionContextTimer=setTimeout((()=>{this.__addActiveVisible(),this.positionContextMenus()}),2e3))}elementMidViewport(){const e=this.activeNode.getBoundingClientRect().y;return e<0&&e>-1*this.activeNode.offsetHeight+140}replacePlaceholder(e){if("text"===e.detail){let e=document.createElement("p");this.haxReplaceNode(this.activeNode,e),this.__focusLogic(e),this.activeNode.parentNode&&this.activeNode.parentNode.setAttribute("contenteditable",!0)}else this.replaceElementWorkflow()}async canTansformNode(e=null){return await this.replaceElementWorkflow(e,!0).length>0}async insertElementWorkflow(e=null,t=!1){}get primitiveTextBlocks(){return["p","div","pre","h1","h2","h3","h4","h5","h6"]}getAllSlotConfig(e){if(!e)return;let t=this.getParentGrid(e);return t&&t.tag?this.getSlotConfig(s.elementList[t.tag],slot):void 0}getParentGrid(e){return((e=e||this.activeNode)?e.slot:void 0)?u(e.parentNode):void 0}getSlotConfig(e="",t={}){let i=t.settings,o=i?Object.keys(i||{}).map((t=>i[t].filter((t=>!(!t.slot||e&&t.slot!==e))))).flat():void 0;return o&&o.length>0?o[0]:void 0}async replaceElementWorkflow(e=null,t=!1){null==e&&(e=this.activeNode);let i=await u(e,null);if(!i)return;let o="*",a=!1,n=(e||{}).slot,r=this.getParentGrid(e);"place-holder"===i.tag&&void 0!==i.properties.type?(o=i.properties.type,a=!0):this.primitiveTextBlocks.includes(i.tag)&&(a=!0);var l=i.content?{innerHTML:i.content}:{};if(void 0!==s.elementList[i.tag]&&!1!==s.elementList[i.tag].gizmo&&void 0!==s.elementList[i.tag].gizmo.handles&&s.elementList[i.tag].gizmo.handles.length>0){let e=s.elementList[i.tag].gizmo;for(var d=0;de[i]=t[i])),e.removeAttribute("data-grid-saved-settings")}}setSlotEditMode(e,t,i){let o=e.getAttribute("data-grid-saved-settings")?JSON.parse(e.getAttribute("data-grid-saved-settings")):{},a=Object.keys(o);Object.keys(t||{}).forEach((i=>{a.includes(i)||(o[i]=e[i]),e[i]=t[i]})),e.setAttribute("data-grid-saved-settings",JSON.stringify(o))}async _activeNodeChanged(e,t){if(window.SimplePopoverManager.requestAvailability().opened=!1,this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,setTimeout((()=>{this.prevKeyActiveNode=null}),5),t&&t.removeAttribute("data-hax-active"),e&&e.setAttribute("data-hax-active","data-hax-active"),e&&t&&s.isGridPlateElement(e)&&(this.__ignoreActive=!0),this.editMode&&null!=e&&e.parentNode&&e.tagName){let t=e.tagName.toLowerCase();(s.isTextElement(e)||"HR"===e.tagName||s.isGridPlateElement(e))&&null===e.getAttribute("data-hax-lock")&&null===e.parentNode.getAttribute("data-hax-lock")?(e.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)):(e.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")),this._keepContextVisible(),this.contextMenus.text.realSelectedValue=t}else null===e&&(this.hideContextMenus(),this.__oldActiveNode=t);if(this.editMode&&await s.runHook(t,"activeElementChanged",[t,!1])&&(this.__ignoreActive=!0),this.editMode&&await s.runHook(e,"activeElementChanged",[e,!0])&&(this.__ignoreActive=!0),this.editMode&&t&&t.tagName){let e=s.haxSchemaFromTag(t.tagName.toLowerCase());if("core"!=e.editingElement||t.parentNode&&t.parentNode.haxUIElement&&t.parentNode===s.activeEditingElement){this.__ignoreActive=!0;let o=await s.runHook(t.parentNode,"activeElementChanged",[t,!1]);if(o&&o!==t){if(t&&t.getAttribute&&null!=t.getAttribute("slot")&&o.setAttribute("slot",t.getAttribute("slot")),e.saveOptions&&e.saveOptions.unsetAttributes&&e.saveOptions.unsetAttributes.length)for(var i in e.saveOptions.unsetAttributes)o.removeAttribute(e.saveOptions.unsetAttributes[i]);this.__applyNodeEditableState(o,this.editMode)}b(s.activeEditingElement),s.activeEditingElement=null}}if(this.editMode&&e){let t=s.haxSchemaFromTag(e.tagName);if(t&&t.editingElement&&"core"!=t.editingElement){if(t.editingElement.import){let e=new URL("./hax-body.js",import.meta.url).href+"/../../../";window.WCGlobalBasePath&&(e=window.WCGlobalBasePath),await import(`${e}${t.editingElement.import}`)}s.activeEditingElement=document.createElement(t.editingElement.tag),e.getAttribute&&null!=e.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",e.getAttribute("slot")),t.editingElement.callback&&t.editingElement.callback(s.activeEditingElement),this.__ignoreActive=!0,v(e,s.activeEditingElement),await s.runHook(s.activeEditingElement,"activeElementChanged",[e,!0])}}!t||!t.parentNode||e&&e.parentNode&&e.parentNode===t.parentNode||this.unsetSlotEditMode(t.parentNode),this.unsetElementEditMode(t)}_getPosition(e){return{x:e.offsetLeft-e.scrollLeft+e.clientLeft,y:e.offsetTop-e.scrollTop+e.clientTop}}_showContextMenu(e){e.setAttribute("on-screen","on-screen"),e.classList.add("hax-context-visible","hax-context-menu-active")}_getContextContainer(e){let t=e&&e.parentNode?e.parentNode:void 0;return t&&t.nodeType?1==t.nodeType?t:t.host:void 0}_hideContextMenu(e){e&&(e.removeAttribute("on-screen"),e.classList.remove("hax-context-visible"),e.classList.remove("hax-context-menu-active"))}_tabKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=!1,i=this.activeNode.parentNode;const o=this.activeNode.parentNode.tagName;let a=s.getRange().cloneRange();var e=a.commonAncestorContainer.tagName;if(void 0===e&&(e=a.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(o)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("indent"));else for(;!t;)null==i.nextSibling?t=!0:"function"===i.nextSibling.focus?(i.nextSibling.focus(),t=!0):i=i.nextSibling}catch(e){console.warn(e)}}_tabBackKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=this.activeNode.parentNode;const i=this.activeNode.parentNode.tagName;let o=s.getRange().cloneRange();var e=o.commonAncestorContainer.tagName;if(void 0===e&&(e=o.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(i)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("outdent"));else{if(null!=t)for(;null!=t&&!this._validElementTest(t);)t=t.previousSibling;null!=t&&setTimeout((()=>{t.focus()}),50)}}catch(e){console.warn(e)}}}customElements.define(HaxBody.tag,HaxBody);export{HaxBody};
\ No newline at end of file
+ `),e}firstUpdated(e){i(this.HAXBODYStyleSheetContent(),this.shadowRoot.querySelector("#hax-body-style-element")),this.dispatchEvent(new CustomEvent("hax-register-body",{bubbles:!0,cancelable:!0,composed:!0,detail:this}));try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){console.warn(e)}this.contextMenus={text:this.shadowRoot.querySelector("#textcontextmenu"),plate:this.shadowRoot.querySelector("#platecontextmenu"),parent:this.shadowRoot.querySelector("#topcontext")},this.shadowRoot.querySelector("slot").addEventListener("mouseup",(e=>{this.editMode&&setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();try{const e=s.getRange();e.cloneRange&&(s._tmpRange=e.cloneRange())}catch(e){console.warn(e)}}),10)})),this.editMode=s.editMode,this.__tabTrap=!1,this.ready=!0,super.firstUpdated&&super.firstUpdated(e)}async updated(e){super.updated&&super.updated(e),e.forEach((async(e,t)=>{"editMode"==t&&void 0!==e&&setTimeout((async()=>{this.__ignoreActive=!0,await this._editModeChanged(this[t],e),setTimeout((()=>{this.__ignoreActive=!1}),100)}),0),"_useristyping"==t&&this[t]&&this.hideContextMenus(),"activeNode"==t&&this.ready&&void 0!==e&&await this._activeNodeChanged(this[t],e)}))}_toggleNodeLocking(e){e.detail.lock?(this.contextMenus.plate.disableDuplicate=!0,this.contextMenus.plate.disableOps=!0,this.contextMenus.plate.disableItemOps=!0,this.contextMenus.plate.canMoveElement=!1,e.detail.node.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")):(this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,e.detail.node.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)),this.requestUpdate()}_keepContextVisible(e=null){this.editMode&&(clearTimeout(this.__contextVisibleLock),this.__contextVisibleLock=setTimeout((()=>{let e=!1;this.contextMenus.plate.classList.contains("hax-context-visible")&&(e=this.contextMenus.plate),e&&this.positionContextMenus()}),100))}_onKeyUp(e){if(["ArrowUp","ArrowDown"].includes(e.key)&&this.activeNode&&s.isTextElement(this.activeNode)&&!E.opened){let t=e.key;if(this[`timesClicked${t}`]++,this[`timesClicked${t}`]>=2&&this.activeNode===this.prevKeyActiveNode)if("ArrowUp"===t){if(this.activeNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode.parentNode!==this&&this.activeNode.parentNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.parentNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.parentNode.previousElementSibling);else if(!this.activeNode.previousElementSibling&&this.activeNode.parentNode===this){let e=document.createElement("p");this.insertBefore(e,this.activeNode)}}else this.activeNode.nextElementSibling||this.children[this.children.length-1]!==this.activeNode?this.activeNode.parentNode&&this.activeNode.parentNode!==this&&!this.activeNode.parentNode.nextElementSibling&&this.children[this.children.length-1]===this.activeNode.parentNode&&this.haxInsert("p","",{},this.activeNode.parentNode):this.haxInsert("p","",{}),this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null;else this.prevKeyActiveNode=this.activeNode;setTimeout((()=>{this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null}),200)}}_onKeyDown(e){if(this.editMode&&"HAX-TRAY"!==document.activeElement.tagName&&"BODY"!==document.activeElement.tagName&&"SIMPLE-MODAL"!==document.activeElement.tagName&&this.getAttribute("contenteditable")){if(this.__dropActiveVisible(),this.__manageFakeEndCap(!1),null!=s.getSelection().anchorNode)switch(e.key){case"Z":case"z":e.ctrlKey&&(e.shiftKey?this.redo():this.undo(),e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());break;case"Tab":this._useristyping=!0,s.isTextElement(this.activeNode)&&(e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),e.shiftKey?this._tabBackKeyPressed():this._tabKeyPressed());break;case"Enter":if(this._useristyping=!0,this.activeNode&&(this.__slot=this.activeNode.getAttribute("slot")),this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");this.keyboardShortCutProcess(e)}break;case"Backspace":case"Delete":this.activeNode&&""==this.activeNode.textContent&&this.activeNode.previousElementSibling&&this.activeNode.previousElementSibling.tagName&&(["TABLE","EDITABLE-TABLE","IFRAME-LOADER","IFRAME","WEBVIEW"].includes(this.activeNode.previousElementSibling.tagName)||"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName&&2===this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0}).length&&this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0})[1]===this.activeNode)&&e.preventDefault(),this._useristyping=!0,this.__delHit=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),100);break;case"Escape":this._useristyping=!0;break;case"/":const t=s.getRange();this.activeNode&&s.isTextElement(this.activeNode)&&""==t.commonAncestorContainer.textContent.trim()&&(e.preventDefault(),E.mini=!0,E.activeRange=t,E.activeSelection=s.getSelection(),E.activeNode=t.commonAncestorContainer,E.runProgram(t.commonAncestorContainer.textContent.trim(),"*"),E.open());break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":this._useristyping=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),0);break;default:this._useristyping=!0,setTimeout((()=>{if(this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");" "===e[e.length-1]&&this.keyboardShortCutProcess(e)}}),0)}}}keyboardShortCutProcess(e){if(s.keyboardShortcuts[e.replace(" ","")]){let t=m(s.keyboardShortcuts[e.replace(" ","")]);this.haxReplaceNode(this.activeNode,t),this.__focusLogic(t),"HR"===t.tagName&&this.haxInsert("p","",{})}}setActiveNode(e,t=!1){e&&this.editMode&&this.activeNode&&(s.isTextElement(this.activeNode)||t)&&(s.activeNode=e,clearTimeout(this.__positionContextTimer),this.__positionContextTimer=setTimeout((()=>{this.__addActiveVisible(),this.positionContextMenus()}),2e3))}elementMidViewport(){const e=this.activeNode.getBoundingClientRect().y;return e<0&&e>-1*this.activeNode.offsetHeight+140}replacePlaceholder(e){if("text"===e.detail){let e=document.createElement("p");this.haxReplaceNode(this.activeNode,e),this.__focusLogic(e),this.activeNode.parentNode&&this.activeNode.parentNode.setAttribute("contenteditable",!0)}else this.replaceElementWorkflow()}async canTansformNode(e=null){return await this.replaceElementWorkflow(e,!0).length>0}async insertElementWorkflow(e=null,t=!1){}get primitiveTextBlocks(){return["p","div","pre","h1","h2","h3","h4","h5","h6"]}getAllSlotConfig(e){if(!e)return;let t=this.getParentGrid(e);return t&&t.tag?this.getSlotConfig(s.elementList[t.tag],slot):void 0}getParentGrid(e){return((e=e||this.activeNode)?e.slot:void 0)?u(e.parentNode):void 0}getSlotConfig(e="",t={}){let i=t.settings,o=i?Object.keys(i||{}).map((t=>i[t].filter((t=>!(!t.slot||e&&t.slot!==e))))).flat():void 0;return o&&o.length>0?o[0]:void 0}async replaceElementWorkflow(e=null,t=!1){null==e&&(e=this.activeNode);let i=await u(e,null);if(!i)return;let o=!1,a=(e||{}).slot,n=this.getParentGrid(e);this.primitiveTextBlocks.includes(i.tag)&&(o=!0);var r=i.content?{innerHTML:i.content}:{};if(void 0!==s.elementList[i.tag]&&!1!==s.elementList[i.tag].gizmo&&void 0!==s.elementList[i.tag].gizmo.handles&&s.elementList[i.tag].gizmo.handles.length>0){let e=s.elementList[i.tag].gizmo;for(var l=0;l e[i]=t[i])),e.removeAttribute("data-grid-saved-settings")}}setSlotEditMode(e,t,i){let o=e.getAttribute("data-grid-saved-settings")?JSON.parse(e.getAttribute("data-grid-saved-settings")):{},a=Object.keys(o);Object.keys(t||{}).forEach((i=>{a.includes(i)||(o[i]=e[i]),e[i]=t[i]})),e.setAttribute("data-grid-saved-settings",JSON.stringify(o))}async _activeNodeChanged(e,t){if(window.SimplePopoverManager.requestAvailability().opened=!1,this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,setTimeout((()=>{this.prevKeyActiveNode=null}),5),t&&t.removeAttribute("data-hax-active"),e&&e.setAttribute("data-hax-active","data-hax-active"),e&&t&&s.isGridPlateElement(e)&&(this.__ignoreActive=!0),this.editMode&&null!=e&&e.parentNode&&e.tagName){let t=e.tagName.toLowerCase();(s.isTextElement(e)||"HR"===e.tagName||s.isGridPlateElement(e))&&null===e.getAttribute("data-hax-lock")&&null===e.parentNode.getAttribute("data-hax-lock")?(e.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)):(e.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")),this._keepContextVisible(),this.contextMenus.text.realSelectedValue=t}else null===e&&(this.hideContextMenus(),this.__oldActiveNode=t);if(this.editMode&&await s.runHook(t,"activeElementChanged",[t,!1])&&(this.__ignoreActive=!0),this.editMode&&await s.runHook(e,"activeElementChanged",[e,!0])&&(this.__ignoreActive=!0),this.editMode&&t&&t.tagName){let e=s.haxSchemaFromTag(t.tagName.toLowerCase());if("core"!=e.editingElement||t.parentNode&&t.parentNode.haxUIElement&&t.parentNode===s.activeEditingElement){this.__ignoreActive=!0;let o=await s.runHook(t.parentNode,"activeElementChanged",[t,!1]);if(o&&o!==t){if(t&&t.getAttribute&&null!=t.getAttribute("slot")&&o.setAttribute("slot",t.getAttribute("slot")),e.saveOptions&&e.saveOptions.unsetAttributes&&e.saveOptions.unsetAttributes.length)for(var i in e.saveOptions.unsetAttributes)o.removeAttribute(e.saveOptions.unsetAttributes[i]);this.__applyNodeEditableState(o,this.editMode)}b(s.activeEditingElement),s.activeEditingElement=null}}if(this.editMode&&e){let t=s.haxSchemaFromTag(e.tagName);if(t&&t.editingElement&&"core"!=t.editingElement){if(t.editingElement.import){let e=new URL("./hax-body.js",import.meta.url).href+"/../../../";window.WCGlobalBasePath&&(e=window.WCGlobalBasePath),await import(`${e}${t.editingElement.import}`)}s.activeEditingElement=document.createElement(t.editingElement.tag),e.getAttribute&&null!=e.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",e.getAttribute("slot")),t.editingElement.callback&&t.editingElement.callback(s.activeEditingElement),this.__ignoreActive=!0,v(e,s.activeEditingElement),await s.runHook(s.activeEditingElement,"activeElementChanged",[e,!0])}}!t||!t.parentNode||e&&e.parentNode&&e.parentNode===t.parentNode||this.unsetSlotEditMode(t.parentNode),this.unsetElementEditMode(t)}_getPosition(e){return{x:e.offsetLeft-e.scrollLeft+e.clientLeft,y:e.offsetTop-e.scrollTop+e.clientTop}}_showContextMenu(e){e.setAttribute("on-screen","on-screen"),e.classList.add("hax-context-visible","hax-context-menu-active")}_getContextContainer(e){let t=e&&e.parentNode?e.parentNode:void 0;return t&&t.nodeType?1==t.nodeType?t:t.host:void 0}_hideContextMenu(e){e&&(e.removeAttribute("on-screen"),e.classList.remove("hax-context-visible"),e.classList.remove("hax-context-menu-active"))}_tabKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=!1,i=this.activeNode.parentNode;const o=this.activeNode.parentNode.tagName;let a=s.getRange().cloneRange();var e=a.commonAncestorContainer.tagName;if(void 0===e&&(e=a.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(o)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("indent"));else for(;!t;)null==i.nextSibling?t=!0:"function"===i.nextSibling.focus?(i.nextSibling.focus(),t=!0):i=i.nextSibling}catch(e){console.warn(e)}}_tabBackKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=this.activeNode.parentNode;const i=this.activeNode.parentNode.tagName;let o=s.getRange().cloneRange();var e=o.commonAncestorContainer.tagName;if(void 0===e&&(e=o.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(i)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("outdent"));else{if(null!=t)for(;null!=t&&!this._validElementTest(t);)t=t.previousSibling;null!=t&&setTimeout((()=>{t.focus()}),50)}}catch(e){console.warn(e)}}}customElements.define(HaxBody.tag,HaxBody);export{HaxBody};
\ No newline at end of file
diff --git a/cdn/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js b/cdn/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
index da6e2e2c2..fac0f7b56 100644
--- a/cdn/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
+++ b/cdn/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
@@ -1,4 +1,4 @@
-import{LitElement as e,html as t,nothing as i}from"../../../lit/index.js";import{SimpleTourManager as a}from"../../simple-popover/lib/simple-tour.js";import{HaxSchematizer as o,HaxElementizer as r}from"../../hax-body-behaviors/lib/HAXFields.js";import{winEventsElement as n,getRange as s,stripMSWord as l,nodeToHaxElement as d,haxElementToNode as c,validURL as h,camelToDash as p,htmlEntities as m,localStorageGet as g,localStorageSet as u}from"../../utils/utils.js";import{observable as x,makeObservable as f,computed as b,configure as v,autorun as y,toJS as T}from"../../../mobx/dist/mobx.esm.js";v({enforceActions:!1});import{HAXElement as S}from"../../hax-body-behaviors/hax-body-behaviors.js";import{I18NMixin as H,I18NManagerStore as w}from"../../i18n-manager/lib/I18NMixin.js";import{enableServices as E}from"../../micro-frontend-registry/lib/microServices.js";import{SuperDaemonInstance as A}from"../../super-daemon/super-daemon.js";import"../../media-behaviors/media-behaviors.js";import"../../editable-table/editable-table.js";import"../../iframe-loader/iframe-loader.js";import"../../hax-iconset/lib/hax-iconset-manifest.js";import{UserScaffoldInstance as N}from"../../user-scaffold/user-scaffold.js";import"./hax-app.js";function sessionStorageGet(e){try{return sessionStorage.getItem(e)}catch(e){return!1}}function sessionStorageSet(e,t){try{return sessionStorage.setItem(e,t)}catch(e){return!1}}class HaxStore extends(H(n(S(e)))){testHook(e,t){return!!(e&&e.tagName&&this.HTMLPrimativeTest(e)&&this.primativeHooks[e.tagName.toLowerCase()]&&this.primativeHooks[e.tagName.toLowerCase()][t])||e&&"function"==typeof e.haxHooks&&e.haxHooks()[t]}async runHook(e,t,i=[]){return!!this.testHook(e,t)&&(this.HTMLPrimativeTest(e)?await this.primativeHooks[e.tagName.toLowerCase()][t](...i):await e[e.haxHooks()[t]](...i))}getSelection(){if(this.activeHaxBody&&this.activeHaxBody.parentNode){if(this.activeHaxBody.parentNode.getSelection)return this.activeHaxBody.parentNode.getSelection();try{if(s(this.activeHaxBody.parentNode))return s(this.activeHaxBody.parentNode)}catch(e){}}return globalThis.getSelection()}getRange(){let e=this.getSelection();return e&&e.getRangeAt&&e.rangeCount?e.getRangeAt(0):e||!1}guessGizmo(e,t,i=!1,a=!1){var o=[],r=[];if(void 0!==e&&this.validGizmoTypes.includes(e))for(let n in this.gizmoList){let s=T(this.gizmoList[n]),l=t.innerHTML?{innerHTML:t.innerHTML}:{},d=!1;if(s&&s.handles)for(let n=0;n Image Caption Here Image Caption Here
- Select the answer you feel satsisfy the question. When you are done,
+ Select the answer you feel answers the question. When you are done,
press ${this.t.checkAnswer}. You will get feedback
indicating correctness of your answer and how to proceed.
- Type the answer you feel satsisfies the question. When you are done,
+ Type the answer you feel answers the question. When you are done,
select ${this.t.checkAnswer}. You will get feedback
indicating correctness of your answer.
By the end of this lesson, you should be able to... By the end of this lesson, you should be able to... e[i]=t[i])),e.removeAttribute("data-grid-saved-settings")}}setSlotEditMode(e,t,i){let o=e.getAttribute("data-grid-saved-settings")?JSON.parse(e.getAttribute("data-grid-saved-settings")):{},a=Object.keys(o);Object.keys(t||{}).forEach((i=>{a.includes(i)||(o[i]=e[i]),e[i]=t[i]})),e.setAttribute("data-grid-saved-settings",JSON.stringify(o))}async _activeNodeChanged(e,t){if(window.SimplePopoverManager.requestAvailability().opened=!1,this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,setTimeout((()=>{this.prevKeyActiveNode=null}),5),t&&t.removeAttribute("data-hax-active"),e&&e.setAttribute("data-hax-active","data-hax-active"),e&&t&&s.isGridPlateElement(e)&&(this.__ignoreActive=!0),this.editMode&&null!=e&&e.parentNode&&e.tagName){let t=e.tagName.toLowerCase();(s.isTextElement(e)||"HR"===e.tagName||s.isGridPlateElement(e))&&null===e.getAttribute("data-hax-lock")&&null===e.parentNode.getAttribute("data-hax-lock")?(e.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)):(e.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")),this._keepContextVisible(),this.contextMenus.text.realSelectedValue=t}else null===e&&(this.hideContextMenus(),this.__oldActiveNode=t);if(this.editMode&&await s.runHook(t,"activeElementChanged",[t,!1])&&(this.__ignoreActive=!0),this.editMode&&await s.runHook(e,"activeElementChanged",[e,!0])&&(this.__ignoreActive=!0),this.editMode&&t&&t.tagName){let e=s.haxSchemaFromTag(t.tagName.toLowerCase());if("core"!=e.editingElement||t.parentNode&&t.parentNode.haxUIElement&&t.parentNode===s.activeEditingElement){this.__ignoreActive=!0;let o=await s.runHook(t.parentNode,"activeElementChanged",[t,!1]);if(o&&o!==t){if(t&&t.getAttribute&&null!=t.getAttribute("slot")&&o.setAttribute("slot",t.getAttribute("slot")),e.saveOptions&&e.saveOptions.unsetAttributes&&e.saveOptions.unsetAttributes.length)for(var i in e.saveOptions.unsetAttributes)o.removeAttribute(e.saveOptions.unsetAttributes[i]);this.__applyNodeEditableState(o,this.editMode)}b(s.activeEditingElement),s.activeEditingElement=null}}if(this.editMode&&e){let t=s.haxSchemaFromTag(e.tagName);if(t&&t.editingElement&&"core"!=t.editingElement){if(t.editingElement.import){let e=new URL("./hax-body.js",import.meta.url).href+"/../../../";window.WCGlobalBasePath&&(e=window.WCGlobalBasePath),await import(`${e}${t.editingElement.import}`)}s.activeEditingElement=document.createElement(t.editingElement.tag),e.getAttribute&&null!=e.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",e.getAttribute("slot")),t.editingElement.callback&&t.editingElement.callback(s.activeEditingElement),this.__ignoreActive=!0,v(e,s.activeEditingElement),await s.runHook(s.activeEditingElement,"activeElementChanged",[e,!0])}}!t||!t.parentNode||e&&e.parentNode&&e.parentNode===t.parentNode||this.unsetSlotEditMode(t.parentNode),this.unsetElementEditMode(t)}_getPosition(e){return{x:e.offsetLeft-e.scrollLeft+e.clientLeft,y:e.offsetTop-e.scrollTop+e.clientTop}}_showContextMenu(e){e.setAttribute("on-screen","on-screen"),e.classList.add("hax-context-visible","hax-context-menu-active")}_getContextContainer(e){let t=e&&e.parentNode?e.parentNode:void 0;return t&&t.nodeType?1==t.nodeType?t:t.host:void 0}_hideContextMenu(e){e&&(e.removeAttribute("on-screen"),e.classList.remove("hax-context-visible"),e.classList.remove("hax-context-menu-active"))}_tabKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=!1,i=this.activeNode.parentNode;const o=this.activeNode.parentNode.tagName;let a=s.getRange().cloneRange();var e=a.commonAncestorContainer.tagName;if(void 0===e&&(e=a.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(o)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("indent"));else for(;!t;)null==i.nextSibling?t=!0:"function"===i.nextSibling.focus?(i.nextSibling.focus(),t=!0):i=i.nextSibling}catch(e){console.warn(e)}}_tabBackKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=this.activeNode.parentNode;const i=this.activeNode.parentNode.tagName;let o=s.getRange().cloneRange();var e=o.commonAncestorContainer.tagName;if(void 0===e&&(e=o.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(i)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("outdent"));else{if(null!=t)for(;null!=t&&!this._validElementTest(t);)t=t.previousSibling;null!=t&&setTimeout((()=>{t.focus()}),50)}}catch(e){console.warn(e)}}}customElements.define(HaxBody.tag,HaxBody);export{HaxBody};
\ No newline at end of file
+ `),e}firstUpdated(e){i(this.HAXBODYStyleSheetContent(),this.shadowRoot.querySelector("#hax-body-style-element")),this.dispatchEvent(new CustomEvent("hax-register-body",{bubbles:!0,cancelable:!0,composed:!0,detail:this}));try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){console.warn(e)}this.contextMenus={text:this.shadowRoot.querySelector("#textcontextmenu"),plate:this.shadowRoot.querySelector("#platecontextmenu"),parent:this.shadowRoot.querySelector("#topcontext")},this.shadowRoot.querySelector("slot").addEventListener("mouseup",(e=>{this.editMode&&setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();try{const e=s.getRange();e.cloneRange&&(s._tmpRange=e.cloneRange())}catch(e){console.warn(e)}}),10)})),this.editMode=s.editMode,this.__tabTrap=!1,this.ready=!0,super.firstUpdated&&super.firstUpdated(e)}async updated(e){super.updated&&super.updated(e),e.forEach((async(e,t)=>{"editMode"==t&&void 0!==e&&setTimeout((async()=>{this.__ignoreActive=!0,await this._editModeChanged(this[t],e),setTimeout((()=>{this.__ignoreActive=!1}),100)}),0),"_useristyping"==t&&this[t]&&this.hideContextMenus(),"activeNode"==t&&this.ready&&void 0!==e&&await this._activeNodeChanged(this[t],e)}))}_toggleNodeLocking(e){e.detail.lock?(this.contextMenus.plate.disableDuplicate=!0,this.contextMenus.plate.disableOps=!0,this.contextMenus.plate.disableItemOps=!0,this.contextMenus.plate.canMoveElement=!1,e.detail.node.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")):(this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,e.detail.node.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)),this.requestUpdate()}_keepContextVisible(e=null){this.editMode&&(clearTimeout(this.__contextVisibleLock),this.__contextVisibleLock=setTimeout((()=>{let e=!1;this.contextMenus.plate.classList.contains("hax-context-visible")&&(e=this.contextMenus.plate),e&&this.positionContextMenus()}),100))}_onKeyUp(e){if(["ArrowUp","ArrowDown"].includes(e.key)&&this.activeNode&&s.isTextElement(this.activeNode)&&!E.opened){let t=e.key;if(this[`timesClicked${t}`]++,this[`timesClicked${t}`]>=2&&this.activeNode===this.prevKeyActiveNode)if("ArrowUp"===t){if(this.activeNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode.parentNode!==this&&this.activeNode.parentNode.previousElementSibling&&"PAGE-BREAK"===this.activeNode.parentNode.previousElementSibling.tagName)this.haxInsert("p","",{},this.activeNode.parentNode.previousElementSibling);else if(!this.activeNode.previousElementSibling&&this.activeNode.parentNode===this){let e=document.createElement("p");this.insertBefore(e,this.activeNode)}}else this.activeNode.nextElementSibling||this.children[this.children.length-1]!==this.activeNode?this.activeNode.parentNode&&this.activeNode.parentNode!==this&&!this.activeNode.parentNode.nextElementSibling&&this.children[this.children.length-1]===this.activeNode.parentNode&&this.haxInsert("p","",{},this.activeNode.parentNode):this.haxInsert("p","",{}),this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null;else this.prevKeyActiveNode=this.activeNode;setTimeout((()=>{this[`timesClicked${t}`]=0,this.prevKeyActiveNode=null}),200)}}_onKeyDown(e){if(this.editMode&&"HAX-TRAY"!==document.activeElement.tagName&&"BODY"!==document.activeElement.tagName&&"SIMPLE-MODAL"!==document.activeElement.tagName&&this.getAttribute("contenteditable")){if(this.__dropActiveVisible(),this.__manageFakeEndCap(!1),null!=s.getSelection().anchorNode)switch(e.key){case"Z":case"z":e.ctrlKey&&(e.shiftKey?this.redo():this.undo(),e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());break;case"Tab":this._useristyping=!0,s.isTextElement(this.activeNode)&&(e.detail.keyboardEvent&&(e.detail.keyboardEvent.preventDefault(),e.detail.keyboardEvent.stopPropagation(),e.detail.keyboardEvent.stopImmediatePropagation()),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),e.shiftKey?this._tabBackKeyPressed():this._tabKeyPressed());break;case"Enter":if(this._useristyping=!0,this.activeNode&&(this.__slot=this.activeNode.getAttribute("slot")),this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");this.keyboardShortCutProcess(e)}break;case"Backspace":case"Delete":this.activeNode&&""==this.activeNode.textContent&&this.activeNode.previousElementSibling&&this.activeNode.previousElementSibling.tagName&&(["TABLE","EDITABLE-TABLE","IFRAME-LOADER","IFRAME","WEBVIEW"].includes(this.activeNode.previousElementSibling.tagName)||"PAGE-BREAK"===this.activeNode.previousElementSibling.tagName&&2===this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0}).length&&this.shadowRoot.querySelector("#body").assignedNodes({flatten:!0})[1]===this.activeNode)&&e.preventDefault(),this._useristyping=!0,this.__delHit=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),100);break;case"Escape":this._useristyping=!0;break;case"/":const t=s.getRange();this.activeNode&&s.isTextElement(this.activeNode)&&""==t.commonAncestorContainer.textContent.trim()&&(e.preventDefault(),E.mini=!0,E.activeRange=t,E.activeSelection=s.getSelection(),E.activeNode=t.commonAncestorContainer,E.runProgram(t.commonAncestorContainer.textContent.trim(),"*"),E.open());break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":this._useristyping=!0,this.querySelectorAll("[data-hax-active]").forEach((e=>e.classList.remove)),setTimeout((()=>{const e=s.getSelection();s._tmpSelection=e,s.haxSelectedText=e.toString();const t=s.getRange();t.commonAncestorContainer&&this.activeNode!==t.commonAncestorContainer&&"function"==typeof t.commonAncestorContainer.focus?"HAX-BODY"!==t.commonAncestorContainer.tagName&&this.__focusLogic(t.commonAncestorContainer,!1):t.commonAncestorContainer&&t.commonAncestorContainer.parentNode&&this.activeNode!==t.commonAncestorContainer.parentNode&&"function"==typeof t.commonAncestorContainer.parentNode.focus&&("HAX-BODY"!==t.commonAncestorContainer.parentNode.tagName?this.__focusLogic(t.commonAncestorContainer.parentNode,!1):this.__focusLogic(t.commonAncestorContainer,!1))}),0);break;default:this._useristyping=!0,setTimeout((()=>{if(this.activeNode&&"P"===this.activeNode.tagName&&["1","#","`",">","-"].includes(this.activeNode.textContent[0])){const e=this.activeNode.textContent.replaceAll(/ /g," ");" "===e[e.length-1]&&this.keyboardShortCutProcess(e)}}),0)}}}keyboardShortCutProcess(e){if(s.keyboardShortcuts[e.replace(" ","")]){let t=m(s.keyboardShortcuts[e.replace(" ","")]);this.haxReplaceNode(this.activeNode,t),this.__focusLogic(t),"HR"===t.tagName&&this.haxInsert("p","",{})}}setActiveNode(e,t=!1){e&&this.editMode&&this.activeNode&&(s.isTextElement(this.activeNode)||t)&&(s.activeNode=e,clearTimeout(this.__positionContextTimer),this.__positionContextTimer=setTimeout((()=>{this.__addActiveVisible(),this.positionContextMenus()}),2e3))}elementMidViewport(){const e=this.activeNode.getBoundingClientRect().y;return e<0&&e>-1*this.activeNode.offsetHeight+140}replacePlaceholder(e){if("text"===e.detail){let e=document.createElement("p");this.haxReplaceNode(this.activeNode,e),this.__focusLogic(e),this.activeNode.parentNode&&this.activeNode.parentNode.setAttribute("contenteditable",!0)}else this.replaceElementWorkflow()}async canTansformNode(e=null){return await this.replaceElementWorkflow(e,!0).length>0}async insertElementWorkflow(e=null,t=!1){}get primitiveTextBlocks(){return["p","div","pre","h1","h2","h3","h4","h5","h6"]}getAllSlotConfig(e){if(!e)return;let t=this.getParentGrid(e);return t&&t.tag?this.getSlotConfig(s.elementList[t.tag],slot):void 0}getParentGrid(e){return((e=e||this.activeNode)?e.slot:void 0)?u(e.parentNode):void 0}getSlotConfig(e="",t={}){let i=t.settings,o=i?Object.keys(i||{}).map((t=>i[t].filter((t=>!(!t.slot||e&&t.slot!==e))))).flat():void 0;return o&&o.length>0?o[0]:void 0}async replaceElementWorkflow(e=null,t=!1){null==e&&(e=this.activeNode);let i=await u(e,null);if(!i)return;let o=!1,a=(e||{}).slot,n=this.getParentGrid(e);this.primitiveTextBlocks.includes(i.tag)&&(o=!0);var r=i.content?{innerHTML:i.content}:{};if(void 0!==s.elementList[i.tag]&&!1!==s.elementList[i.tag].gizmo&&void 0!==s.elementList[i.tag].gizmo.handles&&s.elementList[i.tag].gizmo.handles.length>0){let e=s.elementList[i.tag].gizmo;for(var l=0;l e[i]=t[i])),e.removeAttribute("data-grid-saved-settings")}}setSlotEditMode(e,t,i){let o=e.getAttribute("data-grid-saved-settings")?JSON.parse(e.getAttribute("data-grid-saved-settings")):{},a=Object.keys(o);Object.keys(t||{}).forEach((i=>{a.includes(i)||(o[i]=e[i]),e[i]=t[i]})),e.setAttribute("data-grid-saved-settings",JSON.stringify(o))}async _activeNodeChanged(e,t){if(window.SimplePopoverManager.requestAvailability().opened=!1,this.contextMenus.plate.disableDuplicate=!1,this.contextMenus.plate.disableOps=!1,this.contextMenus.plate.disableItemOps=!1,this.contextMenus.plate.canMoveElement=this.canMoveElement,setTimeout((()=>{this.prevKeyActiveNode=null}),5),t&&t.removeAttribute("data-hax-active"),e&&e.setAttribute("data-hax-active","data-hax-active"),e&&t&&s.isGridPlateElement(e)&&(this.__ignoreActive=!0),this.editMode&&null!=e&&e.parentNode&&e.tagName){let t=e.tagName.toLowerCase();(s.isTextElement(e)||"HR"===e.tagName||s.isGridPlateElement(e))&&null===e.getAttribute("data-hax-lock")&&null===e.parentNode.getAttribute("data-hax-lock")?(e.setAttribute("contenteditable",!0),this.setAttribute("contenteditable",!0)):(e.removeAttribute("contenteditable"),this.removeAttribute("contenteditable")),this._keepContextVisible(),this.contextMenus.text.realSelectedValue=t}else null===e&&(this.hideContextMenus(),this.__oldActiveNode=t);if(this.editMode&&await s.runHook(t,"activeElementChanged",[t,!1])&&(this.__ignoreActive=!0),this.editMode&&await s.runHook(e,"activeElementChanged",[e,!0])&&(this.__ignoreActive=!0),this.editMode&&t&&t.tagName){let e=s.haxSchemaFromTag(t.tagName.toLowerCase());if("core"!=e.editingElement||t.parentNode&&t.parentNode.haxUIElement&&t.parentNode===s.activeEditingElement){this.__ignoreActive=!0;let o=await s.runHook(t.parentNode,"activeElementChanged",[t,!1]);if(o&&o!==t){if(t&&t.getAttribute&&null!=t.getAttribute("slot")&&o.setAttribute("slot",t.getAttribute("slot")),e.saveOptions&&e.saveOptions.unsetAttributes&&e.saveOptions.unsetAttributes.length)for(var i in e.saveOptions.unsetAttributes)o.removeAttribute(e.saveOptions.unsetAttributes[i]);this.__applyNodeEditableState(o,this.editMode)}b(s.activeEditingElement),s.activeEditingElement=null}}if(this.editMode&&e){let t=s.haxSchemaFromTag(e.tagName);if(t&&t.editingElement&&"core"!=t.editingElement){if(t.editingElement.import){let e=new URL("./hax-body.js",import.meta.url).href+"/../../../";window.WCGlobalBasePath&&(e=window.WCGlobalBasePath),await import(`${e}${t.editingElement.import}`)}s.activeEditingElement=document.createElement(t.editingElement.tag),e.getAttribute&&null!=e.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",e.getAttribute("slot")),t.editingElement.callback&&t.editingElement.callback(s.activeEditingElement),this.__ignoreActive=!0,v(e,s.activeEditingElement),await s.runHook(s.activeEditingElement,"activeElementChanged",[e,!0])}}!t||!t.parentNode||e&&e.parentNode&&e.parentNode===t.parentNode||this.unsetSlotEditMode(t.parentNode),this.unsetElementEditMode(t)}_getPosition(e){return{x:e.offsetLeft-e.scrollLeft+e.clientLeft,y:e.offsetTop-e.scrollTop+e.clientTop}}_showContextMenu(e){e.setAttribute("on-screen","on-screen"),e.classList.add("hax-context-visible","hax-context-menu-active")}_getContextContainer(e){let t=e&&e.parentNode?e.parentNode:void 0;return t&&t.nodeType?1==t.nodeType?t:t.host:void 0}_hideContextMenu(e){e&&(e.removeAttribute("on-screen"),e.classList.remove("hax-context-visible"),e.classList.remove("hax-context-menu-active"))}_tabKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=!1,i=this.activeNode.parentNode;const o=this.activeNode.parentNode.tagName;let a=s.getRange().cloneRange();var e=a.commonAncestorContainer.tagName;if(void 0===e&&(e=a.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(o)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("indent"));else for(;!t;)null==i.nextSibling?t=!0:"function"===i.nextSibling.focus?(i.nextSibling.focus(),t=!0):i=i.nextSibling}catch(e){console.warn(e)}}_tabBackKeyPressed(){if(this.activeNode&&s.getRange().cloneRange)try{let t=this.activeNode.parentNode;const i=this.activeNode.parentNode.tagName;let o=s.getRange().cloneRange();var e=o.commonAncestorContainer.tagName;if(void 0===e&&(e=o.commonAncestorContainer.parentNode.tagName),["UL","OL","LI"].includes(i)||["UL","OL","LI"].includes(e))this.polyfillSafe&&(this.__tabTrap=!0,this.__indentTrap=!0,document.execCommand("outdent"));else{if(null!=t)for(;null!=t&&!this._validElementTest(t);)t=t.previousSibling;null!=t&&setTimeout((()=>{t.focus()}),50)}}catch(e){console.warn(e)}}}customElements.define(HaxBody.tag,HaxBody);export{HaxBody};
\ No newline at end of file
diff --git a/haxcms/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js b/haxcms/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
index da6e2e2c2..fac0f7b56 100644
--- a/haxcms/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
+++ b/haxcms/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js
@@ -1,4 +1,4 @@
-import{LitElement as e,html as t,nothing as i}from"../../../lit/index.js";import{SimpleTourManager as a}from"../../simple-popover/lib/simple-tour.js";import{HaxSchematizer as o,HaxElementizer as r}from"../../hax-body-behaviors/lib/HAXFields.js";import{winEventsElement as n,getRange as s,stripMSWord as l,nodeToHaxElement as d,haxElementToNode as c,validURL as h,camelToDash as p,htmlEntities as m,localStorageGet as g,localStorageSet as u}from"../../utils/utils.js";import{observable as x,makeObservable as f,computed as b,configure as v,autorun as y,toJS as T}from"../../../mobx/dist/mobx.esm.js";v({enforceActions:!1});import{HAXElement as S}from"../../hax-body-behaviors/hax-body-behaviors.js";import{I18NMixin as H,I18NManagerStore as w}from"../../i18n-manager/lib/I18NMixin.js";import{enableServices as E}from"../../micro-frontend-registry/lib/microServices.js";import{SuperDaemonInstance as A}from"../../super-daemon/super-daemon.js";import"../../media-behaviors/media-behaviors.js";import"../../editable-table/editable-table.js";import"../../iframe-loader/iframe-loader.js";import"../../hax-iconset/lib/hax-iconset-manifest.js";import{UserScaffoldInstance as N}from"../../user-scaffold/user-scaffold.js";import"./hax-app.js";function sessionStorageGet(e){try{return sessionStorage.getItem(e)}catch(e){return!1}}function sessionStorageSet(e,t){try{return sessionStorage.setItem(e,t)}catch(e){return!1}}class HaxStore extends(H(n(S(e)))){testHook(e,t){return!!(e&&e.tagName&&this.HTMLPrimativeTest(e)&&this.primativeHooks[e.tagName.toLowerCase()]&&this.primativeHooks[e.tagName.toLowerCase()][t])||e&&"function"==typeof e.haxHooks&&e.haxHooks()[t]}async runHook(e,t,i=[]){return!!this.testHook(e,t)&&(this.HTMLPrimativeTest(e)?await this.primativeHooks[e.tagName.toLowerCase()][t](...i):await e[e.haxHooks()[t]](...i))}getSelection(){if(this.activeHaxBody&&this.activeHaxBody.parentNode){if(this.activeHaxBody.parentNode.getSelection)return this.activeHaxBody.parentNode.getSelection();try{if(s(this.activeHaxBody.parentNode))return s(this.activeHaxBody.parentNode)}catch(e){}}return globalThis.getSelection()}getRange(){let e=this.getSelection();return e&&e.getRangeAt&&e.rangeCount?e.getRangeAt(0):e||!1}guessGizmo(e,t,i=!1,a=!1){var o=[],r=[];if(void 0!==e&&this.validGizmoTypes.includes(e))for(let n in this.gizmoList){let s=T(this.gizmoList[n]),l=t.innerHTML?{innerHTML:t.innerHTML}:{},d=!1;if(s&&s.handles)for(let n=0;n Image Caption Here Image Caption Here
- Select the answer you feel satsisfy the question. When you are done,
+ Select the answer you feel answers the question. When you are done,
press ${this.t.checkAnswer}. You will get feedback
indicating correctness of your answer and how to proceed.
- Type the answer you feel satsisfies the question. When you are done,
+ Type the answer you feel answers the question. When you are done,
select ${this.t.checkAnswer}. You will get feedback
indicating correctness of your answer.
/g,"
/g,"/g,"").replace(/<\/ul>/g,"").replace(/
"));try{e.replaceWith(o),i&&setTimeout((()=>{let e=o.children;e[0]&&e.tagName?e[0].focus():o.focus()}),10)}catch(t){console.warn(t),console.warn(o),console.warn(e)}return o}haxDeleteNode(e){if(e.previousElementSibling)s.activeNode=e.previousElementSibling;else if(e.nextElementSibling)s.activeNode=e.nextElementSibling;else{this.haxInsert("p","",{});try{var t=document.createRange(),i=s.getSelection();t.setStart(this.activeNode,0),t.collapse(!0),i.removeAllRanges(),i.addRange(t),this.activeNode.focus()}catch(e){console.warn(e)}}try{return e.remove()}catch(e){console.warn(e)}}importContent(e,t=!0){t&&c(this,"*"),setTimeout((()=>{e=d(e);let t=document.createElement("div");for(t.insertAdjacentHTML("beforeend",e);null!==t.firstChild;)if(void 0!==t.firstChild.tagName)if(s._isSandboxed&&"iframe"===t.firstChild.tagName.toLowerCase()){for(var i=document.createElement("webview"),o=0,a=t.firstChild.attributes.length;o`col-${t}`)):s.slotsFromSchema(t).map((e=>e.slot))).reverse().forEach(((t,i)=>{0==i?e.querySelectorAll(`[slot=${t}]`).forEach((t=>e.append(t))):[...e.querySelectorAll(`[slot=${t}]`)].reverse().forEach((t=>e.insertBefore(t,e.firstChild)))}))}async _haxContextOperation(e){let t=e.detail,i=N(e),o=i&&i[0]?i[0].getAttribute("data-slot"):void 0;switch(t.eventName){case"insert-above-active":if(this.activeNode&&this.activeNode.previousElementSibling)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode){let e=document.createElement("p");this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeNode.parentNode.insertBefore(e,this.activeNode)}else this.appendChild(p);break;case"insert-below-active":this.haxInsert("p","",{});break;case"move-to-slot":o&&this.activeNode&&s.isGridPlateElement(this.activeNode.parentNode)&&(this.activeNode.slot=o,this.sortGridSlots(this.activeNode.parentNode));break;case"insert-into-active":if(o&&this.activeNode&&s.isGridPlateElement(this.activeNode)){let e=document.createElement("p");e.slot=o,this.activeNode.append(e),this.haxInsert("p","",{slot:o},e),e.remove(),this.sortGridSlots()}break;case"hax-select-grid":if(i[0]&&i[0].eventData){let e=i[0].eventData;this.setActiveNode(e,!0),this.positionContextMenus(e)}break;case"hax-select-grid-item":if(i[0]&&i[0].eventData){let e=i[0].eventData,t=e.target,o=e.slot,a=e.index,n=e.grid,s=e.editMode,r=e.invisible?n:[...n.children].filter((e=>o&&""!==o?e.slot===o:!e.slot||""===e.slot))[a]||t;n&&s?this.setSlotEditMode(n,s,r):(this.setActiveNode(node,!0),this.positionContextMenus(node))}break;case"hax-edit-element-toggle":if(i[0]&&i[0].eventData){let e=i[0].eventData;e&&e.target&&e.editMode&&this.toggleElementEditMode(e.target,e.editMode)}break;case"hax-source-view-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t={};if(this.activeNode&&this.activeNode.tagName?t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase()):this.activeNode.parentElement&&this.activeNode.parentElement.tagName&&(t=s.haxSchemaFromTag(this.activeNode.parentElement.tagName.toLowerCase())),this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceToggle=!1}else this.activeNode.__haxSourceView=!0,s.activeEditingElement=document.createElement("code-editor"),s.activeEditingElement.language="html",s.activeEditingElement.title="",s.activeEditingElement.theme="vs",s.activeEditingElement.fontSize=12,s.activeEditingElement.wordWrap=!0,this.viewSourceToggle=!0,import("../code-editor/code-editor.js"),this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),s.testHook(this.activeNode,"preProcessNodeToContent")&&(s.activeNode=await s.runHook(this.activeNode,"preProcessNodeToContent",[this.activeNode])),v(this.activeNode,s.activeEditingElement),s.activeEditingElement.focus();break;case"hax-full-text-editor-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase());if(this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceElement=s.activeEditingElement}else this.activeNode.__haxSourceView=!0,import("../rich-text-editor/rich-text-editor.js").then((()=>{s.activeEditingElement=document.createElement("rich-text-editor"),s.activeEditingElement.type="rich-text-editor-toolbar-full",this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),v(this.activeNode,s.activeEditingElement),this.viewSourceElement=s.activeEditingElement}));break;case"text-tag":s.activeNode=this.haxChangeTagName(this.activeNode,t.value),this.positionContextMenus();break;case"text-tag-ul":this.contextMenus.text.realSelectedValue="ul",s.activeNode=this.haxChangeTagName(this.activeNode,"ul"),this.positionContextMenus();break;case"text-tag-ol":this.contextMenus.text.realSelectedValue="ol",s.activeNode=this.haxChangeTagName(this.activeNode,"ol"),this.positionContextMenus();break;case"hax-transform-node":this.replaceElementWorkflow();break;case"hax-plate-create-right":this.haxGridPlateOps();break;case"hax-plate-remove-right":this.haxGridPlateOps(!1);break;case"hax-plate-duplicate":this.haxDuplicateNode(this.activeNode);break;case"hax-plate-delete":null!=this.activeNode&&this.haxDeleteNode(this.activeNode);break;case"hax-plate-up":this.activeNode.previousElementSibling&&"PAGE-BREAK"!==this.activeNode.previousElementSibling.tagName&&this.haxMoveGridPlate(this.activeNode,-1);break;case"hax-plate-down":this.activeNode.nextElementSibling&&this.haxMoveGridPlate(this.activeNode);break;case"content-edit":"content-edit"===s.haxTray.trayDetail&&(s.haxTray.collapsed=!1),s.haxTray.trayDetail="content-edit";break;case"super-daemon":const e=s.getRange();E.mini=!0,E.activeRange=e,E.activeSelection=s.getSelection();let n=this.activeNode;e.commonAncestorContainer.tagName?n=e.commonAncestorContainer:e.commonAncestorContainer.parentNode&&e.commonAncestorContainer.parentNode.tagName&&(n=e.commonAncestorContainer.parentNode),E.activeNode=n,E.runProgram(n.textContent.trim(),"*"),E.open();break;case"hide-context-menus":this.hideContextMenus()}}_focusIn(e){this.__mouseDown||this.__focusLogic(e.target)&&(e.stopPropagation(),e.stopImmediatePropagation())}__focusLogic(e,t=!0){let i=!1;if(this.editMode&&!this.__tabTrap){let o=e;("SPAN"===o.tagName&&s.isTextElement(o.parentNode)&&""==o.parentNode.getAttribute("slot")||"LI"===o.tagName&&s.isTextElement(o.parentNode)&&["UL","OL"].includes(o.parentNode.tagName))&&(o=e.parentNode);let a=null;if(this._validElementTest(o)&&o.parentNode&&o.parentNode.tagName){if("P"===o.parentNode.tagName&&""==o.parentNode.getAttribute("slot"))a=o,i=!0;else{for(;o.parentNode&&o.parentNode.tagName&&"HAX-BODY"!=o.parentNode.tagName;)null===a&&"B"!==o.tagName&&"I"!==o.tagName&&"STRONG"!==o.tagName&&"EM"!==o.tagName&&(a=o),o=o.parentNode;null===a?a=o:s.isGridPlateElement(o)}(this.activeNode&&this.activeNode.parentNode!==o&&!o.classList.contains("ignore-activation")||o.haxUIElement||o.classList.contains("ignore-activation"))&&(i=!0),a.haxUIElement||a.classList.contains("ignore-activation")||(s.activeNode=a,setTimeout((()=>{if(t&&!this.__mouseDown&&s.isTextElement(a))try{var e=document.createRange(),i=s.getSelection();e.setStart(this.activeNode,0),e.collapse(!0),i.removeAllRanges(),i.addRange(e),this.activeNode.focus()}catch(e){console.warn(e)}this.positionContextMenus(a)}),0),i=!0)}}else this.__tabTrap=!1;return i}scrollHere(e){setTimeout((()=>{e.scrollIntoView({behavior:"smooth",inline:"nearest",block:"end"})}),100)}undo(){super.undo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}redo(){super.redo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}async _editModeChanged(e,t){if(void 0!==t){if(this._applyContentEditable(e),e){if(this.children&&this.children[0]&&this.children[0].focus&&this.children[0].tagName)"PAGE-BREAK"===this.children[0].tagName&&this.children[1]&&this.children[1].focus?this.__focusLogic(this.children[1]):"PAGE-BREAK"===this.children[0].tagName?this.haxInsert("p","",{}):this.__focusLogic(this.children[0]);else{this.haxInsert("p","",{});try{var i=document.createRange(),o=s.getSelection();i.setStart(this.activeNode,0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.activeNode.focus()}catch(e){console.warn(e)}}this._haxContextOperation({detail:{eventName:"content-edit",value:!0}})}else this.activeNode&&(this.unsetSlotEditMode(this.activeNode),this.unsetElementEditMode(this.activeNode));setTimeout((()=>{this.undoStack.undoStackLimit=50,this.undoStack.undoStackPosition=-1,this.undoStack.commands=[],this.undoStack.changed(),this.undoStackInitialValue=this.innerHTML,this.undoStackPrevValue=this.undoStackInitialValue}),0)}if(0==e){b(s.activeEditingElement),s.activeEditingElement=null,this.removeAttribute("contenteditable"),this.hideContextMenus();let e=this.querySelectorAll("[contenteditable],[data-hax-active]");for(var a=0;a/g,"
"),o=o.replace(/<\/h1>/g,"
"),o=o.replace(//g,(function(e,t){return`/g,"
"),o=o.replace(/<\/h1>/g,"
"),o=o.replace(//g,(function(e,t){return`
${i.details.tos.map((e=>t`
${this.question}
- ${this.renderInteraction()}
- ${this.hideButtons?i:this.renderButtons()}
+
+ ${this.question}
+ ${this.renderInteraction()}
+ ${this.hideButtons?i:this.renderButtons()}
+
+
+
/g,"
/g,"/g,"").replace(/<\/ul>/g,"").replace(/
"));try{e.replaceWith(o),i&&setTimeout((()=>{let e=o.children;e[0]&&e.tagName?e[0].focus():o.focus()}),10)}catch(t){console.warn(t),console.warn(o),console.warn(e)}return o}haxDeleteNode(e){if(e.previousElementSibling)s.activeNode=e.previousElementSibling;else if(e.nextElementSibling)s.activeNode=e.nextElementSibling;else{this.haxInsert("p","",{});try{var t=document.createRange(),i=s.getSelection();t.setStart(this.activeNode,0),t.collapse(!0),i.removeAllRanges(),i.addRange(t),this.activeNode.focus()}catch(e){console.warn(e)}}try{return e.remove()}catch(e){console.warn(e)}}importContent(e,t=!0){t&&c(this,"*"),setTimeout((()=>{e=d(e);let t=document.createElement("div");for(t.insertAdjacentHTML("beforeend",e);null!==t.firstChild;)if(void 0!==t.firstChild.tagName)if(s._isSandboxed&&"iframe"===t.firstChild.tagName.toLowerCase()){for(var i=document.createElement("webview"),o=0,a=t.firstChild.attributes.length;o`col-${t}`)):s.slotsFromSchema(t).map((e=>e.slot))).reverse().forEach(((t,i)=>{0==i?e.querySelectorAll(`[slot=${t}]`).forEach((t=>e.append(t))):[...e.querySelectorAll(`[slot=${t}]`)].reverse().forEach((t=>e.insertBefore(t,e.firstChild)))}))}async _haxContextOperation(e){let t=e.detail,i=N(e),o=i&&i[0]?i[0].getAttribute("data-slot"):void 0;switch(t.eventName){case"insert-above-active":if(this.activeNode&&this.activeNode.previousElementSibling)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode){let e=document.createElement("p");this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeNode.parentNode.insertBefore(e,this.activeNode)}else this.appendChild(p);break;case"insert-below-active":this.haxInsert("p","",{});break;case"move-to-slot":o&&this.activeNode&&s.isGridPlateElement(this.activeNode.parentNode)&&(this.activeNode.slot=o,this.sortGridSlots(this.activeNode.parentNode));break;case"insert-into-active":if(o&&this.activeNode&&s.isGridPlateElement(this.activeNode)){let e=document.createElement("p");e.slot=o,this.activeNode.append(e),this.haxInsert("p","",{slot:o},e),e.remove(),this.sortGridSlots()}break;case"hax-select-grid":if(i[0]&&i[0].eventData){let e=i[0].eventData;this.setActiveNode(e,!0),this.positionContextMenus(e)}break;case"hax-select-grid-item":if(i[0]&&i[0].eventData){let e=i[0].eventData,t=e.target,o=e.slot,a=e.index,n=e.grid,s=e.editMode,r=e.invisible?n:[...n.children].filter((e=>o&&""!==o?e.slot===o:!e.slot||""===e.slot))[a]||t;n&&s?this.setSlotEditMode(n,s,r):(this.setActiveNode(node,!0),this.positionContextMenus(node))}break;case"hax-edit-element-toggle":if(i[0]&&i[0].eventData){let e=i[0].eventData;e&&e.target&&e.editMode&&this.toggleElementEditMode(e.target,e.editMode)}break;case"hax-source-view-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t={};if(this.activeNode&&this.activeNode.tagName?t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase()):this.activeNode.parentElement&&this.activeNode.parentElement.tagName&&(t=s.haxSchemaFromTag(this.activeNode.parentElement.tagName.toLowerCase())),this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceToggle=!1}else this.activeNode.__haxSourceView=!0,s.activeEditingElement=document.createElement("code-editor"),s.activeEditingElement.language="html",s.activeEditingElement.title="",s.activeEditingElement.theme="vs",s.activeEditingElement.fontSize=12,s.activeEditingElement.wordWrap=!0,this.viewSourceToggle=!0,import("../code-editor/code-editor.js"),this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),s.testHook(this.activeNode,"preProcessNodeToContent")&&(s.activeNode=await s.runHook(this.activeNode,"preProcessNodeToContent",[this.activeNode])),v(this.activeNode,s.activeEditingElement),s.activeEditingElement.focus();break;case"hax-full-text-editor-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase());if(this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceElement=s.activeEditingElement}else this.activeNode.__haxSourceView=!0,import("../rich-text-editor/rich-text-editor.js").then((()=>{s.activeEditingElement=document.createElement("rich-text-editor"),s.activeEditingElement.type="rich-text-editor-toolbar-full",this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),v(this.activeNode,s.activeEditingElement),this.viewSourceElement=s.activeEditingElement}));break;case"text-tag":s.activeNode=this.haxChangeTagName(this.activeNode,t.value),this.positionContextMenus();break;case"text-tag-ul":this.contextMenus.text.realSelectedValue="ul",s.activeNode=this.haxChangeTagName(this.activeNode,"ul"),this.positionContextMenus();break;case"text-tag-ol":this.contextMenus.text.realSelectedValue="ol",s.activeNode=this.haxChangeTagName(this.activeNode,"ol"),this.positionContextMenus();break;case"hax-transform-node":this.replaceElementWorkflow();break;case"hax-plate-create-right":this.haxGridPlateOps();break;case"hax-plate-remove-right":this.haxGridPlateOps(!1);break;case"hax-plate-duplicate":this.haxDuplicateNode(this.activeNode);break;case"hax-plate-delete":null!=this.activeNode&&this.haxDeleteNode(this.activeNode);break;case"hax-plate-up":this.activeNode.previousElementSibling&&"PAGE-BREAK"!==this.activeNode.previousElementSibling.tagName&&this.haxMoveGridPlate(this.activeNode,-1);break;case"hax-plate-down":this.activeNode.nextElementSibling&&this.haxMoveGridPlate(this.activeNode);break;case"content-edit":"content-edit"===s.haxTray.trayDetail&&(s.haxTray.collapsed=!1),s.haxTray.trayDetail="content-edit";break;case"super-daemon":const e=s.getRange();E.mini=!0,E.activeRange=e,E.activeSelection=s.getSelection();let n=this.activeNode;e.commonAncestorContainer.tagName?n=e.commonAncestorContainer:e.commonAncestorContainer.parentNode&&e.commonAncestorContainer.parentNode.tagName&&(n=e.commonAncestorContainer.parentNode),E.activeNode=n,E.runProgram(n.textContent.trim(),"*"),E.open();break;case"hide-context-menus":this.hideContextMenus()}}_focusIn(e){this.__mouseDown||this.__focusLogic(e.target)&&(e.stopPropagation(),e.stopImmediatePropagation())}__focusLogic(e,t=!0){let i=!1;if(this.editMode&&!this.__tabTrap){let o=e;("SPAN"===o.tagName&&s.isTextElement(o.parentNode)&&""==o.parentNode.getAttribute("slot")||"LI"===o.tagName&&s.isTextElement(o.parentNode)&&["UL","OL"].includes(o.parentNode.tagName))&&(o=e.parentNode);let a=null;if(this._validElementTest(o)&&o.parentNode&&o.parentNode.tagName){if("P"===o.parentNode.tagName&&""==o.parentNode.getAttribute("slot"))a=o,i=!0;else{for(;o.parentNode&&o.parentNode.tagName&&"HAX-BODY"!=o.parentNode.tagName;)null===a&&"B"!==o.tagName&&"I"!==o.tagName&&"STRONG"!==o.tagName&&"EM"!==o.tagName&&(a=o),o=o.parentNode;null===a?a=o:s.isGridPlateElement(o)}(this.activeNode&&this.activeNode.parentNode!==o&&!o.classList.contains("ignore-activation")||o.haxUIElement||o.classList.contains("ignore-activation"))&&(i=!0),a.haxUIElement||a.classList.contains("ignore-activation")||(s.activeNode=a,setTimeout((()=>{if(t&&!this.__mouseDown&&s.isTextElement(a))try{var e=document.createRange(),i=s.getSelection();e.setStart(this.activeNode,0),e.collapse(!0),i.removeAllRanges(),i.addRange(e),this.activeNode.focus()}catch(e){console.warn(e)}this.positionContextMenus(a)}),0),i=!0)}}else this.__tabTrap=!1;return i}scrollHere(e){setTimeout((()=>{e.scrollIntoView({behavior:"smooth",inline:"nearest",block:"end"})}),100)}undo(){super.undo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}redo(){super.redo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}async _editModeChanged(e,t){if(void 0!==t){if(this._applyContentEditable(e),e){if(this.children&&this.children[0]&&this.children[0].focus&&this.children[0].tagName)"PAGE-BREAK"===this.children[0].tagName&&this.children[1]&&this.children[1].focus?this.__focusLogic(this.children[1]):"PAGE-BREAK"===this.children[0].tagName?this.haxInsert("p","",{}):this.__focusLogic(this.children[0]);else{this.haxInsert("p","",{});try{var i=document.createRange(),o=s.getSelection();i.setStart(this.activeNode,0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.activeNode.focus()}catch(e){console.warn(e)}}this._haxContextOperation({detail:{eventName:"content-edit",value:!0}})}else this.activeNode&&(this.unsetSlotEditMode(this.activeNode),this.unsetElementEditMode(this.activeNode));setTimeout((()=>{this.undoStack.undoStackLimit=50,this.undoStack.undoStackPosition=-1,this.undoStack.commands=[],this.undoStack.changed(),this.undoStackInitialValue=this.innerHTML,this.undoStackPrevValue=this.undoStackInitialValue}),0)}if(0==e){b(s.activeEditingElement),s.activeEditingElement=null,this.removeAttribute("contenteditable"),this.hideContextMenus();let e=this.querySelectorAll("[contenteditable],[data-hax-active]");for(var a=0;a
/g,"
/g,"/g,"").replace(/<\/ul>/g,"").replace(/
"));try{e.replaceWith(o),i&&setTimeout((()=>{let e=o.children;e[0]&&e.tagName?e[0].focus():o.focus()}),10)}catch(t){console.warn(t),console.warn(o),console.warn(e)}return o}haxDeleteNode(e){if(e.previousElementSibling)s.activeNode=e.previousElementSibling;else if(e.nextElementSibling)s.activeNode=e.nextElementSibling;else{this.haxInsert("p","",{});try{var t=document.createRange(),i=s.getSelection();t.setStart(this.activeNode,0),t.collapse(!0),i.removeAllRanges(),i.addRange(t),this.activeNode.focus()}catch(e){console.warn(e)}}try{return e.remove()}catch(e){console.warn(e)}}importContent(e,t=!0){t&&c(this,"*"),setTimeout((()=>{e=d(e);let t=document.createElement("div");for(t.insertAdjacentHTML("beforeend",e);null!==t.firstChild;)if(void 0!==t.firstChild.tagName)if(s._isSandboxed&&"iframe"===t.firstChild.tagName.toLowerCase()){for(var i=document.createElement("webview"),o=0,a=t.firstChild.attributes.length;o`col-${t}`)):s.slotsFromSchema(t).map((e=>e.slot))).reverse().forEach(((t,i)=>{0==i?e.querySelectorAll(`[slot=${t}]`).forEach((t=>e.append(t))):[...e.querySelectorAll(`[slot=${t}]`)].reverse().forEach((t=>e.insertBefore(t,e.firstChild)))}))}async _haxContextOperation(e){let t=e.detail,i=N(e),o=i&&i[0]?i[0].getAttribute("data-slot"):void 0;switch(t.eventName){case"insert-above-active":if(this.activeNode&&this.activeNode.previousElementSibling)this.haxInsert("p","",{},this.activeNode.previousElementSibling);else if(this.activeNode){let e=document.createElement("p");this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeNode.parentNode.insertBefore(e,this.activeNode)}else this.appendChild(p);break;case"insert-below-active":this.haxInsert("p","",{});break;case"move-to-slot":o&&this.activeNode&&s.isGridPlateElement(this.activeNode.parentNode)&&(this.activeNode.slot=o,this.sortGridSlots(this.activeNode.parentNode));break;case"insert-into-active":if(o&&this.activeNode&&s.isGridPlateElement(this.activeNode)){let e=document.createElement("p");e.slot=o,this.activeNode.append(e),this.haxInsert("p","",{slot:o},e),e.remove(),this.sortGridSlots()}break;case"hax-select-grid":if(i[0]&&i[0].eventData){let e=i[0].eventData;this.setActiveNode(e,!0),this.positionContextMenus(e)}break;case"hax-select-grid-item":if(i[0]&&i[0].eventData){let e=i[0].eventData,t=e.target,o=e.slot,a=e.index,n=e.grid,s=e.editMode,r=e.invisible?n:[...n.children].filter((e=>o&&""!==o?e.slot===o:!e.slot||""===e.slot))[a]||t;n&&s?this.setSlotEditMode(n,s,r):(this.setActiveNode(node,!0),this.positionContextMenus(node))}break;case"hax-edit-element-toggle":if(i[0]&&i[0].eventData){let e=i[0].eventData;e&&e.target&&e.editMode&&this.toggleElementEditMode(e.target,e.editMode)}break;case"hax-source-view-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t={};if(this.activeNode&&this.activeNode.tagName?t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase()):this.activeNode.parentElement&&this.activeNode.parentElement.tagName&&(t=s.haxSchemaFromTag(this.activeNode.parentElement.tagName.toLowerCase())),this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceToggle=!1}else this.activeNode.__haxSourceView=!0,s.activeEditingElement=document.createElement("code-editor"),s.activeEditingElement.language="html",s.activeEditingElement.title="",s.activeEditingElement.theme="vs",s.activeEditingElement.fontSize=12,s.activeEditingElement.wordWrap=!0,this.viewSourceToggle=!0,import("../code-editor/code-editor.js"),this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),s.testHook(this.activeNode,"preProcessNodeToContent")&&(s.activeNode=await s.runHook(this.activeNode,"preProcessNodeToContent",[this.activeNode])),v(this.activeNode,s.activeEditingElement),s.activeEditingElement.focus();break;case"hax-full-text-editor-toggle":if(this.activeNode.__haxSourceView){this.activeNode.__haxSourceView=!1;let e=await s.runHook(s.activeEditingElement,"activeElementChanged",[this.activeNode,!1]),t=s.haxSchemaFromTag(this.activeNode.tagName.toLowerCase());if(this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),t.saveOptions&&t.saveOptions.unsetAttributes&&t.saveOptions.unsetAttributes.length)for(var a in t.saveOptions.unsetAttributes)e.removeAttribute(t.saveOptions.unsetAttributes[a]);this.__applyNodeEditableState(e,this.editMode),b(s.activeEditingElement),s.activeEditingElement=null,this.viewSourceElement=s.activeEditingElement}else this.activeNode.__haxSourceView=!0,import("../rich-text-editor/rich-text-editor.js").then((()=>{s.activeEditingElement=document.createElement("rich-text-editor"),s.activeEditingElement.type="rich-text-editor-toolbar-full",this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&s.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),v(this.activeNode,s.activeEditingElement),this.viewSourceElement=s.activeEditingElement}));break;case"text-tag":s.activeNode=this.haxChangeTagName(this.activeNode,t.value),this.positionContextMenus();break;case"text-tag-ul":this.contextMenus.text.realSelectedValue="ul",s.activeNode=this.haxChangeTagName(this.activeNode,"ul"),this.positionContextMenus();break;case"text-tag-ol":this.contextMenus.text.realSelectedValue="ol",s.activeNode=this.haxChangeTagName(this.activeNode,"ol"),this.positionContextMenus();break;case"hax-transform-node":this.replaceElementWorkflow();break;case"hax-plate-create-right":this.haxGridPlateOps();break;case"hax-plate-remove-right":this.haxGridPlateOps(!1);break;case"hax-plate-duplicate":this.haxDuplicateNode(this.activeNode);break;case"hax-plate-delete":null!=this.activeNode&&this.haxDeleteNode(this.activeNode);break;case"hax-plate-up":this.activeNode.previousElementSibling&&"PAGE-BREAK"!==this.activeNode.previousElementSibling.tagName&&this.haxMoveGridPlate(this.activeNode,-1);break;case"hax-plate-down":this.activeNode.nextElementSibling&&this.haxMoveGridPlate(this.activeNode);break;case"content-edit":"content-edit"===s.haxTray.trayDetail&&(s.haxTray.collapsed=!1),s.haxTray.trayDetail="content-edit";break;case"super-daemon":const e=s.getRange();E.mini=!0,E.activeRange=e,E.activeSelection=s.getSelection();let n=this.activeNode;e.commonAncestorContainer.tagName?n=e.commonAncestorContainer:e.commonAncestorContainer.parentNode&&e.commonAncestorContainer.parentNode.tagName&&(n=e.commonAncestorContainer.parentNode),E.activeNode=n,E.runProgram(n.textContent.trim(),"*"),E.open();break;case"hide-context-menus":this.hideContextMenus()}}_focusIn(e){this.__mouseDown||this.__focusLogic(e.target)&&(e.stopPropagation(),e.stopImmediatePropagation())}__focusLogic(e,t=!0){let i=!1;if(this.editMode&&!this.__tabTrap){let o=e;("SPAN"===o.tagName&&s.isTextElement(o.parentNode)&&""==o.parentNode.getAttribute("slot")||"LI"===o.tagName&&s.isTextElement(o.parentNode)&&["UL","OL"].includes(o.parentNode.tagName))&&(o=e.parentNode);let a=null;if(this._validElementTest(o)&&o.parentNode&&o.parentNode.tagName){if("P"===o.parentNode.tagName&&""==o.parentNode.getAttribute("slot"))a=o,i=!0;else{for(;o.parentNode&&o.parentNode.tagName&&"HAX-BODY"!=o.parentNode.tagName;)null===a&&"B"!==o.tagName&&"I"!==o.tagName&&"STRONG"!==o.tagName&&"EM"!==o.tagName&&(a=o),o=o.parentNode;null===a?a=o:s.isGridPlateElement(o)}(this.activeNode&&this.activeNode.parentNode!==o&&!o.classList.contains("ignore-activation")||o.haxUIElement||o.classList.contains("ignore-activation"))&&(i=!0),a.haxUIElement||a.classList.contains("ignore-activation")||(s.activeNode=a,setTimeout((()=>{if(t&&!this.__mouseDown&&s.isTextElement(a))try{var e=document.createRange(),i=s.getSelection();e.setStart(this.activeNode,0),e.collapse(!0),i.removeAllRanges(),i.addRange(e),this.activeNode.focus()}catch(e){console.warn(e)}this.positionContextMenus(a)}),0),i=!0)}}else this.__tabTrap=!1;return i}scrollHere(e){setTimeout((()=>{e.scrollIntoView({behavior:"smooth",inline:"nearest",block:"end"})}),100)}undo(){super.undo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}redo(){super.redo(),setTimeout((()=>{let e=this.querySelector("[data-hax-active]");e?(this.__focusLogic(e),this.scrollHere(e)):this.hideContextMenus()}),0)}async _editModeChanged(e,t){if(void 0!==t){if(this._applyContentEditable(e),e){if(this.children&&this.children[0]&&this.children[0].focus&&this.children[0].tagName)"PAGE-BREAK"===this.children[0].tagName&&this.children[1]&&this.children[1].focus?this.__focusLogic(this.children[1]):"PAGE-BREAK"===this.children[0].tagName?this.haxInsert("p","",{}):this.__focusLogic(this.children[0]);else{this.haxInsert("p","",{});try{var i=document.createRange(),o=s.getSelection();i.setStart(this.activeNode,0),i.collapse(!0),o.removeAllRanges(),o.addRange(i),this.activeNode.focus()}catch(e){console.warn(e)}}this._haxContextOperation({detail:{eventName:"content-edit",value:!0}})}else this.activeNode&&(this.unsetSlotEditMode(this.activeNode),this.unsetElementEditMode(this.activeNode));setTimeout((()=>{this.undoStack.undoStackLimit=50,this.undoStack.undoStackPosition=-1,this.undoStack.commands=[],this.undoStack.changed(),this.undoStackInitialValue=this.innerHTML,this.undoStackPrevValue=this.undoStackInitialValue}),0)}if(0==e){b(s.activeEditingElement),s.activeEditingElement=null,this.removeAttribute("contenteditable"),this.hideContextMenus();let e=this.querySelectorAll("[contenteditable],[data-hax-active]");for(var a=0;a/g,"
"),o=o.replace(/<\/h1>/g,"
"),o=o.replace(//g,(function(e,t){return`/g,"
"),o=o.replace(/<\/h1>/g,"
"),o=o.replace(//g,(function(e,t){return`
${i.details.tos.map((e=>t`
${this.question}
- ${this.renderInteraction()}
- ${this.hideButtons?i:this.renderButtons()}
+
+ ${this.question}
+ ${this.renderInteraction()}
+ ${this.hideButtons?i:this.renderButtons()}
+
+
+ =this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}},{key:"_reflow",value:function(){var i=this._first,t=this._last;a(n(o.prototype),"_reflow",this).call(this),(-1===this._first&&-1==this._last||this._first===i&&this._last===t)&&this._resetReflowState()}},{key:"_resetReflowState",value:function(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}},{key:"_updateScrollSize",value:function(){var i=this._metricsCache.averageMarginSize;this._scrollSize=Math.max(1,this.items.length*(i+this._getAverageSize())+i)}},{key:"_delta",get:function(){var i=this._metricsCache.averageMarginSize;return this._getAverageSize()+i}},{key:"_getItemPosition",value:function(i){var t;return s(s(s({},this._positionDim,this._getPosition(i)),this._secondaryPositionDim,0),"horizontal"===this.direction?"xOffset":"yOffset",-(null!==(t=this._metricsCache.getLeadingMarginValue(i,this.direction))&&void 0!==t?t:this._metricsCache.averageMarginSize))}},{key:"_getItemSize",value:function(i){return s(s({},this._sizeDim,this._getSize(i)||this._getAverageSize()),this._secondarySizeDim,this._itemSize[this._secondarySizeDim])}},{key:"_viewDim2Changed",value:function(){this._metricsCache.clear(),this._scheduleReflow()}}])}(u))}}}));
+System.register(["./9b1def34.js"],(function(i){"use strict";var t,e,s,h,a,n,r,o,l;return{setters:[function(i){t=i.a,e=i.c,s=i.l,h=i._,a=i.f,n=i.g,r=i.d,o=i.K,l=i.p}],execute:function(){var _=function(){return t((function i(t){e(this,i),this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===(null==t?void 0:t.roundAverageSize)&&(this._roundAverageSize=!0)}),[{key:"set",value:function(i,t){var e=this._map.get(i)||0;this._map.set(i,t),this.totalSize+=t-e}},{key:"averageSize",get:function(){if(this._map.size>0){var i=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(i):i}return 0}},{key:"getSize",value:function(i){return this._map.get(i)}},{key:"clear",value:function(){this._map.clear(),this.totalSize=0}}])}();function c(i){return"horizontal"===i?"width":"height"}var u=function(){return t((function i(t,s){var h=this;e(this,i),this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then((function(){return h.config=s||h._getDefaultConfig()}))}),[{key:"_getDefaultConfig",value:function(){return{direction:"vertical"}}},{key:"config",get:function(){return{direction:this.direction}},set:function(i){Object.assign(this,Object.assign({},this._getDefaultConfig(),i))}},{key:"items",get:function(){return this._items},set:function(i){this._setItems(i)}},{key:"_setItems",value:function(i){i!==this._items&&(this._items=i,this._scheduleReflow())}},{key:"direction",get:function(){return this._direction},set:function(i){(i="horizontal"===i?i:"vertical")!==this._direction&&(this._direction=i,this._sizeDim="horizontal"===i?"width":"height",this._secondarySizeDim="horizontal"===i?"height":"width",this._positionDim="horizontal"===i?"left":"top",this._secondaryPositionDim="horizontal"===i?"top":"left",this._triggerReflow())}},{key:"viewportSize",get:function(){return this._viewportSize},set:function(i){var t=this._viewDim1,e=this._viewDim2;Object.assign(this._viewportSize,i),e!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}},{key:"viewportScroll",get:function(){return this._latestCoords},set:function(i){Object.assign(this._latestCoords,i);var t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}},{key:"reflowIfNeeded",value:function(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}},{key:"pin",get:function(){if(null!==this._pin){var i=this._pin,t=i.index,e=i.block;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null},set:function(i){this._pin=i,this._triggerReflow()}},{key:"_clampScrollPosition",value:function(i){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(i,this.totalScrollSize[c(this.direction)]-this._viewDim1))}},{key:"unpin",value:function(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}},{key:"_updateLayout",value:function(){}},{key:"_viewDim1",get:function(){return this._viewportSize[this._sizeDim]}},{key:"_viewDim2",get:function(){return this._viewportSize[this._secondarySizeDim]}},{key:"_scheduleReflow",value:function(){this._pendingReflow=!0}},{key:"_scheduleLayoutUpdate",value:function(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}},{key:"_triggerReflow",value:function(){var i=this;this._scheduleLayoutUpdate(),Promise.resolve().then((function(){return i.reflowIfNeeded()}))}},{key:"_reflow",value:function(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}},{key:"_setPositionFromPin",value:function(){if(null!==this.pin){var i=this._scrollPosition,t=this.pin,e=t.index,s=t.block;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:s||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=i-this._scrollPosition}}},{key:"_calculateScrollIntoViewPosition",value:function(i){var t=i.block,e=Math.min(this.items.length,Math.max(0,i.index)),s=this._getItemPosition(e)[this._positionDim],h=s;if("start"!==t){var a=this._getItemSize(e)[this._sizeDim];if("center"===t)h=s-.5*this._viewDim1+.5*a;else{var n=s-this._viewDim1+a;if("end"===t)h=n;else{var r=this._scrollPosition;h=Math.abs(r-s)=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}},{key:"_reflow",value:function(){var i=this._first,t=this._last;a(n(o.prototype),"_reflow",this).call(this),(-1===this._first&&-1==this._last||this._first===i&&this._last===t)&&this._resetReflowState()}},{key:"_resetReflowState",value:function(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}},{key:"_updateScrollSize",value:function(){var i=this._metricsCache.averageMarginSize;this._scrollSize=Math.max(1,this.items.length*(i+this._getAverageSize())+i)}},{key:"_delta",get:function(){var i=this._metricsCache.averageMarginSize;return this._getAverageSize()+i}},{key:"_getItemPosition",value:function(i){var t;return s(s(s({},this._positionDim,this._getPosition(i)),this._secondaryPositionDim,0),"horizontal"===this.direction?"xOffset":"yOffset",-(null!==(t=this._metricsCache.getLeadingMarginValue(i,this.direction))&&void 0!==t?t:this._metricsCache.averageMarginSize))}},{key:"_getItemSize",value:function(i){return s(s({},this._sizeDim,this._getSize(i)||this._getAverageSize()),this._secondarySizeDim,this._itemSize[this._secondarySizeDim])}},{key:"_viewDim2Changed",value:function(){this._metricsCache.clear(),this._scheduleReflow()}}])}(u))}}}));
diff --git a/storybook/e274078c.js b/storybook/1c35b766.js
similarity index 98%
rename from storybook/e274078c.js
rename to storybook/1c35b766.js
index 6592208c2..120512de4 100644
--- a/storybook/e274078c.js
+++ b/storybook/1c35b766.js
@@ -1 +1 @@
-System.register(["./bfad1b78.js"],(function(n){"use strict";var t,e,o,i,r,s,a,c,l,m;return{setters:[function(n){t=n._,e=n.a,o=n.i,i=n.b,r=n.x,s=n.f,a=n.g,c=n.s,l=n.c,m=n.d}],execute:function(){var u,p,g=n("ImageInspector",function(n){function c(){var n;return l(this,c),(n=m(this,c)).noLeft=!1,n.degrees=0,n.src="",n}return t(c,n),e(c,[{key:"render",value:function(){return r(u||(u=i(['\n \n \n ','\n
\n \n ','\n
\n
/g,"
/g,"/g,"").replace(/<\/ul>/g,"").replace(/
"));try{e.replaceWith(o),n&&setTimeout((function(){var e=o.children;e[0]&&e.tagName?e[0].focus():o.focus()}),10)}catch(t){console.warn(t),console.warn(o),console.warn(e)}return o}},{key:"haxDeleteNode",value:function(e){if(e.previousElementSibling)ye.activeNode=e.previousElementSibling;else if(e.nextElementSibling)ye.activeNode=e.nextElementSibling;else{this.haxInsert("p","",{});try{var t=document.createRange(),n=ye.getSelection();t.setStart(this.activeNode,0),t.collapse(!0),n.removeAllRanges(),n.addRange(t),this.activeNode.focus()}catch(e){console.warn(e)}}try{return e.remove()}catch(e){console.warn(e)}}},{key:"importContent",value:function(e){var t=this;(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&C(this,"*"),setTimeout((function(){e=D(e);var n=document.createElement("div");for(n.insertAdjacentHTML("beforeend",e);null!==n.firstChild;)if("undefined"!==R(n.firstChild.tagName))if(ye._isSandboxed&&"iframe"===n.firstChild.tagName.toLowerCase()){for(var o=document.createElement("webview"),i=0,a=n.firstChild.attributes.length;i0&&void 0!==arguments[0]?arguments[0]:this.activeNode,t=ye.haxSchemaFromTag(e.tagName);if("grid"===t.type){var n="GRID-PLATE"===e.tagName?e.layout.split("-").map((function(e,t){return"col-".concat(t)})):ye.slotsFromSchema(t).map((function(e){return e.slot}));n.reverse().forEach((function(t,n){0==n?e.querySelectorAll("[slot=".concat(t,"]")).forEach((function(t){return e.append(t)})):m(e.querySelectorAll("[slot=".concat(t,"]"))).reverse().forEach((function(t){return e.insertBefore(t,e.firstChild)}))}))}}},{key:"_haxContextOperation",value:(x=w(E().mark((function e(t){var o,i,a,r,s,l,c,d,u,h,v,g,f,b,y,x,A,k,w,_,S,N,C=this;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=t.detail,i=T(t),a=i&&i[0]?i[0].getAttribute("data-slot"):void 0,e.t0=o.eventName,e.next="insert-above-active"===e.t0?4:"insert-below-active"===e.t0?6:"move-to-slot"===e.t0?8:"insert-into-active"===e.t0?10:"hax-select-grid"===e.t0?12:"hax-select-grid-item"===e.t0?14:"hax-edit-element-toggle"===e.t0?16:"hax-source-view-toggle"===e.t0?18:"hax-full-text-editor-toggle"===e.t0?54:"text-tag"===e.t0?71:"text-tag-ul"===e.t0?74:"text-tag-ol"===e.t0?78:"hax-transform-node"===e.t0?82:"hax-plate-create-right"===e.t0?84:"hax-plate-remove-right"===e.t0?86:"hax-plate-duplicate"===e.t0?88:"hax-plate-delete"===e.t0?90:"hax-plate-up"===e.t0?92:"hax-plate-down"===e.t0?94:"content-edit"===e.t0?96:"super-daemon"===e.t0?99:"hide-context-menus"===e.t0?109:111;break;case 4:return this.activeNode&&this.activeNode.previousElementSibling?this.haxInsert("p","",{},this.activeNode.previousElementSibling):this.activeNode?(r=document.createElement("p"),this.activeNode.getAttribute("slot")&&r.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeNode.parentNode.insertBefore(r,this.activeNode)):this.appendChild(p),e.abrupt("break",111);case 6:return this.haxInsert("p","",{}),e.abrupt("break",111);case 8:return a&&this.activeNode&&ye.isGridPlateElement(this.activeNode.parentNode)&&(this.activeNode.slot=a,this.sortGridSlots(this.activeNode.parentNode)),e.abrupt("break",111);case 10:return a&&this.activeNode&&ye.isGridPlateElement(this.activeNode)&&((s=document.createElement("p")).slot=a,this.activeNode.append(s),this.haxInsert("p","",{slot:a},s),s.remove(),this.sortGridSlots()),e.abrupt("break",111);case 12:return i[0]&&i[0].eventData&&(l=i[0].eventData,this.setActiveNode(l,!0),this.positionContextMenus(l)),e.abrupt("break",111);case 14:return i[0]&&i[0].eventData&&(c=i[0].eventData,d=c.target,u=c.slot,h=c.index,v=c.grid,g=c.editMode,f=c.invisible,b=f?v:m(v.children).filter((function(e){return u&&""!==u?e.slot===u:!e.slot||""===e.slot}))[h]||d,v&&g?this.setSlotEditMode(v,g,b):(this.setActiveNode(node,!0),this.positionContextMenus(node))),e.abrupt("break",111);case 16:return i[0]&&i[0].eventData&&(y=i[0].eventData)&&y.target&&y.editMode&&this.toggleElementEditMode(y.target,y.editMode),e.abrupt("break",111);case 18:if(this.activeNode.__haxSourceView){e.next=41;break}if(this.activeNode.__haxSourceView=!0,ye.activeEditingElement=document.createElement("code-editor"),ye.activeEditingElement.language="html",ye.activeEditingElement.title="",ye.activeEditingElement.theme="vs",ye.activeEditingElement.fontSize=12,ye.activeEditingElement.wordWrap=!0,this.viewSourceToggle=!0,n.import("./9b1def34.js").then((function(e){return e.b8})),this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&ye.activeEditingElement.setAttribute("slot",this.activeNode.getAttribute("slot")),this.__ignoreActive=!0,this.activeNode.removeAttribute("contenteditable"),this.__applyDragDropState(this.activeNode,!1),this.activeNode.removeAttribute("data-hax-active"),!ye.testHook(this.activeNode,"preProcessNodeToContent")){e.next=37;break}return e.next=36,ye.runHook(this.activeNode,"preProcessNodeToContent",[this.activeNode]);case 36:ye.activeNode=e.sent;case 37:q(this.activeNode,ye.activeEditingElement),ye.activeEditingElement.focus(),e.next=53;break;case 41:return this.activeNode.__haxSourceView=!1,e.next=44,ye.runHook(ye.activeEditingElement,"activeElementChanged",[this.activeNode,!1]);case 44:if(x=e.sent,A={},this.activeNode&&this.activeNode.tagName?A=ye.haxSchemaFromTag(this.activeNode.tagName.toLowerCase()):this.activeNode.parentElement&&this.activeNode.parentElement.tagName&&(A=ye.haxSchemaFromTag(this.activeNode.parentElement.tagName.toLowerCase())),this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&x.setAttribute("slot",this.activeNode.getAttribute("slot")),A.saveOptions&&A.saveOptions.unsetAttributes&&A.saveOptions.unsetAttributes.length)for(k in A.saveOptions.unsetAttributes)x.removeAttribute(A.saveOptions.unsetAttributes[k]);this.__applyNodeEditableState(x,this.editMode),U(ye.activeEditingElement),ye.activeEditingElement=null,this.viewSourceToggle=!1;case 53:return e.abrupt("break",111);case 54:if(this.activeNode.__haxSourceView){e.next=59;break}this.activeNode.__haxSourceView=!0,n.import("./9b1def34.js").then((function(e){return e.b9})).then((function(){ye.activeEditingElement=document.createElement("rich-text-editor"),ye.activeEditingElement.type="rich-text-editor-toolbar-full",C.activeNode.getAttribute&&null!=C.activeNode.getAttribute("slot")&&ye.activeEditingElement.setAttribute("slot",C.activeNode.getAttribute("slot")),C.__ignoreActive=!0,C.activeNode.removeAttribute("contenteditable"),C.__applyDragDropState(C.activeNode,!1),C.activeNode.removeAttribute("data-hax-active"),q(C.activeNode,ye.activeEditingElement),C.viewSourceElement=ye.activeEditingElement})),e.next=70;break;case 59:return this.activeNode.__haxSourceView=!1,e.next=62,ye.runHook(ye.activeEditingElement,"activeElementChanged",[this.activeNode,!1]);case 62:if(w=e.sent,_=ye.haxSchemaFromTag(this.activeNode.tagName.toLowerCase()),this.activeNode&&this.activeNode.getAttribute&&null!=this.activeNode.getAttribute("slot")&&w.setAttribute("slot",this.activeNode.getAttribute("slot")),_.saveOptions&&_.saveOptions.unsetAttributes&&_.saveOptions.unsetAttributes.length)for(k in _.saveOptions.unsetAttributes)w.removeAttribute(_.saveOptions.unsetAttributes[k]);this.__applyNodeEditableState(w,this.editMode),U(ye.activeEditingElement),ye.activeEditingElement=null,this.viewSourceElement=ye.activeEditingElement;case 70:return e.abrupt("break",111);case 71:return ye.activeNode=this.haxChangeTagName(this.activeNode,o.value),this.positionContextMenus(),e.abrupt("break",111);case 74:return this.contextMenus.text.realSelectedValue="ul",ye.activeNode=this.haxChangeTagName(this.activeNode,"ul"),this.positionContextMenus(),e.abrupt("break",111);case 78:return this.contextMenus.text.realSelectedValue="ol",ye.activeNode=this.haxChangeTagName(this.activeNode,"ol"),this.positionContextMenus(),e.abrupt("break",111);case 82:return this.replaceElementWorkflow(),e.abrupt("break",111);case 84:return this.haxGridPlateOps(),e.abrupt("break",111);case 86:return this.haxGridPlateOps(!1),e.abrupt("break",111);case 88:return this.haxDuplicateNode(this.activeNode),e.abrupt("break",111);case 90:return null!=this.activeNode&&this.haxDeleteNode(this.activeNode),e.abrupt("break",111);case 92:return this.activeNode.previousElementSibling&&"PAGE-BREAK"!==this.activeNode.previousElementSibling.tagName&&this.haxMoveGridPlate(this.activeNode,-1),e.abrupt("break",111);case 94:return this.activeNode.nextElementSibling&&this.haxMoveGridPlate(this.activeNode),e.abrupt("break",111);case 96:return"content-edit"===ye.haxTray.trayDetail&&(ye.haxTray.collapsed=!1),ye.haxTray.trayDetail="content-edit",e.abrupt("break",111);case 99:return S=ye.getRange(),z.mini=!0,z.activeRange=S,z.activeSelection=ye.getSelection(),N=this.activeNode,S.commonAncestorContainer.tagName?N=S.commonAncestorContainer:S.commonAncestorContainer.parentNode&&S.commonAncestorContainer.parentNode.tagName&&(N=S.commonAncestorContainer.parentNode),z.activeNode=N,z.runProgram(N.textContent.trim(),"*"),z.open(),e.abrupt("break",111);case 109:return this.hideContextMenus(),e.abrupt("break",111);case 111:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"_focusIn",value:function(e){this.__mouseDown||this.__focusLogic(e.target)&&(e.stopPropagation(),e.stopImmediatePropagation())}},{key:"__focusLogic",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!1;if(this.editMode&&!this.__tabTrap){var i=e;("SPAN"===i.tagName&&ye.isTextElement(i.parentNode)&&""==i.parentNode.getAttribute("slot")||"LI"===i.tagName&&ye.isTextElement(i.parentNode)&&["UL","OL"].includes(i.parentNode.tagName))&&(i=e.parentNode);var a=null;if(this._validElementTest(i)&&i.parentNode&&i.parentNode.tagName){if("P"===i.parentNode.tagName&&""==i.parentNode.getAttribute("slot"))a=i,o=!0;else{for(;i.parentNode&&i.parentNode.tagName&&"HAX-BODY"!=i.parentNode.tagName;)null===a&&"B"!==i.tagName&&"I"!==i.tagName&&"STRONG"!==i.tagName&&"EM"!==i.tagName&&(a=i),i=i.parentNode;null===a?a=i:ye.isGridPlateElement(i)}(this.activeNode&&this.activeNode.parentNode!==i&&!i.classList.contains("ignore-activation")||i.haxUIElement||i.classList.contains("ignore-activation"))&&(o=!0),a.haxUIElement||a.classList.contains("ignore-activation")||(ye.activeNode=a,setTimeout((function(){if(n&&!t.__mouseDown&&ye.isTextElement(a))try{var e=document.createRange(),o=ye.getSelection();e.setStart(t.activeNode,0),e.collapse(!0),o.removeAllRanges(),o.addRange(e),t.activeNode.focus()}catch(e){console.warn(e)}t.positionContextMenus(a)}),0),o=!0)}}else this.__tabTrap=!1;return o}},{key:"scrollHere",value:function(e){setTimeout((function(){e.scrollIntoView({behavior:"smooth",inline:"nearest",block:"end"})}),100)}},{key:"undo",value:function(){var e=this;l(c(t.prototype),"undo",this).call(this),setTimeout((function(){var t=e.querySelector("[data-hax-active]");t?(e.__focusLogic(t),e.scrollHere(t)):e.hideContextMenus()}),0)}},{key:"redo",value:function(){var e=this;l(c(t.prototype),"redo",this).call(this),setTimeout((function(){var t=e.querySelector("[data-hax-active]");t?(e.__focusLogic(t),e.scrollHere(t)):e.hideContextMenus()}),0)}},{key:"_editModeChanged",value:(f=w(E().mark((function e(t,n){var o,i,a,r,s,l,c=this;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!==R(n)){if(this._applyContentEditable(t),t){if(this.children&&this.children[0]&&this.children[0].focus&&this.children[0].tagName)"PAGE-BREAK"===this.children[0].tagName&&this.children[1]&&this.children[1].focus?this.__focusLogic(this.children[1]):"PAGE-BREAK"===this.children[0].tagName?this.haxInsert("p","",{}):this.__focusLogic(this.children[0]);else{this.haxInsert("p","",{});try{o=document.createRange(),i=ye.getSelection(),o.setStart(this.activeNode,0),o.collapse(!0),i.removeAllRanges(),i.addRange(o),this.activeNode.focus()}catch(e){console.warn(e)}}this._haxContextOperation({detail:{eventName:"content-edit",value:!0}})}else this.activeNode&&(this.unsetSlotEditMode(this.activeNode),this.unsetElementEditMode(this.activeNode));setTimeout((function(){c.undoStack.undoStackLimit=50,c.undoStack.undoStackPosition=-1,c.undoStack.commands=[],c.undoStack.changed(),c.undoStackInitialValue=c.innerHTML,c.undoStackPrevValue=c.undoStackInitialValue}),0)}if(0==t)for(U(ye.activeEditingElement),ye.activeEditingElement=null,this.removeAttribute("contenteditable"),this.hideContextMenus(),a=this.querySelectorAll("[contenteditable],[data-hax-active]"),r=0;r\n ',"\n
\n "])),this.fieldId,this.listFocus?"focus":"",this.itemsList.join(),this.filteredOptions.map((function(e){return e.value})).join(),this.isListboxHidden,this.id,this._onListboxMouseout,this._onListboxMouseover,this.listboxInnerTemplate)}},{key:"listboxInnerTemplate",get:function(){var e=this;return(this.filteredOptions||[]).map((function(t){return e.getListItem(t)}))}},{key:"isListboxHidden",get:function(){return this.hidden||!this.expanded||this.filteredOptions.length<1}},{key:"getListItem",value:function(e){var t=this;return a(ft||(ft=r(['\n