diff --git a/docs/assets/spirit-web-chunk.19182ae9.js b/docs/assets/spirit-web-chunk.19182ae9.js deleted file mode 100644 index 06f2ee52be..0000000000 --- a/docs/assets/spirit-web-chunk.19182ae9.js +++ /dev/null @@ -1 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();const j=new Map,Nt={set(e,t,i){j.has(e)||j.set(e,new Map);const s=j.get(e);if(!s.has(t)&&s.size!==0){console.error(`Spirit do not allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(t,i)},get(e,t){return j.has(e)&&j.get(e).get(t)||null},remove(e,t){if(!j.has(e))return;const i=j.get(e);i.delete(t),i.size===0&&j.delete(e)}},Ze=(e,t,i)=>{e&&e.addEventListener(t,i,{passive:!1})},Xe=(e,t,i)=>e.removeEventListener(t,i),g={on(e,t,i){Ze(e,t,i)},off(e,t,i){Xe(e,t,i)},trigger(e,t,i){if(typeof t!="string"||!e)return null;const s=!0,n=new Event(t,{bubbles:s,cancelable:!0});if(typeof i<"u")for(const o of Object.keys(i))Object.defineProperty(n,o,{get(){return i[o]}});return e.dispatchEvent(n),n}},x={findAll(e,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e,t=document.documentElement){return Element.prototype.querySelector.call(t,e)}},pt=e=>!e||typeof e!="object"?!1:typeof e.nodeType<"u",mt=e=>pt(e)?e:typeof e=="string"&&e.length>0?document.querySelector(e):null,Je=(e,t="target")=>{var n;const i=e,s=(n=i==null?void 0:i.dataset)!=null&&n.spiritTarget?mt(e.dataset.spiritTarget):null;return t==="target"?s:i},ti=e=>e==null?void 0:e.getAttribute("data-spirit-target"),Dt=e=>{const t=ti(e);return t?document.querySelector(t):null},Oe="data-spirit-toggle",ei="data-spirit-dismiss",Le=(e,t,i,s,n="target")=>{g.on(e,"click",function(){const r=Je(mt(this),n);t.getOrCreateInstance(r)[i](r,s)})},ii=(e,t)=>{t.getOrCreateInstance(e)},Wt=(e,t,i,s="toggle",n="target")=>{const o=t.NAME;g.on(window,"DOMContentLoaded",r=>{x.findAll(`[${e}="${o}"]`).forEach(l=>{i(l,t,s,r,n)})})},lt=(e,t="toggle",i="target")=>{Wt(Oe,e,Le,t,i)},Ne=(e,t="dismiss",i="target")=>{Wt(ei,e,Le,t,i)},Tt=(e,t="toggle")=>{Wt(Oe,e,ii,t)},si=(e,t)=>!t.composedPath().includes(e);function Zt(e){if(e==="true")return!0;if(e==="false")return!1;if(e===Number(e).toString())return Number(e);if(e===""||e==="null")return null;if(typeof e!="string")return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function Rt(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const Xt={setDataAttribute(e,t,i){e.setAttribute(`data-spirit-${Rt(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-spirit-${Rt(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(s=>s.startsWith("spirit")&&!s.startsWith("spiritConfig"));for(const s of i){let n=s.replace(/^spirit/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=Zt(e.dataset[s])}return t},getDataAttribute(e,t){return Zt(e.getAttribute(`data-spirit-${Rt(t)}`))}},ni=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase();class oi{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}getConfig(t){const i=this.mergeConfigObj(t);return this.typeCheckConfig(i),i}mergeConfigObj(t,i){const s=pt(i)?Xt.getDataAttribute(i,"config"):{};return{...this.constructor.Default,...typeof s=="object"?s:{},...pt(i)?Xt.getDataAttributes(i):{},...typeof t=="object"?t:{}}}typeCheckConfig(t,i=this.constructor.DefaultType){for(const[s,n]of Object.entries(i)){const o=t==null?void 0:t[s],r=pt(o)?"element":ni(o);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${r}" but expected type "${n}".`)}}}const Jt=(e,t)=>{let i,s=!1;return n=>{s||(s=!0,i&&clearTimeout(i),i=setTimeout(()=>{e(n),s=!1},t))}},ri=(e,t,i)=>{const s=new FileReader;s.onload=n=>{const o=new Image;o.onload=()=>{const r=document.createElement("canvas"),l=r.getContext("2d");r.width=t,r.height=o.height/o.width*t,l==null||l.drawImage(o,0,0,r.width,r.height);const a=r.toDataURL("image/jpeg",.8);i(a)},n.target&&n.target.result&&(o.src=n.target.result.toString())},s.readAsDataURL(e)},li=e=>{g.trigger(e,"transitionend")},ai=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const s=Number.parseFloat(t),n=Number.parseFloat(i);return!s&&!n?0:([t]=t.split(","),[i]=i.split(","),(Number.parseFloat(t)+Number.parseFloat(i))*1e3)},te=(e,t=[],i=e)=>typeof e=="function"?e(...t):i,gt=(e,t,i=!0)=>{if(!i){te(t);return}const s=5,n=ai(e)+s;let o=!1;const r=l=>{l.target===e&&(o=!0,e.removeEventListener("transitionend",r),te(t))};e.addEventListener("transitionend",r),setTimeout(()=>{o||li(e)},n)},ci="dialog[open]",_t="is-scrolling-disabled";class De{constructor(t,i,s){this.target=t,this.element=i||document.body,this.selector=s||ci,this.offsetY=0}disableScroll(){if(this.element.classList.contains(_t))return;const i=(this.element.tagName==="BODY"?window.innerWidth:this.element.offsetWidth)-this.element.clientWidth;this.element.style.paddingRight=`${i}px`,this.element.classList.add(_t)}enableScroll(){const t=x.findAll(this.selector);this.target&&t.length===0&>(this.target,()=>{this.element.style.paddingRight="",this.element.classList.remove(_t)})}}class Q extends oi{constructor(t,i){super(),this.element=mt(t),this.NAME="",this.config=this.getConfig(i),Nt.set(this.element,this.constructor.INSTANCE_KEY,this)}dispose(){Nt.remove(this.element,this.constructor.INSTANCE_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}getConfig(t){const i=this.mergeConfigObj(t,this.element);return this.typeCheckConfig(i),i}static get NAME(){return""}static getInstance(t){return Nt.get(mt(t),this.INSTANCE_KEY)}static getOrCreateInstance(t,i={}){return this.getInstance(t)||this.createInstance(t,i)}static createInstance(t,i){return new this(t,typeof i=="object"?i:null)}static get INSTANCE_KEY(){return`spirit.${this.NAME}`}static get DATA_KEY(){return`${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const hi="autoResize",ui="resize",Mt=400;class fi extends Q{constructor(t,i){super(t,i),this.adjustHeight=()=>{const s=parseFloat(getComputedStyle(this.input).getPropertyValue("border-top-width"))||0,n=parseFloat(getComputedStyle(this.input).getPropertyValue("border-bottom-width"))||0,o=s+n;this.input.style.height="auto",this.input.style.overflow="auto";const r=this.input.scrollHeight+o;this.input.style.height=`${r{n.setAttribute(di,this.meta.id),n.setAttribute($t,String(t)),this.meta.hideOnCollapse&&t&&(n.remove(),this.appendNodeToParent(),this.onDestroy())};this.state.open=t,i.length===1?s(this.element):i.map(n=>s(n))}updateCollapsibleElement(t=this.state.open){var i;this.target&&(t||this.adjustCollapsibleChildrenHeight(),this.adjustCollapsibleElementHeight(t),this.state.init&&((i=this.target)==null||i.classList.add(ee)),gt(this.target,()=>{var s,n,o,r;(s=this.target)==null||s.classList.remove(ee),(n=this.target)==null||n.classList.toggle(gi,t),t?(o=this.target)==null||o.setAttribute("style","height: 100%"):(r=this.target)==null||r.style.removeProperty("height")}))}show(){this.hideParentSiblings(this.element),g.trigger(this.target,Ai),this.updateTriggerElement(!0),this.updateCollapsibleElement(!0),this.target&>(this.target,()=>{g.trigger(this.target,ne)})}hide(){g.trigger(this.target,Ei),this.updateTriggerElement(!1),this.updateCollapsibleElement(!1),this.target&>(this.target,()=>{g.trigger(this.target,se)})}toggle(){this.state.open?this.hide():this.show()}initEvents(){const t=x.findAll(`[${Pt}="${this.meta.id}"]`);t.length===1?g.on(this.element,"click",()=>this.toggle()):t.forEach(i=>g.on(i,"click",()=>this.toggle()))}destroyEvents(){const t=x.findAll(`[${Pt}="${this.meta.id}"]`);t.length===1?g.off(this.element,"click",()=>this.toggle()):t.forEach(i=>g.off(i,"click",()=>this.toggle()))}onDestroy(){this.destroyEvents()}init(){this.updateTriggerElement(),this.updateCollapsibleElement(),this.initEvents(),this.state.init=!0}}Tt(zt);const Re="dropdown",wi=`${Re}`,bt=`.${wi}`,Ti=`hide${bt}`,yi=`hidden${bt}`,bi=`show${bt}`,xi=`shown${bt}`,Si="aria-expanded",vi="aria-controls",Ci="DropdownWrapper",Oi="is-expanded",Li="is-open";class Ni extends Q{constructor(t,i){super(t,i),this.autoCloseHandler=s=>{const n=this.target&&si(this.target,s);s.target&&n&&this.hide()},this.target=x.findOne(`${this.element.dataset.spiritTarget}`),this.reference=this.findReferenceElement(),this.state={open:!1},this.options={autoClose:!0}}static get NAME(){return Re}getOptions(){var n;const t={...this.options},i=(n=this.element)==null?void 0:n.dataset,s=i==null?void 0:i.spiritAutoclose;return s&&(t.autoClose=!s),t}findReferenceElement(){let t=this.element;const{reference:i}=this.element.dataset;return i&&(i==="parent"&&this.element.parentElement&&this.element.parentElement.classList.contains(Ci)?t=this.element.parentElement:i.match(/(#)/g)&&(t=x.findOne(i))),t}updateTriggerElement(t=this.state.open){this.element.classList.toggle(Oi,t),this.element.setAttribute(Si,t),this.element.setAttribute(vi,this.element.dataset.spiritTarget)}updateTargetElement(t=this.state.open){var i;(i=this.target)==null||i.classList.toggle(Li,t)}show(){this.state.open=!0,this.target&&g.trigger(this.target,bi),this.updateTriggerElement(),this.updateTargetElement(),setTimeout(()=>{this.target&&g.trigger(this.target,xi),this.getOptions().autoClose&&g.on(document,"click",this.autoCloseHandler)},0)}hide(){this.state.open=!1,this.target&&g.trigger(this.target,Ti),this.updateTriggerElement(),this.updateTargetElement(),g.off(document,"click",this.autoCloseHandler),setTimeout(()=>{this.target&&g.trigger(this.target,yi)},0)}toggle(){this.state.open?this.hide():this.show()}}lt(Ni,"toggle","trigger");const _e="fileUploader",ct=`.${_e}`,Di=`queueFile${ct}`,Ri=`queuedFile${ct}`,_i=`unqueueFile${ct}`,Mi=`unqueuedFile${ct}`,It=`error${ct}`,$i="has-drag-and-drop",oe="is-dragging",Pi="d-none",Ii="is-disabled",re="has-danger",Fi='[data-spirit-element="wrapper"]',Vi='[data-spirit-element="input"]',Hi='[data-spirit-element="list"]',ki='[data-spirit-element="dropZone"]',Bi='[data-spirit-snippet="item"]',et="data-spirit-populate-field",le='[data-spirit-element="attachment-image"]',ae="data-spirit-dismiss",Me="validation_text",ce=`[data-spirit-element="${Me}"]`,Wi=1e7,zi=10,ut={errorMaxFileSize:"The file size limit has been exceeded",errorFileDuplicity:"This file already exists in the queue",errorMaxUploadedFiles:"You have exceeded the number of files allowed in the queue",errorFileNotSupported:"is not a supported file. Please ensure you are uploading a supported file format."},Ui=54,Qi=500,$e=class it extends Q{constructor(t,i){var s,n,o,r,l,a,h,d,c,f;super(t,i),this.wrapper=x.findOne(Fi,t),this.inputElement=x.findOne(Vi,t),this.listElement=x.findOne(Hi,t),this.dropZone=x.findOne(ki,t),this.isDragAndDropSupported="draggable"in document.createElement("span"),this.fileSizeLimit=(s=this.wrapper)!=null&&s.dataset.spiritMaxFileSize?Number((n=this.wrapper)==null?void 0:n.dataset.spiritMaxFileSize):Wi,this.fileQueueLimit=(o=this.wrapper)!=null&&o.dataset.spiritFileQueueLimit?Number((r=this.wrapper)==null?void 0:r.dataset.spiritFileQueueLimit):zi,this.queueLimitBehavior=(l=this.wrapper)!=null&&l.dataset.spiritQueueLimitBehavior?(a=this.wrapper)==null?void 0:a.dataset.spiritQueueLimitBehavior:"none",this.errors={},this.errors.errorMaxFileSize=this.element.dataset.spiritMessageMaxfilesize??ut.errorMaxFileSize,this.errors.errorFileDuplicity=this.element.dataset.spiritMessageDuplicity??ut.errorFileDuplicity,this.errors.errorMaxUploadedFiles=this.element.dataset.spiritMessageMaxuploadedfiles??ut.errorMaxUploadedFiles,this.errors.errorFileNotSupported=this.element.dataset.spiritMessageUnsupported??ut.errorFileNotSupported,this.inputName=((h=this.inputElement)==null?void 0:h.name)||"attachment",this.isMultiple=(d=this.inputElement)==null?void 0:d.multiple,this.accept=(c=this.inputElement)==null?void 0:c.accept,this.isDragging=!1,this.fileQueue=new Map,this.instanceUid=it.getUid(),this.isDisabled=((f=this.inputElement)==null?void 0:f.disabled)||!1,this.init()}static get NAME(){return _e}get getFileQueue(){return this.fileQueue}clearFileQueue(){var t;for(this.fileQueue.clear();(t=this.listElement)!=null&&t.firstChild;)this.listElement.removeChild(this.listElement.firstChild)}static getUid(){return Math.random().toString(36).slice(-6)}getUpdatedFileName(t){return`file_${this.instanceUid}_${t.replace(/[^a-zA-Z0-9]/g,"")}`}dragReset(){var t;this.isDragging=!1,(t=this.wrapper)==null||t.classList.remove(oe)}checkAllowedFileSize(t){if(t.size>this.fileSizeLimit)throw new Error(`${t.name}: ${this.errors.errorMaxFileSize}`)}checkFileQueueDuplicity(t){if(this.fileQueue.has(this.getUpdatedFileName(t.name)))throw new Error(`${t.name}: ${this.errors.errorFileDuplicity}`)}checkQueueLimit(){if(this.fileQueue.size>=this.fileQueueLimit)throw new Error(this.errors.errorMaxUploadedFiles)}checkAllowedFileType(t){var r,l;const i=(r=t.name.split(".").pop())==null?void 0:r.toLowerCase(),s=t.type;let n;if(!!(this.accept===""||this.accept==="*"||this.accept==="*/*"))n=!0;else{const a=(l=this.accept)==null?void 0:l.replace(/ /g,"").split(","),h=a==null?void 0:a.filter(c=>c.match(/\./g)),d=a==null?void 0:a.filter(c=>c.match(/\//g));h==null||h.forEach(c=>{const f=c.replace(".","").replace("*","");i.match(f)&&(n=!0)}),d==null||d.forEach(c=>{const f=c.replace("*","");s.match(f)&&(n=!0)})}if(!n)throw new Error(`${t.name}: ${this.errors.errorFileNotSupported}`)}updateNameAttribute(){var t,i;this.fileQueue.size>0?(t=this.inputElement)==null||t.removeAttribute("name"):(i=this.inputElement)==null||i.setAttribute("name",this.inputName)}updateDropZoneVisibility(){if(this.queueLimitBehavior==="none")return;const t=this.queueLimitBehavior==="hide"?Pi:Ii;setTimeout(()=>{var i;(i=this.wrapper)==null||i.classList.toggle(t,this.fileQueue.size===this.fileQueueLimit),this.inputElement.disabled=this.fileQueue.size===this.fileQueueLimit},0)}createAttachmentElement(){const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("name",`${this.inputName}[]`),t.setAttribute("hidden",""),t}static createValidationTextElement(){const t=document.createElement("ul");return t.dataset.spiritElement=Me,t}static isValidationTextInElement(t,i){const s=i.getElementsByTagName("li");return!!Array.from(s).filter(o=>{var r;return(r=o.textContent)==null?void 0:r.includes(t)}).length}getValidationTextElement(t){const i=document.createElement("li");i.appendChild(document.createTextNode(t));let s=x.findOne(ce,this.wrapper);return s||(s=it.createValidationTextElement()),!it.isValidationTextInElement(t,s)&&s.appendChild(i),s}getAttachmentElement(t,i){var p,m;const s=x.findOne(Bi,this.element),n=s==null?void 0:s.content.cloneNode(!0);if(!n)return null;const o=new DataTransfer;o.items.add(t);const r=this.createAttachmentElement();r.files=o.files;const l=n.querySelector(`[${et}="item"]`),a=n.querySelector(`[${et}="name"]`),h=n.querySelector(`[${et}="button"]`),d=!!((p=l==null?void 0:l.dataset)!=null&&p.spiritImagepreview),c=l==null?void 0:l.querySelector("svg"),f=l==null?void 0:l.querySelector(le),u=t.type.includes("image");return d&&u?(c==null||c.remove(),(m=f==null?void 0:f.querySelector("img"))==null||m.setAttribute("alt",t.name),ri(t,Qi,A=>{var E;return(E=f==null?void 0:f.querySelector("img"))==null?void 0:E.setAttribute("src",A)})):f==null||f.remove(),l.appendChild(r),l.setAttribute("id",i),a.appendChild(document.createTextNode(t.name)),h.setAttribute(ae,i),l.removeAttribute(et),a.removeAttribute(et),h.removeAttribute(et),n.children.item(0)}createAttachmentEvents(t){const i=x.findOne(`[${ae}="${t}"]`);i&&g.on(i,"click",s=>{var o,r;s.preventDefault();const n=(r=(o=s.target)==null?void 0:o.dataset)==null?void 0:r.spiritDismiss;n&&this.removeFromQueue(n)})}appendToList(t,i){if(!this.listElement)return;this.isMultiple||this.clearFileQueue();const s=this.getUpdatedFileName(t.name),n=this.getAttachmentElement(t,s);if(!n)return;const o={file:t};i&&(o.meta=i),this.fileQueue.set(s,o),this.listElement.appendChild(n),this.createAttachmentEvents(s),this.dragReset()}addToQueue(t,i,s){try{g.trigger(this.wrapper,Di,{fileQueue:this.fileQueue,currentFile:t}),this.checkAllowedFileType(t),this.checkAllowedFileSize(t),this.checkFileQueueDuplicity(t),this.checkQueueLimit(),this.appendToList(t,i),this.updateDropZoneVisibility(),this.updateNameAttribute(),s&&s(this.getUpdatedFileName(t.name),t,i),g.trigger(this.wrapper,Ri,{fileQueue:this.fileQueue,currentFile:t})}catch(n){g.trigger(this.wrapper,It,{validationText:n.message})}}updateQueue(t,i,s,n){if(this.fileQueue.has(t)){const o={file:i};s&&(o.meta=s),this.fileQueue.set(t,o);const r=x.findOne(`#${t} ${le} img`);if(s&&r&&it.isCoordsInMeta(s)){const l=Ui,a=parseInt(s.cropWidth,10),h=parseInt(s.cropHeight,10);let d;h>a?d=l/a:d=l/h;const c=Math.round(parseInt(s.x,10)*d),f=Math.round(parseInt(s.y,10)*d),u=Math.round(parseInt(s.originalWidth,10)*d),p=Math.round(parseInt(s.originalHeight,10)*d);r==null||r.style.setProperty("--file-uploader-attachment-image-top",`-${f}px`),r==null||r.style.setProperty("--file-uploader-attachment-image-left",`-${c}px`),r==null||r.style.setProperty("--file-uploader-attachment-image-width",`${u}px`),r==null||r.style.setProperty("--file-uploader-attachment-image-height",`${p}px`)}n&&n(t,i,s)}}removeFromQueue(t,i){if(this.fileQueue.has(t)){g.trigger(this.wrapper,_i,{fileQueue:this.fileQueue,currentFile:t});const s=x.findOne(`#${t}`);this.fileQueue.delete(t),s==null||s.remove(),this.updateDropZoneVisibility(),this.updateNameAttribute(),this.removeValidationWError(),i&&i(t),g.trigger(this.wrapper,Mi,{fileQueue:this.fileQueue,currentFile:t})}}getFileFromQueue(t){return this.fileQueue.get(t)}onChange(t,i){const{target:s}=t,n=s.files?[...s.files]:[];let o=0,r;o+=this.fileQueue.size,n.forEach(l=>{o{s.value="",s.blur()},0)}static onDragOver(t){t.preventDefault()}onDragEnter(){var t;this.isDragging=!0,(t=this.wrapper)==null||t.classList.add(oe)}onDragLeave(){this.dragReset()}onDrop(t){var n,o,r;if(t.preventDefault(),this.isDisabled)return;const i=Array.from(((n=t==null?void 0:t.dataTransfer)==null?void 0:n.items)||[]),s=Array.from(((o=t==null?void 0:t.dataTransfer)==null?void 0:o.files)||[]);!this.isMultiple&&(i.length>1||s.length>1),(r=t==null?void 0:t.dataTransfer)!=null&&r.items?i.forEach(l=>{if(l.kind==="file"){const a=l.getAsFile();a&&this.addToQueue(a)}}):s.forEach(l=>{this.addToQueue(l)})}removeValidationWError(){var t;(t=x.findOne(ce,this.wrapper))==null||t.remove(),this.wrapper.classList.remove(re)}onClick(){this.removeValidationWError()}onValidationError(t){this.wrapper.classList.add(re),this.wrapper.append(this.getValidationTextElement(t.validationText))}addEventListeners(){g.on(this.inputElement,"click",this.onClick.bind(this)),g.on(this.inputElement,"change",this.onChange.bind(this)),g.on(this.wrapper,It,this.onValidationError.bind(this)),this.isDragAndDropSupported&&this.dropZone&&(g.on(this.dropZone,"dragover",it.onDragOver.bind(this)),g.on(this.dropZone,"dragenter",this.onDragEnter.bind(this)),g.on(this.dropZone,"dragleave",this.onDragLeave.bind(this)),g.on(this.dropZone,"drop",this.onDrop.bind(this)))}init(){var t;this.addEventListeners(),this.isDragAndDropSupported&&((t=this.wrapper)==null||t.classList.add($i))}};$e.isCoordsInMeta=e=>["x","y","cropWidth","cropHeight","originalWidth","originalHeight"].every(t=>e[t]!=null);let Yi=$e;Tt(Yi);const Ki="modal",he='[data-spirit-toggle="modal"]';class ji extends Q{constructor(t,i){super(t,i),this.isShown=!1,this.isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0,this.scrollControl=new De(t)}static get NAME(){return Ki}onClick(t){(t.target===this.element||t.target.dataset.spiritDismiss)&&(t.preventDefault(),t.stopPropagation(),(!t.target.dataset.spiritCloseOnBackdropClick||t.target.dataset.spiritCloseOnBackdropClick==="true")&&this.hide(t))}onDialogClose(t){t.defaultPrevented||(this.hide(t),t.preventDefault())}addEventListeners(){g.on(this.element,"close",t=>this.onDialogClose(t)),this.isTouchDevice?g.on(window,"touchstart",t=>this.onClick(t)):g.on(window,"click",t=>this.onClick(t))}removeEventListeners(){g.off(this.element,"close",t=>this.onDialogClose(t)),this.isTouchDevice?g.off(window,"touchstart",t=>this.onClick(t)):g.off(window,"click",t=>this.onClick(t))}show(){var i;if(this.isShown)return;const t=x.findOne(he,this.element);t==null||t.setAttribute("aria-expanded","true"),(i=this.element)==null||i.showModal(),this.addEventListeners(),this.isShown=!0,this.scrollControl.disableScroll()}hide(t){var n;let i;(n=t==null?void 0:t.target)!=null&&n.dataset?t.target.dataset.spiritTarget?i=x.findOne(t.target.dataset.spiritTarget):i=t.target:i=this.element;const s=x.findOne(he,this.element);typeof i.close=="function"&&i.close(),s==null||s.setAttribute("aria-expanded","false"),this.removeEventListeners(),this.isShown=!1,this.scrollControl.enableScroll()}toggle(t,i){t&&(this.isShown?this.hide(i):this.show())}}lt(ji);const Gi=0,qi="768px",Zi="1280px",Xi={mobile:Gi,tablet:qi,desktop:Zi},Ji="offcanvas",ts="offcanvas",xt=`.${ts}`,es=`show${xt}`,is=`shown${xt}`,ss=`hide${xt}`,ns=`hidden${xt}`,os=parseInt(Xi.desktop,10),ue="is-open",rs="--spirit-breakpoint-desktop",ls={breakpointDesktop:os},as={breakpointDesktop:"number"};class Pe extends Q{constructor(t,i){const s=t;super(s,i),this.isShown=!1,this.scrollControl=new De(t),this.breakpoint=this.getBreakpoint()}static get Default(){return ls}static get DefaultType(){return as}static get NAME(){return Ji}getBreakpoint(){var t;return parseInt(getComputedStyle(document.documentElement).getPropertyValue(rs),10)||((t=this.config)==null?void 0:t.breakpointDesktop)}onClick(t){(t.target===this.element||t.target.dataset.spiritDismiss)&&(t.preventDefault(),t.stopPropagation(),this.hide())}onWindowResize(t){t.target.innerWidth>=this.breakpoint&&this.hide()}onDialogClose(t){t.defaultPrevented||(this.hide(),t.preventDefault())}addEventListeners(){g.on(this.element,"close",t=>this.onDialogClose(t)),g.on(window,"resize",t=>this.onWindowResize(t)),g.on(window,"click",t=>this.onClick(t))}removeEventListeners(){g.off(this.element,"close",t=>this.onDialogClose(t)),g.off(window,"resize",t=>this.onWindowResize(t)),g.off(window,"click",t=>this.onClick(t))}show(t){if(this.isShown)return;const i=g.trigger(this.element,es,{relatedTarget:t});i!=null&&i.defaultPrevented||(this.element.classList.add(ue),this.element.showModal(),t.setAttribute("aria-expanded","true"),this.element.setAttribute("aria-modal","true"),this.element.setAttribute("role","dialog"),this.addEventListeners(),this.isShown=!0,g.trigger(this.element,is,{relatedTarget:t}),this.scrollControl.disableScroll())}hide(){if(!this.isShown)return;const t=g.trigger(this.element,ss);t!=null&&t.defaultPrevented||(this.element.classList.remove(ue),this.element.close(),this.element.removeAttribute("aria-modal"),this.element.removeAttribute("role"),this.removeEventListeners(),this.isShown=!1,g.trigger(this.element,ns),this.scrollControl.enableScroll())}toggle(t){t&&(this.isShown?this.hide():this.show(t))}}lt(Pe);Ne(Pe,"hide");const cs="password",fe="aria-pressed",de="aria-label",pe="input";class hs extends Q{constructor(t,i){super(t,i),this.isShown=!1}static get NAME(){return cs}show(t){var i;t.setAttribute(fe,"true"),t.setAttribute(de,"Hide password"),(i=x.findOne(pe,t.parentElement))==null||i.setAttribute("type","text"),this.isShown=!0}hide(t){var i;t.setAttribute(fe,"false"),t.setAttribute(de,"Show password"),(i=x.findOne(pe,t.parentElement))==null||i.setAttribute("type","password"),this.isShown=!1}toggle(t){this.isShown?this.hide(t):this.show(t)}}lt(hs,"toggle","trigger");const ft={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},kt={HORIZONTAL:"horizontal",VERTICAL:"vertical"},us="scrollView",ge=50,fs=kt.VERTICAL,ds='[data-spirit-element="viewport"]',ps='[data-spirit-element="content"]',me="is-scrolled-at-start",Ee="is-scrolled-at-end",gs="resize",ms="scroll",Ae=1;class Es extends Q{constructor(t,i){var s;super(t,i),this.getElementsPositionDifference=()=>{const n=this.content.getBoundingClientRect(),o=this.viewport.getBoundingClientRect();return{bottom:n.bottom-o.bottom,left:n.left-o.left,right:n.right-o.right,top:n.top-o.top}},this.handleScrollViewState=()=>{this.currentPosition=this.getElementsPositionDifference();const n=this.currentPosition[this.scrollPositionStart]<=-1*Ae,o=this.currentPosition[this.scrollPositionEnd]>=Ae;n!==this.isScrolledAtStart&&(this.isScrolledAtStart=n),o!==this.isScrolledAtEnd&&(this.isScrolledAtEnd=o),n?this.element.classList.add(me):this.element.classList.remove(me),o?this.element.classList.add(Ee):this.element.classList.remove(Ee)},this.currentPosition={bottom:0,left:0,right:0,top:0},this.direction=(s=this.element.dataset)!=null&&s.spiritDirection?String(this.element.dataset.spiritDirection):fs,this.content=x.findOne(ps,this.element),this.viewport=x.findOne(ds,this.element),this.scrollPositionStart=this.direction===kt.HORIZONTAL?ft.LEFT:ft.TOP,this.scrollPositionEnd=this.direction===kt.HORIZONTAL?ft.RIGHT:ft.BOTTOM,this.isScrolledAtStart=!1,this.isScrolledAtEnd=!1,this.init()}static get NAME(){return us}static get DATA_KEY(){return`${this.NAME}`}addEventListeners(){g.on(this.viewport,ms,Jt(this.handleScrollViewState,ge)),g.on(window,gs,Jt(this.handleScrollViewState,ge))}init(){this.addEventListeners(),this.handleScrollViewState()}}Tt(Es);const Ie="tabs",As="tabs",St=`.${As}`,ws=`hide${St}`,Ts=`hidden${St}`,ys=`show${St}`,bs=`shown${St}`,Ft="is-selected",xs='[role="tablist"]',Ss='[role="presentation"]',vs='[role="tab"]',Cs=`[data-spirit-toggle="${Ie}"]`,Vt=`${vs}, ${Cs}`;class R extends Q{constructor(t,i){super(t,i),this.parent=this.element.closest(xs),this.parent&&R.setInitialAttributes(this.parent,this.getChildren())}static get NAME(){return Ie}show(){const t=this.element;if(R.isElementActive(t))return;const i=this.getActiveElem(),s=i?g.trigger(i,ws,{relatedTarget:t}):null;g.trigger(t,ys,{relatedTarget:i}).defaultPrevented||s&&s.defaultPrevented||(this.deactivate(i,t),this.activate(t,i))}activate(t,i){t&&(t.classList.add(Ft),this.activate(Dt(t)),t.removeAttribute("tabindex"),t.setAttribute("aria-selected","true"),g.trigger(t,bs,{relatedTarget:i}))}deactivate(t,i){t&&(t.classList.remove(Ft),this.deactivate(Dt(t)),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1"),g.trigger(t,Ts,{relatedTarget:i}))}getChildren(){return x.findAll(Vt,this.parent)}getActiveElem(){return this.getChildren().find(t=>R.isElementActive(t))||null}static setInitialAttributes(t,i){R.setAttributeIfNotExists(t,"role","tablist");for(const s of i)R.setInitialAttributesOnChild(s)}static setInitialAttributesOnChild(t){const i=R.getInnerElement(t),s=R.isElementActive(i),n=R.getOuterElement(i);i==null||i.setAttribute("aria-selected",s.toString()),n!==i&&R.setAttributeIfNotExists(n,"role","presentation"),i&&!s&&i.setAttribute("tabindex","-1"),R.setAttributeIfNotExists(i,"role","tab"),R.setInitialAttributesOnTargetPanel(i)}static setInitialAttributesOnTargetPanel(t){const i=Dt(t);i&&(R.setAttributeIfNotExists(i,"role","tabpanel"),t!=null&&t.id&&R.setAttributeIfNotExists(i,"aria-labelledby",`#${t.id}`))}static setAttributeIfNotExists(t,i,s){t&&!t.hasAttribute(i)&&t.setAttribute(i,s)}static isElementActive(t){return t!==null&&t.classList.contains(Ft)}static getInnerElement(t){return t!=null&&t.matches(Vt)?t:x.findOne(Vt,t)}static getOuterElement(t){return(t==null?void 0:t.closest(Ss))||t}}lt(R,"show","trigger");const Fe=["top","right","bottom","left"],we=["start","end"],Te=Fe.reduce((e,t)=>e.concat(t,t+"-"+we[0],t+"-"+we[1]),[]),W=Math.min,N=Math.max,Et=Math.round,dt=Math.floor,G=e=>({x:e,y:e}),Os={left:"right",right:"left",bottom:"top",top:"bottom"},Ls={start:"end",end:"start"};function Bt(e,t,i){return N(e,W(t,i))}function z(e,t){return typeof e=="function"?e(t):e}function F(e){return e.split("-")[0]}function B(e){return e.split("-")[1]}function Ut(e){return e==="x"?"y":"x"}function Qt(e){return e==="y"?"height":"width"}function tt(e){return["top","bottom"].includes(F(e))?"y":"x"}function Yt(e){return Ut(tt(e))}function Ve(e,t,i){i===void 0&&(i=!1);const s=B(e),n=Yt(e),o=Qt(n);let r=n==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=wt(r)),[r,wt(r)]}function Ns(e){const t=wt(e);return[At(e),t,At(t)]}function At(e){return e.replace(/start|end/g,t=>Ls[t])}function Ds(e,t,i){const s=["left","right"],n=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?n:s:t?s:n;case"left":case"right":return t?o:r;default:return[]}}function Rs(e,t,i,s){const n=B(e);let o=Ds(F(e),i==="start",s);return n&&(o=o.map(r=>r+"-"+n),t&&(o=o.concat(o.map(At)))),o}function wt(e){return e.replace(/left|right|bottom|top/g,t=>Os[t])}function _s(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?_s(e):{top:e,right:e,bottom:e,left:e}}function nt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ye(e,t,i){let{reference:s,floating:n}=e;const o=tt(t),r=Yt(t),l=Qt(r),a=F(t),h=o==="y",d=s.x+s.width/2-n.width/2,c=s.y+s.height/2-n.height/2,f=s[l]/2-n[l]/2;let u;switch(a){case"top":u={x:d,y:s.y-n.height};break;case"bottom":u={x:d,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:c};break;case"left":u={x:s.x-n.width,y:c};break;default:u={x:s.x,y:s.y}}switch(B(t)){case"start":u[r]-=f*(i&&h?-1:1);break;case"end":u[r]+=f*(i&&h?-1:1);break}return u}const Ms=async(e,t,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,l=o.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(t));let h=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:c}=ye(h,s,a),f=s,u={},p=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:i,y:s,placement:n,rects:o,platform:r,elements:l,middlewareData:a}=t,{element:h,padding:d=0}=z(e,t)||{};if(h==null)return{};const c=Kt(d),f={x:i,y:s},u=Yt(n),p=Qt(u),m=await r.getDimensions(h),A=u==="y",E=A?"top":"left",w=A?"bottom":"right",T=A?"clientHeight":"clientWidth",b=o.reference[p]+o.reference[u]-f[u]-o.floating[p],y=f[u]-o.reference[u],S=await(r.getOffsetParent==null?void 0:r.getOffsetParent(h));let C=S?S[T]:0;(!C||!await(r.isElement==null?void 0:r.isElement(S)))&&(C=l.floating[T]||o.floating[p]);const M=b/2-y/2,$=C/2-m[p]/2-1,v=W(c[E],$),D=W(c[w],$),O=v,H=C-m[p]-D,L=C/2-m[p]/2+M,_=Bt(O,L,H),P=!a.arrow&&B(n)!=null&&L!==_&&o.reference[p]/2-(LB(n)===e),...i.filter(n=>B(n)!==e)]:i.filter(n=>F(n)===n)).filter(n=>e?B(n)===e||(t?At(n)!==n:!1):!0)}const Is=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var i,s,n;const{rects:o,middlewareData:r,placement:l,platform:a,elements:h}=t,{crossAxis:d=!1,alignment:c,allowedPlacements:f=Te,autoAlignment:u=!0,...p}=z(e,t),m=c!==void 0||f===Te?Ps(c||null,u,f):f,A=await X(t,p),E=((i=r.autoPlacement)==null?void 0:i.index)||0,w=m[E];if(w==null)return{};const T=Ve(w,o,await(a.isRTL==null?void 0:a.isRTL(h.floating)));if(l!==w)return{reset:{placement:m[0]}};const b=[A[F(w)],A[T[0]],A[T[1]]],y=[...((s=r.autoPlacement)==null?void 0:s.overflows)||[],{placement:w,overflows:b}],S=m[E+1];if(S)return{data:{index:E+1,overflows:y},reset:{placement:S}};const C=y.map(v=>{const D=B(v.placement);return[v.placement,D&&d?v.overflows.slice(0,2).reduce((O,H)=>O+H,0):v.overflows[0],v.overflows]}).sort((v,D)=>v[1]-D[1]),$=((n=C.filter(v=>v[2].slice(0,B(v[0])?2:3).every(D=>D<=0))[0])==null?void 0:n[0])||C[0][0];return $!==l?{data:{index:E+1,overflows:y},reset:{placement:$}}:{}}}},Fs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:l,platform:a,elements:h}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...A}=z(e,t);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const E=F(n),w=F(l)===l,T=await(a.isRTL==null?void 0:a.isRTL(h.floating)),b=f||(w||!m?[wt(l)]:Ns(l));!f&&p!=="none"&&b.push(...Rs(l,m,p,T));const y=[l,...b],S=await X(t,A),C=[];let M=((s=o.flip)==null?void 0:s.overflows)||[];if(d&&C.push(S[E]),c){const O=Ve(n,r,T);C.push(S[O[0]],S[O[1]])}if(M=[...M,{placement:n,overflows:C}],!C.every(O=>O<=0)){var $,v;const O=((($=o.flip)==null?void 0:$.index)||0)+1,H=y[O];if(H)return{data:{index:O,overflows:M},reset:{placement:H}};let L=(v=M.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:v.placement;if(!L)switch(u){case"bestFit":{var D;const _=(D=M.map(P=>[P.placement,P.overflows.filter(k=>k>0).reduce((k,Lt)=>k+Lt,0)]).sort((P,k)=>P[1]-k[1])[0])==null?void 0:D[0];_&&(L=_);break}case"initialPlacement":L=l;break}if(n!==L)return{reset:{placement:L}}}return{}}}};function be(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xe(e){return Fe.some(t=>e[t]>=0)}const Vs=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:s="referenceHidden",...n}=z(e,t);switch(s){case"referenceHidden":{const o=await X(t,{...n,elementContext:"reference"}),r=be(o,i.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:xe(r)}}}case"escaped":{const o=await X(t,{...n,altBoundary:!0}),r=be(o,i.floating);return{data:{escapedOffsets:r,escaped:xe(r)}}}default:return{}}}}};function He(e){const t=W(...e.map(o=>o.left)),i=W(...e.map(o=>o.top)),s=N(...e.map(o=>o.right)),n=N(...e.map(o=>o.bottom));return{x:t,y:i,width:s-t,height:n-i}}function Hs(e){const t=e.slice().sort((n,o)=>n.y-o.y),i=[];let s=null;for(let n=0;ns.height/2?i.push([o]):i[i.length-1].push(o),s=o}return i.map(n=>nt(He(n)))}const ks=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:s,rects:n,platform:o,strategy:r}=t,{padding:l=2,x:a,y:h}=z(e,t),d=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(s.reference))||[]),c=Hs(d),f=nt(He(d)),u=Kt(l);function p(){if(c.length===2&&c[0].left>c[1].right&&a!=null&&h!=null)return c.find(A=>a>A.left-u.left&&aA.top-u.top&&h=2){if(tt(i)==="y"){const v=c[0],D=c[c.length-1],O=F(i)==="top",H=v.top,L=D.bottom,_=O?v.left:D.left,P=O?v.right:D.right,k=P-_,Lt=L-H;return{top:H,bottom:L,left:_,right:P,width:k,height:Lt,x:_,y:H}}const A=F(i)==="left",E=N(...c.map(v=>v.right)),w=W(...c.map(v=>v.left)),T=c.filter(v=>A?v.left===w:v.right===E),b=T[0].top,y=T[T.length-1].bottom,S=w,C=E,M=C-S,$=y-b;return{top:b,bottom:y,left:S,right:C,width:M,height:$,x:S,y:b}}return f}const m=await o.getElementRects({reference:{getBoundingClientRect:p},floating:s.floating,strategy:r});return n.reference.x!==m.reference.x||n.reference.y!==m.reference.y||n.reference.width!==m.reference.width||n.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}};async function Bs(e,t){const{placement:i,platform:s,elements:n}=e,o=await(s.isRTL==null?void 0:s.isRTL(n.floating)),r=F(i),l=B(i),a=tt(i)==="y",h=["left","top"].includes(r)?-1:1,d=o&&a?-1:1,c=z(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*d,y:f*h}:{x:f*h,y:u*d}}const Ws=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,s;const{x:n,y:o,placement:r,middlewareData:l}=t,a=await Bs(t,e);return r===((i=l.offset)==null?void 0:i.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:n+a.x,y:o+a.y,data:{...a,placement:r}}}}},zs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:s,placement:n}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:l={fn:A=>{let{x:E,y:w}=A;return{x:E,y:w}}},...a}=z(e,t),h={x:i,y:s},d=await X(t,a),c=tt(F(n)),f=Ut(c);let u=h[f],p=h[c];if(o){const A=f==="y"?"top":"left",E=f==="y"?"bottom":"right",w=u+d[A],T=u-d[E];u=Bt(w,u,T)}if(r){const A=c==="y"?"top":"left",E=c==="y"?"bottom":"right",w=p+d[A],T=p-d[E];p=Bt(w,p,T)}const m=l.fn({...t,[f]:u,[c]:p});return{...m,data:{x:m.x-i,y:m.y-s}}}}},Us=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:i,y:s,placement:n,rects:o,middlewareData:r}=t,{offset:l=0,mainAxis:a=!0,crossAxis:h=!0}=z(e,t),d={x:i,y:s},c=tt(n),f=Ut(c);let u=d[f],p=d[c];const m=z(l,t),A=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const T=f==="y"?"height":"width",b=o.reference[f]-o.floating[T]+A.mainAxis,y=o.reference[f]+o.reference[T]-A.mainAxis;uy&&(u=y)}if(h){var E,w;const T=f==="y"?"width":"height",b=["top","left"].includes(F(n)),y=o.reference[c]-o.floating[T]+(b&&((E=r.offset)==null?void 0:E[c])||0)+(b?0:A.crossAxis),S=o.reference[c]+o.reference[T]+(b?0:((w=r.offset)==null?void 0:w[c])||0)-(b?A.crossAxis:0);pS&&(p=S)}return{[f]:u,[c]:p}}}},Qs=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:i,rects:s,platform:n,elements:o}=t,{apply:r=()=>{},...l}=z(e,t),a=await X(t,l),h=F(i),d=B(i),c=tt(i)==="y",{width:f,height:u}=s.floating;let p,m;h==="top"||h==="bottom"?(p=h,m=d===(await(n.isRTL==null?void 0:n.isRTL(o.floating))?"start":"end")?"left":"right"):(m=h,p=d==="end"?"top":"bottom");const A=u-a[p],E=f-a[m],w=!t.middlewareData.shift;let T=A,b=E;if(c){const S=f-a.left-a.right;b=d||w?W(E,S):S}else{const S=u-a.top-a.bottom;T=d||w?W(A,S):S}if(w&&!d){const S=N(a.left,0),C=N(a.right,0),M=N(a.top,0),$=N(a.bottom,0);c?b=f-2*(S!==0||C!==0?S+C:N(a.left,a.right)):T=u-2*(M!==0||$!==0?M+$:N(a.top,a.bottom))}await r({...t,availableWidth:b,availableHeight:T});const y=await n.getDimensions(o.floating);return f!==y.width||u!==y.height?{reset:{rects:!0}}:{}}}};function q(e){return ke(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function K(e){var t;return(t=(ke(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ke(e){return e instanceof Node||e instanceof I(e).Node}function Y(e){return e instanceof Element||e instanceof I(e).Element}function U(e){return e instanceof HTMLElement||e instanceof I(e).HTMLElement}function Se(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function ht(e){const{overflow:t,overflowX:i,overflowY:s,display:n}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+i)&&!["inline","contents"].includes(n)}function Ys(e){return["table","td","th"].includes(q(e))}function jt(e){const t=Gt(),i=V(e);return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(i.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(i.contain||"").includes(s))}function Be(e){let t=ot(e);for(;U(t)&&!vt(t);){if(jt(t))return t;t=ot(t)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vt(e){return["html","body","#document"].includes(q(e))}function V(e){return I(e).getComputedStyle(e)}function Ct(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ot(e){if(q(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Se(e)&&e.host||K(e);return Se(t)?t.host:t}function We(e){const t=ot(e);return vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&ht(t)?t:We(t)}function rt(e,t,i){var s;t===void 0&&(t=[]),i===void 0&&(i=!0);const n=We(e),o=n===((s=e.ownerDocument)==null?void 0:s.body),r=I(n);return o?t.concat(r,r.visualViewport||[],ht(n)?n:[],r.frameElement&&i?rt(r.frameElement):[]):t.concat(n,rt(n,[],i))}function ze(e){const t=V(e);let i=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const n=U(e),o=n?e.offsetWidth:i,r=n?e.offsetHeight:s,l=Et(i)!==o||Et(s)!==r;return l&&(i=o,s=r),{width:i,height:s,$:l}}function qt(e){return Y(e)?e:e.contextElement}function st(e){const t=qt(e);if(!U(t))return G(1);const i=t.getBoundingClientRect(),{width:s,height:n,$:o}=ze(t);let r=(o?Et(i.width):i.width)/s,l=(o?Et(i.height):i.height)/n;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Ks=G(0);function Ue(e){const t=I(e);return!Gt()||!t.visualViewport?Ks:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function js(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==I(e)?!1:t}function J(e,t,i,s){t===void 0&&(t=!1),i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=qt(e);let r=G(1);t&&(s?Y(s)&&(r=st(s)):r=st(e));const l=js(o,i,s)?Ue(o):G(0);let a=(n.left+l.x)/r.x,h=(n.top+l.y)/r.y,d=n.width/r.x,c=n.height/r.y;if(o){const f=I(o),u=s&&Y(s)?I(s):s;let p=f.frameElement;for(;p&&s&&u!==f;){const m=st(p),A=p.getBoundingClientRect(),E=V(p),w=A.left+(p.clientLeft+parseFloat(E.paddingLeft))*m.x,T=A.top+(p.clientTop+parseFloat(E.paddingTop))*m.y;a*=m.x,h*=m.y,d*=m.x,c*=m.y,a+=w,h+=T,p=I(p).frameElement}}return nt({width:d,height:c,x:a,y:h})}const Gs=[":popover-open",":modal"];function Qe(e){let t=!1,i=0,s=0;function n(o){try{t=t||e.matches(o)}catch{}}if(Gs.forEach(o=>{n(o)}),t){const o=Be(e);if(o){const r=o.getBoundingClientRect();i=r.x,s=r.y}}return[t,i,s]}function qs(e){let{elements:t,rect:i,offsetParent:s,strategy:n}=e;const o=K(s),[r]=t?Qe(t.floating):[!1];if(s===o||r)return i;let l={scrollLeft:0,scrollTop:0},a=G(1);const h=G(0),d=U(s);if((d||!d&&n!=="fixed")&&((q(s)!=="body"||ht(o))&&(l=Ct(s)),U(s))){const c=J(s);a=st(s),h.x=c.x+s.clientLeft,h.y=c.y+s.clientTop}return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-l.scrollLeft*a.x+h.x,y:i.y*a.y-l.scrollTop*a.y+h.y}}function Zs(e){return Array.from(e.getClientRects())}function Ye(e){return J(K(e)).left+Ct(e).scrollLeft}function Xs(e){const t=K(e),i=Ct(e),s=e.ownerDocument.body,n=N(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=N(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+Ye(e);const l=-i.scrollTop;return V(s).direction==="rtl"&&(r+=N(t.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:l}}function Js(e,t){const i=I(e),s=K(e),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,l=0,a=0;if(n){o=n.width,r=n.height;const h=Gt();(!h||h&&t==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:l,y:a}}function tn(e,t){const i=J(e,!0,t==="fixed"),s=i.top+e.clientTop,n=i.left+e.clientLeft,o=U(e)?st(e):G(1),r=e.clientWidth*o.x,l=e.clientHeight*o.y,a=n*o.x,h=s*o.y;return{width:r,height:l,x:a,y:h}}function ve(e,t,i){let s;if(t==="viewport")s=Js(e,i);else if(t==="document")s=Xs(K(e));else if(Y(t))s=tn(t,i);else{const n=Ue(e);s={...t,x:t.x-n.x,y:t.y-n.y}}return nt(s)}function Ke(e,t){const i=ot(e);return i===t||!Y(i)||vt(i)?!1:V(i).position==="fixed"||Ke(i,t)}function en(e,t){const i=t.get(e);if(i)return i;let s=rt(e,[],!1).filter(l=>Y(l)&&q(l)!=="body"),n=null;const o=V(e).position==="fixed";let r=o?ot(e):e;for(;Y(r)&&!vt(r);){const l=V(r),a=jt(r);!a&&l.position==="fixed"&&(n=null),(o?!a&&!n:!a&&l.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||ht(r)&&!a&&Ke(e,r))?s=s.filter(d=>d!==r):n=l,r=ot(r)}return t.set(e,s),s}function sn(e){let{element:t,boundary:i,rootBoundary:s,strategy:n}=e;const r=[...i==="clippingAncestors"?en(t,this._c):[].concat(i),s],l=r[0],a=r.reduce((h,d)=>{const c=ve(t,d,n);return h.top=N(c.top,h.top),h.right=W(c.right,h.right),h.bottom=W(c.bottom,h.bottom),h.left=N(c.left,h.left),h},ve(t,l,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function nn(e){const{width:t,height:i}=ze(e);return{width:t,height:i}}function on(e,t,i,s){const n=U(t),o=K(t),r=i==="fixed",l=J(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const h=G(0);if(n||!n&&!r)if((q(t)!=="body"||ht(o))&&(a=Ct(t)),n){const m=J(t,!0,r,t);h.x=m.x+t.clientLeft,h.y=m.y+t.clientTop}else o&&(h.x=Ye(o));let d=l.left+a.scrollLeft-h.x,c=l.top+a.scrollTop-h.y;const[f,u,p]=Qe(s);return f&&(d+=u,c+=p,n&&(d+=t.clientLeft,c+=t.clientTop)),{x:d,y:c,width:l.width,height:l.height}}function Ce(e,t){return!U(e)||V(e).position==="fixed"?null:t?t(e):e.offsetParent}function je(e,t){const i=I(e);if(!U(e))return i;let s=Ce(e,t);for(;s&&Ys(s)&&V(s).position==="static";)s=Ce(s,t);return s&&(q(s)==="html"||q(s)==="body"&&V(s).position==="static"&&!jt(s))?i:s||Be(e)||i}const rn=async function(e){const t=this.getOffsetParent||je,i=this.getDimensions;return{reference:on(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await i(e.floating)}}};function ln(e){return V(e).direction==="rtl"}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:qs,getDocumentElement:K,getClippingRect:sn,getOffsetParent:je,getElementRects:rn,getClientRects:Zs,getDimensions:nn,getScale:st,isElement:Y,isRTL:ln};function an(e,t){let i=null,s;const n=K(e);function o(){var l;clearTimeout(s),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const{left:h,top:d,width:c,height:f}=e.getBoundingClientRect();if(l||t(),!c||!f)return;const u=dt(d),p=dt(n.clientWidth-(h+c)),m=dt(n.clientHeight-(d+f)),A=dt(h),w={rootMargin:-u+"px "+-p+"px "+-m+"px "+-A+"px",threshold:N(0,W(1,a))||1};let T=!0;function b(y){const S=y[0].intersectionRatio;if(S!==a){if(!T)return r();S?r(!1,S):s=setTimeout(()=>{r(!1,1e-7)},100)}T=!1}try{i=new IntersectionObserver(b,{...w,root:n.ownerDocument})}catch{i=new IntersectionObserver(b,w)}i.observe(e)}return r(!0),o}function qe(e,t,i,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=s,h=qt(e),d=n||o?[...h?rt(h):[],...rt(t)]:[];d.forEach(E=>{n&&E.addEventListener("scroll",i,{passive:!0}),o&&E.addEventListener("resize",i)});const c=h&&l?an(h,i):null;let f=-1,u=null;r&&(u=new ResizeObserver(E=>{let[w]=E;w&&w.target===h&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var T;(T=u)==null||T.observe(t)})),i()}),h&&!a&&u.observe(h),u.observe(t));let p,m=a?J(e):null;a&&A();function A(){const E=J(e);m&&(E.x!==m.x||E.y!==m.y||E.width!==m.width||E.height!==m.height)&&i(),m=E,p=requestAnimationFrame(A)}return i(),()=>{var E;d.forEach(w=>{n&&w.removeEventListener("scroll",i),o&&w.removeEventListener("resize",i)}),c==null||c(),(E=u)==null||E.disconnect(),u=null,a&&cancelAnimationFrame(p)}}const cn=Is,hn=zs,un=Fs,fn=Qs,dn=Vs,pn=$s,gn=ks,mn=Us,En=(e,t,i)=>{const s=new Map,n={platform:Ge,...i},o={...n.platform,_c:s};return Ms(e,t,{...n,platform:o})},at=Object.freeze(Object.defineProperty({__proto__:null,arrow:pn,autoPlacement:cn,autoUpdate:qe,computePosition:En,detectOverflow:X,flip:un,getOverflowAncestors:rt,hide:dn,inline:gn,limitShift:mn,offset:Ws,platform:Ge,shift:hn,size:fn},Symbol.toStringTag,{value:"Module"})),An="tooltip",wn="tooltip",Ot=`.${wn}`,Tn=`hide${Ot}`,yn=`hidden${Ot}`,bn=`show${Ot}`,xn=`shown${Ot}`,Sn='[data-spirit-element="arrow"]',vn="is-visible",Ht="is-hidden",Cn=e=>e.split(",").map(t=>t.trim());class Z extends Q{constructor(t,i){if(typeof at>"u")throw new TypeError("Floating UI dependency is missing. Please, install it (https://floating-ui.com/)");super(t,i),this.tip=this.getTipElement(),this.isPlacementControlled()&&(this.trigger=this.getTipTooltipWrapper(),this.arrow=this.tip.querySelector(Sn),this.tooltipComputedStyle=window.getComputedStyle(this.tip),this.tooltipMaxWidth=parseInt(this.tooltipComputedStyle.maxWidth,10),this.tooltipOffset=parseInt(this.tooltipComputedStyle.getPropertyValue("--tooltip-offset"),10),this.arrowCornerOffset=this.arrow&&parseInt(window.getComputedStyle(this.arrow).getPropertyValue("--tooltip-arrow-corner-offset"),10),this.arrowWidth=this.arrow&&parseInt(window.getComputedStyle(this.arrow).getPropertyValue("width"),10),this.tip&&this.trigger&&qe(this.trigger,this.tip,()=>this.trigger&&this.updateTooltipPosition(this.trigger,this.tip)))}static get NAME(){return An}toggle(){this.isShown()?this.hide():this.show()}isPlacementControlled(){const t=this.config,i="placementControlled";return i in t&&t[i]!==!1}updateConfig(t){const i=this.config;this.trigger&&this.tip&&(this.config={...i,...t},this.updateTooltipPosition(this.trigger,this.tip))}show(){var i,s;if(((s=(i=this.element)==null?void 0:i.style)==null?void 0:s.display)==="none")throw new Error("Please use show on elements without `display: none`");if(!g.trigger(this.element,Z.eventName(bn)).defaultPrevented){if(this.element.setAttribute("aria-describedby",this.tip.getAttribute("id")),this.tip.classList.remove(Ht),"ontouchstart"in document.documentElement)for(const n of[].concat(...document.body.children))g.on(n,"mouseover",null);this.trigger&&this.tip&&this.updateTooltipPosition(this.trigger,this.tip),g.trigger(this.element,Z.eventName(xn))}}hide(){if(!(!this.isShown()||g.trigger(this.element,Z.eventName(Tn)).defaultPrevented)){if(this.tip.classList.add(Ht),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))g.off(i,"mouseover",null);this.element.removeAttribute("aria-describedby"),g.trigger(this.element,Z.eventName(yn))}}isShown(){var t,i;return this.tip&&(((t=this.tip.classList)==null?void 0:t.contains(vn))||!((i=this.tip.classList)!=null&&i.contains(Ht)))}getTipTooltipWrapper(){var s;const t=this.tip.getAttribute("id");return(s=document.getElementById(t))==null?void 0:s.closest('[data-spirit-element="tooltip-wrapper"]')}getTipElement(){var t,i,s;return this.tip||(this.tip=x.findOne((i=(t=this.element)==null?void 0:t.dataset)==null?void 0:i.spiritTarget)||this.element||((s=this.element)==null?void 0:s.parentElement)),this.tip}getTooltipFloatingProps(){const{enableFlipping:t,enableShifting:i,enableSizing:s,enableFlippingCrossAxis:n,flipFallbackAxisSideDirection:o,flipFallbackPlacements:r,placement:l}=this.config;return{placement:l,flip:t??!0,shift:i??!0,size:s??!0,flipCrossAxis:n??!0,flipFallbackPlacements:r&&Cn(r),flipFallbackAxisSideDirection:o||"none"}}getFlipConfig(){const{flip:t}=at,i=this.getTooltipFloatingProps(),{flip:s,flipCrossAxis:n,flipFallbackAxisSideDirection:o,flipFallbackPlacements:r}=i;return s&&t({mainAxis:s,crossAxis:n,fallbackAxisSideDirection:o,fallbackPlacements:r||void 0})}getShiftConfig(){const{shift:t,limitShift:i}=at,s=this.getTooltipFloatingProps(),n=(this.arrowCornerOffset||0)+(this.arrowWidth||0);return s.shift&&t({limiter:i({offset:()=>({mainAxis:n})})})}getSizeConfig(t){const{size:i}=at,{tooltipMaxWidth:s}=this;return this.getTooltipFloatingProps().size&&s?i({apply({availableWidth:o}){Object.assign(t.style,{maxWidth:`${s{Object.assign(i.style,{top:`${p}px`,left:`${u}px`});const E=A.split("-")[0],w={top:"bottom",right:"left",bottom:"top",left:"right"}[E];if(m.arrow&&a){const T=w==="top"||w==="bottom"?a.offsetHeight:(a.offsetHeight+a.offsetWidth)/2,{x:b,y}=m.arrow;Object.assign(a.style,{left:b!=null?`${b}px`:"",top:y!=null?`${y}px`:"",bottom:"",right:"",[w]:`-${Math.floor(T)}px`})}i.dataset.spiritPlacement=A})}}lt(Z,"toggle");Ne(Z,"hide");export{Yi as F,ji as M,Z as T}; diff --git a/docs/assets/spirit-web-chunk.6c1d1de4.js b/docs/assets/spirit-web-chunk.6c1d1de4.js new file mode 100644 index 0000000000..087639657c --- /dev/null +++ b/docs/assets/spirit-web-chunk.6c1d1de4.js @@ -0,0 +1 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function e(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=e(n);fetch(n.href,r)}})();const j=new Map,Rt={set(i,t,e){j.has(i)||j.set(i,new Map);const s=j.get(i);if(!s.has(t)&&s.size!==0){console.error(`Spirit do not allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(t,e)},get(i,t){return j.has(i)&&j.get(i).get(t)||null},remove(i,t){if(!j.has(i))return;const e=j.get(i);e.delete(t),e.size===0&&j.delete(i)}},si=(i,t,e)=>{i&&i.addEventListener(t,e,{passive:!1})},ni=(i,t,e)=>i.removeEventListener(t,e),p={on(i,t,e){si(i,t,e)},off(i,t,e){ni(i,t,e)},trigger(i,t,e){if(typeof t!="string"||!i)return null;const s=!0,n=new Event(t,{bubbles:s,cancelable:!0});if(typeof e<"u")for(const r of Object.keys(e))Object.defineProperty(n,r,{get(){return e[r]}});return i.dispatchEvent(n),n}},x={findAll(i,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,i))},findOne(i,t=document.documentElement){return Element.prototype.querySelector.call(t,i)}},At=i=>!i||typeof i!="object"?!1:typeof i.nodeType<"u",ht=i=>At(i)?i:typeof i=="string"&&i.length>0?document.querySelector(i):null,Re=(i,t="target")=>{var n;const e=i,s=(n=e==null?void 0:e.dataset)!=null&&n.spiritTarget?ht(i.dataset.spiritTarget):null;return t==="target"?s:e},ri=i=>i==null?void 0:i.getAttribute("data-spirit-target"),_t=i=>{const t=ri(i);return t?document.querySelector(t):null},_e="data-spirit-toggle",oi="data-spirit-dismiss",Me=(i,t,e,s,n="target")=>{p.on(i,"click",function(){const o=Re(ht(this),n);t.getOrCreateInstance(o)[e](o,s)})},li=(i,t,e,s,n="trigger")=>{let r=i;n==="target"&&(r=Re(ht(i),n)),t.getOrCreateInstance(r)},zt=(i,t,e,s="toggle",n="target")=>{const r=t.NAME;p.on(window,"DOMContentLoaded",o=>{x.findAll(`[${i}="${r}"]`).forEach(l=>{e(l,t,s,o,n)})})},ut=(i,t="toggle",e="target")=>{zt(_e,i,Me,t,e)},$e=(i,t="dismiss",e="target")=>{zt(oi,i,Me,t,e)},dt=(i,t="toggle",e="trigger")=>{zt(_e,i,li,t,e)},Ie=(i,t)=>!t.composedPath().includes(i);function Jt(i){if(i==="true")return!0;if(i==="false")return!1;if(i===Number(i).toString())return Number(i);if(i===""||i==="null")return null;if(typeof i!="string")return i;try{return JSON.parse(decodeURIComponent(i))}catch{return i}}function Mt(i){return i.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const te={setDataAttribute(i,t,e){i.setAttribute(`data-spirit-${Mt(t)}`,e)},removeDataAttribute(i,t){i.removeAttribute(`data-spirit-${Mt(t)}`)},getDataAttributes(i){if(!i)return{};const t={},e=Object.keys(i.dataset).filter(s=>s.startsWith("spirit")&&!s.startsWith("spiritConfig"));for(const s of e){let n=s.replace(/^spirit/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=Jt(i.dataset[s])}return t},getDataAttribute(i,t){return Jt(i.getAttribute(`data-spirit-${Mt(t)}`))}},ai=i=>i==null?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();class ci{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}getConfig(t){const e=this.mergeConfigObj(t);return this.typeCheckConfig(e),e}mergeConfigObj(t,e){const s=At(e)?te.getDataAttribute(e,"config"):{};return{...this.constructor.Default,...typeof s=="object"?s:{},...At(e)?te.getDataAttributes(e):{},...typeof t=="object"?t:{}}}typeCheckConfig(t,e=this.constructor.DefaultType){for(const[s,n]of Object.entries(e)){const r=t==null?void 0:t[s],o=At(r)?"element":ai(r);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${o}" but expected type "${n}".`)}}}const ee=(i,t)=>{let e,s=!1;return n=>{s||(s=!0,e&&clearTimeout(e),e=setTimeout(()=>{i(n),s=!1},t))}},hi=(i,t,e)=>{const s=new FileReader;s.onload=n=>{const r=new Image;r.onload=()=>{const o=document.createElement("canvas"),l=o.getContext("2d");o.width=t,o.height=r.height/r.width*t,l==null||l.drawImage(r,0,0,o.width,o.height);const a=o.toDataURL("image/jpeg",.8);e(a)},n.target&&n.target.result&&(r.src=n.target.result.toString())},s.readAsDataURL(i)},ui=i=>{p.trigger(i,"transitionend")},di=i=>{if(!i)return 0;let{transitionDuration:t,transitionDelay:e}=window.getComputedStyle(i);const s=Number.parseFloat(t),n=Number.parseFloat(e);return!s&&!n?0:([t]=t.split(","),[e]=e.split(","),(Number.parseFloat(t)+Number.parseFloat(e))*1e3)},ie=(i,t=[],e=i)=>typeof i=="function"?i(...t):e,wt=(i,t,e=!0)=>{if(!e){ie(t);return}const s=5,n=di(i)+s;let r=!1;const o=l=>{l.target===i&&(r=!0,i.removeEventListener("transitionend",o),ie(t))};i.addEventListener("transitionend",o),setTimeout(()=>{r||ui(i)},n)},fi="dialog[open]",$t="is-scrolling-disabled";class Pe{constructor(t,e,s){this.target=t,this.element=e||document.body,this.selector=s||fi,this.offsetY=0}disableScroll(){if(this.element.classList.contains($t))return;const e=(this.element.tagName==="BODY"?window.innerWidth:this.element.offsetWidth)-this.element.clientWidth;this.element.style.paddingRight=`${e}px`,this.element.classList.add($t)}enableScroll(){const t=x.findAll(this.selector);this.target&&t.length===0&&wt(this.target,()=>{this.element.style.paddingRight="",this.element.classList.remove($t)})}}class Y extends ci{constructor(t,e){super(),this.element=ht(t),this.NAME="",this.config=this.getConfig(e),Rt.set(this.element,this.constructor.INSTANCE_KEY,this)}dispose(){Rt.remove(this.element,this.constructor.INSTANCE_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}getConfig(t){const e=this.mergeConfigObj(t,this.element);return this.typeCheckConfig(e),e}static get NAME(){return""}static getInstance(t){return Rt.get(ht(t),this.INSTANCE_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||this.createInstance(t,e)}static createInstance(t,e){return new this(t,typeof e=="object"?e:null)}static get INSTANCE_KEY(){return`spirit.${this.NAME}`}static get DATA_KEY(){return`${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const gi="autoResize",pi="resize",It=400;class mi extends Y{constructor(t,e){super(t,e),this.adjustHeight=()=>{const s=parseFloat(getComputedStyle(this.input).getPropertyValue("border-top-width"))||0,n=parseFloat(getComputedStyle(this.input).getPropertyValue("border-bottom-width"))||0,r=s+n;this.input.style.height="auto",this.input.style.overflow="auto";const o=this.input.scrollHeight+r;this.input.style.height=`${o{n.setAttribute(Ei,this.meta.id),n.setAttribute(Pt,String(t)),this.meta.hideOnCollapse&&t&&(n.remove(),this.appendNodeToParent(),this.onDestroy())};this.state.open=t,e.length===1?s(this.element):e.map(n=>s(n))}updateCollapsibleElement(t=this.state.open){var e;this.target&&(t||this.adjustCollapsibleChildrenHeight(),this.adjustCollapsibleElementHeight(t),this.state.init&&((e=this.target)==null||e.classList.add(se)),wt(this.target,()=>{var s,n,r,o;(s=this.target)==null||s.classList.remove(se),(n=this.target)==null||n.classList.toggle(wi,t),t?(r=this.target)==null||r.setAttribute("style","height: 100%"):(o=this.target)==null||o.style.removeProperty("height")}))}show(){this.hideParentSiblings(this.element),p.trigger(this.target,bi),this.updateTriggerElement(!0),this.updateCollapsibleElement(!0),this.target&&wt(this.target,()=>{p.trigger(this.target,oe)})}hide(){p.trigger(this.target,yi),this.updateTriggerElement(!1),this.updateCollapsibleElement(!1),this.target&&wt(this.target,()=>{p.trigger(this.target,re)})}toggle(){this.state.open?this.hide():this.show()}initEvents(){const t=x.findAll(`[${Ft}="${this.meta.id}"]`);t.length===1?p.on(this.element,"click",()=>this.toggle()):t.forEach(e=>p.on(e,"click",()=>this.toggle()))}destroyEvents(){const t=x.findAll(`[${Ft}="${this.meta.id}"]`);t.length===1?p.off(this.element,"click",()=>this.toggle()):t.forEach(e=>p.off(e,"click",()=>this.toggle()))}onDestroy(){this.destroyEvents()}init(){this.updateTriggerElement(),this.updateCollapsibleElement(),this.initEvents(),this.state.init=!0}}dt(Qt);const Fe="dropdown",xi=`${Fe}`,vt=`.${xi}`,vi=`hide${vt}`,Si=`hidden${vt}`,Ci=`show${vt}`,Oi=`shown${vt}`,Li="aria-expanded",Ni="aria-controls",Di="DropdownWrapper",Ri="is-expanded",_i="is-open";class Mi extends Y{constructor(t,e){super(t,e),this.autoCloseHandler=s=>{const n=this.target&&Ie(this.target,s);s.target&&n&&this.hide()},this.target=x.findOne(`${this.element.dataset.spiritTarget}`),this.reference=this.findReferenceElement(),this.state={open:!1},this.options={autoClose:!0}}static get NAME(){return Fe}getOptions(){var n;const t={...this.options},e=(n=this.element)==null?void 0:n.dataset,s=e==null?void 0:e.spiritAutoclose;return s&&(t.autoClose=!s),t}findReferenceElement(){let t=this.element;const{reference:e}=this.element.dataset;return e&&(e==="parent"&&this.element.parentElement&&this.element.parentElement.classList.contains(Di)?t=this.element.parentElement:e.match(/(#)/g)&&(t=x.findOne(e))),t}updateTriggerElement(t=this.state.open){this.element.classList.toggle(Ri,t),this.element.setAttribute(Li,t),this.element.setAttribute(Ni,this.element.dataset.spiritTarget)}updateTargetElement(t=this.state.open){var e;(e=this.target)==null||e.classList.toggle(_i,t)}show(){this.state.open=!0,this.target&&p.trigger(this.target,Ci),this.updateTriggerElement(),this.updateTargetElement(),setTimeout(()=>{this.target&&p.trigger(this.target,Oi),this.getOptions().autoClose&&p.on(document,"click",this.autoCloseHandler)},0)}hide(){this.state.open=!1,this.target&&p.trigger(this.target,vi),this.updateTriggerElement(),this.updateTargetElement(),p.off(document,"click",this.autoCloseHandler),setTimeout(()=>{this.target&&p.trigger(this.target,Si)},0)}toggle(){this.state.open?this.hide():this.show()}}ut(Mi,"toggle","trigger");const Ve="fileUploader",ft=`.${Ve}`,$i=`queueFile${ft}`,Ii=`queuedFile${ft}`,Pi=`unqueueFile${ft}`,Fi=`unqueuedFile${ft}`,Vt=`error${ft}`,Vi="has-drag-and-drop",le="is-dragging",Hi="d-none",ki="is-disabled",ae="has-danger",Wi='[data-spirit-element="wrapper"]',Bi='[data-spirit-element="input"]',Ui='[data-spirit-element="list"]',zi='[data-spirit-element="dropZone"]',Qi='[data-spirit-snippet="item"]',it="data-spirit-populate-field",ce='[data-spirit-element="attachment-image"]',he="data-spirit-dismiss",He="validation_text",ue=`[data-spirit-element="${He}"]`,Yi=1e7,Ki=10,pt={errorMaxFileSize:"The file size limit has been exceeded",errorFileDuplicity:"This file already exists in the queue",errorMaxUploadedFiles:"You have exceeded the number of files allowed in the queue",errorFileNotSupported:"is not a supported file. Please ensure you are uploading a supported file format."},Gi=54,ji=500,ke=class nt extends Y{constructor(t,e){var s,n,r,o,l,a,h,f,c,d;super(t,e),this.wrapper=x.findOne(Wi,t),this.inputElement=x.findOne(Bi,t),this.listElement=x.findOne(Ui,t),this.dropZone=x.findOne(zi,t),this.isDragAndDropSupported="draggable"in document.createElement("span"),this.fileSizeLimit=(s=this.wrapper)!=null&&s.dataset.spiritMaxFileSize?Number((n=this.wrapper)==null?void 0:n.dataset.spiritMaxFileSize):Yi,this.fileQueueLimit=(r=this.wrapper)!=null&&r.dataset.spiritFileQueueLimit?Number((o=this.wrapper)==null?void 0:o.dataset.spiritFileQueueLimit):Ki,this.queueLimitBehavior=(l=this.wrapper)!=null&&l.dataset.spiritQueueLimitBehavior?(a=this.wrapper)==null?void 0:a.dataset.spiritQueueLimitBehavior:"none",this.errors={},this.errors.errorMaxFileSize=this.element.dataset.spiritMessageMaxfilesize??pt.errorMaxFileSize,this.errors.errorFileDuplicity=this.element.dataset.spiritMessageDuplicity??pt.errorFileDuplicity,this.errors.errorMaxUploadedFiles=this.element.dataset.spiritMessageMaxuploadedfiles??pt.errorMaxUploadedFiles,this.errors.errorFileNotSupported=this.element.dataset.spiritMessageUnsupported??pt.errorFileNotSupported,this.inputName=((h=this.inputElement)==null?void 0:h.name)||"attachment",this.isMultiple=(f=this.inputElement)==null?void 0:f.multiple,this.accept=(c=this.inputElement)==null?void 0:c.accept,this.isDragging=!1,this.fileQueue=new Map,this.instanceUid=nt.getUid(),this.isDisabled=((d=this.inputElement)==null?void 0:d.disabled)||!1,this.init()}static get NAME(){return Ve}get getFileQueue(){return this.fileQueue}clearFileQueue(){var t;for(this.fileQueue.clear();(t=this.listElement)!=null&&t.firstChild;)this.listElement.removeChild(this.listElement.firstChild)}static getUid(){return Math.random().toString(36).slice(-6)}getUpdatedFileName(t){return`file_${this.instanceUid}_${t.replace(/[^a-zA-Z0-9]/g,"")}`}dragReset(){var t;this.isDragging=!1,(t=this.wrapper)==null||t.classList.remove(le)}checkAllowedFileSize(t){if(t.size>this.fileSizeLimit)throw new Error(`${t.name}: ${this.errors.errorMaxFileSize}`)}checkFileQueueDuplicity(t){if(this.fileQueue.has(this.getUpdatedFileName(t.name)))throw new Error(`${t.name}: ${this.errors.errorFileDuplicity}`)}checkQueueLimit(){if(this.fileQueue.size>=this.fileQueueLimit)throw new Error(this.errors.errorMaxUploadedFiles)}checkAllowedFileType(t){var o,l;const e=(o=t.name.split(".").pop())==null?void 0:o.toLowerCase(),s=t.type;let n;if(!!(this.accept===""||this.accept==="*"||this.accept==="*/*"))n=!0;else{const a=(l=this.accept)==null?void 0:l.replace(/ /g,"").split(","),h=a==null?void 0:a.filter(c=>c.match(/\./g)),f=a==null?void 0:a.filter(c=>c.match(/\//g));h==null||h.forEach(c=>{const d=c.replace(".","").replace("*","");e.match(d)&&(n=!0)}),f==null||f.forEach(c=>{const d=c.replace("*","");s.match(d)&&(n=!0)})}if(!n)throw new Error(`${t.name}: ${this.errors.errorFileNotSupported}`)}updateNameAttribute(){var t,e;this.fileQueue.size>0?(t=this.inputElement)==null||t.removeAttribute("name"):(e=this.inputElement)==null||e.setAttribute("name",this.inputName)}updateDropZoneVisibility(){if(this.queueLimitBehavior==="none")return;const t=this.queueLimitBehavior==="hide"?Hi:ki;setTimeout(()=>{var e;(e=this.wrapper)==null||e.classList.toggle(t,this.fileQueue.size===this.fileQueueLimit),this.inputElement.disabled=this.fileQueue.size===this.fileQueueLimit},0)}createAttachmentElement(){const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("name",`${this.inputName}[]`),t.setAttribute("hidden",""),t}static createValidationTextElement(){const t=document.createElement("ul");return t.dataset.spiritElement=He,t}static isValidationTextInElement(t,e){const s=e.getElementsByTagName("li");return!!Array.from(s).filter(r=>{var o;return(o=r.textContent)==null?void 0:o.includes(t)}).length}getValidationTextElement(t){const e=document.createElement("li");e.appendChild(document.createTextNode(t));let s=x.findOne(ue,this.wrapper);return s||(s=nt.createValidationTextElement()),!nt.isValidationTextInElement(t,s)&&s.appendChild(e),s}getAttachmentElement(t,e){var g,m;const s=x.findOne(Qi,this.element),n=s==null?void 0:s.content.cloneNode(!0);if(!n)return null;const r=new DataTransfer;r.items.add(t);const o=this.createAttachmentElement();o.files=r.files;const l=n.querySelector(`[${it}="item"]`),a=n.querySelector(`[${it}="name"]`),h=n.querySelector(`[${it}="button"]`),f=!!((g=l==null?void 0:l.dataset)!=null&&g.spiritImagepreview),c=l==null?void 0:l.querySelector("svg"),d=l==null?void 0:l.querySelector(ce),u=t.type.includes("image");return f&&u?(c==null||c.remove(),(m=d==null?void 0:d.querySelector("img"))==null||m.setAttribute("alt",t.name),hi(t,ji,A=>{var E;return(E=d==null?void 0:d.querySelector("img"))==null?void 0:E.setAttribute("src",A)})):d==null||d.remove(),l.appendChild(o),l.setAttribute("id",e),a.appendChild(document.createTextNode(t.name)),h.setAttribute(he,e),l.removeAttribute(it),a.removeAttribute(it),h.removeAttribute(it),n.children.item(0)}createAttachmentEvents(t){const e=x.findOne(`[${he}="${t}"]`);e&&p.on(e,"click",s=>{var r,o;s.preventDefault();const n=(o=(r=s.target)==null?void 0:r.dataset)==null?void 0:o.spiritDismiss;n&&this.removeFromQueue(n)})}appendToList(t,e){if(!this.listElement)return;this.isMultiple||this.clearFileQueue();const s=this.getUpdatedFileName(t.name),n=this.getAttachmentElement(t,s);if(!n)return;const r={file:t};e&&(r.meta=e),this.fileQueue.set(s,r),this.listElement.appendChild(n),this.createAttachmentEvents(s),this.dragReset()}addToQueue(t,e,s){try{p.trigger(this.wrapper,$i,{fileQueue:this.fileQueue,currentFile:t}),this.checkAllowedFileType(t),this.checkAllowedFileSize(t),this.checkFileQueueDuplicity(t),this.checkQueueLimit(),this.appendToList(t,e),this.updateDropZoneVisibility(),this.updateNameAttribute(),s&&s(this.getUpdatedFileName(t.name),t,e),p.trigger(this.wrapper,Ii,{fileQueue:this.fileQueue,currentFile:t})}catch(n){p.trigger(this.wrapper,Vt,{validationText:n.message})}}updateQueue(t,e,s,n){if(this.fileQueue.has(t)){const r={file:e};s&&(r.meta=s),this.fileQueue.set(t,r);const o=x.findOne(`#${t} ${ce} img`);if(s&&o&&nt.isCoordsInMeta(s)){const l=Gi,a=parseInt(s.cropWidth,10),h=parseInt(s.cropHeight,10);let f;h>a?f=l/a:f=l/h;const c=Math.round(parseInt(s.x,10)*f),d=Math.round(parseInt(s.y,10)*f),u=Math.round(parseInt(s.originalWidth,10)*f),g=Math.round(parseInt(s.originalHeight,10)*f);o==null||o.style.setProperty("--file-uploader-attachment-image-top",`-${d}px`),o==null||o.style.setProperty("--file-uploader-attachment-image-left",`-${c}px`),o==null||o.style.setProperty("--file-uploader-attachment-image-width",`${u}px`),o==null||o.style.setProperty("--file-uploader-attachment-image-height",`${g}px`)}n&&n(t,e,s)}}removeFromQueue(t,e){if(this.fileQueue.has(t)){p.trigger(this.wrapper,Pi,{fileQueue:this.fileQueue,currentFile:t});const s=x.findOne(`#${t}`);this.fileQueue.delete(t),s==null||s.remove(),this.updateDropZoneVisibility(),this.updateNameAttribute(),this.removeValidationWError(),e&&e(t),p.trigger(this.wrapper,Fi,{fileQueue:this.fileQueue,currentFile:t})}}getFileFromQueue(t){return this.fileQueue.get(t)}onChange(t,e){const{target:s}=t,n=s.files?[...s.files]:[];let r=0,o;r+=this.fileQueue.size,n.forEach(l=>{r{s.value="",s.blur()},0)}static onDragOver(t){t.preventDefault()}onDragEnter(){var t;this.isDragging=!0,(t=this.wrapper)==null||t.classList.add(le)}onDragLeave(){this.dragReset()}onDrop(t){var n,r,o;if(t.preventDefault(),this.isDisabled)return;const e=Array.from(((n=t==null?void 0:t.dataTransfer)==null?void 0:n.items)||[]),s=Array.from(((r=t==null?void 0:t.dataTransfer)==null?void 0:r.files)||[]);!this.isMultiple&&(e.length>1||s.length>1),(o=t==null?void 0:t.dataTransfer)!=null&&o.items?e.forEach(l=>{if(l.kind==="file"){const a=l.getAsFile();a&&this.addToQueue(a)}}):s.forEach(l=>{this.addToQueue(l)})}removeValidationWError(){var t;(t=x.findOne(ue,this.wrapper))==null||t.remove(),this.wrapper.classList.remove(ae)}onClick(){this.removeValidationWError()}onValidationError(t){this.wrapper.classList.add(ae),this.wrapper.append(this.getValidationTextElement(t.validationText))}addEventListeners(){p.on(this.inputElement,"click",this.onClick.bind(this)),p.on(this.inputElement,"change",this.onChange.bind(this)),p.on(this.wrapper,Vt,this.onValidationError.bind(this)),this.isDragAndDropSupported&&this.dropZone&&(p.on(this.dropZone,"dragover",nt.onDragOver.bind(this)),p.on(this.dropZone,"dragenter",this.onDragEnter.bind(this)),p.on(this.dropZone,"dragleave",this.onDragLeave.bind(this)),p.on(this.dropZone,"drop",this.onDrop.bind(this)))}init(){var t;this.addEventListeners(),this.isDragAndDropSupported&&((t=this.wrapper)==null||t.classList.add(Vi))}};ke.isCoordsInMeta=i=>["x","y","cropWidth","cropHeight","originalWidth","originalHeight"].every(t=>i[t]!=null);let qi=ke;dt(qi);const Zi="modal",de='[data-spirit-toggle="modal"]';class Xi extends Y{constructor(t,e){super(t,e),this.isShown=!1,this.isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0,this.scrollControl=new Pe(t)}static get NAME(){return Zi}onClick(t){(t.target===this.element||t.target.dataset.spiritDismiss)&&(t.preventDefault(),t.stopPropagation(),(!t.target.dataset.spiritCloseOnBackdropClick||t.target.dataset.spiritCloseOnBackdropClick==="true")&&this.hide(t))}onDialogClose(t){t.defaultPrevented||(this.hide(t),t.preventDefault())}addEventListeners(){p.on(this.element,"close",t=>this.onDialogClose(t)),this.isTouchDevice?p.on(window,"touchstart",t=>this.onClick(t)):p.on(window,"click",t=>this.onClick(t))}removeEventListeners(){p.off(this.element,"close",t=>this.onDialogClose(t)),this.isTouchDevice?p.off(window,"touchstart",t=>this.onClick(t)):p.off(window,"click",t=>this.onClick(t))}show(){var e;if(this.isShown)return;const t=x.findOne(de,this.element);t==null||t.setAttribute("aria-expanded","true"),(e=this.element)==null||e.showModal(),this.addEventListeners(),this.isShown=!0,this.scrollControl.disableScroll()}hide(t){var n;let e;(n=t==null?void 0:t.target)!=null&&n.dataset?t.target.dataset.spiritTarget?e=x.findOne(t.target.dataset.spiritTarget):e=t.target:e=this.element;const s=x.findOne(de,this.element);typeof e.close=="function"&&e.close(),s==null||s.setAttribute("aria-expanded","false"),this.removeEventListeners(),this.isShown=!1,this.scrollControl.enableScroll()}toggle(t,e){t&&(this.isShown?this.hide(e):this.show())}}ut(Xi);const Ji=0,ts="768px",es="1280px",is={mobile:Ji,tablet:ts,desktop:es},ss="offcanvas",ns="offcanvas",St=`.${ns}`,rs=`show${St}`,os=`shown${St}`,ls=`hide${St}`,as=`hidden${St}`,cs=parseInt(is.desktop,10),fe="is-open",hs="--spirit-breakpoint-desktop",us={breakpointDesktop:cs},ds={breakpointDesktop:"number"};class We extends Y{constructor(t,e){const s=t;super(s,e),this.isShown=!1,this.scrollControl=new Pe(t),this.breakpoint=this.getBreakpoint()}static get Default(){return us}static get DefaultType(){return ds}static get NAME(){return ss}getBreakpoint(){var t;return parseInt(getComputedStyle(document.documentElement).getPropertyValue(hs),10)||((t=this.config)==null?void 0:t.breakpointDesktop)}onClick(t){(t.target===this.element||t.target.dataset.spiritDismiss)&&(t.preventDefault(),t.stopPropagation(),this.hide())}onWindowResize(t){t.target.innerWidth>=this.breakpoint&&this.hide()}onDialogClose(t){t.defaultPrevented||(this.hide(),t.preventDefault())}addEventListeners(){p.on(this.element,"close",t=>this.onDialogClose(t)),p.on(window,"resize",t=>this.onWindowResize(t)),p.on(window,"click",t=>this.onClick(t))}removeEventListeners(){p.off(this.element,"close",t=>this.onDialogClose(t)),p.off(window,"resize",t=>this.onWindowResize(t)),p.off(window,"click",t=>this.onClick(t))}show(t){if(this.isShown)return;const e=p.trigger(this.element,rs,{relatedTarget:t});e!=null&&e.defaultPrevented||(this.element.classList.add(fe),this.element.showModal(),t.setAttribute("aria-expanded","true"),this.element.setAttribute("aria-modal","true"),this.element.setAttribute("role","dialog"),this.addEventListeners(),this.isShown=!0,p.trigger(this.element,os,{relatedTarget:t}),this.scrollControl.disableScroll())}hide(){if(!this.isShown)return;const t=p.trigger(this.element,ls);t!=null&&t.defaultPrevented||(this.element.classList.remove(fe),this.element.close(),this.element.removeAttribute("aria-modal"),this.element.removeAttribute("role"),this.removeEventListeners(),this.isShown=!1,p.trigger(this.element,as),this.scrollControl.enableScroll())}toggle(t){t&&(this.isShown?this.hide():this.show(t))}}ut(We);$e(We,"hide");const fs="password",ge="aria-pressed",pe="aria-label",me="input";class gs extends Y{constructor(t,e){super(t,e),this.isShown=!1}static get NAME(){return fs}show(t){var e;t.setAttribute(ge,"true"),t.setAttribute(pe,"Hide password"),(e=x.findOne(me,t.parentElement))==null||e.setAttribute("type","text"),this.isShown=!0}hide(t){var e;t.setAttribute(ge,"false"),t.setAttribute(pe,"Show password"),(e=x.findOne(me,t.parentElement))==null||e.setAttribute("type","password"),this.isShown=!1}toggle(t){this.isShown?this.hide(t):this.show(t)}}ut(gs,"toggle","trigger");const mt={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},Bt={HORIZONTAL:"horizontal",VERTICAL:"vertical"},ps="scrollView",Ee=50,ms=Bt.VERTICAL,Es='[data-spirit-element="viewport"]',As='[data-spirit-element="content"]',Ae="is-scrolled-at-start",we="is-scrolled-at-end",ws="resize",Ts="scroll",Te=1;class ys extends Y{constructor(t,e){var s;super(t,e),this.getElementsPositionDifference=()=>{const n=this.content.getBoundingClientRect(),r=this.viewport.getBoundingClientRect();return{bottom:n.bottom-r.bottom,left:n.left-r.left,right:n.right-r.right,top:n.top-r.top}},this.handleScrollViewState=()=>{this.currentPosition=this.getElementsPositionDifference();const n=this.currentPosition[this.scrollPositionStart]<=-1*Te,r=this.currentPosition[this.scrollPositionEnd]>=Te;n!==this.isScrolledAtStart&&(this.isScrolledAtStart=n),r!==this.isScrolledAtEnd&&(this.isScrolledAtEnd=r),n?this.element.classList.add(Ae):this.element.classList.remove(Ae),r?this.element.classList.add(we):this.element.classList.remove(we)},this.currentPosition={bottom:0,left:0,right:0,top:0},this.direction=(s=this.element.dataset)!=null&&s.spiritDirection?String(this.element.dataset.spiritDirection):ms,this.content=x.findOne(As,this.element),this.viewport=x.findOne(Es,this.element),this.scrollPositionStart=this.direction===Bt.HORIZONTAL?mt.LEFT:mt.TOP,this.scrollPositionEnd=this.direction===Bt.HORIZONTAL?mt.RIGHT:mt.BOTTOM,this.isScrolledAtStart=!1,this.isScrolledAtEnd=!1,this.init()}static get NAME(){return ps}static get DATA_KEY(){return`${this.NAME}`}addEventListeners(){p.on(this.viewport,Ts,ee(this.handleScrollViewState,Ee)),p.on(window,ws,ee(this.handleScrollViewState,Ee))}init(){this.addEventListeners(),this.handleScrollViewState()}}dt(ys);const Be="tabs",bs="tabs",Ct=`.${bs}`,xs=`hide${Ct}`,vs=`hidden${Ct}`,Ss=`show${Ct}`,Cs=`shown${Ct}`,Ht="is-selected",Os='[role="tablist"]',Ls='[role="presentation"]',Ns='[role="tab"]',Ds=`[data-spirit-toggle="${Be}"]`,kt=`${Ns}, ${Ds}`;class R extends Y{constructor(t,e){super(t,e),this.parent=this.element.closest(Os),this.parent&&R.setInitialAttributes(this.parent,this.getChildren())}static get NAME(){return Be}show(){const t=this.element;if(R.isElementActive(t))return;const e=this.getActiveElem(),s=e?p.trigger(e,xs,{relatedTarget:t}):null;p.trigger(t,Ss,{relatedTarget:e}).defaultPrevented||s&&s.defaultPrevented||(this.deactivate(e,t),this.activate(t,e))}activate(t,e){t&&(t.classList.add(Ht),this.activate(_t(t)),t.removeAttribute("tabindex"),t.setAttribute("aria-selected","true"),p.trigger(t,Cs,{relatedTarget:e}))}deactivate(t,e){t&&(t.classList.remove(Ht),this.deactivate(_t(t)),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1"),p.trigger(t,vs,{relatedTarget:e}))}getChildren(){return x.findAll(kt,this.parent)}getActiveElem(){return this.getChildren().find(t=>R.isElementActive(t))||null}static setInitialAttributes(t,e){R.setAttributeIfNotExists(t,"role","tablist");for(const s of e)R.setInitialAttributesOnChild(s)}static setInitialAttributesOnChild(t){const e=R.getInnerElement(t),s=R.isElementActive(e),n=R.getOuterElement(e);e==null||e.setAttribute("aria-selected",s.toString()),n!==e&&R.setAttributeIfNotExists(n,"role","presentation"),e&&!s&&e.setAttribute("tabindex","-1"),R.setAttributeIfNotExists(e,"role","tab"),R.setInitialAttributesOnTargetPanel(e)}static setInitialAttributesOnTargetPanel(t){const e=_t(t);e&&(R.setAttributeIfNotExists(e,"role","tabpanel"),t!=null&&t.id&&R.setAttributeIfNotExists(e,"aria-labelledby",`#${t.id}`))}static setAttributeIfNotExists(t,e,s){t&&!t.hasAttribute(e)&&t.setAttribute(e,s)}static isElementActive(t){return t!==null&&t.classList.contains(Ht)}static getInnerElement(t){return t!=null&&t.matches(kt)?t:x.findOne(kt,t)}static getOuterElement(t){return(t==null?void 0:t.closest(Ls))||t}}ut(R,"show","trigger");const Ue=["top","right","bottom","left"],ye=["start","end"],be=Ue.reduce((i,t)=>i.concat(t,t+"-"+ye[0],t+"-"+ye[1]),[]),B=Math.min,N=Math.max,Tt=Math.round,Et=Math.floor,Z=i=>({x:i,y:i}),Rs={left:"right",right:"left",bottom:"top",top:"bottom"},_s={start:"end",end:"start"};function Ut(i,t,e){return N(i,B(t,e))}function U(i,t){return typeof i=="function"?i(t):i}function F(i){return i.split("-")[0]}function W(i){return i.split("-")[1]}function Yt(i){return i==="x"?"y":"x"}function Kt(i){return i==="y"?"height":"width"}function et(i){return["top","bottom"].includes(F(i))?"y":"x"}function Gt(i){return Yt(et(i))}function ze(i,t,e){e===void 0&&(e=!1);const s=W(i),n=Gt(i),r=Kt(n);let o=n==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=bt(o)),[o,bt(o)]}function Ms(i){const t=bt(i);return[yt(i),t,yt(t)]}function yt(i){return i.replace(/start|end/g,t=>_s[t])}function $s(i,t,e){const s=["left","right"],n=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(i){case"top":case"bottom":return e?t?n:s:t?s:n;case"left":case"right":return t?r:o;default:return[]}}function Is(i,t,e,s){const n=W(i);let r=$s(F(i),e==="start",s);return n&&(r=r.map(o=>o+"-"+n),t&&(r=r.concat(r.map(yt)))),r}function bt(i){return i.replace(/left|right|bottom|top/g,t=>Rs[t])}function Ps(i){return{top:0,right:0,bottom:0,left:0,...i}}function jt(i){return typeof i!="number"?Ps(i):{top:i,right:i,bottom:i,left:i}}function ot(i){return{...i,top:i.y,left:i.x,right:i.x+i.width,bottom:i.y+i.height}}function xe(i,t,e){let{reference:s,floating:n}=i;const r=et(t),o=Gt(t),l=Kt(o),a=F(t),h=r==="y",f=s.x+s.width/2-n.width/2,c=s.y+s.height/2-n.height/2,d=s[l]/2-n[l]/2;let u;switch(a){case"top":u={x:f,y:s.y-n.height};break;case"bottom":u={x:f,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:c};break;case"left":u={x:s.x-n.width,y:c};break;default:u={x:s.x,y:s.y}}switch(W(t)){case"start":u[o]-=d*(e&&h?-1:1);break;case"end":u[o]+=d*(e&&h?-1:1);break}return u}const Fs=async(i,t,e)=>{const{placement:s="bottom",strategy:n="absolute",middleware:r=[],platform:o}=e,l=r.filter(Boolean),a=await(o.isRTL==null?void 0:o.isRTL(t));let h=await o.getElementRects({reference:i,floating:t,strategy:n}),{x:f,y:c}=xe(h,s,a),d=s,u={},g=0;for(let m=0;m({name:"arrow",options:i,async fn(t){const{x:e,y:s,placement:n,rects:r,platform:o,elements:l,middlewareData:a}=t,{element:h,padding:f=0}=U(i,t)||{};if(h==null)return{};const c=jt(f),d={x:e,y:s},u=Gt(n),g=Kt(u),m=await o.getDimensions(h),A=u==="y",E=A?"top":"left",w=A?"bottom":"right",T=A?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[u]-d[u]-r.floating[g],y=d[u]-r.reference[u],v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h));let C=v?v[T]:0;(!C||!await(o.isElement==null?void 0:o.isElement(v)))&&(C=l.floating[T]||r.floating[g]);const M=b/2-y/2,$=C/2-m[g]/2-1,S=B(c[E],$),D=B(c[w],$),O=S,H=C-m[g]-D,L=C/2-m[g]/2+M,_=Ut(O,L,H),I=!a.arrow&&W(n)!=null&&L!==_&&r.reference[g]/2-(LW(n)===i),...e.filter(n=>W(n)!==i)]:e.filter(n=>F(n)===n)).filter(n=>i?W(n)===i||(t?yt(n)!==n:!1):!0)}const ks=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(t){var e,s,n;const{rects:r,middlewareData:o,placement:l,platform:a,elements:h}=t,{crossAxis:f=!1,alignment:c,allowedPlacements:d=be,autoAlignment:u=!0,...g}=U(i,t),m=c!==void 0||d===be?Hs(c||null,u,d):d,A=await J(t,g),E=((e=o.autoPlacement)==null?void 0:e.index)||0,w=m[E];if(w==null)return{};const T=ze(w,r,await(a.isRTL==null?void 0:a.isRTL(h.floating)));if(l!==w)return{reset:{placement:m[0]}};const b=[A[F(w)],A[T[0]],A[T[1]]],y=[...((s=o.autoPlacement)==null?void 0:s.overflows)||[],{placement:w,overflows:b}],v=m[E+1];if(v)return{data:{index:E+1,overflows:y},reset:{placement:v}};const C=y.map(S=>{const D=W(S.placement);return[S.placement,D&&f?S.overflows.slice(0,2).reduce((O,H)=>O+H,0):S.overflows[0],S.overflows]}).sort((S,D)=>S[1]-D[1]),$=((n=C.filter(S=>S[2].slice(0,W(S[0])?2:3).every(D=>D<=0))[0])==null?void 0:n[0])||C[0][0];return $!==l?{data:{index:E+1,overflows:y},reset:{placement:$}}:{}}}},Ws=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,s;const{placement:n,middlewareData:r,rects:o,initialPlacement:l,platform:a,elements:h}=t,{mainAxis:f=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...A}=U(i,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const E=F(n),w=F(l)===l,T=await(a.isRTL==null?void 0:a.isRTL(h.floating)),b=d||(w||!m?[bt(l)]:Ms(l));!d&&g!=="none"&&b.push(...Is(l,m,g,T));const y=[l,...b],v=await J(t,A),C=[];let M=((s=r.flip)==null?void 0:s.overflows)||[];if(f&&C.push(v[E]),c){const O=ze(n,o,T);C.push(v[O[0]],v[O[1]])}if(M=[...M,{placement:n,overflows:C}],!C.every(O=>O<=0)){var $,S;const O=((($=r.flip)==null?void 0:$.index)||0)+1,H=y[O];if(H)return{data:{index:O,overflows:M},reset:{placement:H}};let L=(S=M.filter(_=>_.overflows[0]<=0).sort((_,I)=>_.overflows[1]-I.overflows[1])[0])==null?void 0:S.placement;if(!L)switch(u){case"bestFit":{var D;const _=(D=M.map(I=>[I.placement,I.overflows.filter(k=>k>0).reduce((k,Dt)=>k+Dt,0)]).sort((I,k)=>I[1]-k[1])[0])==null?void 0:D[0];_&&(L=_);break}case"initialPlacement":L=l;break}if(n!==L)return{reset:{placement:L}}}return{}}}};function ve(i,t){return{top:i.top-t.height,right:i.right-t.width,bottom:i.bottom-t.height,left:i.left-t.width}}function Se(i){return Ue.some(t=>i[t]>=0)}const Bs=function(i){return i===void 0&&(i={}),{name:"hide",options:i,async fn(t){const{rects:e}=t,{strategy:s="referenceHidden",...n}=U(i,t);switch(s){case"referenceHidden":{const r=await J(t,{...n,elementContext:"reference"}),o=ve(r,e.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Se(o)}}}case"escaped":{const r=await J(t,{...n,altBoundary:!0}),o=ve(r,e.floating);return{data:{escapedOffsets:o,escaped:Se(o)}}}default:return{}}}}};function Qe(i){const t=B(...i.map(r=>r.left)),e=B(...i.map(r=>r.top)),s=N(...i.map(r=>r.right)),n=N(...i.map(r=>r.bottom));return{x:t,y:e,width:s-t,height:n-e}}function Us(i){const t=i.slice().sort((n,r)=>n.y-r.y),e=[];let s=null;for(let n=0;ns.height/2?e.push([r]):e[e.length-1].push(r),s=r}return e.map(n=>ot(Qe(n)))}const zs=function(i){return i===void 0&&(i={}),{name:"inline",options:i,async fn(t){const{placement:e,elements:s,rects:n,platform:r,strategy:o}=t,{padding:l=2,x:a,y:h}=U(i,t),f=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(s.reference))||[]),c=Us(f),d=ot(Qe(f)),u=jt(l);function g(){if(c.length===2&&c[0].left>c[1].right&&a!=null&&h!=null)return c.find(A=>a>A.left-u.left&&aA.top-u.top&&h=2){if(et(e)==="y"){const S=c[0],D=c[c.length-1],O=F(e)==="top",H=S.top,L=D.bottom,_=O?S.left:D.left,I=O?S.right:D.right,k=I-_,Dt=L-H;return{top:H,bottom:L,left:_,right:I,width:k,height:Dt,x:_,y:H}}const A=F(e)==="left",E=N(...c.map(S=>S.right)),w=B(...c.map(S=>S.left)),T=c.filter(S=>A?S.left===w:S.right===E),b=T[0].top,y=T[T.length-1].bottom,v=w,C=E,M=C-v,$=y-b;return{top:b,bottom:y,left:v,right:C,width:M,height:$,x:v,y:b}}return d}const m=await r.getElementRects({reference:{getBoundingClientRect:g},floating:s.floating,strategy:o});return n.reference.x!==m.reference.x||n.reference.y!==m.reference.y||n.reference.width!==m.reference.width||n.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}};async function Qs(i,t){const{placement:e,platform:s,elements:n}=i,r=await(s.isRTL==null?void 0:s.isRTL(n.floating)),o=F(e),l=W(e),a=et(e)==="y",h=["left","top"].includes(o)?-1:1,f=r&&a?-1:1,c=U(t,i);let{mainAxis:d,crossAxis:u,alignmentAxis:g}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return l&&typeof g=="number"&&(u=l==="end"?g*-1:g),a?{x:u*f,y:d*h}:{x:d*h,y:u*f}}const Ys=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,s;const{x:n,y:r,placement:o,middlewareData:l}=t,a=await Qs(t,i);return o===((e=l.offset)==null?void 0:e.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:n+a.x,y:r+a.y,data:{...a,placement:o}}}}},Ks=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){const{x:e,y:s,placement:n}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:l={fn:A=>{let{x:E,y:w}=A;return{x:E,y:w}}},...a}=U(i,t),h={x:e,y:s},f=await J(t,a),c=et(F(n)),d=Yt(c);let u=h[d],g=h[c];if(r){const A=d==="y"?"top":"left",E=d==="y"?"bottom":"right",w=u+f[A],T=u-f[E];u=Ut(w,u,T)}if(o){const A=c==="y"?"top":"left",E=c==="y"?"bottom":"right",w=g+f[A],T=g-f[E];g=Ut(w,g,T)}const m=l.fn({...t,[d]:u,[c]:g});return{...m,data:{x:m.x-e,y:m.y-s}}}}},Gs=function(i){return i===void 0&&(i={}),{options:i,fn(t){const{x:e,y:s,placement:n,rects:r,middlewareData:o}=t,{offset:l=0,mainAxis:a=!0,crossAxis:h=!0}=U(i,t),f={x:e,y:s},c=et(n),d=Yt(c);let u=f[d],g=f[c];const m=U(l,t),A=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const T=d==="y"?"height":"width",b=r.reference[d]-r.floating[T]+A.mainAxis,y=r.reference[d]+r.reference[T]-A.mainAxis;uy&&(u=y)}if(h){var E,w;const T=d==="y"?"width":"height",b=["top","left"].includes(F(n)),y=r.reference[c]-r.floating[T]+(b&&((E=o.offset)==null?void 0:E[c])||0)+(b?0:A.crossAxis),v=r.reference[c]+r.reference[T]+(b?0:((w=o.offset)==null?void 0:w[c])||0)-(b?A.crossAxis:0);gv&&(g=v)}return{[d]:u,[c]:g}}}},js=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(t){const{placement:e,rects:s,platform:n,elements:r}=t,{apply:o=()=>{},...l}=U(i,t),a=await J(t,l),h=F(e),f=W(e),c=et(e)==="y",{width:d,height:u}=s.floating;let g,m;h==="top"||h==="bottom"?(g=h,m=f===(await(n.isRTL==null?void 0:n.isRTL(r.floating))?"start":"end")?"left":"right"):(m=h,g=f==="end"?"top":"bottom");const A=u-a[g],E=d-a[m],w=!t.middlewareData.shift;let T=A,b=E;if(c){const v=d-a.left-a.right;b=f||w?B(E,v):v}else{const v=u-a.top-a.bottom;T=f||w?B(A,v):v}if(w&&!f){const v=N(a.left,0),C=N(a.right,0),M=N(a.top,0),$=N(a.bottom,0);c?b=d-2*(v!==0||C!==0?v+C:N(a.left,a.right)):T=u-2*(M!==0||$!==0?M+$:N(a.top,a.bottom))}await o({...t,availableWidth:b,availableHeight:T});const y=await n.getDimensions(r.floating);return d!==y.width||u!==y.height?{reset:{rects:!0}}:{}}}};function X(i){return Ye(i)?(i.nodeName||"").toLowerCase():"#document"}function P(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function G(i){var t;return(t=(Ye(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function Ye(i){return i instanceof Node||i instanceof P(i).Node}function K(i){return i instanceof Element||i instanceof P(i).Element}function Q(i){return i instanceof HTMLElement||i instanceof P(i).HTMLElement}function Ce(i){return typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof P(i).ShadowRoot}function gt(i){const{overflow:t,overflowX:e,overflowY:s,display:n}=V(i);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(n)}function qs(i){return["table","td","th"].includes(X(i))}function qt(i){const t=Zt(),e=V(i);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Ke(i){let t=lt(i);for(;Q(t)&&!Ot(t);){if(qt(t))return t;t=lt(t)}return null}function Zt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ot(i){return["html","body","#document"].includes(X(i))}function V(i){return P(i).getComputedStyle(i)}function Lt(i){return K(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function lt(i){if(X(i)==="html")return i;const t=i.assignedSlot||i.parentNode||Ce(i)&&i.host||G(i);return Ce(t)?t.host:t}function Ge(i){const t=lt(i);return Ot(t)?i.ownerDocument?i.ownerDocument.body:i.body:Q(t)&>(t)?t:Ge(t)}function at(i,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const n=Ge(i),r=n===((s=i.ownerDocument)==null?void 0:s.body),o=P(n);return r?t.concat(o,o.visualViewport||[],gt(n)?n:[],o.frameElement&&e?at(o.frameElement):[]):t.concat(n,at(n,[],e))}function je(i){const t=V(i);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const n=Q(i),r=n?i.offsetWidth:e,o=n?i.offsetHeight:s,l=Tt(e)!==r||Tt(s)!==o;return l&&(e=r,s=o),{width:e,height:s,$:l}}function Xt(i){return K(i)?i:i.contextElement}function rt(i){const t=Xt(i);if(!Q(t))return Z(1);const e=t.getBoundingClientRect(),{width:s,height:n,$:r}=je(t);let o=(r?Tt(e.width):e.width)/s,l=(r?Tt(e.height):e.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Zs=Z(0);function qe(i){const t=P(i);return!Zt()||!t.visualViewport?Zs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xs(i,t,e){return t===void 0&&(t=!1),!e||t&&e!==P(i)?!1:t}function tt(i,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const n=i.getBoundingClientRect(),r=Xt(i);let o=Z(1);t&&(s?K(s)&&(o=rt(s)):o=rt(i));const l=Xs(r,e,s)?qe(r):Z(0);let a=(n.left+l.x)/o.x,h=(n.top+l.y)/o.y,f=n.width/o.x,c=n.height/o.y;if(r){const d=P(r),u=s&&K(s)?P(s):s;let g=d.frameElement;for(;g&&s&&u!==d;){const m=rt(g),A=g.getBoundingClientRect(),E=V(g),w=A.left+(g.clientLeft+parseFloat(E.paddingLeft))*m.x,T=A.top+(g.clientTop+parseFloat(E.paddingTop))*m.y;a*=m.x,h*=m.y,f*=m.x,c*=m.y,a+=w,h+=T,g=P(g).frameElement}}return ot({width:f,height:c,x:a,y:h})}const Js=[":popover-open",":modal"];function Ze(i){let t=!1,e=0,s=0;function n(r){try{t=t||i.matches(r)}catch{}}if(Js.forEach(r=>{n(r)}),t){const r=Ke(i);if(r){const o=r.getBoundingClientRect();e=o.x,s=o.y}}return[t,e,s]}function tn(i){let{elements:t,rect:e,offsetParent:s,strategy:n}=i;const r=G(s),[o]=t?Ze(t.floating):[!1];if(s===r||o)return e;let l={scrollLeft:0,scrollTop:0},a=Z(1);const h=Z(0),f=Q(s);if((f||!f&&n!=="fixed")&&((X(s)!=="body"||gt(r))&&(l=Lt(s)),Q(s))){const c=tt(s);a=rt(s),h.x=c.x+s.clientLeft,h.y=c.y+s.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-l.scrollLeft*a.x+h.x,y:e.y*a.y-l.scrollTop*a.y+h.y}}function en(i){return Array.from(i.getClientRects())}function Xe(i){return tt(G(i)).left+Lt(i).scrollLeft}function sn(i){const t=G(i),e=Lt(i),s=i.ownerDocument.body,n=N(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=N(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+Xe(i);const l=-e.scrollTop;return V(s).direction==="rtl"&&(o+=N(t.clientWidth,s.clientWidth)-n),{width:n,height:r,x:o,y:l}}function nn(i,t){const e=P(i),s=G(i),n=e.visualViewport;let r=s.clientWidth,o=s.clientHeight,l=0,a=0;if(n){r=n.width,o=n.height;const h=Zt();(!h||h&&t==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:r,height:o,x:l,y:a}}function rn(i,t){const e=tt(i,!0,t==="fixed"),s=e.top+i.clientTop,n=e.left+i.clientLeft,r=Q(i)?rt(i):Z(1),o=i.clientWidth*r.x,l=i.clientHeight*r.y,a=n*r.x,h=s*r.y;return{width:o,height:l,x:a,y:h}}function Oe(i,t,e){let s;if(t==="viewport")s=nn(i,e);else if(t==="document")s=sn(G(i));else if(K(t))s=rn(t,e);else{const n=qe(i);s={...t,x:t.x-n.x,y:t.y-n.y}}return ot(s)}function Je(i,t){const e=lt(i);return e===t||!K(e)||Ot(e)?!1:V(e).position==="fixed"||Je(e,t)}function on(i,t){const e=t.get(i);if(e)return e;let s=at(i,[],!1).filter(l=>K(l)&&X(l)!=="body"),n=null;const r=V(i).position==="fixed";let o=r?lt(i):i;for(;K(o)&&!Ot(o);){const l=V(o),a=qt(o);!a&&l.position==="fixed"&&(n=null),(r?!a&&!n:!a&&l.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||gt(o)&&!a&&Je(i,o))?s=s.filter(f=>f!==o):n=l,o=lt(o)}return t.set(i,s),s}function ln(i){let{element:t,boundary:e,rootBoundary:s,strategy:n}=i;const o=[...e==="clippingAncestors"?on(t,this._c):[].concat(e),s],l=o[0],a=o.reduce((h,f)=>{const c=Oe(t,f,n);return h.top=N(c.top,h.top),h.right=B(c.right,h.right),h.bottom=B(c.bottom,h.bottom),h.left=N(c.left,h.left),h},Oe(t,l,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function an(i){const{width:t,height:e}=je(i);return{width:t,height:e}}function cn(i,t,e,s){const n=Q(t),r=G(t),o=e==="fixed",l=tt(i,!0,o,t);let a={scrollLeft:0,scrollTop:0};const h=Z(0);if(n||!n&&!o)if((X(t)!=="body"||gt(r))&&(a=Lt(t)),n){const m=tt(t,!0,o,t);h.x=m.x+t.clientLeft,h.y=m.y+t.clientTop}else r&&(h.x=Xe(r));let f=l.left+a.scrollLeft-h.x,c=l.top+a.scrollTop-h.y;const[d,u,g]=Ze(s);return d&&(f+=u,c+=g,n&&(f+=t.clientLeft,c+=t.clientTop)),{x:f,y:c,width:l.width,height:l.height}}function Le(i,t){return!Q(i)||V(i).position==="fixed"?null:t?t(i):i.offsetParent}function ti(i,t){const e=P(i);if(!Q(i))return e;let s=Le(i,t);for(;s&&qs(s)&&V(s).position==="static";)s=Le(s,t);return s&&(X(s)==="html"||X(s)==="body"&&V(s).position==="static"&&!qt(s))?e:s||Ke(i)||e}const hn=async function(i){const t=this.getOffsetParent||ti,e=this.getDimensions;return{reference:cn(i.reference,await t(i.floating),i.strategy,i.floating),floating:{x:0,y:0,...await e(i.floating)}}};function un(i){return V(i).direction==="rtl"}const ei={convertOffsetParentRelativeRectToViewportRelativeRect:tn,getDocumentElement:G,getClippingRect:ln,getOffsetParent:ti,getElementRects:hn,getClientRects:en,getDimensions:an,getScale:rt,isElement:K,isRTL:un};function dn(i,t){let e=null,s;const n=G(i);function r(){var l;clearTimeout(s),(l=e)==null||l.disconnect(),e=null}function o(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const{left:h,top:f,width:c,height:d}=i.getBoundingClientRect();if(l||t(),!c||!d)return;const u=Et(f),g=Et(n.clientWidth-(h+c)),m=Et(n.clientHeight-(f+d)),A=Et(h),w={rootMargin:-u+"px "+-g+"px "+-m+"px "+-A+"px",threshold:N(0,B(1,a))||1};let T=!0;function b(y){const v=y[0].intersectionRatio;if(v!==a){if(!T)return o();v?o(!1,v):s=setTimeout(()=>{o(!1,1e-7)},100)}T=!1}try{e=new IntersectionObserver(b,{...w,root:n.ownerDocument})}catch{e=new IntersectionObserver(b,w)}e.observe(i)}return o(!0),r}function ii(i,t,e,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=s,h=Xt(i),f=n||r?[...h?at(h):[],...at(t)]:[];f.forEach(E=>{n&&E.addEventListener("scroll",e,{passive:!0}),r&&E.addEventListener("resize",e)});const c=h&&l?dn(h,e):null;let d=-1,u=null;o&&(u=new ResizeObserver(E=>{let[w]=E;w&&w.target===h&&u&&(u.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=u)==null||T.observe(t)})),e()}),h&&!a&&u.observe(h),u.observe(t));let g,m=a?tt(i):null;a&&A();function A(){const E=tt(i);m&&(E.x!==m.x||E.y!==m.y||E.width!==m.width||E.height!==m.height)&&e(),m=E,g=requestAnimationFrame(A)}return e(),()=>{var E;f.forEach(w=>{n&&w.removeEventListener("scroll",e),r&&w.removeEventListener("resize",e)}),c==null||c(),(E=u)==null||E.disconnect(),u=null,a&&cancelAnimationFrame(g)}}const fn=ks,gn=Ks,pn=Ws,mn=js,En=Bs,An=Vs,wn=zs,Tn=Gs,yn=(i,t,e)=>{const s=new Map,n={platform:ei,...e},r={...n.platform,_c:s};return Fs(i,t,{...n,platform:r})},ct=Object.freeze(Object.defineProperty({__proto__:null,arrow:An,autoPlacement:fn,autoUpdate:ii,computePosition:yn,detectOverflow:J,flip:pn,getOverflowAncestors:at,hide:En,inline:wn,limitShift:Tn,offset:Ys,platform:ei,shift:gn,size:mn},Symbol.toStringTag,{value:"Module"})),bn="tooltip",xn="tooltip",Nt=`.${xn}`,vn=`hide${Nt}`,Sn=`hidden${Nt}`,Cn=`show${Nt}`,On=`shown${Nt}`,Ne="click",Ln="mouseenter",Nn="mouseleave",q="hover",st="click",Dn='[data-spirit-element="arrow"]',Rn='[data-spirit-element="tooltip-wrapper"]',_n="is-visible",Wt="is-hidden",De=i=>i.split(",").map(t=>t.trim());class z extends Y{constructor(t,e){if(typeof ct>"u")throw new TypeError("Floating UI dependency is missing. Please, install it (https://floating-ui.com/)");super(t,e),this.autoCloseHandler=s=>{const n=this.getTrigger(),r=n&&Ie(n,s)&&s.target!==this.tip;s.target&&r&&(this.activeTrigger[st]=!1,this.activeTrigger[q]=!1,this.leave())},this.activeTrigger={},this.isHovered=!1,this.isToggled=!1,this.tip=this.getTipElement(),this.triggers=this.getTriggers(),this.isPlacementControlled()&&(this.trigger=this.getTipTooltipWrapper(),this.arrow=this.tip.querySelector(Dn),this.tooltipComputedStyle=window.getComputedStyle(this.tip),this.tooltipMaxWidth=parseInt(this.tooltipComputedStyle.maxWidth,10),this.tooltipOffset=parseInt(this.tooltipComputedStyle.getPropertyValue("--tooltip-offset"),10),this.arrowCornerOffset=this.arrow&&parseInt(window.getComputedStyle(this.arrow).getPropertyValue("--tooltip-arrow-corner-offset"),10),this.arrowWidth=this.arrow&&parseInt(window.getComputedStyle(this.arrow).getPropertyValue("width"),10),this.tip&&this.trigger&&ii(this.trigger,this.tip,()=>this.trigger&&this.updateTooltipPosition(this.trigger,this.tip))),this.addEventListeners()}static get NAME(){return bn}getTriggers(){const t=this.config,e=[st,q];return t.trigger?De(t.trigger):e}toggle(){if(this.activeTrigger[st]="click"in this.activeTrigger?!this.activeTrigger[st]:!0,this.activeTrigger[q]="hover"in this.activeTrigger?!this.activeTrigger[q]:!0,this.isShown()){this.leave();return}this.enter()}isPlacementControlled(){const t=this.config,e="placementControlled";return e in t&&t[e]!==!1}updateConfig(t){const e=this.config;this.trigger&&this.tip&&(this.config={...e,...t},this.updateTooltipPosition(this.trigger,this.tip))}show(){var e,s;if(((s=(e=this.element)==null?void 0:e.style)==null?void 0:s.display)==="none")throw new Error("Please use show on elements without `display: none`");if(!p.trigger(this.element,z.eventName(Cn)).defaultPrevented){if(this.element.setAttribute("aria-describedby",this.tip.getAttribute("id")),this.tip.classList.remove(Wt),"ontouchstart"in document.documentElement)for(const n of[].concat(...document.body.children))p.on(n,"mouseover",null);this.trigger&&this.tip&&this.updateTooltipPosition(this.trigger,this.tip),p.trigger(this.element,z.eventName(On))}}hide(){if(!(!this.isShown()||p.trigger(this.element,z.eventName(vn)).defaultPrevented)){if(this.tip.classList.add(Wt),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))p.off(e,"mouseover",null);this.activeTrigger[st]=!1,this.activeTrigger[q]=!1,this.isHovered=!1,!this.isWithActiveTrigger()&&(this.element.removeAttribute("aria-describedby"),p.trigger(this.element,z.eventName(Sn)))}}isShown(){var t,e;return this.tip&&(((t=this.tip.classList)==null?void 0:t.contains(_n))||!((e=this.tip.classList)!=null&&e.contains(Wt)))}getTipTooltipWrapper(){var s;const t=this.tip.getAttribute("id");return(s=document.getElementById(t))==null?void 0:s.closest(Rn)}getTipElement(){var t,e,s;return this.tip||(this.tip=x.findOne((e=(t=this.element)==null?void 0:t.dataset)==null?void 0:e.spiritTarget)||this.element||((s=this.element)==null?void 0:s.parentElement)),this.tip}getTooltipFloatingProps(){const{enableFlipping:t,enableShifting:e,enableSizing:s,enableFlippingCrossAxis:n,flipFallbackAxisSideDirection:r,flipFallbackPlacements:o,placement:l}=this.config;return{placement:l,flip:t??!0,shift:e??!0,size:s??!0,flipCrossAxis:n??!0,flipFallbackPlacements:o&&De(o),flipFallbackAxisSideDirection:r||"none"}}getFlipConfig(){const{flip:t}=ct,e=this.getTooltipFloatingProps(),{flip:s,flipCrossAxis:n,flipFallbackAxisSideDirection:r,flipFallbackPlacements:o}=e;return s&&t({mainAxis:s,crossAxis:n,fallbackAxisSideDirection:r,fallbackPlacements:o||void 0})}getShiftConfig(){const{shift:t,limitShift:e}=ct,s=this.getTooltipFloatingProps(),n=(this.arrowCornerOffset||0)+(this.arrowWidth||0);return s.shift&&t({limiter:e({offset:()=>({mainAxis:n})})})}getSizeConfig(t){const{size:e}=ct,{tooltipMaxWidth:s}=this;return this.getTooltipFloatingProps().size&&s?e({apply({availableWidth:r}){Object.assign(t.style,{maxWidth:`${s{Object.assign(e.style,{top:`${g}px`,left:`${u}px`});const E=A.split("-")[0],w={top:"bottom",right:"left",bottom:"top",left:"right"}[E];if(m.arrow&&a){const T=w==="top"||w==="bottom"?a.offsetHeight:(a.offsetHeight+a.offsetWidth)/2,{x:b,y}=m.arrow;Object.assign(a.style,{left:b!=null?`${b}px`:"",top:y!=null?`${y}px`:"",bottom:"",right:"",[w]:`-${Math.floor(T)}px`})}e.dataset.spiritPlacement=A})}isWithActiveTrigger(){return Object.values(this.activeTrigger).includes(!0)}enter(){if(this.isShown()||this.isHovered){this.isHovered=!0;return}this.isHovered=!0,this.show()}leave(){this.isWithActiveTrigger()||(this.isHovered=!1,this.hide())}addEventListeners(){var t,e;(t=this.triggers)!=null&&t.includes(st)&&this.addClickEventListeners(),(e=this.triggers)!=null&&e.includes(q)&&this.addMouseEventListeners()}addClickEventListeners(){const t=this.getTrigger();p.on(document,Ne,e=>this.autoCloseHandler(e)),p.on(t,Ne,()=>{z.getOrCreateInstance(this.element).toggle()})}addMouseEventListeners(){const t=this.getTrigger();p.on(t,Ln,()=>{const e=z.getOrCreateInstance(this.element);e.activeTrigger[q]=!0,e.enter()}),p.on(t,Nn,()=>{const e=z.getOrCreateInstance(this.element);e.activeTrigger[q]=!1,e.leave()})}}dt(z,void 0,"target");$e(z,"hide");export{qi as F,Xi as M,z as T}; diff --git a/docs/assets/spirit-web-entry.66a02047.js b/docs/assets/spirit-web-entry.66a02047.js new file mode 100644 index 0000000000..4449310375 --- /dev/null +++ b/docs/assets/spirit-web-entry.66a02047.js @@ -0,0 +1 @@ +import{T as s}from"./spirit-web-chunk.6c1d1de4.js";const f="my-dismissible-button",y="my-dismissible-tooltip-with-floating-ui",t="show-tooltip",h=document.getElementById(y),m=new s(h);window.localStorage.getItem(t)&&m.toggle();document.getElementById(f).addEventListener("click",()=>{const p=window.localStorage.getItem(t),r=m.isShown();p&&!r?window.localStorage.removeItem(t):window.localStorage.setItem(t,!0)});document.getElementById("my-dismissible-tooltip-button").addEventListener("click",()=>{window.localStorage.removeItem(t)});const o=document.getElementById("my-advanced-flip"),c=document.getElementById("my-advanced-flipCrossAxis"),d=document.getElementById("my-advanced-shift"),i=document.getElementById("my-advanced-size"),l=document.getElementById("my-advanced-select"),a=document.getElementById("my-advanced-select-fallback"),e=s.getOrCreateInstance(document.getElementById("my-advanced-tooltip"));o.addEventListener("change",()=>e.updateConfig({enableFlipping:o.checked}));c.addEventListener("change",()=>{e.updateConfig({enableFlippingCrossAxis:c.checked})});d.addEventListener("change",()=>{e.updateConfig({enableShifting:d.checked})});i.addEventListener("change",()=>{e.updateConfig({enableSizing:i.checked})});l.addEventListener("change",()=>{e.updateConfig({placement:l.value})});a.addEventListener("change",()=>{e.updateConfig({flipFallbackPlacements:a.value})});const n=document.getElementById("my-advanced-viewport"),g=document.getElementById("my-advanced-content");n.scrollLeft=(g.offsetWidth-n.offsetWidth)/2;n.scrollTop=(g.offsetHeight-n.offsetHeight)/2; diff --git a/docs/assets/spirit-web-entry.d15720d0.js b/docs/assets/spirit-web-entry.d261b39b.js similarity index 97% rename from docs/assets/spirit-web-entry.d15720d0.js rename to docs/assets/spirit-web-entry.d261b39b.js index e7255e832b..3e01962c67 100644 --- a/docs/assets/spirit-web-entry.d15720d0.js +++ b/docs/assets/spirit-web-entry.d261b39b.js @@ -1 +1 @@ -import{M,F as I}from"./spirit-web-chunk.19182ae9.js";window.addEventListener("DOMContentLoaded",()=>{let t;const l=document.getElementById("example_image_preview"),s=new M(l),u=l.querySelector("[data-example-content]"),y=l.querySelector('[data-element="cancel"]'),c=document.getElementById("example_customImagePreview"),a=I.getInstance(c),m=i=>i.type.split("/")[0]==="image",h=i=>{if(m(i)){const r=new FileReader;r.readAsDataURL(i),r.onloadend=()=>{const g=r.result;localStorage.setItem("image",g),u.innerHTML=`${i.name}`,s.show()}}},p=()=>{a.removeFromQueue(a.getUpdatedFileName(t.name)),v()},v=()=>{s.hide(),u.innerHTML="",t=void 0};y.addEventListener("click",p),c.addEventListener("queuedFile.fileUploader",i=>{t=i.currentFile,h(t)})});window.addEventListener("DOMContentLoaded",()=>{let t;const l=document.getElementById("example_modal_data"),s=new M(l),u=l.querySelector("[data-example-content]"),y=l.querySelector('[data-element="cancel"]'),c=document.getElementById("example_customMetaData"),a=I.getInstance(c);let m=!1;const h=e=>e.type.split("/")[0]==="image",p=(e,d,o)=>{const n=document.querySelector("#FileUploaderListWithMetaData"),L=a.getUpdatedFileName(d.name),F=n==null?void 0:n.querySelector(`input[name="attachments_${L}_meta"]`);if(o)if(F)F.value=JSON.stringify(o);else{const f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("name",`attachments_${L}_meta`),f.setAttribute("value",JSON.stringify(o)),n==null||n.appendChild(f)}o||F&&F.remove()},v=e=>{var d;(d=document.querySelector(`input[name="attachments_${e}_meta"]`))==null||d.remove()},i=(e,d)=>{if(h(e)){const o=new FileReader;o.readAsDataURL(e),o.onloadend=()=>{const n=o.result;localStorage.setItem("image",n),u.innerHTML=`${e.name}`,s.show()}}a.updateQueue(a.getUpdatedFileName(e.name),e,d,p)},r=e=>{const d=e.target.closest("li").id,o=m?{x:30,y:30,cropWidth:150,cropHeight:150,originalWidth:560,originalHeight:330}:{x:22,y:0,cropWidth:110,cropHeight:100,originalWidth:560,originalHeight:330};m=!m;const n=a.getFileFromQueue(d).file;a.updateQueue(d,n,o,p)};moduleFunctions.customEdit=r;const g=()=>{a.removeFromQueue(a.getUpdatedFileName(t.name)),U()},U=()=>{s.hide(),u.innerHTML="",t=void 0};y.addEventListener("click",g),c.addEventListener("queuedFile.fileUploader",e=>{t=e.currentFile,i(t)}),c.addEventListener("unqueuedFile.fileUploader",e=>{v(e.currentFile)}),c.addEventListener("editFile.fileUploader",e=>{r(e.currentFile)})});const w=document.querySelector("#form-example"),q=document.querySelector("#example-composition"),E=I.createInstance(q);w.addEventListener("submit",t=>{t.preventDefault();const l=new FormData(w);console.log("form element",w),console.log("form data",l),console.log("file queue",E.getFileQueue),setTimeout(()=>{E.clearFileQueue(),console.log("file queue after submit",E.getFileQueue)},250)}); +import{M,F as I}from"./spirit-web-chunk.6c1d1de4.js";window.addEventListener("DOMContentLoaded",()=>{let t;const l=document.getElementById("example_image_preview"),s=new M(l),u=l.querySelector("[data-example-content]"),y=l.querySelector('[data-element="cancel"]'),c=document.getElementById("example_customImagePreview"),a=I.getInstance(c),m=i=>i.type.split("/")[0]==="image",h=i=>{if(m(i)){const r=new FileReader;r.readAsDataURL(i),r.onloadend=()=>{const g=r.result;localStorage.setItem("image",g),u.innerHTML=`${i.name}`,s.show()}}},p=()=>{a.removeFromQueue(a.getUpdatedFileName(t.name)),v()},v=()=>{s.hide(),u.innerHTML="",t=void 0};y.addEventListener("click",p),c.addEventListener("queuedFile.fileUploader",i=>{t=i.currentFile,h(t)})});window.addEventListener("DOMContentLoaded",()=>{let t;const l=document.getElementById("example_modal_data"),s=new M(l),u=l.querySelector("[data-example-content]"),y=l.querySelector('[data-element="cancel"]'),c=document.getElementById("example_customMetaData"),a=I.getInstance(c);let m=!1;const h=e=>e.type.split("/")[0]==="image",p=(e,d,o)=>{const n=document.querySelector("#FileUploaderListWithMetaData"),L=a.getUpdatedFileName(d.name),F=n==null?void 0:n.querySelector(`input[name="attachments_${L}_meta"]`);if(o)if(F)F.value=JSON.stringify(o);else{const f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("name",`attachments_${L}_meta`),f.setAttribute("value",JSON.stringify(o)),n==null||n.appendChild(f)}o||F&&F.remove()},v=e=>{var d;(d=document.querySelector(`input[name="attachments_${e}_meta"]`))==null||d.remove()},i=(e,d)=>{if(h(e)){const o=new FileReader;o.readAsDataURL(e),o.onloadend=()=>{const n=o.result;localStorage.setItem("image",n),u.innerHTML=`${e.name}`,s.show()}}a.updateQueue(a.getUpdatedFileName(e.name),e,d,p)},r=e=>{const d=e.target.closest("li").id,o=m?{x:30,y:30,cropWidth:150,cropHeight:150,originalWidth:560,originalHeight:330}:{x:22,y:0,cropWidth:110,cropHeight:100,originalWidth:560,originalHeight:330};m=!m;const n=a.getFileFromQueue(d).file;a.updateQueue(d,n,o,p)};moduleFunctions.customEdit=r;const g=()=>{a.removeFromQueue(a.getUpdatedFileName(t.name)),U()},U=()=>{s.hide(),u.innerHTML="",t=void 0};y.addEventListener("click",g),c.addEventListener("queuedFile.fileUploader",e=>{t=e.currentFile,i(t)}),c.addEventListener("unqueuedFile.fileUploader",e=>{v(e.currentFile)}),c.addEventListener("editFile.fileUploader",e=>{r(e.currentFile)})});const w=document.querySelector("#form-example"),q=document.querySelector("#example-composition"),E=I.createInstance(q);w.addEventListener("submit",t=>{t.preventDefault();const l=new FormData(w);console.log("form element",w),console.log("form data",l),console.log("file queue",E.getFileQueue),setTimeout(()=>{E.clearFileQueue(),console.log("file queue after submit",E.getFileQueue)},250)}); diff --git a/docs/assets/spirit-web-entry.e8abe875.js b/docs/assets/spirit-web-entry.e8abe875.js deleted file mode 100644 index f364643565..0000000000 --- a/docs/assets/spirit-web-entry.e8abe875.js +++ /dev/null @@ -1 +0,0 @@ -import{T as s}from"./spirit-web-chunk.19182ae9.js";const g=document.getElementById("my-dismissible-tooltip-with-floating-ui"),n=new s(g);window.localStorage.getItem("my-tooltip")||n.show();document.getElementById("my-dismissible-button").addEventListener("click",()=>{n.show(),window.localStorage.removeItem("my-tooltip")});document.getElementById("my-dismissible-tooltip-with-floating-ui-button").addEventListener("click",()=>{n.hide(),window.localStorage.setItem("my-tooltip",!0)});const o=document.getElementById("my-advanced-flip"),d=document.getElementById("my-advanced-flipCrossAxis"),c=document.getElementById("my-advanced-shift"),i=document.getElementById("my-advanced-size"),l=document.getElementById("my-advanced-select"),a=document.getElementById("my-advanced-select-fallback"),e=s.getOrCreateInstance(document.getElementById("my-advanced-tooltip"));e.show();o.addEventListener("change",()=>e.updateConfig({enableFlipping:o.checked}));d.addEventListener("change",()=>{e.updateConfig({enableFlippingCrossAxis:d.checked})});c.addEventListener("change",()=>{e.updateConfig({enableShifting:c.checked})});i.addEventListener("change",()=>{e.updateConfig({enableSizing:i.checked})});l.addEventListener("change",()=>{e.updateConfig({placement:l.value})});a.addEventListener("change",()=>{e.updateConfig({flipFallbackPlacements:a.value})});const t=document.getElementById("my-advanced-viewport"),m=document.getElementById("my-advanced-content");t.scrollLeft=(m.offsetWidth-t.offsetWidth)/2;t.scrollTop=(m.offsetHeight-t.offsetHeight)/2; diff --git a/docs/index.html b/docs/index.html index 1257756e5b..505e13eb11 100644 --- a/docs/index.html +++ b/docs/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/icons/index.html b/docs/src/icons/index.html index 13e6026c5c..a09a648111 100644 --- a/docs/src/icons/index.html +++ b/docs/src/icons/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Accordion/index.html b/docs/src/scss/components/Accordion/index.html index 69e3d775d4..a09dcd622a 100644 --- a/docs/src/scss/components/Accordion/index.html +++ b/docs/src/scss/components/Accordion/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Alert/index.html b/docs/src/scss/components/Alert/index.html index b6ce5882d0..eaf47708da 100644 --- a/docs/src/scss/components/Alert/index.html +++ b/docs/src/scss/components/Alert/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Breadcrumbs/index.html b/docs/src/scss/components/Breadcrumbs/index.html index 5f9ff7ecc9..dab9e9f510 100644 --- a/docs/src/scss/components/Breadcrumbs/index.html +++ b/docs/src/scss/components/Breadcrumbs/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Button/index.html b/docs/src/scss/components/Button/index.html index 0a999cc115..2e9f4e1454 100644 --- a/docs/src/scss/components/Button/index.html +++ b/docs/src/scss/components/Button/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Checkbox/index.html b/docs/src/scss/components/Checkbox/index.html index da32477842..bf568aac90 100644 --- a/docs/src/scss/components/Checkbox/index.html +++ b/docs/src/scss/components/Checkbox/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Collapse/index.html b/docs/src/scss/components/Collapse/index.html index 2106c4c50c..68436c9962 100644 --- a/docs/src/scss/components/Collapse/index.html +++ b/docs/src/scss/components/Collapse/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Container/index.html b/docs/src/scss/components/Container/index.html index 8d51c1789f..afd1089c8b 100644 --- a/docs/src/scss/components/Container/index.html +++ b/docs/src/scss/components/Container/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Dropdown/index.html b/docs/src/scss/components/Dropdown/index.html index cd3f8da396..332ef627d2 100644 --- a/docs/src/scss/components/Dropdown/index.html +++ b/docs/src/scss/components/Dropdown/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/FieldGroup/index.html b/docs/src/scss/components/FieldGroup/index.html index 00b76101ca..3c656c5ee9 100644 --- a/docs/src/scss/components/FieldGroup/index.html +++ b/docs/src/scss/components/FieldGroup/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/FileUploader/index.html b/docs/src/scss/components/FileUploader/index.html index 3d6f314db2..2b9cf992fc 100644 --- a/docs/src/scss/components/FileUploader/index.html +++ b/docs/src/scss/components/FileUploader/index.html @@ -21,8 +21,8 @@ - - + + diff --git a/docs/src/scss/components/Grid/index.html b/docs/src/scss/components/Grid/index.html index 8301c43de6..f869d1a62f 100644 --- a/docs/src/scss/components/Grid/index.html +++ b/docs/src/scss/components/Grid/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Header/index.html b/docs/src/scss/components/Header/index.html index f4661ae818..ec6596abe0 100644 --- a/docs/src/scss/components/Header/index.html +++ b/docs/src/scss/components/Header/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Item/index.html b/docs/src/scss/components/Item/index.html index a7927b14c0..a72bc7e9b2 100644 --- a/docs/src/scss/components/Item/index.html +++ b/docs/src/scss/components/Item/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Modal/index.html b/docs/src/scss/components/Modal/index.html index eeca8216af..8c562d5b76 100644 --- a/docs/src/scss/components/Modal/index.html +++ b/docs/src/scss/components/Modal/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Pagination/index.html b/docs/src/scss/components/Pagination/index.html index 900c9b2370..741dc67968 100644 --- a/docs/src/scss/components/Pagination/index.html +++ b/docs/src/scss/components/Pagination/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Pill/index.html b/docs/src/scss/components/Pill/index.html index cbefa9e4a7..654328dddc 100644 --- a/docs/src/scss/components/Pill/index.html +++ b/docs/src/scss/components/Pill/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Radio/index.html b/docs/src/scss/components/Radio/index.html index a444c8f507..caeb3d7d95 100644 --- a/docs/src/scss/components/Radio/index.html +++ b/docs/src/scss/components/Radio/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/ScrollView/index.html b/docs/src/scss/components/ScrollView/index.html index 82733be34a..cc24de5071 100644 --- a/docs/src/scss/components/ScrollView/index.html +++ b/docs/src/scss/components/ScrollView/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Select/index.html b/docs/src/scss/components/Select/index.html index 1d668f83bd..9bc3c98859 100644 --- a/docs/src/scss/components/Select/index.html +++ b/docs/src/scss/components/Select/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Spinner/index.html b/docs/src/scss/components/Spinner/index.html index 243e9057c3..30842de51a 100644 --- a/docs/src/scss/components/Spinner/index.html +++ b/docs/src/scss/components/Spinner/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Stack/index.html b/docs/src/scss/components/Stack/index.html index 6c94351adb..c1c17e45fa 100644 --- a/docs/src/scss/components/Stack/index.html +++ b/docs/src/scss/components/Stack/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Tabs/index.html b/docs/src/scss/components/Tabs/index.html index b9ad13ba69..86d966cdf7 100644 --- a/docs/src/scss/components/Tabs/index.html +++ b/docs/src/scss/components/Tabs/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Tag/index.html b/docs/src/scss/components/Tag/index.html index 9318e4d05a..1db7ad3a7b 100644 --- a/docs/src/scss/components/Tag/index.html +++ b/docs/src/scss/components/Tag/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/TextArea/index.html b/docs/src/scss/components/TextArea/index.html index 04b0cc8c7a..aff9687efc 100644 --- a/docs/src/scss/components/TextArea/index.html +++ b/docs/src/scss/components/TextArea/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/TextField/index.html b/docs/src/scss/components/TextField/index.html index 7f75931f0e..3bee07c574 100644 --- a/docs/src/scss/components/TextField/index.html +++ b/docs/src/scss/components/TextField/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/components/Tooltip/index.html b/docs/src/scss/components/Tooltip/index.html index ced95784fc..202b3893cd 100644 --- a/docs/src/scss/components/Tooltip/index.html +++ b/docs/src/scss/components/Tooltip/index.html @@ -21,8 +21,8 @@ - - + + @@ -405,11 +405,17 @@

Dismissible Tooltip

- +
Close me + + +
+ + + +
+ +

Tooltip on Icon Component

+ +
+ + + Click on the icon on the right to view the tooltip +
+ + + + +
+
+ +
+ +
+
diff --git a/docs/src/scss/helpers/accessibility/index.html b/docs/src/scss/helpers/accessibility/index.html index 98281806a2..dac7562983 100644 --- a/docs/src/scss/helpers/accessibility/index.html +++ b/docs/src/scss/helpers/accessibility/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/animations/index.html b/docs/src/scss/helpers/animations/index.html index f8589734e9..06421832e4 100644 --- a/docs/src/scss/helpers/animations/index.html +++ b/docs/src/scss/helpers/animations/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/breakout/index.html b/docs/src/scss/helpers/breakout/index.html index 8de1756aa2..28c5862df2 100644 --- a/docs/src/scss/helpers/breakout/index.html +++ b/docs/src/scss/helpers/breakout/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/images/index.html b/docs/src/scss/helpers/images/index.html index de01968cd1..1693d171c5 100644 --- a/docs/src/scss/helpers/images/index.html +++ b/docs/src/scss/helpers/images/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/index.html b/docs/src/scss/helpers/index.html index 540ee7811a..eea4436ce2 100644 --- a/docs/src/scss/helpers/index.html +++ b/docs/src/scss/helpers/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/links/index.html b/docs/src/scss/helpers/links/index.html index 047bf8b77d..b5bca37d47 100644 --- a/docs/src/scss/helpers/links/index.html +++ b/docs/src/scss/helpers/links/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/lists/index.html b/docs/src/scss/helpers/lists/index.html index ef39014e3a..e9e6566c8d 100644 --- a/docs/src/scss/helpers/lists/index.html +++ b/docs/src/scss/helpers/lists/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/scroll-control/index.html b/docs/src/scss/helpers/scroll-control/index.html index 31bf604515..f0d22186fe 100644 --- a/docs/src/scss/helpers/scroll-control/index.html +++ b/docs/src/scss/helpers/scroll-control/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/text/index.html b/docs/src/scss/helpers/text/index.html index 320ac4c4cc..9da4e31f16 100644 --- a/docs/src/scss/helpers/text/index.html +++ b/docs/src/scss/helpers/text/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/src/scss/helpers/typography/index.html b/docs/src/scss/helpers/typography/index.html index 1eb9f9d3a1..13811a435c 100644 --- a/docs/src/scss/helpers/typography/index.html +++ b/docs/src/scss/helpers/typography/index.html @@ -21,7 +21,7 @@ - +