rettangoli-ui 0.1.0-rc1 → 0.1.0-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rettangoli-iife-layout.min.js +309 -284
- package/dist/rettangoli-iife-ui.min.js +383 -548
- package/package.json +4 -3
@@ -1,24 +1,25 @@
|
|
1
|
-
var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDescriptor:ze}=Object,W=[],Ht=()=>document.createRange(),q=(t,e,n)=>(t.set(e,n),n),Fe=(t,e)=>e.reduceRight(je,t),je=(t,e)=>t.childNodes[e],{setPrototypeOf:Ie}=Object,F,zt=(t,e,n)=>(F||(F=Ht()),n?F.setStartAfter(t):F.setStartBefore(t),F.setEndAfter(e),F.deleteContents(),t),Rt=({firstChild:t,lastChild:e},n)=>zt(t,e,n),Ft=!1,yt=(t,e)=>Ft&&t.nodeType===11?1/e<0?e?Rt(t,!0):t.lastChild:e?t.valueOf():t.firstChild:t,Mt=t=>document.createComment(t),Ot=class extends(e=>{function n(o){return Ie(o,new.target.prototype)}return n.prototype=e.prototype,n})(DocumentFragment){#e=Mt("<>");#n=Mt("</>");#t=W;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#n),Ft=!0}get firstChild(){return this.#e}get lastChild(){return this.#n}get parentNode(){return this.#e.parentNode}remove(){Rt(this,!1)}replaceWith(e){Rt(this,!0).replaceWith(e)}valueOf(){let{parentNode:e}=this;if(e===this)this.#t===W&&(this.#t=[...this.childNodes]);else{if(e){let{firstChild:n,lastChild:o}=this;for(this.#t=[n];n!==o;)this.#t.push(n=n.nextSibling)}this.replaceChildren(...this.#t)}return this}},jt=(t,e,n)=>t.setAttribute(e,n),st=(t,e)=>t.removeAttribute(e),ot,Ve=(t,e,n)=>{n=n.slice(1),ot||(ot=new WeakMap);let o=ot.get(t)||q(ot,t,{}),r=o[n];return r&&r[0]&&t.removeEventListener(n,...r),r=Nt(e)?e:[e,!1],o[n]=r,r[0]&&t.addEventListener(n,...r),e},X=(t,e)=>{let{t:n,n:o}=t,r=!1;switch(typeof e){case"object":if(e!==null){(o||n).replaceWith(t.n=e.valueOf());break}case"undefined":r=!0;default:n.data=r?"":e,o&&(t.n=null,o.replaceWith(n))}return e},lt=(t,e,n)=>t[n]=e,Ue=(t,e,n)=>lt(t,e,n.slice(1)),kt=(t,e,n)=>e==null?(st(t,n),e):lt(t,e,n),It=(t,e)=>(typeof e=="function"?e(t):e.current=t,e),St=(t,e,n)=>(e==null?st(t,n):jt(t,n,e),e),Ke=(t,e,n)=>(t.toggleAttribute(n.slice(1),e),e),it=(t,e,n)=>{let{length:o}=e;if(t.data=`[${o}]`,o)return((r,i,l,s,a)=>{let c=l.length,f=i.length,d=c,h=0,u=0,g=null;for(;h<f||u<d;)if(f===h){let p=d<c?u?s(l[u-1],-0).nextSibling:s(l[d],0):a;for(;u<d;)r.insertBefore(s(l[u++],1),p)}else if(d===u)for(;h<f;)g&&g.has(i[h])||r.removeChild(s(i[h],-1)),h++;else if(i[h]===l[u])h++,u++;else if(i[f-1]===l[d-1])f--,d--;else if(i[h]===l[d-1]&&l[u]===i[f-1]){let p=s(i[--f],-0).nextSibling;r.insertBefore(s(l[u++],1),s(i[h++],-0).nextSibling),r.insertBefore(s(l[--d],1),p),i[f]=l[d]}else{if(!g){g=new Map;let p=u;for(;p<d;)g.set(l[p],p++)}if(g.has(i[h])){let p=g.get(i[h]);if(u<p&&p<d){let w=h,T=1;for(;++w<f&&w<d&&g.get(i[w])===p+T;)T++;if(T>p-u){let P=s(i[h],0);for(;u<p;)r.insertBefore(s(l[u++],1),P)}else r.replaceChild(s(l[u++],1),s(i[h++],-1))}else h++}else r.removeChild(s(i[h++],-1))}return l})(t.parentNode,n,e,yt,t);switch(n.length){case 1:n[0].remove();case 0:break;default:zt(yt(n[0],0),yt(n.at(-1),-0),!1)}return W},Ye=new Map([["aria",(t,e)=>{for(let n in e){let o=e[n],r=n==="role"?n:`aria-${n}`;o==null?st(t,r):jt(t,r,o)}return e}],["class",(t,e)=>kt(t,e,e==null?"class":"className")],["data",(t,e)=>{let{dataset:n}=t;for(let o in e)e[o]==null?delete n[o]:n[o]=e[o];return e}],["ref",It],["style",(t,e)=>e==null?kt(t,e,"style"):lt(t.style,e,"cssText")]]),qe=(t,e,n)=>{switch(e[0]){case".":return Ue;case"?":return Ke;case"@":return Ve;default:return n||"ownerSVGElement"in t?e==="ref"?It:St:Ye.get(e)||(e in t?e.startsWith("on")?lt:((o,r)=>{let i;do i=ze(o,r);while(!i&&(o=He(o)));return i})(t,e)?.set?kt:St:St)}},Xe=(t,e)=>(t.textContent=e??"",e),Y=(t,e,n)=>({a:t,b:e,c:n}),j=()=>Y(null,null,W),Vt=t=>(e,n)=>{let{a:o,b:r,c:i}=t(e,n),l=document.importNode(o,!0),s=W;if(r!==W){s=[];for(let h,u,g=0;g<r.length;g++){let{a:p,b:w,c:T}=r[g],P=p===u?h:h=Fe(l,u=p);s[g]=(a=w,c=P,f=T,d=w===it?[]:w===X?j():null,{v:W,u:a,t:c,n:f,c:d})}}var a,c,f,d;return((h,u)=>({b:h,c:u}))(i?l.firstChild:new Ot(l),s)},Ge=/^(?:plaintext|script|style|textarea|title|xmp)$/i,Je=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,Qe=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,Ze=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,tn=/[\x01\x02]/g,$t,At,rt=document.createElement("template"),en=(t,e)=>{if(e)return $t||($t=document.createElementNS("http://www.w3.org/2000/svg","svg"),At=Ht(),At.selectNodeContents($t)),At.createContextualFragment(t);rt.innerHTML=t;let{content:n}=rt;return rt=rt.cloneNode(!1),n},Ct=t=>{let e=[],n;for(;n=t.parentNode;)e.push(e.indexOf.call(n.childNodes,t)),t=n;return e},Wt=()=>document.createTextNode(""),nn=(t,e,n)=>{let o=en(((a,c,f)=>{let d=0;return a.join("").trim().replace(Qe,(h,u,g,p)=>`<${u}${g.replace(Ze,"=$2$1").trimEnd()}${p?f||Je.test(u)?" /":`></${u}`:""}>`).replace(tn,h=>h===""?`<!--${c+d++}-->`:c+d++)})(t,K,n),n),{length:r}=t,i=W;if(r>1){let a=[],c=document.createTreeWalker(o,129),f=0,d=`${K}${f++}`;for(i=[];f<r;){let h=c.nextNode();if(h.nodeType===8){if(h.data===d){let u=Nt(e[f-1])?it:X;u===X&&a.push(h),i.push(Y(Ct(h),u,null)),d=`${K}${f++}`}}else{let u;for(;h.hasAttribute(d);){u||(u=Ct(h));let g=h.getAttribute(d);i.push(Y(u,qe(h,g,n),g)),st(h,d),d=`${K}${f++}`}!n&&Ge.test(h.localName)&&h.textContent.trim()===`<!--${d}-->`&&(i.push(Y(u||Ct(h),Xe,null)),d=`${K}${f++}`)}}for(f=0;f<a.length;f++)a[f].replaceWith(Wt())}let{childNodes:l}=o,{length:s}=l;return s<1?(s=1,o.appendChild(Wt())):s===1&&r!==1&&l[0].nodeType!==1&&(s=0),q(Ut,t,Y(o,i,s===1))},Ut=new WeakMap,K="is\xB5",Kt=t=>(e,n)=>Ut.get(e)||nn(e,n,t),on=Vt(Kt(!1)),rn=Vt(Kt(!0)),Et=(t,{s:e,t:n,v:o})=>{if(t.a!==n){let{b:r,c:i}=(e?rn:on)(n,o);t.a=n,t.b=r,t.c=i}for(let{c:r}=t,i=0;i<r.length;i++){let l=o[i],s=r[i];switch(s.u){case it:s.v=it(s.t,sn(s.c,l),s.v);break;case X:let a=l instanceof D?Et(s.c||(s.c=j()),l):(s.c=null,l);a!==s.v&&(s.v=X(s,a));break;default:l!==s.v&&(s.v=s.u(s.t,l,s.n,s.v))}}return t.b},sn=(t,e)=>{let n=0,{length:o}=e;for(o<t.length&&t.splice(o);n<o;n++){let r=e[n];r instanceof D?e[n]=Et(t[n]||(t[n]=j()),r):t[n]=null}return e},D=class{constructor(e,n,o){this.s=e,this.t=n,this.v=o}toDOM(e=j()){return Et(e,this)}};var Yt=t=>(e,...n)=>new D(t,e,n),y=Yt(!1),Mn=Yt(!0),Bt=new WeakMap,S=(t,e)=>((n,o)=>{let r=Bt.get(n)||q(Bt,n,j()),{b:i}=r,l=typeof o=="function"?o():o,s=l instanceof D?l.toDOM(r):l;return i!==s&&n.replaceChildren((r.b=s).valueOf()),n})(t,e),Dt=new WeakMap,qt=t=>(e,n)=>{let o=Dt.get(e)||q(Dt,e,new Map);return o.get(n)||q(o,n,function(r,...i){return new D(t,r,i).toDOM(this)}.bind(j()))},Wn=qt(!1),Bn=qt(!0);function m(t,...e){let n="";return t.forEach((o,r)=>{n+=o+(e[r]||"")}),n}var ln=["xs","sm","md","lg","xl"],Xt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},Gt=Object.keys(Xt),Jt=t=>t.concat(ln.flatMap(e=>t.map(n=>`${e}-${n}`))),Qt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},C=(t,e={})=>{let n="";for(let[o,r]of Object.entries(Qt)){o!=="default"&&(n+=`${r} {`);for(let[i,l]of Object.entries(t)){let s=e[i]?` ${e[i]} `:" ";for(let[a,c]of Object.entries(l)){let f=Xt[i],d=c.startsWith("--")?`var(${c})`:c,h=o==="default"?i:`${o}-${i}`,u=o==="default"?`h-${i}`:`${o}-h-${i}`;if(f){let p=f.split(" ").map(w=>`${w}: ${d};`).join(" ");n+=`
|
2
|
-
:host([${h}="${a}"])${s}{
|
3
|
-
|
1
|
+
var rettangoli=(()=>{var Zn=Object.create;var ct=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var Un=Object.getPrototypeOf,Wn=Object.prototype.hasOwnProperty;var Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ie=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},Kn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Vn(t))!Wn.call(e,a)&&a!==r&&ct(e,a,{get:()=>t[a],enumerable:!(n=Bn(t,a))||n.enumerable});return e};var qn=(e,t,r)=>(r=e!=null?Zn(Un(e)):{},Kn(t||!e||!e.__esModule?ct(r,"default",{value:e,enumerable:!0}):r,e));var Vr=Jn((Ht,Rt)=>{(function(e,t){typeof Ht=="object"&&typeof Rt<"u"?Rt.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.jsone=t())})(Ht,function(){"use strict";var e={},t={};class r{constructor(i){this.token=i,this.constructorName="ASTNode"}}let n=r;class a extends r{constructor(i,s,o){super(i),this.constructorName="BinOp",this.left=s,this.right=o}}class c extends r{constructor(i,s){super(i),this.constructorName="UnaryOp",this.expr=s}}class h extends r{constructor(i,s,o){super(i),this.constructorName="FunctionCall",this.name=s,this.args=o}}class d{constructor(i){this.token=i,this.constructorName="ContextValue"}}class p extends r{constructor(i,s){super(i),this.constructorName="List",this.list=s}}class C extends r{constructor(i,s,o,u,m){super(i),this.constructorName="ValueAccess",this.isInterval=o,this.arr=s,this.left=u,this.right=m}}class D extends r{constructor(i,s){super(i),this.constructorName="Object",this.obj=s}}t.ASTNode=r,t.BinOp=a,t.UnaryOp=c,t.Primitive=n,t.FunctionCall=h,t.ContextValue=d,t.ValueAccess=C,t.List=p,t.Object=D;class T extends Error{constructor(i){super(i),this.location=[]}add_location(i){this.location.unshift(i)}toString(){return this.location.length?`${this.name} at template${this.location.join("")}: ${this.message}`:`${this.name}: ${this.message}`}}class R extends T{constructor(i){super(i),this.message=i,this.name="SyntaxError"}}class V extends T{constructor(i){super(i),this.message=i,this.name="BaseError"}}class f extends V{constructor(i){super(i),this.name="InterpreterError"}}class g extends V{constructor(i){super(i),this.name="TemplateError"}}class b extends V{constructor(i){super(i),this.name="BuiltinError"}}var y={JSONTemplateError:T,SyntaxError:R,InterpreterError:f,TemplateError:g,BuiltinError:b};let{UnaryOp:S,BinOp:I,Primitive:x,ContextValue:N,FunctionCall:E,ValueAccess:P,List:O,Object:F}=t,{SyntaxError:M}=y,$=(l,i)=>(i.sort(),new M(`Found: ${l.value} token, expected one of: ${i.join(", ")}`,l));class k{constructor(i,s,o=0){this._source=s,this._tokenizer=i,this.current_token=this._tokenizer.next(this._source,o),this.unaryOpTokens=["-","+","!"],this.primitivesTokens=["number","null","true","false","string"],this.operations=[["||"],["&&"],["in"],["==","!="],["<",">","<=",">="],["+","-"],["*","/"],["**"]],this.expectedTokens=["!","(","+","-","[","false","identifier","null","number","string","true","{"]}takeToken(...i){if(this.current_token==null)throw new M("Unexpected end of input");if(i.length>0&&i.indexOf(this.current_token.kind)===-1)throw $(this.current_token,i);try{this.current_token=this._tokenizer.next(this._source,this.current_token.end)}catch(s){throw s}}parse(i=0){let s;if(i==this.operations.length-1){s=this.parsePropertyAccessOrFunc();let o=this.current_token;for(;o!=null&&this.operations[i].indexOf(o.kind)!==-1;o=this.current_token)this.takeToken(o.kind),s=new I(o,this.parse(i),s)}else{s=this.parse(i+1);let o=this.current_token;for(;o!=null&&this.operations[i].indexOf(o.kind)!==-1;o=this.current_token)this.takeToken(o.kind),s=new I(o,s,this.parse(i+1))}return s}parsePropertyAccessOrFunc(){let i=this.parseUnit(),s=["[","(","."],o;for(let u=this.current_token;u!=null&&s.indexOf(u.kind)!==-1;u=this.current_token)u.kind=="["?i=this.parseAccessWithBrackets(i):u.kind=="."?(u=this.current_token,this.takeToken("."),o=new x(this.current_token),this.takeToken("identifier"),i=new I(u,i,o)):u.kind=="("&&(i=this.parseFunctionCall(i));return i}parseUnit(){let i=this.current_token,s,o=this.unaryOpTokens.indexOf(i.kind)!==-1,u=this.primitivesTokens.indexOf(i.kind)!==-1;if(this.current_token==null)throw new M("Unexpected end of input");if(o)this.takeToken(i.kind),s=new S(i,this.parseUnit());else if(u)this.takeToken(i.kind),s=new x(i);else if(i.kind=="identifier")this.takeToken(i.kind),s=new N(i);else if(i.kind=="("){if(this.takeToken("("),s=this.parse(),s==null)throw $(this.current_token,this.expectedTokens);this.takeToken(")")}else i.kind=="["?s=this.parseList():i.kind=="{"&&(s=this.parseObject());return s}parseFunctionCall(i){let s=this.current_token,o,u=[];if(this.takeToken("("),this.current_token.kind!=")")for(o=this.parse(),u.push(o);this.current_token!=null&&this.current_token.kind==",";){if(u[u.length-1]==null)throw $(this.current_token,this.expectedTokens);this.takeToken(","),o=this.parse(),u.push(o)}return this.takeToken(")"),o=new E(s,i,u),o}parseList(){let i,s=[],o=this.current_token;if(this.takeToken("["),this.current_token.kind!="]")for(i=this.parse(),s.push(i);this.current_token.kind==",";){if(s[s.length-1]==null)throw $(this.current_token,this.expectedTokens);this.takeToken(","),i=this.parse(),s.push(i)}return this.takeToken("]"),i=new O(o,s),i}parseAccessWithBrackets(i){let s=null,o=null,u=this.current_token,m=!1;if(this.takeToken("["),this.current_token.kind=="]")throw $(this.current_token,this.expectedTokens);if(this.current_token.kind!=":"&&(s=this.parse()),this.current_token.kind==":"&&(m=!0,this.takeToken(":")),this.current_token.kind!="]"&&(o=this.parse()),m&&o==null&&this.current_token.kind!="]")throw $(this.current_token,this.expectedTokens);return this.takeToken("]"),i=new P(u,i,m,s,o),i}parseObject(){let i,s={},o,u,m=this.current_token;this.takeToken("{");let v=this.current_token;for(;v!=null&&(v.kind=="string"||v.kind=="identifier");){if(o=v.value,v.kind=="string"&&(o=Z(o)),this.takeToken(v.kind),this.takeToken(":"),u=this.parse(),u==null)throw $(this.current_token,this.expectedTokens);if(s[o]=u,this.current_token!=null&&this.current_token.kind=="}")break;this.takeToken(","),v=this.current_token}return this.takeToken("}"),i=new F(m,s),i}}let Z=l=>l.slice(1,-1);e.Parser=k;var{SyntaxError:W}=y;let X=l=>l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),te=l=>{if(typeof l!="string")return!1;try{new RegExp(`^${l}$`)}catch{return!1}return!0},Gt=l=>te(l)&&new RegExp(`^(?:|${l})$`).exec("").length===1,dn=(l,i=0)=>{let s=l.length;for(let o=i;o<s;o++)if(l[o]!==void 0)return o;return-1},De=l=>{if(!l)throw new Error("Token configuration is invalid")};class fn{constructor(i={}){i=Object.assign({},{ignore:null,patterns:{},tokens:[]},i),De(i.ignore===null||Gt(i.ignore)),De(i.patterns instanceof Object);for(let s of Object.keys(i.patterns))De(Gt(i.patterns[s]));De(i.tokens instanceof Array),i.tokens.forEach(s=>De(typeof s=="string")),this._tokens=i.tokens,this._hasIgnore=i.ignore?1:0,this._regex=new RegExp("^(?:"+[this._hasIgnore?`(${i.ignore})`:null,...this._tokens.map(s=>`(${i.patterns[s]||X(s)})`)].filter(s=>s!==null).join("|")+")")}next(i,s=0){let o,u;do{if(o=this._regex.exec(i.slice(s)),o===null){if(i.slice(s)!=="")throw new W(`Unexpected input for '${i}' at '${i.slice(s)}'`,{start:s,end:i.length});return null}u=dn(o,1),s+=o[0].length}while(this._hasIgnore&&u===1);return{kind:this._tokens[u-1-this._hasIgnore],value:o[u],start:s-o[0].length,end:s}}tokenize(i,s=0){let o={end:s},u=[];for(;o=this.next(i,o.end);)u.push(o);return u}}var pn=fn,Xt={};let be={isString:l=>typeof l=="string",isNumber:l=>typeof l=="number",isInteger:l=>typeof l=="number"&&Number.isInteger(l),isBool:l=>typeof l=="boolean",isNull:l=>l===null,isArray:l=>l instanceof Array,isObject:l=>l instanceof Object&&!(l instanceof Array)&&!(l instanceof Function),isFunction:l=>l instanceof Function,isTruthy:l=>l!==null&&(be.isArray(l)&&l.length>0||be.isObject(l)&&Object.keys(l).length>0||be.isString(l)&&l.length>0||be.isNumber(l)&&l!==0||be.isBool(l)&&l||be.isFunction(l))};var ot=be;let{isFunction:Yt,isObject:Me,isString:fe,isArray:Fe,isNumber:ye,isInteger:at,isTruthy:Le}=ot,{InterpreterError:pe}=y,ce=(l,i)=>new pe(`${l} expects ${i}`);class mn{constructor(i){this.context=i}visit(i){let s="visit_"+i.constructorName;return this[s](i)}visit_ASTNode(i){let s;switch(i.token.kind){case"number":return+i.token.value;case"null":return null;case"string":return s=i.token.value.slice(1,-1),s;case"true":return!0;case"false":return!1;case"identifier":return i.token.value}}visit_UnaryOp(i){let s=this.visit(i.expr);switch(i.token.kind){case"+":if(!ye(s))throw ce("unary +","number");return+s;case"-":if(!ye(s))throw ce("unary -","number");return-s;case"!":return!Le(s)}}visit_BinOp(i){let s=this.visit(i.left),o;switch(i.token.kind){case"||":return Le(s)||Le(this.visit(i.right));case"&&":return Le(s)&&Le(this.visit(i.right));default:o=this.visit(i.right)}switch(i.token.kind){case"+":return He("+",s,o),s+o;case"-":return He("-",s,o),s-o;case"/":if(He("/",s,o),o==0)throw new pe("division by zero");return s/o;case"*":return He("*",s,o),s*o;case">":return Se(">",s,o),s>o;case"<":return Se("<",s,o),s<o;case">=":return Se(">=",s,o),s>=o;case"<=":return Se("<=",s,o),s<=o;case"!=":return Se("!=",s,o),!ke(s,o);case"==":return Se("==",s,o),ke(s,o);case"**":return He("**",s,o),Math.pow(o,s);case".":{if(Me(s)){if(s.hasOwnProperty(o))return s[o];throw new pe(`object has no property "${o}"`)}throw ce("infix: .","objects")}case"in":{if(Me(o)){if(!fe(s))throw ce("Infix: in-object","string on left side");o=Object.keys(o)}else if(fe(o)){if(!fe(s))throw ce("Infix: in-string","string on left side");return o.indexOf(s)!==-1}else if(!Fe(o))throw ce("Infix: in","Array, string, or object on right side");return o.some(u=>ke(s,u))}}}visit_List(i){let s=[];return i.list[0]!==void 0&&i.list.forEach(function(o){s.push(this.visit(o))},this),s}visit_ValueAccess(i){let s=this.visit(i.arr),o=0,u=null;i.left&&(o=this.visit(i.left)),i.right&&(u=this.visit(i.right));let m=(v,j,_,A)=>{if(_<0&&(_=j.length+_,_<0&&(_=0)),v){if(A=A===null?j.length:A,A<0&&(A=j.length+A,A<0&&(A=0)),_>A&&(_=A),!at(_)||!at(A))throw new pe("cannot perform interval access with non-integers");return j.slice(_,A)}if(!at(_))throw new pe("should only use integers to access arrays or strings");if(_>=j.length)throw new pe("index out of bounds");return j[_]};if(Fe(s))return m(i.isInterval,s,o,u);if(fe(s)){if(/^[\x00-\x7F]*$/.test(s))return m(i.isInterval,s,o,u);let v=m(i.isInterval,[...s],o,u);return Fe(v)&&(v=v.join("")),v}if(!Me(s))throw ce('infix: "[..]"',"object, array, or string");if(!fe(o))throw new pe("object keys must be strings");return s.hasOwnProperty(o)?s[o]:null}visit_ContextValue(i){if(this.context.hasOwnProperty(i.token.value))return this.context[i.token.value];throw new pe(`unknown context value ${i.token.value}`)}visit_FunctionCall(i){let s=[],o=this.visit(i.name);if(Yt(o))return i.args.forEach(function(u){s.push(this.visit(u))},this),o.hasOwnProperty("jsone_builtin")&&s.unshift(this.context),o.apply(null,s);throw new pe(`${o} is not callable`)}visit_Object(i){let s={};for(let o in i.obj)s[o]=this.visit(i.obj[o]);return s}interpret(i){return this.visit(i)}}let ke=(l,i)=>{if(Fe(l)&&Fe(i)&&l.length===i.length){for(let s=0;s<l.length;s++)if(!ke(l[s],i[s]))return!1;return!0}if(Yt(l))return l===i;if(Me(l)&&Me(i)){let s=Object.keys(l).sort();if(!ke(s,Object.keys(i).sort()))return!1;for(let o of s)if(!ke(l[o],i[o]))return!1;return!0}return l===i},He=(l,i,s)=>{if(l==="+"&&!(ye(i)&&ye(s)||fe(i)&&fe(s)))throw ce("infix: +","numbers/strings + numbers/strings");if(["-","*","/","**"].some(o=>o===l)&&!(ye(i)&&ye(s)))throw ce(`infix: ${l}`,`number ${l} number`)},Se=(l,i,s)=>{if(l==="=="||l==="!=")return null;if(!([">=","<=","<",">"].some(u=>u===l)&&(ye(i)&&ye(s)||fe(i)&&fe(s))))throw ce(`infix: ${l}`,`numbers/strings ${l} numbers/strings`)};Xt.Interpreter=mn;var gn=new RegExp(["^(\\s*(-|\\+))?","(\\s*(?<years>\\d+)\\s*(y|year|years|yr))?","(\\s*(?<months>\\d+)\\s*(months|month|mo))?","(\\s*(?<weeks>\\d+)\\s*(weeks|week|wk|w))?","(\\s*(?<days>\\d+)\\s*(days|day|d))?","(\\s*(?<hours>\\d+)\\s*(hours|hour|hr|h))?","(\\s*(?<minutes>\\d+)\\s*(minutes|minute|min|m))?","(\\s*(?<seconds>\\d+)\\s*(seconds|second|sec|s))?","\\s*$"].join(""),"i"),yn=function(l){var i=gn.exec(l||"");if(!i)throw new Error("String: '"+l+"' isn't a time expression");var s=i[2]==="-"?-1:1;let o=i.groups;return{years:parseInt(o.years||0,10)*s,months:parseInt(o.months||0,10)*s,weeks:parseInt(o.weeks||0,10)*s,days:parseInt(o.days||0,10)*s,hours:parseInt(o.hours||0,10)*s,minutes:parseInt(o.minutes||0,10)*s,seconds:parseInt(o.seconds||0,10)*s}},Qt=(l="",i)=>{let s=yn(l);s.days+=30*s.months,s.days+=365*s.years,i?i=new Date(i):i=new Date;var o=new Date(i.getTime()+s.weeks*7*24*60*60*1e3+s.days*24*60*60*1e3+s.hours*60*60*1e3+s.minutes*60*1e3+s.seconds*1e3);return o.toJSON()},bn=function(l,i){i||(i={}),typeof i=="function"&&(i={cmp:i});var s=i.space||"";typeof s=="number"&&(s=Array(s+1).join(" "));var o=typeof i.cycles=="boolean"?i.cycles:!1,u=i.replacer||function(j,_){return _},m=i.cmp&&function(j){return function(_){return function(A,w){var L={key:A,value:_[A]},J={key:w,value:_[w]};return j(L,J)}}}(i.cmp),v=[];return function j(_,A,w,L){var J=s?`
|
2
|
+
`+new Array(L+1).join(s):"",ue=s?": ":":";if(w&&w.toJSON&&typeof w.toJSON=="function"&&(w=w.toJSON()),w=u.call(_,A,w),w!==void 0){if(typeof w!="object"||w===null)return JSON.stringify(w);if(vn(w)){for(var me=[],ae=0;ae<w.length;ae++){var Hn=j(w,ae,w[ae],L+1)||JSON.stringify(null);me.push(J+s+Hn)}return"["+me.join(",")+J+"]"}else{if(v.indexOf(w)!==-1){if(o)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}else v.push(w);for(var cr=wn(w).sort(m&&m(w)),me=[],ae=0;ae<cr.length;ae++){var A=cr[ae],hr=j(w,A,w[A],L+1);if(hr){var Rn=JSON.stringify(A)+ue+hr;me.push(J+s+Rn)}}return v.splice(v.indexOf(w),1),"{"+me.join(",")+J+"}"}}}({"":l},"",l,0)},vn=Array.isArray||function(l){return{}.toString.call(l)==="[object Array]"},wn=Object.keys||function(l){var i=Object.prototype.hasOwnProperty||function(){return!0},s=[];for(var o in l)i.call(l,o)&&s.push(o);return s},{BuiltinError:_n}=y,xn=Qt,{isString:$n,isNumber:kn,isBool:Sn,isInteger:An,isArray:En,isObject:On,isNull:Cn,isFunction:jn}=ot;let lt={string:$n,number:kn,integer:An,boolean:Sn,array:En,object:On,null:Cn,function:jn},We=l=>new _n(`invalid arguments to ${l}`);var Tn=l=>{let i={},s=(o,u,{argumentTests:m=[],minArgs:v=!1,variadic:j=null,needsContext:_=!1,invoke:A})=>(u[o]=(...w)=>{let L=w.shift();if(!j&&w.length<m.length)throw We(`builtin: ${o}`,`${w.toString()}, too few arguments`);if(v&&w.length<v)throw We(`builtin: ${o}: expected at least ${v} arguments`);return j&&(m=w.map((J,ue)=>ue<m.length?m[ue]:j)),w.forEach((J,ue)=>{if(!m[ue].split("|").some(me=>lt[me](J)))throw We(`builtin: ${o}`,`argument ${ue+1} to be ${m[ue]} found ${typeof J}`)}),_?A(L,...w):A(...w)},u[o].jsone_builtin=!0,u[o]);return["max","min"].forEach(o=>{if(Math[o]==null)throw new Error(`${o} in Math undefined`);s(o,i,{minArgs:1,variadic:"number",invoke:(...u)=>Math[o](...u)})}),["sqrt","ceil","floor","abs"].forEach(o=>{if(Math[o]==null)throw new Error(`${o} in Math undefined`);s(o,i,{argumentTests:["number"],invoke:u=>Math[o](u)})}),s("range",i,{minArgs:2,argumentTests:["integer","integer","integer"],variadic:"number",invoke:(o,u,m=1)=>Array.from({length:Math.ceil((u-o)/m)},(v,j)=>o+j*m)}),s("lowercase",i,{argumentTests:["string"],invoke:o=>o.toLowerCase()}),s("uppercase",i,{argumentTests:["string"],invoke:o=>o.toUpperCase()}),s("str",i,{argumentTests:["string|number|boolean|null"],invoke:o=>o===null?"null":o.toString()}),s("number",i,{argumentTests:["string"],invoke:Number}),s("len",i,{argumentTests:["string|array"],invoke:o=>Array.from(o).length}),s("strip",i,{argumentTests:["string"],invoke:o=>o.trim()}),s("rstrip",i,{argumentTests:["string"],invoke:o=>o.replace(/\s+$/,"")}),s("lstrip",i,{argumentTests:["string"],invoke:o=>o.replace(/^\s+/,"")}),s("split",i,{minArgs:2,argumentTests:["string","string|number"],invoke:(o,u)=>o.split(u)}),s("join",i,{argumentTests:["array","string|number"],invoke:(o,u)=>o.join(u)}),s("fromNow",i,{variadic:"string",minArgs:1,needsContext:!0,invoke:(o,u,m)=>xn(u,m||o.now)}),s("typeof",i,{argumentTests:["string|number|boolean|array|object|null|function"],invoke:o=>{for(let u of["string","number","boolean","array","object","function"])if(lt[u](o))return u;if(lt.null(o))return"null";throw We("builtin: typeof")}}),s("defined",i,{argumentTests:["string"],needsContext:!0,invoke:(o,u)=>o.hasOwnProperty(u)}),Object.assign({},i,l)};let{Parser:er}=e,In=pn,{Interpreter:tr}=Xt;var rr=Qt,Nn=bn,{isString:Re,isNumber:zn,isBool:Pn,isArray:Y,isObject:Q,isTruthy:Je,isFunction:Dn}=ot,Mn=Tn,{JSONTemplateError:nr,TemplateError:z,SyntaxError:ir}=y;let sr=l=>new ir(`Found: ${l.value} token, expected one of: !=, &&, (, *, **, +, -, ., /, <, <=, ==, >, >=, [, in, ||`);function q(l,i){var s="",o=new RegExp(i.join("|")+"$");for(var u of Object.keys(l).sort())o.test(u)||(s+=" "+u);if(s)throw new z(i[0].replace("\\","")+" has undefined properties:"+s)}let or=l=>Array.isArray(l)?[].concat(...l.map(or)):l,ar=(l,i)=>{let s="",o=l,u;for(;(u=o.search(/\$?\${/g))!==-1;)if(s+=o.slice(0,u),o[u+1]!="$"){let m=Fn(o.slice(u+2),"}",i);if(Y(m.result)||Q(m.result)){let v=o.slice(u+2,u+m.offset);throw new z(`interpolation of '${v}' produced an array or object`)}m.result===null?s+="":s+=m.result.toString(),o=o.slice(u+m.offset+1)}else s+="${",o=o.slice(u+3);return s+=o,s},he={},K={};K.$eval=(l,i)=>{if(q(l,["\\$eval"]),!Re(l.$eval))throw new z("$eval must be given a string expression");return Ae(l.$eval,i)},K.$flatten=(l,i)=>{q(l,["\\$flatten"]);let s=B(l.$flatten,i);if(!Y(s))throw new z("$flatten value must evaluate to an array");return s.reduce((o,u)=>o.concat(u),[])},K.$flattenDeep=(l,i)=>{q(l,["\\$flattenDeep"]);let s=B(l.$flattenDeep,i);if(!Y(s))throw new z("$flattenDeep value must evaluate to an array");return or(s)},K.$fromNow=(l,i)=>{q(l,["\\$fromNow","from"]);let s=B(l.$fromNow,i),o=i.now;if(l.from&&(o=B(l.from,i)),!Re(s))throw new z("$fromNow expects a string");return rr(s,o)},K.$if=(l,i)=>{if(q(l,["\\$if","then","else"]),!Re(l.$if))throw new z("$if can evaluate string expressions only");if(Je(Ae(l.$if,i))){if(l.hasOwnProperty("$then"))throw new z("$if Syntax error: $then: should be spelled then: (no $)");return l.hasOwnProperty("then")?B(l.then,i):he}return l.hasOwnProperty("else")?B(l.else,i):he},K.$json=(l,i)=>{q(l,["\\$json"]);let s=B(l.$json,i);if(Ke(s))throw new z("evaluated template contained uncalled functions");return Nn(s)},K.$let=(l,i)=>{if(q(l,["\\$let","in"]),!Q(l.$let))throw new z("$let value must be an object");let s={},o=B(l.$let,i);if(!Q(o))throw new z("$let value must be an object");Object.keys(o).forEach(m=>{if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(m))s[m]=o[m];else throw new z("top level keys of $let must follow /[a-zA-Z_][a-zA-Z0-9_]*/")});var u=Object.assign({},i,s);if(l.in==null)throw new z("$let operator requires an `in` clause");return B(l.in,u)},K.$map=(l,i)=>{q(l,["\\$map","each\\(([a-zA-Z_][a-zA-Z0-9_]*)(,\\s*([a-zA-Z_][a-zA-Z0-9_]*))?\\)"]);let o=B(l.$map,i);if(!Y(o)&&!Q(o))throw new z("$map value must evaluate to an array or object");if(Object.keys(l).length!==2)throw new z("$map must have exactly two properties");let u=Object.keys(l).filter(w=>w!=="$map")[0],m=/^each\(([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))?\)$/.exec(u);if(!m)throw new z("$map requires each(identifier) syntax");let v=m[1],j=m[3],_=l[u];if(Q(o)){o=Object.keys(o).map(L=>({key:L,val:o[L]}));let w;return o=o.map(L=>{let J=typeof j<"u"?{[v]:L.val,[j]:L.key}:{[v]:L};if(w=B(_,Object.assign({},i,J)),!Q(w))throw new z(`$map on objects expects each(${v}) to evaluate to an object`);return w}).filter(L=>L!==he),Object.assign({},...o)}else return o.map((w,L)=>{let J=typeof j<"u"?{[v]:w,[j]:L}:{[v]:w};return B(_,Object.assign({},i,J))}).filter(w=>w!==he)},K.$reduce=(l,i)=>{q(l,["\\$reduce","initial","each\\(([a-zA-Z_][a-zA-Z0-9_]*),\\s*([a-zA-Z_][a-zA-Z0-9_]*)(,\\s*([a-zA-Z_][a-zA-Z0-9_]*))?\\)"]);let o=B(l.$reduce,i);if(!Y(o))throw new z("$reduce value must evaluate to an array");if(Object.keys(l).length!==3)throw new z("$reduce must have exactly three properties");let u=Object.keys(l).find(L=>L!=="$reduce"&&L!=="initial"),m=/^each\(([a-zA-Z_][a-zA-Z0-9_]*),\s*([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))?\)$/.exec(u);if(!m)throw new z("$reduce requires each(identifier) syntax");let v=m[1],j=m[2],_=m[4],A=l[u],w=l.initial;return o.reduce((L,J,ue)=>{let me=typeof _<"u"?{[v]:L,[j]:J,[_]:ue}:{[v]:L,[j]:J},ae=B(A,Object.assign({},i,me));return ae===he?L:ae},w)},K.$find=(l,i)=>{q(l,["\\$find","each\\(([a-zA-Z_][a-zA-Z0-9_]*)(,\\s*([a-zA-Z_][a-zA-Z0-9_]*))?\\)"]);let o=B(l.$find,i);if(!Y(o))throw new z("$find value must evaluate to an array");if(Object.keys(l).length!==2)throw new z("$find must have exactly two properties");let u=Object.keys(l).filter(w=>w!=="$find")[0],m=/^each\(([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))?\)$/.exec(u);if(!m)throw new z("$find requires each(identifier) syntax");if(!Re(l[u]))throw new z("each can evaluate string expressions only");let v=m[1],j=m[3],_=l[u],A=o.find((w,L)=>{let J=typeof j<"u"?{[v]:w,[j]:L}:{[v]:w};if(Je(Ae(_,Object.assign({},i,J))))return B(_,Object.assign({},i,J))});return A!==void 0?A:he},K.$match=(l,i)=>{if(q(l,["\\$match"]),!Q(l.$match))throw new z("$match can evaluate objects only");let s=[],o=l.$match;for(let u of Object.keys(o).sort())Je(Ae(u,i))&&s.push(B(o[u],i));return s},K.$switch=(l,i)=>{if(q(l,["\\$switch"]),!Q(l.$switch))throw new z("$switch can evaluate objects only");let s=[],o=l.$switch;for(let u of Object.keys(o).filter(m=>m!=="$default").sort())Je(Ae(u,i))&&s.push(B(o[u],i));if(s.length>1)throw new z("$switch can only have one truthy condition");return s.length===0&&o.$default&&s.push(B(o.$default,i)),s.length>0?s[0]:he},K.$merge=(l,i)=>{q(l,["\\$merge"]);let s=B(l.$merge,i);if(!Y(s)||s.some(o=>!Q(o)))throw new z("$merge value must evaluate to an array of objects");return Object.assign({},...s)},K.$mergeDeep=(l,i)=>{q(l,["\\$mergeDeep"]);let s=B(l.$mergeDeep,i);if(!Y(s)||s.some(u=>!Q(u)))throw new z("$mergeDeep value must evaluate to an array of objects");if(s.length===0)return{};let o=(u,m)=>{if(Y(u)&&Y(m))return u.concat(m);if(Q(u)&&Q(m)){let v=Object.assign({},u);for(let j in m)j in u?v[j]=o(u[j],m[j]):v[j]=m[j];return v}return m};return s.reduce(o,s.shift())},K.$reverse=(l,i)=>{q(l,["\\$reverse"]);let s=B(l.$reverse,i);if(!Y(s))throw new z("$reverse value must evaluate to an array of objects");return s.reverse()},K.$sort=(l,i)=>{q(l,["\\$sort","by\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)"]);let o=B(l.$sort,i);if(!Y(o))throw new z("$sorted values to be sorted must have the same type");let u=Object.keys(l).filter(_=>_!=="$sort")[0],m=/^by\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/.exec(u),v;if(m){let _=Object.assign({},i),A=m[1],w=l[u];v=L=>(_[A]=L,Ae(w,_))}else{if(o.some(A=>Y(A)||Q(A)))throw new z("$sorted values to be sorted must have the same type");v=A=>A}let j=o.map(_=>[v(_),_]);if(j.length>0){let _=typeof j[0][0];if(_!=="number"&&_!=="string"||j.some(A=>_!==typeof A[0]))throw new z("$sorted values to be sorted must have the same type")}return j.sort((_,A)=>(_=_[0],A=A[0],_<A?-1:_>A?1:0)).map(_=>_[1])};let B=(l,i)=>{if(zn(l)||Pn(l)||l===null)return l;if(Re(l))return ar(l,i);if(Y(l))return l.map((u,m)=>{try{return B(u,i)}catch(v){throw v instanceof nr&&v.add_location(`[${m}]`),v}}).filter(u=>u!==he);let s=Object.keys(K).filter(u=>l.hasOwnProperty(u));if(s.length>1)throw new z("only one operator allowed");if(s.length===1)return K[s[0]](l,i);let o={};for(let u of Object.keys(l)){let m;try{m=B(l[u],i)}catch(v){throw v instanceof nr&&(/^[a-zA-Z][a-zA-Z0-9]*$/.test(u)?v.add_location(`.${u}`):v.add_location(`[${JSON.stringify(u)}]`)),v}if(m!==he){if(u.startsWith("$$"))u=u.substr(1);else{if(/^\$[a-zA-Z][a-zA-Z0-9]*$/.test(u))throw new z("$<identifier> is reserved; use $$<identifier>");u=ar(u,i)}o[u]=m}}return o},lr=new In({ignore:"\\s+",patterns:{number:"[0-9]+(?:\\.[0-9]+)?",identifier:"[a-zA-Z_][a-zA-Z_0-9]*",string:`'[^']*'|"[^"]*"`,true:"true(?![a-zA-Z_0-9])",false:"false(?![a-zA-Z_0-9])",in:"in(?![a-zA-Z_0-9])",null:"null(?![a-zA-Z_0-9])"},tokens:["**",..."+-*/[].(){}:,".split(""),">=","<=","<",">","==","!=","!","&&","||","true","false","in","null","number","identifier","string"]}),Ae=(l,i)=>{let s=new er(lr,l),o=s.parse();if(s.current_token!=null)throw sr(s.current_token);return new tr(i).interpret(o)},Fn=(l,i,s)=>{let o=new er(lr,l),u=o.parse(),m=o.current_token;if(m){if(m.kind!==i)throw sr(m)}else{let _=l.length;throw new ir("unterminated ${..} expression",{start:_,end:_})}return{result:new tr(s).interpret(u),offset:m.start+2}},Ke=l=>{if(Dn(l))return!0;if(Array.isArray(l))return l.some(Ke);if(typeof l=="object"&&l!==null){for(let i of Object.keys(l))if(Ke(l[i]))return!0;return!1}else return!1};var Ln=(l,i={})=>{if(!Q(i))throw new z("context must be an object");if(!Object.keys(i).every(u=>/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)))throw new z("top level keys of context must follow /[a-zA-Z_][a-zA-Z0-9_]*/");i=Mn(Object.assign({},{now:rr("0 seconds")},i));let o=B(l,i);if(o===he)return null;if(Ke(o))throw new z("evaluated template contained uncalled functions");return o};return Ln})});function U(e,...t){let r="";return e.forEach((n,a)=>{r+=n+(t[a]||"")}),r}var Gn=["xs","sm","md","lg","xl"],ur={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},Ee=Object.keys(ur),Oe=e=>e.concat(Gn.flatMap(t=>e.map(r=>`${t}-${r}`))),dr={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},se=(e,t={})=>{let r="";for(let[n,a]of Object.entries(dr)){n!=="default"&&(r+=`${a} {`);for(let[c,h]of Object.entries(e)){let d=t[c]?` ${t[c]} `:" ";for(let[p,C]of Object.entries(h)){let D=ur[c],T=C.startsWith("--")?`var(${C})`:C,R=n==="default"?c:`${n}-${c}`,V=n==="default"?`h-${c}`:`${n}-h-${c}`;if(D){let g=D.split(" ").map(b=>`${b}: ${T};`).join(" ");r+=`
|
3
|
+
:host([${R}="${p}"])${d}{
|
4
|
+
${g}
|
4
5
|
}
|
5
|
-
:host([${
|
6
|
-
${
|
6
|
+
:host([${V}="${p}"]:hover)${d}{
|
7
|
+
${g}
|
7
8
|
}
|
8
|
-
`}else
|
9
|
-
:host([${
|
10
|
-
${
|
9
|
+
`}else r+=`
|
10
|
+
:host([${R}="${p}"])${d}{
|
11
|
+
${C}
|
11
12
|
}
|
12
|
-
:host([${
|
13
|
-
${
|
13
|
+
:host([${V}="${p}"]:hover)${d}{
|
14
|
+
${C}
|
14
15
|
}
|
15
|
-
`}}
|
16
|
-
`);let
|
17
|
-
`);
|
18
|
-
${
|
16
|
+
`}}n!=="default"&&(r+="}")}return r};function Xn(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Yn=e=>/%$/.test(e),G=e=>{if(e!==void 0)return Yn(e)?e:Xn(e)?`${e}px`:Object.keys(H).includes(e)?`var(${H[e]})`:e},H={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Ce(e,t=":host"){let r="";for(let[n,a]of Object.entries(dr)){n!=="default"&&(r+=`${a} {
|
17
|
+
`);let c="";for(let[h,d]of Object.entries(e[n]))d!=null&&(c+=`${h}: ${d};
|
18
|
+
`);r+=`${t} {
|
19
|
+
${c.trim()}
|
19
20
|
}
|
20
|
-
`,n!=="default"&&(
|
21
|
-
`)}return
|
21
|
+
`,n!=="default"&&(r+=`}
|
22
|
+
`)}return r}var je=U`
|
22
23
|
:host([flex="0"]) {
|
23
24
|
flex: 0;
|
24
25
|
}
|
@@ -58,7 +59,7 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
58
59
|
:host([flex="12"]) {
|
59
60
|
flex: 12;
|
60
61
|
}
|
61
|
-
`;var
|
62
|
+
`;var Qn={mt:H,mr:H,mb:H,ml:H,m:H,mh:H,mv:H,s:{sm:`
|
62
63
|
height: 28px;
|
63
64
|
padding-left: 12px;
|
64
65
|
padding-right: 12px;
|
@@ -104,141 +105,139 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
104
105
|
`,lk:`
|
105
106
|
background-color: transparent;
|
106
107
|
color: var(--foreground);
|
107
|
-
`}},
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
108
|
+
`}},ei={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},fr=se(Qn,ei);var Te=U`
|
109
|
+
a, a:link, a:visited, a:hover, a:active {
|
110
|
+
color: inherit;
|
111
|
+
text-decoration: none;
|
112
|
+
background: none;
|
113
|
+
border: none;
|
114
|
+
padding: 0;
|
115
|
+
margin: 0;
|
116
|
+
font: inherit;
|
117
|
+
}
|
118
|
+
`;var ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
119
|
+
:host {
|
120
|
+
display: contents;
|
121
|
+
}
|
122
|
+
slot {
|
123
|
+
display: contents;
|
124
|
+
}
|
114
125
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
button {
|
127
|
+
display: flex;
|
128
|
+
flex-direction: row;
|
129
|
+
align-items: center;
|
130
|
+
justify-content: center;
|
131
|
+
gap: var(--spacing-sm);
|
132
|
+
border-width: 0px;
|
133
|
+
border-style: solid;
|
134
|
+
border-color: var(--border);
|
135
|
+
padding: 0px;
|
136
|
+
height: 32px;
|
137
|
+
padding-left: 16px;
|
138
|
+
padding-right: 16px;
|
139
|
+
border-radius: 4px;
|
129
140
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
141
|
+
font-size: var(--sm-font-size);
|
142
|
+
font-weight: var(--sm-font-weight);
|
143
|
+
line-height: var(--sm-line-height);
|
144
|
+
letter-spacing: var(--sm-letter-spacing);
|
134
145
|
|
135
|
-
|
136
|
-
|
137
|
-
|
146
|
+
background-color: var(--primary);
|
147
|
+
color: var(--primary-foreground);
|
148
|
+
}
|
138
149
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
150
|
+
button:hover {
|
151
|
+
cursor: pointer;
|
152
|
+
background-color: color-mix(
|
153
|
+
in srgb,
|
154
|
+
var(--primary) 85%,
|
155
|
+
white 15%
|
156
|
+
);
|
157
|
+
}
|
147
158
|
|
148
|
-
|
149
|
-
|
150
|
-
|
159
|
+
button:disabled {
|
160
|
+
cursor: not-allowed;
|
161
|
+
}
|
151
162
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
163
|
+
button:active {
|
164
|
+
cursor: pointer;
|
165
|
+
background-color: color-mix(
|
166
|
+
in srgb,
|
167
|
+
var(--primary) 80%,
|
168
|
+
white 20%
|
169
|
+
);
|
170
|
+
}
|
160
171
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
172
|
+
:host([v="pr"]) button:hover {
|
173
|
+
background-color: color-mix(
|
174
|
+
in srgb,
|
175
|
+
var(--primary) 85%,
|
176
|
+
white 15%
|
177
|
+
);
|
178
|
+
}
|
168
179
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
180
|
+
:host([v="pr"]) button:active {
|
181
|
+
background-color: color-mix(
|
182
|
+
in srgb,
|
183
|
+
var(--primary) 80%,
|
184
|
+
white 20%
|
185
|
+
);
|
186
|
+
}
|
176
187
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
188
|
+
:host([v="se"]) button:hover {
|
189
|
+
background-color: color-mix(
|
190
|
+
in srgb,
|
191
|
+
var(--secondary) 85%,
|
192
|
+
white 15%
|
193
|
+
);
|
194
|
+
}
|
184
195
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
196
|
+
:host([v="se"]) button:active {
|
197
|
+
background-color: color-mix(
|
198
|
+
in srgb,
|
199
|
+
var(--secondary) 80%,
|
200
|
+
white 20%
|
201
|
+
);
|
202
|
+
}
|
192
203
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
204
|
+
:host([v="de"]) button:hover {
|
205
|
+
background-color: color-mix(
|
206
|
+
in srgb,
|
207
|
+
var(--destructive) 85%,
|
208
|
+
white 15%
|
209
|
+
);
|
210
|
+
}
|
200
211
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
212
|
+
:host([v="de"]) button:active {
|
213
|
+
background-color: color-mix(
|
214
|
+
in srgb,
|
215
|
+
var(--destructive) 80%,
|
216
|
+
white 20%
|
217
|
+
);
|
218
|
+
}
|
208
219
|
|
209
|
-
|
210
|
-
|
211
|
-
|
220
|
+
:host([v="ol"]) button:hover {
|
221
|
+
background-color: var(--accent);
|
222
|
+
}
|
212
223
|
|
213
|
-
|
214
|
-
|
215
|
-
|
224
|
+
:host([v="gh"]) button:hover {
|
225
|
+
background-color: var(--accent);
|
226
|
+
}
|
216
227
|
|
217
|
-
|
218
|
-
|
219
|
-
|
228
|
+
:host([v="lk"]) button:hover {
|
229
|
+
text-decoration: underline;
|
230
|
+
}
|
220
231
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
>
|
231
|
-
<button disabled="${r}">
|
232
|
-
${this.renderIcon()}
|
233
|
-
<slot></slot>
|
234
|
-
</button>
|
235
|
-
</a>
|
236
|
-
`:e`
|
237
|
-
<button ref=${this._assingRef} disabled="${r}">
|
238
|
-
${this.renderIcon()}
|
239
|
-
<slot></slot>
|
240
|
-
</button>
|
241
|
-
`}}};var ee=m`
|
232
|
+
${Te}
|
233
|
+
|
234
|
+
a {
|
235
|
+
display: contents;
|
236
|
+
}
|
237
|
+
|
238
|
+
${fr}
|
239
|
+
${je}
|
240
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,n){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let n=document.createElement("a");n.setAttribute("href",r);let a=this.getAttribute("target");a&&n.setAttribute("target",a),n.appendChild(this._buttonElement),this.shadow.appendChild(n),this._containerElement=n}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},n={sm:14,md:18,lg:22},a=r[this.getAttribute("v")]||"pr-fg",c=n[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",a),this._iconElement.setAttribute("wh",c.toString()),this._buttonElement.insertBefore(this._iconElement,this._slotElement)}}_updateWidth(){let t=G(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},pr=({render:e,html:t})=>ht;var mr=U`
|
242
241
|
|
243
242
|
:host([d="h"]) {
|
244
243
|
flex-direction: row;
|
@@ -309,7 +308,7 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
309
308
|
justify-content: center;
|
310
309
|
}
|
311
310
|
}
|
312
|
-
`;var
|
311
|
+
`;var ti={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},oe=se(ti);var gr=U`
|
313
312
|
:host([sh]:not([sv])) {
|
314
313
|
overflow-x: scroll;
|
315
314
|
flex-wrap: nowrap;
|
@@ -327,12 +326,14 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
327
326
|
flex-wrap: nowrap;
|
328
327
|
}
|
329
328
|
|
330
|
-
`;var
|
329
|
+
`;var Ze={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ri={bgc:{pr:`
|
331
330
|
background-color: var(--primary);
|
332
331
|
`,se:`
|
333
332
|
background-color: var(--secondary);
|
334
333
|
`,de:`
|
335
334
|
background-color: var(--destructive);
|
335
|
+
`,fg:`
|
336
|
+
background-color: var(--foreground);
|
336
337
|
`,bg:`
|
337
338
|
background-color: var(--background);
|
338
339
|
`,mu:`
|
@@ -365,37 +366,47 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
365
366
|
left: 0;
|
366
367
|
top: 0;
|
367
368
|
height: 100%;
|
368
|
-
`},shadow:{
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
369
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:H,pr:H,pb:H,pl:H,p:H,ph:H,pv:H,g:H,gv:H,gh:H,bw:Ze,bwt:Ze,bwr:Ze,bwb:Ze,bwl:Ze,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},qe=se(ri);var ni={mt:H,mr:H,mb:H,ml:H,m:H,mh:H,mv:H},de=se(ni);var ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
370
|
+
slot {
|
371
|
+
display: contents;
|
372
|
+
}
|
373
|
+
:host {
|
374
|
+
display: flex;
|
375
|
+
flex-direction: column;
|
376
|
+
align-self: auto;
|
377
|
+
align-content: flex-start;
|
378
|
+
border-style: solid;
|
379
|
+
border-width: 0;
|
380
|
+
box-sizing: border-box;
|
381
|
+
border-color: var(--border);
|
382
|
+
}
|
382
383
|
|
383
|
-
|
384
|
-
|
385
|
-
|
384
|
+
:host([fw="w"]) {
|
385
|
+
flex-wrap: wrap;
|
386
|
+
}
|
387
|
+
|
388
|
+
${je}
|
389
|
+
${gr}
|
390
|
+
${mr}
|
391
|
+
${de}
|
392
|
+
${oe}
|
393
|
+
${qe}
|
394
|
+
${Te}
|
386
395
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
396
|
+
:host([href]) {
|
397
|
+
cursor: pointer;
|
398
|
+
position: relative;
|
399
|
+
}
|
400
|
+
|
401
|
+
:host([href]) a {
|
402
|
+
position: absolute;
|
403
|
+
top: 0;
|
404
|
+
left: 0;
|
405
|
+
right: 0;
|
406
|
+
bottom: 0;
|
407
|
+
z-index: 1;
|
408
|
+
}
|
409
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target",...Oe([...Ee,"wh","w","h","hidden","sh","sv"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,r,n){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(c=>{let h=R=>`${c==="default"?"":`${c}-`}${R}`,d=this.getAttribute(h("wh")),p=G(d===null?this.getAttribute(h("w")):d),C=G(d===null?this.getAttribute(h("h")):d),D=this.getAttribute(h("op")),T=this.getAttribute(h("z"));T!==null&&(this._styles[c]["z-index"]=T),D!==null&&(this._styles[c].opacity=D),p==="f"?this._styles[c].width="var(--width-stretch)":p!==void 0&&(this._styles[c].width=p,this._styles[c]["min-width"]=p,this._styles[c]["max-width"]=p),C==="f"?this._styles[c].height="100%":C!==void 0&&(this._styles[c].height=C,this._styles[c]["min-height"]=C,this._styles[c]["max-height"]=C),this.hasAttribute(h("hidden"))&&(this._styles[c].display="none !important"),this.hasAttribute(h("visible"))&&(this._styles[c].display="flex !important")});let a=Ce(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}},yr=({render:e,html:t})=>ut;var ii={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
|
399
410
|
font-size: var(--h1-font-size);
|
400
411
|
font-weight: var(--h1-font-weight);
|
401
412
|
line-height: var(--h1-line-height);
|
@@ -435,76 +446,92 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
|
|
435
446
|
font-weight: var(--xs-font-weight);
|
436
447
|
line-height: var(--xs-line-height);
|
437
448
|
letter-spacing: var(--xs-letter-spacing);
|
438
|
-
`}},
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
449
|
+
`}},br=se(ii);var si={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},Ge=se(si);var dt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
450
|
+
:host {
|
451
|
+
display: block;
|
452
|
+
font-size: var(--md-font-size);
|
453
|
+
font-weight: var(--md-font-weight);
|
454
|
+
line-height: var(--md-line-height);
|
455
|
+
letter-spacing: var(--md-letter-spacing);
|
456
|
+
}
|
457
|
+
slot {
|
458
|
+
display: contents;
|
459
|
+
}
|
460
|
+
:host ::slotted(a) {
|
461
|
+
text-decoration: var(--anchor-text-decoration);
|
462
|
+
color: var(--anchor-color);
|
463
|
+
}
|
464
|
+
:host ::slotted(a:hover) {
|
465
|
+
text-decoration: var(--anchor-text-decoration-hover);
|
466
|
+
color: var(--anchor-color-hover);
|
467
|
+
}
|
468
|
+
:host([href]) {
|
469
|
+
cursor: pointer;
|
470
|
+
position: relative;
|
471
|
+
}
|
472
|
+
:host([href]) a {
|
473
|
+
position: absolute;
|
474
|
+
top: 0;
|
475
|
+
left: 0;
|
476
|
+
right: 0;
|
477
|
+
bottom: 0;
|
478
|
+
z-index: 1;
|
479
|
+
}
|
480
|
+
${br}
|
481
|
+
${Ge}
|
482
|
+
${de}
|
483
|
+
${oe}
|
484
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,n){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=G(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},vr=({render:e,html:t})=>dt;var ft=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
485
|
+
:host {
|
486
|
+
border-style: solid;
|
487
|
+
box-sizing: border-box;
|
488
|
+
overflow: hidden;
|
489
|
+
border-width: 0;
|
490
|
+
}
|
491
|
+
slot {
|
492
|
+
display: contents;
|
493
|
+
}
|
494
|
+
:host([of="con"]) img {
|
495
|
+
object-fit: contain;
|
496
|
+
}
|
497
|
+
:host([of="cov"]) img {
|
498
|
+
object-fit: cover;
|
499
|
+
}
|
500
|
+
:host([of="none"]) img {
|
501
|
+
object-fit: none;
|
502
|
+
}
|
503
|
+
img {
|
504
|
+
height: 100%;
|
505
|
+
width: 100%;
|
506
|
+
}
|
507
|
+
|
508
|
+
${Te}
|
509
|
+
|
510
|
+
a {
|
511
|
+
display: block;
|
512
|
+
height: 100%;
|
513
|
+
width: 100%;
|
514
|
+
}
|
515
|
+
|
516
|
+
:host([href]) {
|
517
|
+
cursor: pointer;
|
518
|
+
}
|
519
|
+
|
520
|
+
${qe}
|
521
|
+
${de}
|
522
|
+
${oe}
|
523
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return Oe([...Ee,"key","src","href","target","wh","w","h","hidden","height","width"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,n){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(c=>{let h=R=>`${c==="default"?"":`${c}-`}${R}`,d=this.getAttribute(h("wh")),p=G(d===null?this.getAttribute(h("w")):d),C=G(d===null?this.getAttribute(h("h")):d),D=this.getAttribute(h("o")),T=this.getAttribute(h("z"));T!==null&&(this._styles[c]["z-index"]=T),D!==null&&(this._styles[c].opacity=D),p==="f"?this._styles[c].width="var(--width-stretch)":p!==void 0&&(this._styles[c].width=p,this._styles[c]["min-width"]=p,this._styles[c]["max-width"]=p),C==="f"?this._styles[c].height="100%":C!==void 0&&(this._styles[c].height=C,this._styles[c]["min-height"]=C,this._styles[c]["max-height"]=C),this.hasAttribute(h("hidden"))&&(this._styles[c].display="none !important"),this.hasAttribute(h("visible"))&&(this._styles[c].display="block !important")});let a=Ce(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),n=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),n!==null&&this._imgElement.setAttribute("height",n)}connectedCallback(){this._updateImageAttributes()}},wr=({render:e,html:t})=>ft;var _r=U`
|
497
524
|
:host([pt="xs"]) svg {
|
498
525
|
padding-top: var(--spacing-xs);
|
499
526
|
}
|
500
|
-
:host([pt="
|
501
|
-
padding-top: var(--spacing-
|
527
|
+
:host([pt="sm"]) svg {
|
528
|
+
padding-top: var(--spacing-sm);
|
502
529
|
}
|
503
|
-
:host([pt="
|
504
|
-
padding-top: var(--spacing-
|
530
|
+
:host([pt="md"]) svg {
|
531
|
+
padding-top: var(--spacing-md);
|
505
532
|
}
|
506
|
-
:host([pt="
|
507
|
-
padding-top: var(--spacing-
|
533
|
+
:host([pt="lg"]) svg {
|
534
|
+
padding-top: var(--spacing-lg);
|
508
535
|
}
|
509
536
|
:host([pt="xl"]) svg {
|
510
537
|
padding-top: var(--spacing-xl);
|
@@ -512,14 +539,14 @@ ${b}
|
|
512
539
|
:host([pr="xs"]) svg {
|
513
540
|
padding-right: var(--spacing-xs);
|
514
541
|
}
|
515
|
-
:host([pr="
|
516
|
-
padding-right: var(--spacing-
|
542
|
+
:host([pr="sm"]) svg {
|
543
|
+
padding-right: var(--spacing-sm);
|
517
544
|
}
|
518
|
-
:host([pr="
|
519
|
-
padding-right: var(--spacing-
|
545
|
+
:host([pr="md"]) svg {
|
546
|
+
padding-right: var(--spacing-md);
|
520
547
|
}
|
521
|
-
:host([pr="
|
522
|
-
padding-right: var(--spacing-
|
548
|
+
:host([pr="lg"]) svg {
|
549
|
+
padding-right: var(--spacing-lg);
|
523
550
|
}
|
524
551
|
:host([pr="xl"]) svg {
|
525
552
|
padding-right: var(--spacing-xl);
|
@@ -527,14 +554,14 @@ ${b}
|
|
527
554
|
:host([pb="xs"]) svg {
|
528
555
|
padding-bottom: var(--spacing-xs);
|
529
556
|
}
|
530
|
-
:host([pb="
|
531
|
-
padding-bottom: var(--spacing-
|
557
|
+
:host([pb="sm"]) svg {
|
558
|
+
padding-bottom: var(--spacing-sm);
|
532
559
|
}
|
533
|
-
:host([pb="
|
534
|
-
padding-bottom: var(--spacing-
|
560
|
+
:host([pb="md"]) svg {
|
561
|
+
padding-bottom: var(--spacing-md);
|
535
562
|
}
|
536
|
-
:host([pb="
|
537
|
-
padding-bottom: var(--spacing-
|
563
|
+
:host([pb="lg"]) svg {
|
564
|
+
padding-bottom: var(--spacing-lg);
|
538
565
|
}
|
539
566
|
:host([pb="xl"]) svg {
|
540
567
|
padding-bottom: var(--spacing-xl);
|
@@ -542,14 +569,14 @@ ${b}
|
|
542
569
|
:host([pl="xs"]) svg {
|
543
570
|
padding-left: var(--spacing-xs);
|
544
571
|
}
|
545
|
-
:host([pl="
|
546
|
-
padding-left: var(--spacing-
|
572
|
+
:host([pl="sm"]) svg {
|
573
|
+
padding-left: var(--spacing-sm);
|
547
574
|
}
|
548
|
-
:host([pl="
|
549
|
-
padding-left: var(--spacing-
|
575
|
+
:host([pl="md"]) svg {
|
576
|
+
padding-left: var(--spacing-md);
|
550
577
|
}
|
551
|
-
:host([pl="
|
552
|
-
padding-left: var(--spacing-
|
578
|
+
:host([pl="lg"]) svg {
|
579
|
+
padding-left: var(--spacing-lg);
|
553
580
|
}
|
554
581
|
:host([pl="xl"]) svg {
|
555
582
|
padding-left: var(--spacing-xl);
|
@@ -557,14 +584,14 @@ ${b}
|
|
557
584
|
:host([p="xs"]) svg {
|
558
585
|
padding: var(--spacing-xs);
|
559
586
|
}
|
560
|
-
:host([p="
|
561
|
-
padding: var(--spacing-
|
587
|
+
:host([p="sm"]) svg {
|
588
|
+
padding: var(--spacing-sm);
|
562
589
|
}
|
563
|
-
:host([p="
|
564
|
-
padding: var(--spacing-
|
590
|
+
:host([p="md"]) svg {
|
591
|
+
padding: var(--spacing-md);
|
565
592
|
}
|
566
|
-
:host([p="
|
567
|
-
padding: var(--spacing-
|
593
|
+
:host([p="lg"]) svg {
|
594
|
+
padding: var(--spacing-lg);
|
568
595
|
}
|
569
596
|
:host([p="xl"]) svg {
|
570
597
|
padding: var(--spacing-xl);
|
@@ -573,17 +600,17 @@ ${b}
|
|
573
600
|
padding-left: var(--spacing-xs);
|
574
601
|
padding-right: var(--spacing-xs);
|
575
602
|
}
|
576
|
-
:host([ph="
|
577
|
-
padding-left: var(--spacing-
|
578
|
-
padding-right: var(--spacing-
|
603
|
+
:host([ph="sm"]) svg {
|
604
|
+
padding-left: var(--spacing-sm);
|
605
|
+
padding-right: var(--spacing-sm);
|
579
606
|
}
|
580
|
-
:host([ph="
|
581
|
-
padding-left: var(--spacing-
|
582
|
-
padding-right: var(--spacing-
|
607
|
+
:host([ph="md"]) svg {
|
608
|
+
padding-left: var(--spacing-md);
|
609
|
+
padding-right: var(--spacing-md);
|
583
610
|
}
|
584
|
-
:host([ph="
|
585
|
-
padding-left: var(--spacing-
|
586
|
-
padding-right: var(--spacing-
|
611
|
+
:host([ph="lg"]) svg {
|
612
|
+
padding-left: var(--spacing-lg);
|
613
|
+
padding-right: var(--spacing-lg);
|
587
614
|
}
|
588
615
|
:host([ph="xl"]) svg {
|
589
616
|
padding-left: var(--spacing-xl);
|
@@ -593,295 +620,103 @@ ${b}
|
|
593
620
|
padding-top: var(--spacing-xs);
|
594
621
|
padding-bottom: var(--spacing-xs);
|
595
622
|
}
|
596
|
-
:host([pv="
|
597
|
-
padding-top: var(--spacing-
|
598
|
-
padding-bottom: var(--spacing-
|
623
|
+
:host([pv="sm"]) svg {
|
624
|
+
padding-top: var(--spacing-sm);
|
625
|
+
padding-bottom: var(--spacing-sm);
|
599
626
|
}
|
600
|
-
:host([pv="
|
601
|
-
padding-top: var(--spacing-
|
602
|
-
padding-bottom: var(--spacing-
|
627
|
+
:host([pv="md"]) svg {
|
628
|
+
padding-top: var(--spacing-md);
|
629
|
+
padding-bottom: var(--spacing-md);
|
603
630
|
}
|
604
|
-
:host([pv="
|
605
|
-
padding-top: var(--spacing-
|
606
|
-
padding-bottom: var(--spacing-
|
631
|
+
:host([pv="lg"]) svg {
|
632
|
+
padding-top: var(--spacing-lg);
|
633
|
+
padding-bottom: var(--spacing-lg);
|
607
634
|
}
|
608
635
|
:host([pv="xl"]) svg {
|
609
636
|
padding-top: var(--spacing-xl);
|
610
637
|
padding-bottom: var(--spacing-xl);
|
611
638
|
}
|
612
|
-
`;var
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
${
|
619
|
-
${
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
${
|
645
|
-
${
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
${x}
|
672
|
-
${
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
display: contents;
|
683
|
-
}
|
639
|
+
`;var pt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
640
|
+
:host {
|
641
|
+
color: var(--foreground);
|
642
|
+
}
|
643
|
+
${Ge}
|
644
|
+
${_r}
|
645
|
+
${je}
|
646
|
+
${oe}
|
647
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,n){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=G(t===null?this.getAttribute("w"):t),n=G(t===null?this.getAttribute("h"):t);r&&(this.style.width=r),n&&(this.style.height=n)}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},xr=({render:e,html:t})=>pt;var mt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
648
|
+
:host {
|
649
|
+
display: contents;
|
650
|
+
}
|
651
|
+
input {
|
652
|
+
background-color: var(--background);
|
653
|
+
font-size: var(--sm-font-size);
|
654
|
+
font-weight: var(--sm-font-weight);
|
655
|
+
line-height: var(--sm-line-height);
|
656
|
+
letter-spacing: var(--sm-letter-spacing);
|
657
|
+
border: 1px solid var(--ring);
|
658
|
+
border-radius: var(--border-radius-lg);
|
659
|
+
padding-left: var(--spacing-md);
|
660
|
+
padding-right: var(--spacing-md);
|
661
|
+
height: 32px;
|
662
|
+
color: var(--foreground);
|
663
|
+
outline: none;
|
664
|
+
}
|
665
|
+
input:focus {
|
666
|
+
border-color: var(--foreground);
|
667
|
+
}
|
668
|
+
input:disabled {
|
669
|
+
cursor: not-allowed;
|
670
|
+
}
|
671
|
+
${de}
|
672
|
+
${oe}
|
673
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("keydown",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled",...Oe([...Ee,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-keydown",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,n){if(["type","placeholder","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(c=>{let h=R=>`${c==="default"?"":`${c}-`}${R}`,d=this.getAttribute(h("wh")),p=G(d===null?this.getAttribute(h("w")):d),C=G(d===null?this.getAttribute(h("h")):d),D=this.getAttribute(h("op")),T=this.getAttribute(h("z"));T!==null&&(this._styles[c]["z-index"]=T),D!==null&&(this._styles[c].opacity=D),p==="f"?this._styles[c].width="var(--width-stretch)":p!==void 0&&(this._styles[c].width=p,this._styles[c]["min-width"]=p,this._styles[c]["max-width"]=p),C==="f"?this._styles[c].height="100%":C!==void 0&&(this._styles[c].height=C,this._styles[c]["min-height"]=C,this._styles[c]["max-height"]=C),this.hasAttribute(h("hidden"))&&(this._styles[c].display="none !important"),this.hasAttribute(h("visible"))&&(this._styles[c].display="block !important")});let a=Ce(this._styles,"input");a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},$r=({render:e,html:t})=>mt;var gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(U`
|
674
|
+
:host {
|
675
|
+
display: contents;
|
676
|
+
}
|
677
|
+
textarea {
|
678
|
+
font-family: inherit;
|
679
|
+
background-color: var(--background);
|
680
|
+
font-size: var(--sm-font-size);
|
681
|
+
font-weight: var(--sm-font-weight);
|
682
|
+
line-height: var(--sm-line-height);
|
683
|
+
letter-spacing: var(--sm-letter-spacing);
|
684
|
+
border: 1px solid var(--ring);
|
685
|
+
border-radius: var(--border-radius-lg);
|
686
|
+
padding-top: var(--spacing-md);
|
687
|
+
padding-bottom: var(--spacing-md);
|
688
|
+
padding-left: var(--spacing-md);
|
689
|
+
padding-right: var(--spacing-md);
|
690
|
+
color: var(--foreground);
|
691
|
+
outline: none;
|
692
|
+
}
|
693
|
+
textarea:focus {
|
694
|
+
border-color: var(--foreground);
|
695
|
+
}
|
696
|
+
${de}
|
697
|
+
${oe}
|
698
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,n){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),n=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),n!==null?this._textareaElement.setAttribute("placeholder",n):this._textareaElement.removeAttribute("placeholder")}},kr=({render:e,html:t})=>gt;var yt={};ie(yt,{INITIAL_STATE:()=>oi,selectState:()=>li,setOpen:()=>ci,setState:()=>hi,toViewData:()=>ai});var oi=Object.freeze({isOpen:!1}),ai=({state:e,props:t})=>({isOpen:e.isOpen,options:t.options||[]}),li=({state:e})=>e,ci=e=>{e.open=!0},hi=e=>{};var Sr={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:null,items:{type:"array",items:{type:"object",properties:{id:{type:"string"},lalbel:{type:"string"},value:{type:"any"}}}}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{}},events:{},template:[{"rtgl-button#select-button v=ol":"Placeholder"},{"rtgl-popover#popover":[{"rtgl-view wh=300 g=xs slot=content":[{$map:{$eval:"options"},"each(v,i)":[{"rtgl-view w=f h-bgc=mu ph=lg pv=md cur=p br=md":[{"rtgl-text":"${v.label}"}]}]}]}]}]};var bt={};ie(bt,{handleButtonClick:()=>di,handleOnMount:()=>ui});var ui=e=>{},di=(e,t)=>{let{store:r,render:n,getRefIds:a}=t;a().popover.elm.transformedHandlers.open({position:{x:e.clientX,y:e.clientY}})};var Ar={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{$switch:{'"image" in start':[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}}]],template:[{"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}":[{$switch:{'"href" in start':[{"a href=${start.href}":[{"rtgl-view d=h av=c g=lg g=md":[[{"rtgl-text s=lg":"${start.label}"},{$switch:{'"image" in start':[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}}]]}]}],'"path" in start':[{"rtgl-view#start d=h av=c g=lg g=md cur=p":[[{"rtgl-text s=lg":"${start.label}"},{$switch:{'"image" in start':[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}}]]}],$default:[{"rtgl-view d=h av=c g=lg g=md":[[{"rtgl-text s=lg":"${start.label}"},{$switch:{'"image" in start':[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}}]]}]}},{"rtgl-view flex=1":null},{"rtgl-view d=h av=c g=lg":[{"slot name=right":null}]}]}]};var vt={};ie(vt,{handleClickStart:()=>fi});var fi=(e,t)=>{let{dispatchEvent:r,store:n}=t;console.log("handle click start",n.selectPath()),r(new CustomEvent("clickStart",{detail:{path:n.selectPath()}}))};var wt={};ie(wt,{INITIAL_STATE:()=>pi,selectPath:()=>bi,setState:()=>vi,toViewData:()=>yi});var pi=Object.freeze({}),mi=["id","class","style","slot"],gi=e=>Object.entries(e).filter(([t])=>!mi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),yi=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let n=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:gi(r),start:n||{label:"",image:{src:"",width:32,height:32,alt:""}}}},bi=({props:e})=>e.start.path,vi=e=>{};var _t={};ie(_t,{INITIAL_STATE:()=>wi,selectState:()=>xi,setClose:()=>ki,setOpen:()=>$i,toViewData:()=>_i});var wi=Object.freeze({isOpen:!1,position:{x:0,y:0}}),_i=({state:e,props:t})=>t.isOpen!==void 0?{isOpen:t.isOpen,position:{x:0,y:0}}:{isOpen:e.isOpen,position:e.position},xi=({state:e})=>e,$i=(e,t)=>{e.isOpen=!0,e.position=t},ki=e=>{e.isOpen=!1,e.position={x:0,y:0}};var xt={};ie(xt,{handleClickOverlay:()=>Si,open:()=>Ai});var Si=(e,t)=>{let{props:r,dispatchEvent:n,store:a,render:c}=t;if(r.isOpen!==void 0){n(new CustomEvent("closePopover"));return}a.setClose(),c()},Ai=(e,t)=>{let{position:r}=e,{store:n,render:a}=t;n.setOpen(r),a()};var Er={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:[{$if:"isOpen",then:[{"rtgl-view#popoverOverlay pos=fix cor=full":null},{'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=bg':[{"slot name=content":null}]}]}]};var $t={};ie($t,{INITIAL_STATE:()=>Ei,selectFormValues:()=>Ii,selectState:()=>Ti,setDefaultValues:()=>zi,setFormFieldValue:()=>Pi,setState:()=>Ni,toViewData:()=>ji});var Ei=Object.freeze({formValues:{}}),Oi=["id","class","style","slot"],Ci=e=>Object.entries(e).filter(([t])=>!Oi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ji=({state:e,props:t,attrs:r})=>({containerAttrString:Ci(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),Ti=({state:e})=>e,Ii=({state:e})=>e.formValues,Ni=e=>{},zi=(e,t)=>{e.formValues=t||{}},Pi=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var kt={};ie(kt,{handleActionClick:()=>Mi,handleInputChange:()=>Fi,handleOnMount:()=>Di});var Di=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},Mi=(e,t)=>{let{store:r,dispatchEvent:n}=t,a=e.currentTarget.id.replace("action-","");n(new CustomEvent("action-click",{detail:{actionId:a,formValues:r.selectFormValues()}}))},Fi=(e,t)=>{let{store:r}=t,n=e.currentTarget.id.replace("input-","");n&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:n,value:e.detail.value})};var Or={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object",properties:{}},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-keydown":{handler:"handleInputChange"}}}},events:{},template:[{"rtgl-view w=f h=f p=md g=lg ${containerAttrString}":[{"rtgl-view g=sm w=f":[{"rtgl-text s=lg":"${title}"},{"rtgl-text c=mu-fg":"${description}"}]},{"rtgl-view g=sm w=f":[{$map:{$eval:"fields"},"each(v,i)":[{"rtgl-view g=sm w=f":[{"rtgl-text":"${v.label}"},{"rtgl-text s=sm c=mu-fg":"${v.description}"},{$switch:{'v.inputType == "inputText"':{"rtgl-input#input-${v.id} w=f":null}}}]}]}]},{"rtgl-view g=sm w=f":[{$map:{$eval:"actions.buttons"},"each(v,i)":[{"rtgl-view d=h ah=e g=sm w=f":[{"rtgl-button#action-${v.id}":"${v.content}"}]}]}]}]}]};var At={};ie(At,{INITIAL_STATE:()=>Li,selectActiveItem:()=>Vi,selectHeader:()=>Bi,selectItem:()=>Ui,setState:()=>Wi,toViewData:()=>Zi});var Li=Object.freeze({}),Hi=["id","class","style","slot"],Ri=e=>Object.entries(e).filter(([t])=>!Hi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function St(e){let t=[];for(let r of e)if(t.push({id:r.id||r.href||r.path,title:r.title,href:r.href,type:r.type||"item",hrefAttr:r.href?`href=${r.href}`:""}),r.items&&Array.isArray(r.items))for(let n of r.items)t.push({id:n.id||n.href||n.path,title:n.title,href:n.href,type:n.type||"item",hrefAttr:n.href?`href=${n.href}`:""});return t}var Zi=({state:e,props:t,attrs:r})=>{let n=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,a=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,c=Ri(r),h=n||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},d=a?St(a):[];return{containerAttrString:c,header:h,items:d}},Bi=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Vi=({state:e,props:t})=>(t.items?St(t.items):[]).find(n=>n.active),Ui=({state:e,props:t,attrs:r},n)=>{let a=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(a?St(a):[]).find(h=>h.id===n)},Wi=e=>{};var Cr={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"}}}}}},propsSchema:{type:"object",properties:{header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},anchors:[[{$switch:{'"image" in header && "src" in header.image':[{$switch:{'"href" in header.image':[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],'"path" in header.image':[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$default:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}}]}},{$switch:{'"label" in header':[{$switch:{'"labelHref" in header':[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],'"labelPath" in header':[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$default:[{"rtgl-text s=lg":"${header.label}"}]}}]}}]],template:[{"rtgl-view h=f w=272 bwr=xs ${containerAttrString}":[{"rtgl-view p=lg":[{$switch:{'"href" in header && header.href':[{"rtgl-view href=${header.href} d=h av=c g=lg":[[{$switch:{'"image" in header && "src" in header.image':[{$switch:{'"href" in header.image':[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],'"path" in header.image':[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$default:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}}]}},{$switch:{'"label" in header':[{$switch:{'"labelHref" in header':[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],'"labelPath" in header':[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$default:[{"rtgl-text s=lg":"${header.label}"}]}}]}}]]}],$default:[{"rtgl-view#header d=h av=c g=lg cur=p":[[{$switch:{'"image" in header && "src" in header.image':[{$switch:{'"href" in header.image':[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],'"path" in header.image':[{"rtgl-view#header-image cur=p":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$default:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}}]}},{$switch:{'"label" in header':[{$switch:{'"labelHref" in header':[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],'"labelPath" in header':[{"rtgl-view#header-label cur=p":[{"rtgl-text s=lg":"${header.label}"}]}],$default:[{"rtgl-text s=lg":"${header.label}"}]}}]}}]]}]}}]},{"rtgl-view w=f ph=lg pb=lg g=xs":[{$map:{$eval:"items"},"each(v,i)":[{$switch:{'v.type == "groupLabel"':[{"rtgl-view mt=md h=32 av=c ph=md":[{"rtgl-text s=xs c=mu-fg":"${v.title}"}]}],$default:[{"rtgl-view#item-${v.id} ${v.hrefAttr} h=32 av=c ph=md w=f h-bgc=mu br=lg bgc=bg cur=p":[{"rtgl-text s=sm":"${v.title}"}]}]}}]}]}]}]};var Et={};ie(Et,{handleHeaderClick:()=>Ji,handleItemClick:()=>Ki});var Ji=(e,t)=>{let{store:r,dispatchEvent:n}=t,a,c=r.selectHeader();e.currentTarget.id==="header-label"?a=c.labelPath:e.currentTarget.id==="header-image"?a=c.image.path:e.currentTarget.id==="header"&&(a=c.path),n(new CustomEvent("headerClick",{detail:{path:a},bubbles:!0,composed:!0}))},Ki=(e,t)=>{let{store:r,dispatchEvent:n}=t,a=e.currentTarget.id.replace("item-",""),c=r.selectItem(a);n(new CustomEvent("itemClick",{detail:{item:c},bubbles:!0,composed:!0}))};var Ot={};ie(Ot,{INITIAL_STATE:()=>qi,selectCurrentId:()=>Yi,selectState:()=>Xi,setContentContainer:()=>ts,setCurrentId:()=>es,setItems:()=>Qi,toViewData:()=>Gi});var qi=Object.freeze({items:[],currentId:null,contentContainer:null}),Gi=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Xi=({state:e})=>e,Yi=({state:e})=>e.currentId,Qi=(e,t)=>{e.items=t},es=(e,t)=>{e.currentId=t},ts=(e,t)=>{e.contentContainer=t};var jr={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:[{"rtgl-view h=f w=272":[{"rtgl-view w=f g=sm mt=xl":[{$map:{$eval:"items"},"each(v,i)":[{"rtgl-view pv=xs av=c href=${v.href}":[{"rtgl-text s=sm c=${v.c} h-c=fg":"${v.title}"}]}]}]}]}]};var Ct={};ie(Ct,{handleOnMount:()=>ns});var Tr=(e,t)=>{let{store:r,render:n}=t,a,c=-1/0;e.forEach(h=>{let d=h.getBoundingClientRect();d.top<=20&&d.top>c&&(c=d.top,a=h.id)}),a&&a!==r.selectCurrentId()&&(r.setCurrentId(a),n())},rs=(e,t)=>{let{store:r,render:n}=t,a=e.querySelectorAll("rtgl-text[id]"),c=Array.from(a),h=c.map(p=>({id:p.id,href:`#${p.id}`,title:p.textContent}));r.setItems(h),Tr(c,t),n();let d=Tr.bind(void 0,c,t);return e.addEventListener("scroll",d,{passive:!0}),()=>{e.removeEventListener("scroll",d)}},ns=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),n=rs(r,e);return()=>{n()}})};var Mr=Symbol.for("immer-nothing"),Ir=Symbol.for("immer-draftable"),re=Symbol.for("immer-state");function le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ie=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[re]}function we(e){return e?Fr(e)||Array.isArray(e)||!!e[Ir]||!!e.constructor?.[Ir]||tt(e)||rt(e):!1}var is=Object.prototype.constructor.toString();function Fr(e){if(!e||typeof e!="object")return!1;let t=Ie(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===is}function Xe(e,t){et(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function et(e){let t=e[re];return t?t.type_:Array.isArray(e)?1:tt(e)?2:rt(e)?3:0}function It(e,t){return et(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Lr(e,t,r){let n=et(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function ss(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function tt(e){return e instanceof Map}function rt(e){return e instanceof Set}function ve(e){return e.copy_||e.base_}function Nt(e,t){if(tt(e))return new Map(e);if(rt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Fr(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[re];let a=Reflect.ownKeys(n);for(let c=0;c<a.length;c++){let h=a[c],d=n[h];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(n[h]={configurable:!0,writable:!0,enumerable:d.enumerable,value:e[h]})}return Object.create(Ie(e),n)}else{let n=Ie(e);if(n!==null&&r)return{...e};let a=Object.create(n);return Object.assign(a,e)}}function Ft(e,t=!1){return nt(e)||Ne(e)||!we(e)||(et(e)>1&&(e.set=e.add=e.clear=e.delete=os),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Ft(n,!0))),e}function os(){le(2)}function nt(e){return Object.isFrozen(e)}var as={};function _e(e){let t=as[e];return t||le(0,e),t}var Be;function Hr(){return Be}function ls(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Nr(e,t){t&&(_e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function zt(e){Pt(e),e.drafts_.forEach(cs),e.drafts_=null}function Pt(e){e===Be&&(Be=e.parent_)}function zr(e){return Be=ls(Be,e)}function cs(e){let t=e[re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Pr(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[re].modified_&&(zt(t),le(4)),we(e)&&(e=Ye(t,e),t.parent_||Qe(t,e)),t.patches_&&_e("Patches").generateReplacementPatches_(r[re].base_,e,t.patches_,t.inversePatches_)):e=Ye(t,r,[]),zt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Mr?e:void 0}function Ye(e,t,r){if(nt(t))return t;let n=t[re];if(!n)return Xe(t,(a,c)=>Dr(e,n,t,a,c,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Qe(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let a=n.copy_,c=a,h=!1;n.type_===3&&(c=new Set(a),a.clear(),h=!0),Xe(c,(d,p)=>Dr(e,n,a,d,p,r,h)),Qe(e,a,!1),r&&e.patches_&&_e("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Dr(e,t,r,n,a,c,h){if(Ne(a)){let d=c&&t&&t.type_!==3&&!It(t.assigned_,n)?c.concat(n):void 0,p=Ye(e,a,d);if(Lr(r,n,p),Ne(p))e.canAutoFreeze_=!1;else return}else h&&r.add(a);if(we(a)&&!nt(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ye(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Qe(e,a)}}function Qe(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ft(t,r)}function hs(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Hr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},a=n,c=Lt;r&&(a=[n],c=Ve);let{revoke:h,proxy:d}=Proxy.revocable(a,c);return n.draft_=d,n.revoke_=h,d}var Lt={get(e,t){if(t===re)return e;let r=ve(e);if(!It(r,t))return us(e,r,t);let n=r[t];return e.finalized_||!we(n)?n:n===jt(e.base_,t)?(Tt(e),e.copy_[t]=Mt(n,e)):n},has(e,t){return t in ve(e)},ownKeys(e){return Reflect.ownKeys(ve(e))},set(e,t,r){let n=Rr(ve(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let a=jt(ve(e),t),c=a?.[re];if(c&&c.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ss(r,a)&&(r!==void 0||It(e.base_,t)))return!0;Tt(e),Dt(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return jt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Tt(e),Dt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ve(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){le(11)},getPrototypeOf(e){return Ie(e.base_)},setPrototypeOf(){le(12)}},Ve={};Xe(Lt,(e,t)=>{Ve[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ve.deleteProperty=function(e,t){return Ve.set.call(this,e,t,void 0)};Ve.set=function(e,t,r){return Lt.set.call(this,e[0],t,r,e[0])};function jt(e,t){let r=e[re];return(r?ve(r):e)[t]}function us(e,t,r){let n=Rr(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Rr(e,t){if(!(t in e))return;let r=Ie(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ie(r)}}function Dt(e){e.modified_||(e.modified_=!0,e.parent_&&Dt(e.parent_))}function Tt(e){e.copy_||(e.copy_=Nt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ds=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let c=r;r=t;let h=this;return function(p=c,...C){return h.produce(p,D=>r.call(this,D,...C))}}typeof r!="function"&&le(6),n!==void 0&&typeof n!="function"&&le(7);let a;if(we(t)){let c=zr(this),h=Mt(t,void 0),d=!0;try{a=r(h),d=!1}finally{d?zt(c):Pt(c)}return Nr(c,n),Pr(a,c)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===Mr&&(a=void 0),this.autoFreeze_&&Ft(a,!0),n){let c=[],h=[];_e("Patches").generateReplacementPatches_(t,a,c,h),n(c,h)}return a}else le(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(h,...d)=>this.produceWithPatches(h,p=>t(p,...d));let n,a;return[this.produce(t,r,(h,d)=>{n=h,a=d}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){we(e)||le(8),Ne(e)&&(e=fs(e));let t=zr(this),r=Mt(e,void 0);return r[re].isManual_=!0,Pt(t),r}finishDraft(e,t){let r=e&&e[re];(!r||!r.isManual_)&&le(9);let{scope_:n}=r;return Nr(n,t),Pr(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));let n=_e("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Mt(e,t){let r=tt(e)?_e("MapSet").proxyMap_(e,t):rt(e)?_e("MapSet").proxySet_(e,t):hs(e,t);return(t?t.scope_:Hr()).drafts_.push(r),r}function fs(e){return Ne(e)||le(10,e),Zr(e)}function Zr(e){if(!we(e)||nt(e))return e;let t=e[re],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Nt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Nt(e,!0);return Xe(r,(n,a)=>{Lr(r,n,Zr(a))}),t&&(t.finalized_=!1),r}var ne=new ds,Br=ne.produce,ba=ne.produceWithPatches.bind(ne),va=ne.setAutoFreeze.bind(ne),wa=ne.setUseStrictShallowCopy.bind(ne),_a=ne.applyPatches.bind(ne),xa=ne.createDraft.bind(ne),$a=ne.finishDraft.bind(ne);var Ur=qn(Vr(),1),ps=(e,t)=>t.split(".").reduce((r,n)=>r&&r[n],e),Zt=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Zt(r));else{if(r&&typeof r=="object"){let n=Object.entries(r);if(n.length>0){let[a,c]=n[0];Array.isArray(c)&&(r={[a]:Zt(c)})}}t.push(r)}return t},[]):e,Wr=({h:e,template:t,viewData:r,refs:n,handlers:a})=>{let c=(0,Ur.default)(t,r),h=Zt(c),d=ms({h:e,items:h,refs:n,handlers:a,viewData:r});return e("div",{style:{display:"contents"}},d)},ms=({h:e,items:t,refs:r={},handlers:n={},viewData:a={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function c(h,d=""){return h.map((p,C)=>{if(typeof p=="string"||typeof p=="number")return String(p);if(typeof p!="object"||p===null)return console.warn("Skipping invalid item in DOM structure:",p),null;let D=Object.entries(p);if(D.length===0)return console.warn("Skipping empty object item:",p),null;let[T,R]=D[0];if(!isNaN(Number(T)))return Array.isArray(R)?c(R,`${d}.${T}`):typeof R=="object"&&R!==null&&Object.entries(R).length>0?c([R],`${d}.${T}`):String(R);D.length>1&&console.warn("Item has multiple keys, processing only the first:",T);let V,f,g=T.indexOf(" ");g===-1?(V=T,f=""):(V=T.substring(0,g),f=T.substring(g+1).trim());let b=V.split(/[.#]/)[0],y=b.includes("-"),S={},I={};if(f){let $=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,k;for(;(k=$.exec(f))!==null;)if(k[1].startsWith(".")){let Z=k[1].substring(1),W=k[4];I[Z]=ps(a,W)}else S[k[1]]=k[2]||k[3]||k[4]}let x=V.match(/#([^.#\s]+)/);x&&!Object.prototype.hasOwnProperty.call(S,"id")&&(S.id=x[1]);let N=null;S.id?N=S.id:y&&(N=b);let E=Object.create(null),P=null;if(y)P=b;else{let $=V.match(/\.([^.#]+)/g);$&&$.forEach(Z=>{let W=Z.substring(1);E[W]=!0});let k=V.match(/#([^.#\s]+)/);k&&(P=k[1])}let O;typeof R=="string"||typeof R=="number"?O=String(R):Array.isArray(R)?O=c(R,`${d}.${T}`):O=[],P&&!y&&(S.id=P);let F=Object.create(null);if(N&&r){let $=[];if(Object.keys(r).forEach(k=>{if(k.includes("*")){let Z="^"+k.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(Z).test(N)&&$.push(k)}catch(W){console.warn(`[Parser] Invalid regex pattern created from refKey '${k}': ${Z}`,W)}}else N===k&&$.push(k)}),$.length>0){$.sort((Z,W)=>{let X=!Z.includes("*"),te=!W.includes("*");return X&&!te?-1:!X&&te?1:W.length-Z.length});let k=$[0];if(r[k]&&r[k].eventListeners){let Z=r[k].eventListeners;Object.entries(Z).forEach(([W,X])=>{X.handler&&n[X.handler]?F[W]=te=>{n[X.handler](te)}:X.handler&&console.warn(`[Parser] Handler '${X.handler}' for refKey '${k}' (matching elementId '${N}') is referenced but not found in available handlers.`)})}}}let M={};if(N)M.key=N;else if(V){let $=d?`${d}.${C}`:String(C);if(M.key=`${V}-${$}`,Object.keys(I).length>0){let k=JSON.stringify(I).substring(0,50);M.key+=`-${k}`}}Object.keys(S).length>0&&(M.attrs=S),Object.keys(E).length>0&&(M.class=E),Object.keys(F).length>0&&(M.on=F),Object.keys(I).length>0&&(M.props=I,y&&(M.hook={update:($,k)=>{let Z=$.data?.props||{},W=k.data?.props||{};if(JSON.stringify(Z)!==JSON.stringify(W)){let te=k.elm;te&&te.render&&typeof te.render=="function"&&(te.setAttribute("isDirty","true"),requestAnimationFrame(()=>{te.render(),te.removeAttribute("isDirty")}))}}}));try{return e(b,M,O)}catch($){return console.error("Error creating virtual node:",$,{tagName:b,snabbdomData:M,childrenOrText:O}),e("div",{},["Error creating element"])}}).filter(Boolean)}return c(t)};var gs=(e,t)=>{if(!t||typeof t!="object")return"";let r="",n=c=>Object.entries(c).map(([h,d])=>` ${h}: ${d};`).join(`
|
699
|
+
`),a=(c,h)=>{if(typeof h!="object"||h===null)return"";if(c.startsWith("@")){let d=Object.entries(h).map(([p,C])=>{let D=n(C);return` ${p} {
|
700
|
+
${D.split(`
|
701
|
+
`).map(T=>T?` ${T}`:"").join(`
|
702
|
+
`)}
|
703
|
+
}`}).join(`
|
704
|
+
`);return`${c} {
|
705
|
+
${d}
|
706
|
+
}`}else{let d=n(h);return`${c} {
|
707
|
+
${d}
|
708
|
+
}`}};return Object.entries(t).forEach(([c,h])=>{let d=a(c,h);d&&(r+=(r?`
|
684
709
|
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
color: var(--foreground);
|
697
|
-
outline: none;
|
698
|
-
cursor: pointer;
|
699
|
-
}
|
700
|
-
button:focus {
|
701
|
-
border-color: var(--foreground);
|
702
|
-
}
|
703
|
-
|
704
|
-
${x}
|
705
|
-
${b}
|
706
|
-
`);class o extends R({render:t,styleSheet:n}){_popoverRef={};_buttonRef={};options=[];close=()=>{this._popoverRef.current.close()};open=()=>{this._popoverRef.current.open(this._buttonRef.current)};select=i=>{this.onSelect&&this.onSelect(i),this.close()};render=()=>e`
|
707
|
-
<!-- TODO style this button and use proper selected value -->
|
708
|
-
<button ref=${this._buttonRef} onclick=${this.open}>Placeholder</button>
|
709
|
-
|
710
|
-
<rtgl-popover ref=${this._popoverRef} placement="bottom-start">
|
711
|
-
<rtgl-view wh="300" g="xs">
|
712
|
-
${this.options.map(({value:i,label:l})=>e`
|
713
|
-
<rtgl-view
|
714
|
-
w="f"
|
715
|
-
h-bgc="mu"
|
716
|
-
ph="l"
|
717
|
-
pv="m"
|
718
|
-
cur="p"
|
719
|
-
br="m"
|
720
|
-
onclick=${()=>this.select(i)}
|
721
|
-
>
|
722
|
-
<rtgl-text>${l}</rtgl-text>
|
723
|
-
</rtgl-view>
|
724
|
-
`)}
|
725
|
-
</rtgl-view>
|
726
|
-
</rtgl-popover>
|
727
|
-
`}return o};var ht=Math.min,N=Math.max,J=Math.round;var E=t=>({x:t,y:t});function he(t,e){return typeof t=="function"?t(e):t}function ut(t){return t.split("-")[0]}function Tt(t){return t.split("-")[1]}function ue(t){return t==="x"?"y":"x"}function ge(t){return t==="y"?"height":"width"}function gt(t){return["top","bottom"].includes(ut(t))?"y":"x"}function pe(t){return ue(gt(t))}function Q(t){let{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function me(t,e,n){let{reference:o,floating:r}=t,i=gt(e),l=pe(e),s=ge(l),a=ut(e),c=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2,u;switch(a){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-r.width,y:d};break;default:u={x:o.x,y:o.y}}switch(Tt(e)){case"start":u[l]-=h*(n&&c?-1:1);break;case"end":u[l]+=h*(n&&c?-1:1);break}return u}var ve=async(t,e,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(e)),c=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:d}=me(c,o,a),h=o,u={},g=0;for(let p=0;p<s.length;p++){let{name:w,fn:T}=s[p],{x:P,y:nt,data:xt,reset:B}=await T({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:u,rects:c,platform:l,elements:{reference:t,floating:e}});f=P??f,d=nt??d,u={...u,[w]:{...u[w],...xt}},B&&g<=50&&(g++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(c=B.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:r}):B.rects),{x:f,y:d}=me(c,h,a)),p=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:u}};async function bn(t,e){let{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=ut(n),s=Tt(n),a=gt(n)==="y",c=["left","top"].includes(l)?-1:1,f=i&&a?-1:1,d=he(e,t),{mainAxis:h,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(u=s==="end"?g*-1:g),a?{x:u*f,y:h*c}:{x:h*c,y:u*f}}var be=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:r,y:i,placement:l,middlewareData:s}=e,a=await bn(e,t);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}};function mt(){return typeof window<"u"}function H(t){return xe(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(xe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xe(t){return mt()?t instanceof Node||t instanceof A(t).Node:!1}function O(t){return mt()?t instanceof Element||t instanceof A(t).Element:!1}function _(t){return mt()?t instanceof HTMLElement||t instanceof A(t).HTMLElement:!1}function we(t){return!mt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof A(t).ShadowRoot}function V(t){let{overflow:e,overflowX:n,overflowY:o,display:r}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ye(t){return["table","td","th"].includes(H(t))}function Z(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vt(t){let e=bt(),n=O(t)?k(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Se(t){let e=M(t);for(;_(e)&&!z(e);){if(vt(e))return e;if(Z(e))return null;e=M(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(H(t))}function k(t){return A(t).getComputedStyle(t)}function tt(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(H(t)==="html")return t;let e=t.assignedSlot||t.parentNode||we(t)&&t.host||L(t);return we(e)?e.host:e}function $e(t){let e=M(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&V(e)?e:$e(e)}function pt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=$e(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),l=A(r);if(i){let s=wt(l);return e.concat(l,l.visualViewport||[],V(r)?r:[],s&&n?pt(s):[])}return e.concat(r,pt(r,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Re(t){let e=k(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,r=_(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=J(n)!==i||J(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function Oe(t){return O(t)?t:t.contextElement}function U(t){let e=Oe(t);if(!_(e))return E(1);let n=e.getBoundingClientRect(),{width:o,height:r,$:i}=Re(e),l=(i?J(n.width):n.width)/o,s=(i?J(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}var wn=E(0);function ke(t){let e=A(t);return!bt()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==A(t)?!1:e}function et(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=Oe(t),l=E(1);e&&(o?O(o)&&(l=U(o)):l=U(t));let s=xn(i,n,o)?ke(i):E(0),a=(r.left+s.x)/l.x,c=(r.top+s.y)/l.y,f=r.width/l.x,d=r.height/l.y;if(i){let h=A(i),u=o&&O(o)?A(o):o,g=h,p=wt(g);for(;p&&o&&u!==g;){let w=U(p),T=p.getBoundingClientRect(),P=k(p),nt=T.left+(p.clientLeft+parseFloat(P.paddingLeft))*w.x,xt=T.top+(p.clientTop+parseFloat(P.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,d*=w.y,a+=nt,c+=xt,g=A(p),p=wt(g)}}return Q({width:f,height:d,x:a,y:c})}function Pt(t,e){let n=tt(t).scrollLeft;return e?e.left+n:et(L(t)).left+n}function Ee(t,e,n){n===void 0&&(n=!1);let o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:Pt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function yn(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t,i=r==="fixed",l=L(o),s=e?Z(e.floating):!1;if(o===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},c=E(1),f=E(0),d=_(o);if((d||!d&&!i)&&((H(o)!=="body"||V(l))&&(a=tt(o)),_(o))){let u=et(o);c=U(o),f.x=u.x+o.clientLeft,f.y=u.y+o.clientTop}let h=l&&!d&&!i?Ee(l,a,!0):E(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-a.scrollTop*c.y+f.y+h.y}}function Sn(t){return Array.from(t.getClientRects())}function $n(t){let e=L(t),n=tt(t),o=t.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=N(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),l=-n.scrollLeft+Pt(t),s=-n.scrollTop;return k(o).direction==="rtl"&&(l+=N(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:s}}function An(t,e){let n=A(t),o=L(t),r=n.visualViewport,i=o.clientWidth,l=o.clientHeight,s=0,a=0;if(r){i=r.width,l=r.height;let c=bt();(!c||c&&e==="fixed")&&(s=r.offsetLeft,a=r.offsetTop)}return{width:i,height:l,x:s,y:a}}function Cn(t,e){let n=et(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?U(t):E(1),l=t.clientWidth*i.x,s=t.clientHeight*i.y,a=r*i.x,c=o*i.y;return{width:l,height:s,x:a,y:c}}function Ae(t,e,n){let o;if(e==="viewport")o=An(t,n);else if(e==="document")o=$n(L(t));else if(O(e))o=Cn(e,n);else{let r=ke(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Q(o)}function _e(t,e){let n=M(t);return n===e||!O(n)||z(n)?!1:k(n).position==="fixed"||_e(n,e)}function Rn(t,e){let n=e.get(t);if(n)return n;let o=pt(t,[],!1).filter(s=>O(s)&&H(s)!=="body"),r=null,i=k(t).position==="fixed",l=i?M(t):t;for(;O(l)&&!z(l);){let s=k(l),a=vt(l);!a&&s.position==="fixed"&&(r=null),(i?!a&&!r:!a&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||V(l)&&!a&&_e(t,l))?o=o.filter(f=>f!==l):r=s,l=M(l)}return e.set(t,o),o}function On(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t,l=[...n==="clippingAncestors"?Z(e)?[]:Rn(e,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,f)=>{let d=Ae(e,f,r);return c.top=N(d.top,c.top),c.right=ht(d.right,c.right),c.bottom=ht(d.bottom,c.bottom),c.left=N(d.left,c.left),c},Ae(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function kn(t){let{width:e,height:n}=Re(t);return{width:e,height:n}}function En(t,e,n){let o=_(e),r=L(e),i=n==="fixed",l=et(t,!0,i,e),s={scrollLeft:0,scrollTop:0},a=E(0);if(o||!o&&!i)if((H(e)!=="body"||V(r))&&(s=tt(e)),o){let h=et(e,!0,i,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else r&&(a.x=Pt(r));let c=r&&!o&&!i?Ee(r,s):E(0),f=l.left+s.scrollLeft-a.x-c.x,d=l.top+s.scrollTop-a.y-c.y;return{x:f,y:d,width:l.width,height:l.height}}function Lt(t){return k(t).position==="static"}function Ce(t,e){if(!_(t)||k(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Te(t,e){let n=A(t);if(Z(t))return n;if(!_(t)){let r=M(t);for(;r&&!z(r);){if(O(r)&&!Lt(r))return r;r=M(r)}return n}let o=Ce(t,e);for(;o&&ye(o)&&Lt(o);)o=Ce(o,e);return o&&z(o)&&Lt(o)&&!vt(o)?n:o||Se(t)||n}var _n=async function(t){let e=this.getOffsetParent||Te,n=this.getDimensions,o=await n(t.floating);return{reference:En(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Tn(t){return k(t).direction==="rtl"}var Ln={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:L,getClippingRect:On,getOffsetParent:Te,getElementRects:_n,getClientRects:Sn,getDimensions:kn,getScale:U,isElement:O,isRTL:Tn};var Le=be;var Pe=(t,e,n)=>{let o=new Map,r={platform:Ln,...n},i={...r.platform,_c:o};return ve(t,e,{...r,platform:i})};var Me=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
728
|
-
:host {
|
729
|
-
display: contents;
|
730
|
-
}
|
731
|
-
slot {
|
732
|
-
display: contents;
|
733
|
-
}
|
734
|
-
|
735
|
-
${x}
|
736
|
-
${b}
|
737
|
-
|
738
|
-
@keyframes popover-in {
|
739
|
-
from {
|
740
|
-
opacity: 0;
|
741
|
-
transform: scale(0.95);
|
710
|
+
`:"")+d)}),r},ys=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function bs(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function vs(e,t){let r=new Set(t);return new Proxy({},{get(n,a){if(typeof a=="string"&&r.has(a))return e[a]},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(n,a){return typeof a=="string"&&r.has(a)},ownKeys(){return[...r]},getOwnPropertyDescriptor(n,a){if(typeof a=="string"&&r.has(a))return{configurable:!0,enumerable:!0,get:()=>e[a]}}})}var Bt=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
|
711
|
+
a, a:link, a:visited, a:hover, a:active {
|
712
|
+
display: contents;
|
713
|
+
color: inherit;
|
714
|
+
text-decoration: none;
|
715
|
+
background: none;
|
716
|
+
border: none;
|
717
|
+
padding: 0;
|
718
|
+
margin: 0;
|
719
|
+
font: inherit;
|
720
|
+
cursor: pointer;
|
742
721
|
}
|
743
|
-
to {
|
744
|
-
opacity: 1;
|
745
|
-
transform: scale(1);
|
746
|
-
}
|
747
|
-
}
|
748
|
-
|
749
|
-
.popover-content {
|
750
|
-
animation: popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
751
|
-
transform-origin: top;
|
752
|
-
}
|
753
|
-
`);class o extends R({render:t,styleSheet:n}){_isOpen=!1;_refElement;_floatingElement;open=i=>{this._isOpen=!0,this._refElement=i,this.reRender(),Pe(this._refElement,this._floatingElement,{placement:this.getAttribute("placement")||"bottom",middleware:[Le(12)]}).then(({x:l,y:s})=>{Object.assign(this._floatingElement.style,{left:`${l}px`,top:`${s}px`,position:"fixed"})})};close=()=>{this._isOpen=!1,this.reRender()};render=()=>this._isOpen?e`
|
754
|
-
<rtgl-view onclick=${this.close} pos="fix" cor="full">
|
755
|
-
<rtgl-view
|
756
|
-
ref=${i=>this._floatingElement=i}
|
757
|
-
bw="xs"
|
758
|
-
p="l"
|
759
|
-
class="popover-content"
|
760
|
-
onclick=${i=>i.stopPropagation()}
|
761
|
-
>
|
762
|
-
<slot></slot>
|
763
|
-
</rtgl-view>
|
764
|
-
</rtgl-view>
|
765
|
-
`:e``}return o};function Pn(t){let e=[];for(let n of t)if(e.push({title:n.title,slug:n.slug,type:n.type}),n.items&&Array.isArray(n.items))for(let o of n.items)e.push({title:o.title,slug:o.slug,type:o.type});return e}var We=({render:t,html:e})=>class extends R({render:t}){items=[];title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let o=this.getAttribute("title");o&&(console.log("titleAttribute",o),this.title=JSON.parse(decodeURIComponent(o)),this.reRender())};getItems=()=>{let o,r=this.getAttribute("items");return r?o=JSON.parse(decodeURIComponent(r)):o=this.items,Pn(o)};static get observedAttributes(){return["items"]}render=()=>e`
|
766
|
-
<rtgl-view h="f" w="272" bwr="xs">
|
767
|
-
<rtgl-view p="l">
|
768
|
-
<a
|
769
|
-
style="text-decoration: none; display: contents; color: inherit;"
|
770
|
-
href=${this.title.href}
|
771
|
-
>
|
772
|
-
<rtgl-view d="h" av="c" g="l">
|
773
|
-
${this.title?.image?.src?e`<rtgl-image
|
774
|
-
w=${this.title?.image?.width}
|
775
|
-
h=${this.title?.image?.height}
|
776
|
-
src=${this.title?.image?.src}
|
777
|
-
alt=${this.title?.image?.alt||"Navbar"}
|
778
|
-
/>`:""}
|
779
|
-
${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
|
780
|
-
</rtgl-view>
|
781
|
-
</a>
|
782
|
-
</rtgl-view>
|
783
|
-
<rtgl-view w="f" ph="l" pb="l" g="xs">
|
784
|
-
${this.getItems().map((o,r)=>{let i=r===0;return o.type==="groupLabel"?e`
|
785
|
-
<rtgl-view mt=${i?void 0:"m"} h="32" av="c" ph="m">
|
786
|
-
<rtgl-text s="xs" c="mu-fg">${o.title}</rtgl-text>
|
787
|
-
</rtgl-view>
|
788
|
-
`:e`
|
789
|
-
<a
|
790
|
-
style="display: contents; text-decoration: none; color: inherit;"
|
791
|
-
href=${o.slug}
|
792
|
-
>
|
793
|
-
<rtgl-view
|
794
|
-
h="32"
|
795
|
-
av="c"
|
796
|
-
ph="m"
|
797
|
-
w="f"
|
798
|
-
h-bgc="mu"
|
799
|
-
br="l"
|
800
|
-
bgc="${o.active?"mu":"bg"}"
|
801
|
-
cur="p"
|
802
|
-
>
|
803
|
-
<rtgl-text s="sm">${o.title}</rtgl-text>
|
804
|
-
</rtgl-view>
|
805
|
-
</a>
|
806
|
-
`})}
|
807
|
-
</rtgl-view>
|
808
|
-
</rtgl-view>
|
809
|
-
`};var Be=({render:t,html:e})=>class extends R({render:t}){items=[];_contentContainer;_selectedSlug;onUnmount=()=>{this._contentContainer.removeEventListener("scroll",this.checkCurrentHeading),window.removeEventListener("scroll",this.checkCurrentHeading)};checkCurrentHeading=()=>{let o=this._contentContainer.querySelectorAll("rtgl-text[id]"),r=Array.from(o),i=null,l=null,s=-1/0;r.forEach(a=>{let c=a.getBoundingClientRect();c.top<=100&&c.top>s&&(s=c.top,l=a.id)}),l&&l!==i&&(i=l,this._selectedSlug=l,this.reRender())};startListening=o=>{this._contentContainer=o;let r=this._contentContainer.querySelectorAll("rtgl-text[id]"),i=Array.from(r);this.items=i.map(l=>({slug:l.id,title:l.textContent})),o&&o.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),window.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),this.checkCurrentHeading()};render=()=>e`
|
810
|
-
<rtgl-view h="f" w="272">
|
811
|
-
<rtgl-view w="f" g="s" mt="xl">
|
812
|
-
${this.items.map(o=>{let r=`${this._selectedSlug}`===o.slug?"fg":"mu-fg",i=`#${o.slug}`;return e`
|
813
|
-
<a
|
814
|
-
style="display: contents; text-decoration: none; color: inherit;"
|
815
|
-
href=${i}
|
816
|
-
>
|
817
|
-
<rtgl-text s="sm" c=${r}>${o.title}</rtgl-text>
|
818
|
-
</a>
|
819
|
-
`})}
|
820
|
-
</rtgl-view>
|
821
|
-
</rtgl-view>
|
822
|
-
`};var De=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
823
|
-
:host {
|
824
|
-
display: contents;
|
825
|
-
}
|
826
|
-
slot {
|
827
|
-
display: contents;
|
828
|
-
}
|
829
|
-
${x}
|
830
|
-
${b}
|
831
|
-
`);class o extends R({render:t,styleSheet:n}){title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let i=this.getAttribute("title");i&&(console.log("titleAttribute",i),this.title=JSON.parse(decodeURIComponent(i)),this.reRender())};render=()=>e`
|
832
|
-
<rtgl-view d="h" h="48" av="c" w="f">
|
833
|
-
<a
|
834
|
-
style="text-decoration: none; display: contents; color: inherit;"
|
835
|
-
href=${this.title.href}
|
836
|
-
>
|
837
|
-
<rtgl-view d="h" av="c" g="l">
|
838
|
-
${this.title?.image?.src?e`<rtgl-image
|
839
|
-
w=${this.title?.image?.width}
|
840
|
-
h=${this.title?.image?.height}
|
841
|
-
src=${this.title?.image?.src}
|
842
|
-
alt=${this.title?.image?.alt||"Navbar"}
|
843
|
-
/>`:""}
|
844
|
-
${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
|
845
|
-
</rtgl-view>
|
846
|
-
</a>
|
847
|
-
<rtgl-view flex="1"></rtgl-view>
|
848
|
-
<slot name="right"> </slot>
|
849
|
-
</rtgl-view>
|
850
|
-
`}return o};var Ne=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
851
|
-
:host {
|
852
|
-
display: contents;
|
853
|
-
}
|
854
|
-
${x}
|
855
|
-
${b}
|
856
|
-
`);class o extends R({render:t,styleSheet:n}){form={title:void 0,description:void 0,fields:[],actions:[]};values={};fieldStates={};static get observedAttributes(){return["key","w","ellipsis"]}_onChange=(i,l)=>{console.log("onChange",{name:i,value:l}),this.values[i]=l;let s=this.form?.fields?.find(a=>a.name===i)?.validations;if(s){for(let a of s)if(a.rule instanceof RegExp){let c=a.rule.test(l);this.fieldStates[i]||(this.fieldStates[i]={}),c?delete this.fieldStates[i].error:this.fieldStates[i].error=a.message}}this.reRender()};_onSubmit=i=>{this.onSubmit&&this.onSubmit({action:i,values:this.values,fieldStates:this.fieldStates})};render=()=>e`
|
857
|
-
<rtgl-view p="m" w="f">
|
858
|
-
<form style="display: contents;">
|
859
|
-
<rtgl-text s="h2">${this.form.title}</rtgl-text>
|
860
|
-
<rtgl-text c="mu-fg">${this.form.description}</rtgl-text>
|
861
|
-
<rtgl-view g="l">
|
862
|
-
${this.form.fields.map(i=>{if(i.type==="groupLabel")return e`<rtgl-text s="h4">${i.content}</rtgl-text> `;let l;i.type==="input"&&(l=e`
|
863
|
-
<rtgl-input
|
864
|
-
.onChange=${this._onChange.bind(this,i.name)}
|
865
|
-
type="text"
|
866
|
-
name="${i.name}"
|
867
|
-
/>
|
868
|
-
`);let s=this.fieldStates?.[i?.name]?.error;return e`
|
869
|
-
<rtgl-view g="m">
|
870
|
-
<rtgl-text s="sm" c=${s?"de":"fg"}>${i.label}</rtgl-text>
|
871
|
-
${l}
|
872
|
-
<rtgl-text s="sm" c="mu-fg">${i.description}</rtgl-text>
|
873
|
-
${s?e`<rtgl-text s="sm" c="de">${s}</rtgl-text>`:""}
|
874
|
-
</rtgl-view>
|
875
|
-
`})}
|
876
|
-
</rtgl-view>
|
877
|
-
<rtgl-view g="m" mt="l" w="f">
|
878
|
-
${this.form.actions.map(i=>e`<rtgl-button
|
879
|
-
w=${i.fill?"f":""}
|
880
|
-
onclick=${this._onSubmit.bind(this,i.id)}
|
881
|
-
>${i.content}</rtgl-button
|
882
|
-
> `)}
|
883
|
-
</rtgl-view>
|
884
|
-
</form>
|
885
|
-
</rtgl-view>
|
886
|
-
`}return o};customElements.define("rtgl-button",te({render:S,html:y}));customElements.define("rtgl-view",oe({render:S,html:y}));customElements.define("rtgl-text",ie({render:S,html:y}));customElements.define("rtgl-image",se({render:S,html:y}));customElements.define("rtgl-svg",ae({render:S,html:y}));customElements.define("rtgl-input",ce({render:S,html:y}));customElements.define("rtgl-textarea",de({render:S,html:y}));customElements.define("rtgl-select",fe({render:S,html:y}));customElements.define("rtgl-popover",Me({render:S,html:y}));customElements.define("rtgl-sidebar",We({render:S,html:y}));customElements.define("rtgl-page-outline",Be({render:S,html:y}));customElements.define("rtgl-navbar",De({render:S,html:y}));customElements.define("rtgl-form",Ne({render:S,html:y}));})();
|
887
|
-
/*! (c) Andrea Giammarchi - MIT */
|
722
|
+
`);let r=[t];if(this.cssText){let a=new CSSStyleSheet;a.replaceSync(this.cssText),r.push(a)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(a=>{this.transformedHandlers[a]=c=>this.handlers[a](c,n)}),this.handlers?.subscriptions&&(this.unsubscribeAll=ys(this.handlers.subscriptions(n))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(n)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t=Wr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),r={},n=a=>{a.data?.attrs&&a.data.attrs.id&&(r[a.data.attrs.id]=a),a.children&&a.children.forEach(n)};n(t),this.refIds=r,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,t):this._oldVNode=this.patch(this.renderTarget,t)}catch(t){console.error("Error during patching:",t)}}},ws=(e,t,r)=>{let{INITIAL_STATE:n,toViewData:a,...c}=e,h={},d={},p=structuredClone(n);return Object.entries(c).forEach(([C,D])=>{C.startsWith("select")?h[C]=(...T)=>D({state:p,props:t,attrs:r},...T):d[C]=T=>(p=Br(p,R=>D(R,T)),p)}),{toViewData:()=>a({state:p,props:t,attrs:r}),getState:()=>p,...d,...h}},_s=({handlers:e,view:t,store:r,patch:n,h:a},c)=>{let{elementName:h,propsSchema:d,template:p,refs:C,styles:D}=t;if(!n)throw new Error("Patch is not defined");if(!a)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class T extends Bt{constructor(){super();let V=bs(this);this.propsSchema=d,this.props=d?vs(this,Object.keys(d.properties)):{},this.elementName=h,this.styles=D,this.store=ws(r,this.props,V),this.template=p,this.handlers=e,this.refs=C,this.patch=n,this.deps={...c,store:this.store,render:this.render,handlers:e,attrs:V,props:this.props},this.h=a,this.cssText=gs(h,D)}}return T},Vt=_s;function xe(e,t,r,n,a){let c=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:n,elm:a,key:c}}var ze=Array.isArray;function Pe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function xs(e,t){return document.createElement(e,t)}function $s(e,t,r){return document.createElementNS(e,t,r)}function ks(){return $e(document.createDocumentFragment())}function Ss(e){return document.createTextNode(e)}function As(e){return document.createComment(e)}function Es(e,t,r){if(ge(e)){let n=e;for(;n&&ge(n);)n=$e(n).parent;e=n??e}ge(t)&&(t=$e(t,e)),r&&ge(r)&&(r=$e(r).firstChildNode),e.insertBefore(t,r)}function Os(e,t){e.removeChild(t)}function Cs(e,t){ge(t)&&(t=$e(t,e)),e.appendChild(t)}function Kr(e){if(ge(e)){for(;e&&ge(e);)e=$e(e).parent;return e??null}return e.parentNode}function js(e){var t;if(ge(e)){let r=$e(e),n=Kr(r);if(n&&r.lastChildNode){let a=Array.from(n.childNodes),c=a.indexOf(r.lastChildNode);return(t=a[c+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Ts(e){return e.tagName}function Is(e,t){e.textContent=t}function Ns(e){return e.textContent}function zs(e){return e.nodeType===1}function Ps(e){return e.nodeType===3}function Ds(e){return e.nodeType===8}function ge(e){return e.nodeType===11}function $e(e,t){var r,n,a;let c=e;return(r=c.parent)!==null&&r!==void 0||(c.parent=t??null),(n=c.firstChildNode)!==null&&n!==void 0||(c.firstChildNode=e.firstChild),(a=c.lastChildNode)!==null&&a!==void 0||(c.lastChildNode=e.lastChild),c}var qr={createElement:xs,createElementNS:$s,createTextNode:Ss,createDocumentFragment:ks,createComment:As,insertBefore:Es,removeChild:Os,appendChild:Cs,parentNode:Kr,nextSibling:js,tagName:Ts,setTextContent:Is,getTextContent:Ns,isElement:zs,isText:Ps,isComment:Ds,isDocumentFragment:ge};function it(e){return e===void 0}function ee(e){return e!==void 0}var Ut=xe("",{},[],void 0,void 0);function Ue(e,t){var r,n;let a=e.key===t.key,c=((r=e.data)===null||r===void 0?void 0:r.is)===((n=t.data)===null||n===void 0?void 0:n.is),h=e.sel===t.sel,d=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return h&&a&&c&&d}function Ms(){throw new Error("The document fragment is not supported on this platform.")}function Fs(e,t){return e.isElement(t)}function Ls(e,t){return e.isDocumentFragment(t)}function Hs(e,t,r){var n;let a={};for(let c=t;c<=r;++c){let h=(n=e[c])===null||n===void 0?void 0:n.key;h!==void 0&&(a[h]=c)}return a}var Rs=["create","update","remove","destroy","pre","post"];function Gr(e,t,r){let n={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},a=t!==void 0?t:qr;for(let f of Rs)for(let g of e){let b=g[f];b!==void 0&&n[f].push(b)}function c(f){let g=f.id?"#"+f.id:"",b=f.getAttribute("class"),y=b?"."+b.split(" ").join("."):"";return xe(a.tagName(f).toLowerCase()+g+y,{},[],void 0,f)}function h(f){return xe(void 0,{},[],void 0,f)}function d(f,g){return function(){if(--g===0){let y=a.parentNode(f);y!==null&&a.removeChild(y,f)}}}function p(f,g){var b,y,S,I;let x,N=f.data;if(N!==void 0){let O=(b=N.hook)===null||b===void 0?void 0:b.init;ee(O)&&(O(f),N=f.data)}let E=f.children,P=f.sel;if(P==="!")it(f.text)&&(f.text=""),f.elm=a.createComment(f.text);else if(P==="")f.elm=a.createTextNode(f.text);else if(P!==void 0){let O=P.indexOf("#"),F=P.indexOf(".",O),M=O>0?O:P.length,$=F>0?F:P.length,k=O!==-1||F!==-1?P.slice(0,Math.min(M,$)):P,Z=f.elm=ee(N)&&ee(x=N.ns)?a.createElementNS(x,k,N):a.createElement(k,N);for(M<$&&Z.setAttribute("id",P.slice(M+1,$)),F>0&&Z.setAttribute("class",P.slice($+1).replace(/\./g," ")),x=0;x<n.create.length;++x)n.create[x](Ut,f);if(Pe(f.text)&&(!ze(E)||E.length===0)&&a.appendChild(Z,a.createTextNode(f.text)),ze(E))for(x=0;x<E.length;++x){let X=E[x];X!=null&&a.appendChild(Z,p(X,g))}let W=f.data.hook;ee(W)&&((y=W.create)===null||y===void 0||y.call(W,Ut,f),W.insert&&g.push(f))}else if(!((S=r?.experimental)===null||S===void 0)&&S.fragments&&f.children){for(f.elm=((I=a.createDocumentFragment)!==null&&I!==void 0?I:Ms)(),x=0;x<n.create.length;++x)n.create[x](Ut,f);for(x=0;x<f.children.length;++x){let O=f.children[x];O!=null&&a.appendChild(f.elm,p(O,g))}}else f.elm=a.createTextNode(f.text);return f.elm}function C(f,g,b,y,S,I){for(;y<=S;++y){let x=b[y];x!=null&&a.insertBefore(f,p(x,I),g)}}function D(f){var g,b;let y=f.data;if(y!==void 0){(b=(g=y?.hook)===null||g===void 0?void 0:g.destroy)===null||b===void 0||b.call(g,f);for(let S=0;S<n.destroy.length;++S)n.destroy[S](f);if(f.children!==void 0)for(let S=0;S<f.children.length;++S){let I=f.children[S];I!=null&&typeof I!="string"&&D(I)}}}function T(f,g,b,y){for(var S,I;b<=y;++b){let x,N,E=g[b];if(E!=null)if(ee(E.sel)){D(E),x=n.remove.length+1,N=d(E.elm,x);for(let O=0;O<n.remove.length;++O)n.remove[O](E,N);let P=(I=(S=E?.data)===null||S===void 0?void 0:S.hook)===null||I===void 0?void 0:I.remove;ee(P)?P(E,N):N()}else E.children?(D(E),T(f,E.children,0,E.children.length-1)):a.removeChild(f,E.elm)}}function R(f,g,b,y){let S=0,I=0,x=g.length-1,N=g[0],E=g[x],P=b.length-1,O=b[0],F=b[P],M,$,k,Z;for(;S<=x&&I<=P;)N==null?N=g[++S]:E==null?E=g[--x]:O==null?O=b[++I]:F==null?F=b[--P]:Ue(N,O)?(V(N,O,y),N=g[++S],O=b[++I]):Ue(E,F)?(V(E,F,y),E=g[--x],F=b[--P]):Ue(N,F)?(V(N,F,y),a.insertBefore(f,N.elm,a.nextSibling(E.elm)),N=g[++S],F=b[--P]):Ue(E,O)?(V(E,O,y),a.insertBefore(f,E.elm,N.elm),E=g[--x],O=b[++I]):(M===void 0&&(M=Hs(g,S,x)),$=M[O.key],it($)?(a.insertBefore(f,p(O,y),N.elm),O=b[++I]):it(M[F.key])?(a.insertBefore(f,p(F,y),a.nextSibling(E.elm)),F=b[--P]):(k=g[$],k.sel!==O.sel?a.insertBefore(f,p(O,y),N.elm):(V(k,O,y),g[$]=void 0,a.insertBefore(f,k.elm,N.elm)),O=b[++I]));I<=P&&(Z=b[P+1]==null?null:b[P+1].elm,C(f,Z,b,I,P,y)),S<=x&&T(f,g,S,x)}function V(f,g,b){var y,S,I,x,N,E,P,O;let F=(y=g.data)===null||y===void 0?void 0:y.hook;(S=F?.prepatch)===null||S===void 0||S.call(F,f,g);let M=g.elm=f.elm;if(f===g)return;if(g.data!==void 0||ee(g.text)&&g.text!==f.text){(I=g.data)!==null&&I!==void 0||(g.data={}),(x=f.data)!==null&&x!==void 0||(f.data={});for(let Z=0;Z<n.update.length;++Z)n.update[Z](f,g);(P=(E=(N=g.data)===null||N===void 0?void 0:N.hook)===null||E===void 0?void 0:E.update)===null||P===void 0||P.call(E,f,g)}let $=f.children,k=g.children;it(g.text)?ee($)&&ee(k)?$!==k&&R(M,$,k,b):ee(k)?(ee(f.text)&&a.setTextContent(M,""),C(M,null,k,0,k.length-1,b)):ee($)?T(M,$,0,$.length-1):ee(f.text)&&a.setTextContent(M,""):f.text!==g.text&&(ee($)&&T(M,$,0,$.length-1),a.setTextContent(M,g.text)),(O=F?.postpatch)===null||O===void 0||O.call(F,f,g)}return function(g,b){let y,S,I,x=[];for(y=0;y<n.pre.length;++y)n.pre[y]();for(Fs(a,g)?g=c(g):Ls(a,g)&&(g=h(g)),Ue(g,b)?V(g,b,x):(S=g.elm,I=a.parentNode(S),p(b,x),I!==null&&(a.insertBefore(I,b.elm,a.nextSibling(S)),T(I,[g],0,0))),y=0;y<x.length;++y)x[y].data.hook.insert(x[y]);for(y=0;y<n.post.length;++y)n.post[y]();return b}}function Xr(e,t){let r,n,a=t.elm,c=e.data.class,h=t.data.class;if(!(!c&&!h)&&c!==h){c=c||{},h=h||{};for(n in c)c[n]&&!Object.prototype.hasOwnProperty.call(h,n)&&a.classList.remove(n);for(n in h)r=h[n],r!==c[n]&&a.classList[r?"add":"remove"](n)}}var Yr={create:Xr,update:Xr};function Qr(e,t){let r,n,a,c=t.elm,h=e.data.props,d=t.data.props;if(!(!h&&!d)&&h!==d){h=h||{},d=d||{};for(r in d)n=d[r],a=h[r],a!==n&&(r!=="value"||c[r]!==n)&&(c[r]=n)}}var en={create:Qr,update:Qr};var Zs="http://www.w3.org/1999/xlink",Bs="http://www.w3.org/2000/xmlns/",Vs="http://www.w3.org/XML/1998/namespace";function tn(e,t){let r,n=t.elm,a=e.data.attrs,c=t.data.attrs;if(!(!a&&!c)&&a!==c){a=a||{},c=c||{};for(r in c){let h=c[r];a[r]!==h&&(h===!0?n.setAttribute(r,""):h===!1?n.removeAttribute(r):r.charCodeAt(0)!==120?n.setAttribute(r,h):r.charCodeAt(3)===58?n.setAttributeNS(Vs,r,h):r.charCodeAt(5)===58?r.charCodeAt(1)===109?n.setAttributeNS(Bs,r,h):n.setAttributeNS(Zs,r,h):n.setAttribute(r,h))}for(r in a)r in c||n.removeAttribute(r)}}var rn={create:tn,update:tn};var nn=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Us=function(e){nn(function(){nn(e)})},Wt=!1;function Ws(e,t,r){Us(function(){e[t]=r})}function sn(e,t){let r,n,a=t.elm,c=e.data.style,h=t.data.style;if(!c&&!h||c===h)return;c=c||{},h=h||{};let d="delayed"in c;for(n in c)n in h||(n[0]==="-"&&n[1]==="-"?a.style.removeProperty(n):a.style[n]="");for(n in h)if(r=h[n],n==="delayed"&&h.delayed)for(let p in h.delayed)r=h.delayed[p],(!d||r!==c.delayed[p])&&Ws(a.style,p,r);else n!=="remove"&&r!==c[n]&&(n[0]==="-"&&n[1]==="-"?a.style.setProperty(n,r):a.style[n]=r)}function Js(e){let t,r,n=e.elm,a=e.data.style;if(!(!a||!(t=a.destroy)))for(r in t)n.style[r]=t[r]}function Ks(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Wt||(e.elm.offsetLeft,Wt=!0);let n,a=e.elm,c=0,h=r.remove,d=0,p=[];for(n in h)p.push(n),a.style[n]=h[n];let D=getComputedStyle(a)["transition-property"].split(", ");for(;c<D.length;++c)p.indexOf(D[c])!==-1&&d++;a.addEventListener("transitionend",function(T){T.target===a&&--d,d===0&&t()})}function qs(){Wt=!1}var on={pre:qs,create:sn,update:sn,destroy:Js,remove:Ks};function an(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let n=0;n<e.length;n++)an(e[n],t,r)}function Gs(e,t){let r=e.type,n=t.data.on;n&&n[r]&&an(n[r],t,e)}function Xs(){return function e(t){Gs(t,e.vnode)}}function Jt(e,t){let r=e.data.on,n=e.listener,a=e.elm,c=t&&t.data.on,h=t&&t.elm,d;if(r!==c){if(r&&n)if(c)for(d in r)c[d]||a.removeEventListener(d,n,!1);else for(d in r)a.removeEventListener(d,n,!1);if(c){let p=t.listener=e.listener||Xs();if(p.vnode=t,r)for(d in c)r[d]||h.addEventListener(d,p,!1);else for(d in c)h.addEventListener(d,p,!1)}}}var ln={create:Jt,update:Jt,destroy:Jt};var Ys=()=>Gr([Yr,en,rn,on,ln]),Kt=Ys;function cn(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let n=0;n<t.length;++n){let a=t[n];if(typeof a=="string")continue;let c=a.data;c!==void 0&&cn(c,a.children,a.sel)}}function qt(e,t,r){let n={},a,c,h;if(r!==void 0?(t!==null&&(n=t),ze(r)?a=r:Pe(r)?c=r.toString():r&&r.sel&&(a=[r])):t!=null&&(ze(t)?a=t:Pe(t)?c=t.toString():t&&t.sel?a=[t]:n=t),a!==void 0)for(h=0;h<a.length;++h)Pe(a[h])&&(a[h]=xe(void 0,void 0,void 0,a[h],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&cn(n,a,e),xe(e,n,a,c,void 0)}var Qs={},hn={components:Qs},un=Kt();var st={components:{select:{store:yt,view:Sr,handlers:bt},navbar:{view:Ar,handlers:vt,store:wt},popover:{store:_t,handlers:xt,view:Er},form:{store:$t,handlers:kt,view:Or},sidebar:{store:At,view:Cr,handlers:Et},pageOutline:{store:Ot,view:jr,handlers:Ct}}};Object.keys(st).forEach(e=>{Object.keys(st[e]).forEach(t=>{let r=Vt({...st[e][t],patch:un,h:qt},hn[e]);customElements.define(st[e][t].view.elementName,r)})});customElements.define("rtgl-button",pr({}));customElements.define("rtgl-view",yr({}));customElements.define("rtgl-text",vr({}));customElements.define("rtgl-image",wr({}));customElements.define("rtgl-svg",xr({}));customElements.define("rtgl-input",$r({}));customElements.define("rtgl-textarea",kr({}));})();
|