diff --git a/package.json b/package.json index 1714dc4..d1800bc 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,25 @@ { "type": "module", "scripts": { - "dev": "vite --config tools/vite.config.ts", - "build": "vite build --config tools/vite.config.ts", - "preview": "vite preview", - "check": "svelte-check --workspace ui --tsconfig ./../tools/tsconfig.json", - "lint": "prettier --check --plugin-search-dir=. ./ui --config ./tools/.prettierrc --ignore-path ./tools/.prettierignore", - "format": "prettier --write --plugin-search-dir=. ./ui --config ./tools/.prettierrc --ignore-path ./tools/.prettierignore" - }, - "dependencies": { - "svelte-portal": "^2.2.0" - }, - "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^1.0.1", - "@tsconfig/svelte": "^3.0.0", - "prettier": "^2.7.1", - "prettier-plugin-svelte": "^2.7.0", - "sass": "^1.54.4", - "svelte": "^3.49.0", - "svelte-check": "^2.8.0", - "svelte-preprocess": "^4.10.7", - "tslib": "^2.4.0", - "typescript": "^4.6.4", - "vite": "^3.0.7" - } + "dev": "vite --config tools/vite.config.ts", + "build": "vite build --config tools/vite.config.ts", + "preview": "vite preview", + "check": "svelte-check --workspace ui --tsconfig ./../tools/tsconfig.json", + "lint": "prettier --check --plugin-search-dir=. ./ui --config ./tools/.prettierrc --ignore-path ./tools/.prettierignore", + "format": "prettier --write --plugin-search-dir=. ./ui --config ./tools/.prettierrc --ignore-path ./tools/.prettierignore" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^1.0.1", + "@tsconfig/svelte": "^3.0.0", + "postcss-nested": "^6.0.1", + "prettier": "^2.7.1", + "prettier-plugin-svelte": "^2.7.0", + "svelte": "^3.49.0", + "svelte-check": "^2.8.0", + "svelte-portal": "^2.2.0", + "svelte-preprocess": "^4.10.7", + "tslib": "^2.4.0", + "typescript": "^4.6.4", + "vite": "^3.0.7" + } } diff --git a/tools/postcss.config.cjs b/tools/postcss.config.cjs new file mode 100644 index 0000000..df07af8 --- /dev/null +++ b/tools/postcss.config.cjs @@ -0,0 +1,5 @@ +module.exports = { + plugins: [ + require('postcss-nested'), + ], +} diff --git a/tools/vite.config.ts b/tools/vite.config.ts index 5b4fd82..98e2169 100644 --- a/tools/vite.config.ts +++ b/tools/vite.config.ts @@ -1,7 +1,6 @@ import {defineConfig} from "vite" import {svelte} from "@sveltejs/vite-plugin-svelte" -// https://vitejs.dev/config/ export default defineConfig({ plugins: [ svelte({ @@ -9,6 +8,9 @@ export default defineConfig({ }) ], root: "ui", + css: { + postcss: __dirname + '/postcss.config.cjs', + }, build: { rollupOptions: { input: "ui/src/main.ts", diff --git a/ui/dist/assets/main.css b/ui/dist/assets/main.css index 534a639..d2fdac6 100644 --- a/ui/dist/assets/main.css +++ b/ui/dist/assets/main.css @@ -1 +1 @@ -:root{--orisai-radius: 3px;--orisai-color-border: #ecebeb;--orisai-color-border-active: #95caf5;--orisai-color-active: #0095ff;--orisai-color-link: #125eae;--orisai-color-warning: #FC4D25}#orisai-inspector{display:grid}#orisai-inspector>div{overflow:auto}div.svelte-12zqdjt{display:flex;align-items:center;gap:4px}a.svelte-4tavks{display:flex;align-items:center;border-radius:48px;padding:0 6px;font-size:10px;font-style:italic;font-weight:700;height:16px}.orisai-php.svelte-4tavks{background-color:#b0b3d6;color:#fff!important}.orisai-php.svelte-4tavks:hover,.orisai-php.svelte-4tavks:focus-visible{background-color:#787cb5!important}.orisai-latte.svelte-4tavks{background-color:#ffbe6c;color:#fff!important}.orisai-latte.svelte-4tavks:hover,.orisai-latte.svelte-4tavks:focus-visible{background-color:#f1a443!important}ul.svelte-1d9y6ld.svelte-1d9y6ld{border:1px solid var(--orisai-color-border);border-radius:0 0 var(--orisai-radius) var(--orisai-radius);overflow:hidden;margin:0;padding:0}li.svelte-1d9y6ld.svelte-1d9y6ld{padding:4px 4px 4px 8px;margin:0;display:flex;align-items:center;color:var(--orisai-color-link);cursor:pointer;transition:background-color .16s ease,opacity .2s ease}li.svelte-1d9y6ld:hover .orisai-editor-links.svelte-1d9y6ld{visibility:visible}li.svelte-1d9y6ld.svelte-1d9y6ld:not(:first-child){border-top:1px solid var(--orisai-color-border)}li.svelte-1d9y6ld.svelte-1d9y6ld:hover,.orisai-active.svelte-1d9y6ld.svelte-1d9y6ld{background-color:#f5f4f2;color:var(--orisai-color-active)}.orisai-active.svelte-1d9y6ld.svelte-1d9y6ld,.orisai-active.svelte-1d9y6ld.svelte-1d9y6ld:hover{color:#000}input.svelte-1d9y6ld.svelte-1d9y6ld{display:block;width:100%;border:1px solid var(--orisai-color-border);border-radius:var(--orisai-radius) var(--orisai-radius) 0 0;padding:0 8px;line-height:32px;height:32px}input.svelte-1d9y6ld.svelte-1d9y6ld:focus{border-color:var(--orisai-color-border-active);outline:none}.orisai-muted.svelte-1d9y6ld.svelte-1d9y6ld{opacity:.32}.orisai-editor-links.svelte-1d9y6ld.svelte-1d9y6ld{margin-left:auto;visibility:hidden;padding-left:16px}div.svelte-5a6l6p{display:inline-flex}div.svelte-5a6l6p>*:first-child{border-top-left-radius:var(--orisai-radius);border-bottom-left-radius:var(--orisai-radius)}div.svelte-5a6l6p>*:last-child{border-top-right-radius:var(--orisai-radius);border-bottom-right-radius:var(--orisai-radius)}div.svelte-5a6l6p>*:not(:first-child){margin-left:-1px}button.svelte-103qs3m{cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;height:32px;border:1px solid var(--orisai-color-border);transition:background-color .16s ease;white-space:nowrap}button.svelte-103qs3m:not(.orisai-active):hover{background-color:#f5f4f2}button.svelte-103qs3m:focus{outline:none}button.svelte-103qs3m:focus-visible{border-color:var(--orisai-color-border-active);z-index:1}button.svelte-103qs3m svg{margin-right:6px;flex:0 0 auto}.orisai-active.svelte-103qs3m{border-color:var(--orisai-color-border-active);color:var(--orisai-color-active);position:relative;z-index:1}div.svelte-1vj1au{--color:hsla(205, 100%, 50%, 1);--background:hsla(205, 100%, 50%, .32);--on-color:white;border:1px solid var(--color);background:var(--background);pointer-events:none;position:absolute;border-radius:0 var(--orisai-radius) var(--orisai-radius);z-index:19000}.orisai-mode-info.svelte-1vj1au{--color:hsla(205, 100%, 50%, 1);--background:hsla(205, 100%, 50%, .32)}.orisai-mode-php.svelte-1vj1au{--color:#787cb5;--background:rgba(120, 124, 181, .32)}.orisai-mode-latte.svelte-1vj1au{--color:#F1A443;--background:rgba(241, 164, 67, .32)}span.svelte-1vj1au{position:absolute;padding:2px 6px;background-color:var(--color);color:var(--on-color);border-radius:var(--orisai-radius) var(--orisai-radius) 0 0;font-family:system,sans-serif;font-size:11px;bottom:100%;left:-1px}div.svelte-1pj8e1h{display:inline-flex;align-items:center;opacity:.5}h2.svelte-62j2r4.svelte-62j2r4{font-size:17px;margin:0 0 8px!important}.orisai-grid.svelte-62j2r4.svelte-62j2r4{display:flex;align-items:center;gap:8px}.InspectorPanel.svelte-62j2r4 td.svelte-62j2r4{white-space:nowrap}.InspectorPanel-php.svelte-62j2r4.svelte-62j2r4{background:#8993be;color:#fff;border-radius:79px;padding:1px 4px 3px;font-size:75%;font-style:italic;font-weight:700;vertical-align:text-top;opacity:.5;margin-left:2ex}.InspectorPanel-type.svelte-62j2r4.svelte-62j2r4{border-radius:2px;padding:2px 4px;font-size:80%;color:#fff;font-weight:700}span.svelte-1u21lo6{display:inline-block;padding:1px 3px;background:#ffffff;border:1px solid rgba(0,0,0,.12);box-shadow:0 2px 4px #0000000a;border-radius:6px;min-width:18px;text-align:center}.orisai-grid.svelte-152bwch.svelte-152bwch.svelte-152bwch{display:grid;grid-template-columns:auto 1fr;column-gap:24px}.orisai-grid.svelte-152bwch>div.svelte-152bwch.svelte-152bwch{width:auto;overflow:auto}.orisai-grid.svelte-152bwch>div.svelte-152bwch.svelte-152bwch:nth-child(2){display:flex;flex-direction:column;gap:12px}.orisai-grid.svelte-152bwch>div.svelte-152bwch:nth-child(2)>div.svelte-152bwch{flex:1;overflow:auto} +:root{--orisai-radius: 3px;--orisai-color-border: #ecebeb;--orisai-color-border-active: #95caf5;--orisai-color-active: #0095ff;--orisai-color-link: #125eae;--orisai-color-warning: #FC4D25}#orisai-inspector{display:grid}#orisai-inspector>div{overflow:auto}div.svelte-1vne03z{display:flex;align-items:center;gap:4px}a.svelte-1adkrmg{display:flex;align-items:center;border-radius:48px;padding:0 6px;font-size:10px;font-style:italic;font-weight:700;height:16px}.orisai-php.svelte-1adkrmg{background-color:#b0b3d6;color:#fff!important}.orisai-php.svelte-1adkrmg:hover,.orisai-php.svelte-1adkrmg:focus-visible{background-color:#787cb5!important}.orisai-latte.svelte-1adkrmg{background-color:#ffbe6c;color:#fff!important}.orisai-latte.svelte-1adkrmg:hover,.orisai-latte.svelte-1adkrmg:focus-visible{background-color:#f1a443!important}ul.svelte-ks6908{border:1px solid var(--orisai-color-border);border-radius:0 0 var(--orisai-radius) var(--orisai-radius);overflow:hidden;margin:0;padding:0}li.svelte-ks6908{padding:4px 4px 4px 8px;margin:0;display:flex;align-items:center;color:var(--orisai-color-link);cursor:pointer;transition:background-color .16s ease,opacity .2s ease}li.svelte-ks6908:hover .orisai-editor-links{visibility:visible}li.svelte-ks6908:not(:first-child){border-top:1px solid var(--orisai-color-border)}li.svelte-ks6908:hover,.orisai-active.svelte-ks6908{background-color:#f5f4f2;color:var(--orisai-color-active)}.orisai-active.svelte-ks6908,.orisai-active.svelte-ks6908:hover{color:#000}input.svelte-ks6908{display:block;width:100%;border:1px solid var(--orisai-color-border);border-radius:var(--orisai-radius) var(--orisai-radius) 0 0;padding:0 8px;line-height:32px;height:32px}input.svelte-ks6908:focus{border-color:var(--orisai-color-border-active);outline:none}.orisai-muted.svelte-ks6908{opacity:.32}.orisai-editor-links.svelte-ks6908{margin-left:auto;visibility:hidden;padding-left:16px}div.svelte-1vmd063{display:inline-flex}div.svelte-1vmd063 :global(> *:first-child){border-top-left-radius:var(--orisai-radius);border-bottom-left-radius:var(--orisai-radius)};div.svelte-1vmd063 :global(> *:last-child){border-top-right-radius:var(--orisai-radius);border-bottom-right-radius:var(--orisai-radius)};div.svelte-1vmd063 :global(> *:not(:first-child)){margin-left:-1px}button.svelte-2yk66i{cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;height:32px;border:1px solid var(--orisai-color-border);transition:background-color .16s ease;white-space:nowrap}button.svelte-2yk66i:not(.orisai-active):hover{background-color:#f5f4f2};button.svelte-2yk66i:focus{outline:none};button.svelte-2yk66i:focus-visible{border-color:var(--orisai-color-border-active);z-index:1};button.svelte-2yk66i :global(svg){margin-right:6px;flex:0 0 auto}.orisai-active.svelte-2yk66i{border-color:var(--orisai-color-border-active);color:var(--orisai-color-active);position:relative;z-index:1}div.svelte-w5axtv{--color:hsla(205, 100%, 50%, 1);--background:hsla(205, 100%, 50%, .32);--on-color:white;border:1px solid var(--color);background:var(--background);pointer-events:none;position:absolute;border-radius:0 var(--orisai-radius) var(--orisai-radius);z-index:19000}.orisai-mode-info.svelte-w5axtv{--color:hsla(205, 100%, 50%, 1);--background:hsla(205, 100%, 50%, .32)}.orisai-mode-php.svelte-w5axtv{--color:#787cb5;--background:rgba(120, 124, 181, .32)}.orisai-mode-latte.svelte-w5axtv{--color:#f1a443;--background:rgba(241, 164, 67, .32)}span.svelte-w5axtv{position:absolute;padding:2px 6px;background-color:var(--color);color:var(--on-color);border-radius:var(--orisai-radius) var(--orisai-radius) 0 0;font-family:system,sans-serif;font-size:11px;bottom:100%;left:-1px}div.svelte-org3jl{display:inline-flex;align-items:center;opacity:.5}h2.svelte-rtqx0m.svelte-rtqx0m{font-size:17px;margin:0 0 8px!important}.orisai-grid.svelte-rtqx0m.svelte-rtqx0m{display:flex;align-items:center;gap:8px}.InspectorPanel.svelte-rtqx0m td.svelte-rtqx0m{white-space:nowrap}.InspectorPanel-php.svelte-rtqx0m.svelte-rtqx0m{background:#8993be;color:#fff;border-radius:79px;padding:1px 4px 3px;font-size:75%;font-style:italic;font-weight:700;vertical-align:text-top;opacity:.5;margin-left:2ex}.InspectorPanel-type.svelte-rtqx0m.svelte-rtqx0m{border-radius:2px;padding:2px 4px;font-size:80%;color:#fff;font-weight:700}span.svelte-cvacmi{display:inline-block;padding:1px 3px;background:#ffffff;border:1px solid rgba(0,0,0,12%);box-shadow:0 2px 4px #0000000a;border-radius:6px;min-width:18px;text-align:center}.orisai-grid.svelte-5mmuxd{display:grid;grid-template-columns:auto 1fr;column-gap:24px}.orisai-grid.svelte-5mmuxd>div{width:auto;overflow:auto};.orisai-grid.svelte-5mmuxd > div:nth-child(2){display:flex;flex-direction:column;gap:12px}.orisai-grid.svelte-5mmuxd>div:nth-child(2)>div{flex:1;overflow:auto} diff --git a/ui/dist/assets/main.js b/ui/dist/assets/main.js index a5fab6a..5b98f65 100644 --- a/ui/dist/assets/main.js +++ b/ui/dist/assets/main.js @@ -1,18 +1,18 @@ -function D(){}function ot(t,e){for(const l in e)t[l]=e[l];return t}function Je(t){return t()}function Le(){return Object.create(null)}function x(t){t.forEach(Je)}function ye(t){return typeof t=="function"}function O(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function it(t){return Object.keys(t).length===0}function rt(t,...e){if(t==null)return D;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ie(t,e,l){t.$$.on_destroy.push(rt(e,l))}function he(t,e,l,n){if(t){const o=Ge(t,e,l,n);return t[0](o)}}function Ge(t,e,l,n){return t[1]&&n?ot(l.ctx.slice(),t[1](n(e))):l.ctx}function $e(t,e,l,n){if(t[2]&&n){const o=t[2](n(l));if(e.dirty===void 0)return o;if(typeof o=="object"){const i=[],r=Math.max(e.dirty.length,o.length);for(let s=0;s32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function ft(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function k(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}function ut(t){return Array.from(t.childNodes)}function F(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Te(t,e){t.value=e==null?"":e}function X(t,e,l,n){l===null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function j(t,e,l){t.classList[l?"add":"remove"](e)}function ct(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,l,n,e),o}class Qe{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,l,n=null){this.e||(this.is_svg?this.e=ce(l.nodeName):this.e=y(l.nodeName),this.t=l,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let l=0;l{const o=t.$$.callbacks[e];if(o){const i=ct(e,l,{cancelable:n});return o.slice().forEach(r=>{r.call(t,i)}),!i.defaultPrevented}return!0}}function pt(t,e){const l=t.$$.callbacks[e.type];l&&l.slice().forEach(n=>n.call(this,e))}const le=[],Ne=[],ae=[],Ie=[],Xe=Promise.resolve();let ke=!1;function Ye(){ke||(ke=!0,Xe.then(xe))}function mt(){return Ye(),Xe}function ve(t){ae.push(t)}const we=new Set;let fe=0;function xe(){const t=re;do{for(;fe{pe.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}const et=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function M(t){t&&t.c()}function I(t,e,l,n){const{fragment:o,on_mount:i,on_destroy:r,after_update:s}=t.$$;o&&o.m(e,l),n||ve(()=>{const f=i.map(Je).filter(ye);r?r.push(...f):x(f),t.$$.on_mount=[]}),s.forEach(ve)}function H(t,e){const l=t.$$;l.fragment!==null&&(x(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function _t(t,e){t.$$.dirty[0]===-1&&(le.push(t),Ye(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const b=g.length?g[0]:a;return c.ctx&&o(c.ctx[m],c.ctx[m]=b)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](b),u&&_t(t,m)),a}):[],c.update(),u=!0,x(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=ut(e.target);c.fragment&&c.fragment.l(m),m.forEach(h)}else c.fragment&&c.fragment.c();e.intro&&_(t.$$.fragment),I(t,e.target,e.anchor,e.customElement),xe()}oe(f)}class R{$destroy(){H(this,1),this.$destroy=D}$on(e,l){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const o=n.indexOf(l);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!it(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var U=(t=>(t.Info="info",t.PHP="php",t.Latte="latte",t))(U||{});function de(t){if(!/^__/.test(t.fullName))return t.shortName;if(t.control!==null)return t.control.shortName;if(t.id!==null)return t.id;throw new Error("Should not happen")}function He(t){let e=t,l=null,n=!1,o=null;const i=[];if(t instanceof HTMLFormElement||t.closest("form")){const m=t.closest("form");return{rootElements:[m],fullName:m.id.split("-").pop()}}const r=new RegExp("{control (.+)}"),s=new RegExp("{/control (.+)}");for(;e;)if(e.nodeType===Node.COMMENT_NODE){if(!n&&e.textContent!==null&&s.test(e.textContent.trim())){n=!0;break}else if(e.textContent!==null&&r.test(e.textContent.trim())&&n){n=!1;break}l=e,e=null}else e instanceof HTMLElement&&(o=e),e=e.previousSibling||e.parentNode;if(l===null||l.textContent===null||!r.test(l.textContent.trim()))return null;const f=l.textContent.trim().match(r);if(o===null||f===null)return null;const c=f[1];if(o===document.documentElement||o===document.body)return null;i.push(o);let u=o;for(;u.nextSibling;){if(u.nextSibling.nodeType===Node.ELEMENT_NODE)i.push(u.nextSibling);else if(u.nextSibling.nodeType===Node.COMMENT_NODE&&s.test(u.nextSibling.textContent.trim()))break;u=u.nextSibling}return{rootElements:i,fullName:c}}function ht(t){let e,l;const n=t[1].default,o=he(n,t,t[0],null);return{c(){e=y("div"),o&&o.c(),k(e,"class","svelte-12zqdjt")},m(i,r){$(i,e,r),o&&o.m(e,null),l=!0},p(i,[r]){o&&o.p&&(!l||r&1)&&ge(o,n,i,i[0],l?$e(n,i[0],r,null):be(i[0]),null)},i(i){l||(_(o,i),l=!0)},o(i){v(o,i),l=!1},d(i){i&&h(e),o&&o.d(i)}}}function $t(t,e,l){let{$$slots:n={},$$scope:o}=e;return t.$$set=i=>{"$$scope"in i&&l(0,o=i.$$scope)},[o,n]}class gt extends R{constructor(e){super(),K(this,e,$t,ht,O,{})}}function bt(t){let e,l;return{c(){e=y("a"),l=E(t[1]),k(e,"href",t[0]),k(e,"class","svelte-4tavks"),j(e,"orisai-latte",t[1]==="latte"),j(e,"orisai-php",t[1]==="php")},m(n,o){$(n,e,o),d(e,l)},p(n,[o]){o&2&&F(l,n[1]),o&1&&k(e,"href",n[0]),o&2&&j(e,"orisai-latte",n[1]==="latte"),o&2&&j(e,"orisai-php",n[1]==="php")},i:D,o:D,d(n){n&&h(e)}}}function wt(t,e,l){let{uri:n}=e,{type:o}=e;return t.$$set=i=>{"uri"in i&&l(0,n=i.uri),"type"in i&&l(1,o=i.type)},[n,o]}class tt extends R{constructor(e){super(),K(this,e,wt,bt,O,{uri:0,type:1})}}function Me(t){let e,l;return e=new tt({props:{uri:t[0].control.editorUri,type:"php"}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.uri=n[0].control.editorUri),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Pe(t){let e,l;return e=new tt({props:{uri:t[0].template.editorUri,type:"latte"}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.uri=n[0].template.editorUri),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function kt(t){let e,l,n,o=t[0].control!==null&&Me(t),i=t[0].template!==null&&Pe(t);return{c(){o&&o.c(),e=T(),i&&i.c(),l=ee()},m(r,s){o&&o.m(r,s),$(r,e,s),i&&i.m(r,s),$(r,l,s),n=!0},p(r,s){r[0].control!==null?o?(o.p(r,s),s&1&&_(o,1)):(o=Me(r),o.c(),_(o,1),o.m(e.parentNode,e)):o&&(z(),v(o,1,1,()=>{o=null}),A()),r[0].template!==null?i?(i.p(r,s),s&1&&_(i,1)):(i=Pe(r),i.c(),_(i,1),i.m(l.parentNode,l)):i&&(z(),v(i,1,1,()=>{i=null}),A())},i(r){n||(_(o),_(i),n=!0)},o(r){v(o),v(i),n=!1},d(r){o&&o.d(r),r&&h(e),i&&i.d(r),r&&h(l)}}}function vt(t){let e,l;return e=new gt({props:{$$slots:{default:[kt]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&3&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function yt(t,e,l){let{component:n}=e;return t.$$set=o=>{"component"in o&&l(0,n=o.component)},[n]}class nt extends R{constructor(e){super(),K(this,e,yt,vt,O,{component:0})}}function Se(t,e,l){const n=t.slice();return n[6]=e[l],n}function je(t){let e,l,n=de(t[6])+"",o,i,r,s,f,c,u,m,a=t[6].depth>0&&De(t);s=new nt({props:{component:t[6]}});function g(){return t[5](t[6])}return{c(){e=y("li"),a&&a.c(),l=T(),o=E(n),i=T(),r=y("div"),M(s.$$.fragment),f=T(),k(r,"class","orisai-editor-links svelte-1d9y6ld"),k(e,"class","svelte-1d9y6ld"),j(e,"orisai-muted",!t[6].fullName.toLowerCase().includes(t[2].toLowerCase())&&!t[6].control.shortName.toLowerCase().includes(t[2].toLowerCase())),j(e,"orisai-active",t[1]===t[6])},m(b,p){$(b,e,p),a&&a.m(e,null),d(e,l),d(e,o),d(e,i),d(e,r),I(s,r,null),d(e,f),c=!0,u||(m=q(e,"click",g),u=!0)},p(b,p){t=b,t[6].depth>0?a?a.p(t,p):(a=De(t),a.c(),a.m(e,l)):a&&(a.d(1),a=null),(!c||p&1)&&n!==(n=de(t[6])+"")&&F(o,n);const w={};p&1&&(w.component=t[6]),s.$set(w),p&5&&j(e,"orisai-muted",!t[6].fullName.toLowerCase().includes(t[2].toLowerCase())&&!t[6].control.shortName.toLowerCase().includes(t[2].toLowerCase())),p&3&&j(e,"orisai-active",t[1]===t[6])},i(b){c||(_(s.$$.fragment,b),c=!0)},o(b){v(s.$$.fragment,b),c=!1},d(b){b&&h(e),a&&a.d(),H(s),u=!1,m()}}}function De(t){let e,l;return{c(){e=y("span"),l=E("\u2514"),X(e,"margin-left",t[6].depth*2+"ex")},m(n,o){$(n,e,o),$(n,l,o)},p(n,o){o&1&&X(e,"margin-left",n[6].depth*2+"ex")},d(n){n&&h(e),n&&h(l)}}}function Oe(t){let e,l,n=t[6].control!==null&&t[6].showInTree&&je(t);return{c(){n&&n.c(),e=ee()},m(o,i){n&&n.m(o,i),$(o,e,i),l=!0},p(o,i){o[6].control!==null&&o[6].showInTree?n?(n.p(o,i),i&1&&_(n,1)):(n=je(o),n.c(),_(n,1),n.m(e.parentNode,e)):n&&(z(),v(n,1,1,()=>{n=null}),A())},i(o){l||(_(n),l=!0)},o(o){v(n),l=!1},d(o){n&&n.d(o),o&&h(e)}}}function Ct(t){let e,l,n,o,i,r,s=t[0],f=[];for(let u=0;uv(f[u],1,1,()=>{f[u]=null});return{c(){e=y("input"),l=T(),n=y("ul");for(let u=0;ui("select",c);return t.$$set=c=>{"list"in c&&l(0,n=c.list),"selectedComponent"in c&&l(1,o=c.selectedComponent)},[n,o,r,i,s,f]}class Lt extends R{constructor(e){super(),K(this,e,Et,Ct,O,{list:0,selectedComponent:1})}}function Tt(t){let e,l;const n=t[1].default,o=he(n,t,t[0],null);return{c(){e=y("div"),o&&o.c(),k(e,"class","svelte-5a6l6p")},m(i,r){$(i,e,r),o&&o.m(e,null),l=!0},p(i,[r]){o&&o.p&&(!l||r&1)&&ge(o,n,i,i[0],l?$e(n,i[0],r,null):be(i[0]),null)},i(i){l||(_(o,i),l=!0)},o(i){v(o,i),l=!1},d(i){i&&h(e),o&&o.d(i)}}}function Nt(t,e,l){let{$$slots:n={},$$scope:o}=e;return t.$$set=i=>{"$$scope"in i&&l(0,o=i.$$scope)},[o,n]}class It extends R{constructor(e){super(),K(this,e,Nt,Tt,O,{})}}function Ht(t){let e,l,n,o;const i=t[2].default,r=he(i,t,t[1],null);return{c(){e=y("button"),r&&r.c(),k(e,"class","svelte-103qs3m"),j(e,"orisai-active",t[0])},m(s,f){$(s,e,f),r&&r.m(e,null),l=!0,n||(o=q(e,"click",ft(t[3])),n=!0)},p(s,[f]){r&&r.p&&(!l||f&2)&&ge(r,i,s,s[1],l?$e(i,s[1],f,null):be(s[1]),null),f&1&&j(e,"orisai-active",s[0])},i(s){l||(_(r,s),l=!0)},o(s){v(r,s),l=!1},d(s){s&&h(e),r&&r.d(s),n=!1,o()}}}function Mt(t,e,l){let{$$slots:n={},$$scope:o}=e,{active:i=!1}=e;function r(s){pt.call(this,t,s)}return t.$$set=s=>{"active"in s&&l(0,i=s.active),"$$scope"in s&&l(1,o=s.$$scope)},[i,o,n,r]}class Ue extends R{constructor(e){super(),K(this,e,Mt,Ht,O,{active:0})}}const W=[];function lt(t,e=D){let l;const n=new Set;function o(s){if(O(t,s)&&(t=s,l)){const f=!W.length;for(const c of n)c[1](),W.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&(l(),l=null)}}return{set:o,update:i,subscribe:r}}var V=(t=>(t[t.Inspect=0]="Inspect",t))(V||{});const B=lt(null),_e=lt(!1);function Pt(t){let e,l,n,o;return{c(){e=ce("svg"),l=ce("path"),n=ce("path"),o=E(` - Inspect`),k(l,"d","M3.33333 3.33333V12.6667H5.85185V14H2.66667C2.29848 14 2 13.7015 2 13.3333V2.66667C2 2.29848 2.29848 2 2.66667 2H13.3333C13.7015 2 14 2.29848 14 2.66667V5.85185H12.6667V3.33333H3.33333Z"),k(l,"fill","currentColor"),k(n,"d","M7.4075 7.61148L9.18437 14.2747C9.22274 14.4187 9.41622 14.4438 9.49011 14.3145L10.9016 11.8444L13.5286 14.4714C13.7889 14.7317 14.211 14.7317 14.4714 14.4714C14.7317 14.211 14.7317 13.7889 14.4714 13.5286L11.8444 10.9016L14.3145 9.49011C14.4438 9.41622 14.4187 9.22274 14.2747 9.18437L7.61148 7.4075C7.48768 7.37448 7.37448 7.48768 7.4075 7.61148Z"),k(n,"fill","currentColor"),k(e,"width","16"),k(e,"height","16"),k(e,"viewBox","0 0 16 16"),k(e,"fill","none"),k(e,"xmlns","http://www.w3.org/2000/svg")},m(i,r){$(i,e,r),d(e,l),d(e,n),$(i,o,r)},p:D,d(i){i&&h(e),i&&h(o)}}}function St(t){let e;return{c(){e=E("Help")},m(l,n){$(l,e,n)},d(l){l&&h(e)}}}function jt(t){let e,l,n,o;return e=new Ue({props:{active:t[0]===V.Inspect,$$slots:{default:[Pt]},$$scope:{ctx:t}}}),e.$on("click",t[2]),n=new Ue({props:{active:t[1],$$slots:{default:[St]},$$scope:{ctx:t}}}),n.$on("click",t[3]),{c(){M(e.$$.fragment),l=T(),M(n.$$.fragment)},m(i,r){I(e,i,r),$(i,l,r),I(n,i,r),o=!0},p(i,r){const s={};r&1&&(s.active=i[0]===V.Inspect),r&16&&(s.$$scope={dirty:r,ctx:i}),e.$set(s);const f={};r&2&&(f.active=i[1]),r&16&&(f.$$scope={dirty:r,ctx:i}),n.$set(f)},i(i){o||(_(e.$$.fragment,i),_(n.$$.fragment,i),o=!0)},o(i){v(e.$$.fragment,i),v(n.$$.fragment,i),o=!1},d(i){H(e,i),i&&h(l),H(n,i)}}}function Dt(t){let e,l;return e=new It({props:{$$slots:{default:[jt]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&19&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Ot(t,e,l){let n,o;return ie(t,B,s=>l(0,n=s)),ie(t,_e,s=>l(1,o=s)),[n,o,()=>Y(B,n=n===V.Inspect?null:V.Inspect,n),()=>Y(_e,o=!o,o)]}class Ut extends R{constructor(e){super(),K(this,e,Ot,Dt,O,{})}}function Kt(t){let e,l,n,o,i;const r=t[2].default,s=he(r,t,t[1],null);return{c(){e=y("div"),s&&s.c(),e.hidden=!0},m(f,c){$(f,e,c),s&&s.m(e,null),n=!0,o||(i=st(l=Rt.call(null,e,t[0])),o=!0)},p(f,[c]){s&&s.p&&(!n||c&2)&&ge(s,r,f,f[1],n?$e(r,f[1],c,null):be(f[1]),null),l&&ye(l.update)&&c&1&&l.update.call(null,f[0])},i(f){n||(_(s,f),n=!0)},o(f){v(s,f),n=!1},d(f){f&&h(e),s&&s.d(f),o=!1,i()}}}function Rt(t,e="body"){let l;async function n(i){if(e=i,typeof e=="string"){if(l=document.querySelector(e),l===null&&(await mt(),l=document.querySelector(e)),l===null)throw new Error(`No element found matching css selector: "${e}"`)}else if(e instanceof HTMLElement)l=e;else throw new TypeError(`Unknown portal target type: ${e===null?"null":typeof e}. Allowed types: string (CSS selector) or HTMLElement.`);l.appendChild(t),t.hidden=!1}function o(){t.parentNode&&t.parentNode.removeChild(t)}return n(e),{update:n,destroy:o}}function qt(t,e,l){let{$$slots:n={},$$scope:o}=e,{target:i="body"}=e;return t.$$set=r=>{"target"in r&&l(0,i=r.target),"$$scope"in r&&l(1,o=r.$$scope)},[i,o,n]}class Bt extends R{constructor(e){super(),K(this,e,qt,Kt,O,{target:0})}}function Ft(t){let e,l,n,o,i,r;return{c(){e=y("div"),l=y("span"),n=E(t[0]),o=E(` +function D(){}function ot(t,e){for(const l in e)t[l]=e[l];return t}function Je(t){return t()}function Te(){return Object.create(null)}function ne(t){t.forEach(Je)}function he(t){return typeof t=="function"}function O(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function it(t){return Object.keys(t).length===0}function rt(t,...e){if(t==null)return D;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function se(t,e,l){t.$$.on_destroy.push(rt(e,l))}function $e(t,e,l,n){if(t){const o=Ge(t,e,l,n);return t[0](o)}}function Ge(t,e,l,n){return t[1]&&n?ot(l.ctx.slice(),t[1](n(e))):l.ctx}function ge(t,e,l,n){if(t[2]&&n){const o=t[2](n(l));if(e.dirty===void 0)return o;if(typeof o=="object"){const i=[],r=Math.max(e.dirty.length,o.length);for(let s=0;s32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function ft(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function v(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}function ut(t){return Array.from(t.childNodes)}function F(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Le(t,e){t.value=e==null?"":e}function x(t,e,l,n){l===null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function q(t,e,l){t.classList[l?"add":"remove"](e)}function ct(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,l,n,e),o}class Qe{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,l,n=null){this.e||(this.is_svg?this.e=ae(l.nodeName):this.e=y(l.nodeType===11?"TEMPLATE":l.nodeName),this.t=l.tagName!=="TEMPLATE"?l:l.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let l=0;l{const o=t.$$.callbacks[e];if(o){const i=ct(e,l,{cancelable:n});return o.slice().forEach(r=>{r.call(t,i)}),!i.defaultPrevented}return!0}}function pt(t,e){const l=t.$$.callbacks[e.type];l&&l.slice().forEach(n=>n.call(this,e))}const Y=[],Ne=[];let ee=[];const Ie=[],Xe=Promise.resolve();let ve=!1;function Ye(){ve||(ve=!0,Xe.then(xe))}function mt(){return Ye(),Xe}function ye(t){ee.push(t)}const we=new Set;let W=0;function xe(){if(W!==0)return;const t=fe;do{try{for(;Wt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ee=e}const pe=new Set;let J;function j(){J={r:0,c:[],p:J}}function z(){J.r||ne(J.c),J=J.p}function _(t,e){t&&t.i&&(pe.delete(t),t.i(e))}function w(t,e,l,n){if(t&&t.o){if(pe.has(t))return;pe.add(t),J.c.push(()=>{pe.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}const et=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function M(t){t&&t.c()}function I(t,e,l,n){const{fragment:o,after_update:i}=t.$$;o&&o.m(e,l),n||ye(()=>{const r=t.$$.on_mount.map(Je).filter(he);t.$$.on_destroy?t.$$.on_destroy.push(...r):ne(r),t.$$.on_mount=[]}),i.forEach(ye)}function H(t,e){const l=t.$$;l.fragment!==null&&(_t(l.after_update),ne(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function ht(t,e){t.$$.dirty[0]===-1&&(Y.push(t),Ye(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const b=g.length?g[0]:a;return c.ctx&&o(c.ctx[m],c.ctx[m]=b)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](b),u&&ht(t,m)),a}):[],c.update(),u=!0,ne(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=ut(e.target);c.fragment&&c.fragment.l(m),m.forEach(h)}else c.fragment&&c.fragment.c();e.intro&&_(t.$$.fragment),I(t,e.target,e.anchor,e.customElement),xe()}re(f)}class A{$destroy(){H(this,1),this.$destroy=D}$on(e,l){if(!he(l))return D;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const o=n.indexOf(l);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!it(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var U=(t=>(t.Info="info",t.PHP="php",t.Latte="latte",t))(U||{});function de(t){if(!/^__/.test(t.fullName))return t.shortName;if(t.control!==null)return t.control.shortName;if(t.id!==null)return t.id;throw new Error("Should not happen")}function He(t){let e=t,l=null,n=!1,o=null;const i=[];if(t instanceof HTMLFormElement||t.closest("form")){const m=t.closest("form");return{rootElements:[m],fullName:m.id.split("-").pop()}}const r=new RegExp("{control (.+)}"),s=new RegExp("{/control (.+)}");for(;e;)if(e.nodeType===Node.COMMENT_NODE){if(!n&&e.textContent!==null&&s.test(e.textContent.trim())){n=!0;break}else if(e.textContent!==null&&r.test(e.textContent.trim())&&n){n=!1;break}l=e,e=null}else e instanceof HTMLElement&&(o=e),e=e.previousSibling||e.parentNode;if(l===null||l.textContent===null||!r.test(l.textContent.trim()))return null;const f=l.textContent.trim().match(r);if(o===null||f===null)return null;const c=f[1];if(o===document.documentElement||o===document.body)return null;i.push(o);let u=o;for(;u.nextSibling;){if(u.nextSibling.nodeType===Node.ELEMENT_NODE)i.push(u.nextSibling);else if(u.nextSibling.nodeType===Node.COMMENT_NODE&&s.test(u.nextSibling.textContent.trim()))break;u=u.nextSibling}return{rootElements:i,fullName:c}}function $t(t){let e,l;const n=t[1].default,o=$e(n,t,t[0],null);return{c(){e=y("div"),o&&o.c(),v(e,"class","svelte-1vne03z")},m(i,r){$(i,e,r),o&&o.m(e,null),l=!0},p(i,[r]){o&&o.p&&(!l||r&1)&&be(o,n,i,i[0],l?ge(n,i[0],r,null):ke(i[0]),null)},i(i){l||(_(o,i),l=!0)},o(i){w(o,i),l=!1},d(i){i&&h(e),o&&o.d(i)}}}function gt(t,e,l){let{$$slots:n={},$$scope:o}=e;return t.$$set=i=>{"$$scope"in i&&l(0,o=i.$$scope)},[o,n]}class bt extends A{constructor(e){super(),K(this,e,gt,$t,O,{})}}function kt(t){let e,l;return{c(){e=y("a"),l=C(t[1]),v(e,"href",t[0]),v(e,"class","svelte-1adkrmg"),q(e,"orisai-latte",t[1]==="latte"),q(e,"orisai-php",t[1]==="php")},m(n,o){$(n,e,o),d(e,l)},p(n,[o]){o&2&&F(l,n[1]),o&1&&v(e,"href",n[0]),o&2&&q(e,"orisai-latte",n[1]==="latte"),o&2&&q(e,"orisai-php",n[1]==="php")},i:D,o:D,d(n){n&&h(e)}}}function wt(t,e,l){let{uri:n}=e,{type:o}=e;return t.$$set=i=>{"uri"in i&&l(0,n=i.uri),"type"in i&&l(1,o=i.type)},[n,o]}class tt extends A{constructor(e){super(),K(this,e,wt,kt,O,{uri:0,type:1})}}function Me(t){let e,l;return e=new tt({props:{uri:t[0].control.editorUri,type:"php"}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.uri=n[0].control.editorUri),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Pe(t){let e,l;return e=new tt({props:{uri:t[0].template.editorUri,type:"latte"}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.uri=n[0].template.editorUri),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function vt(t){let e,l,n,o=t[0].control!==null&&Me(t),i=t[0].template!==null&&Pe(t);return{c(){o&&o.c(),e=L(),i&&i.c(),l=le()},m(r,s){o&&o.m(r,s),$(r,e,s),i&&i.m(r,s),$(r,l,s),n=!0},p(r,s){r[0].control!==null?o?(o.p(r,s),s&1&&_(o,1)):(o=Me(r),o.c(),_(o,1),o.m(e.parentNode,e)):o&&(j(),w(o,1,1,()=>{o=null}),z()),r[0].template!==null?i?(i.p(r,s),s&1&&_(i,1)):(i=Pe(r),i.c(),_(i,1),i.m(l.parentNode,l)):i&&(j(),w(i,1,1,()=>{i=null}),z())},i(r){n||(_(o),_(i),n=!0)},o(r){w(o),w(i),n=!1},d(r){o&&o.d(r),r&&h(e),i&&i.d(r),r&&h(l)}}}function yt(t){let e,l;return e=new bt({props:{$$slots:{default:[vt]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&3&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Et(t,e,l){let{component:n}=e;return t.$$set=o=>{"component"in o&&l(0,n=o.component)},[n]}class nt extends A{constructor(e){super(),K(this,e,Et,yt,O,{component:0})}}function Se(t,e,l){const n=t.slice();return n[6]=e[l],n}function De(t){let e,l,n=de(t[6])+"",o,i,r,s,f,c,u,m,a=t[6].depth>0&&qe(t);s=new nt({props:{component:t[6]}});function g(){return t[5](t[6])}return{c(){e=y("li"),a&&a.c(),l=L(),o=C(n),i=L(),r=y("div"),M(s.$$.fragment),f=L(),v(r,"class","orisai-editor-links svelte-ks6908"),v(e,"class","svelte-ks6908"),q(e,"orisai-muted",!t[6].fullName.toLowerCase().includes(t[2].toLowerCase())&&!t[6].control.shortName.toLowerCase().includes(t[2].toLowerCase())),q(e,"orisai-active",t[1]===t[6])},m(b,p){$(b,e,p),a&&a.m(e,null),d(e,l),d(e,o),d(e,i),d(e,r),I(s,r,null),d(e,f),c=!0,u||(m=R(e,"click",g),u=!0)},p(b,p){t=b,t[6].depth>0?a?a.p(t,p):(a=qe(t),a.c(),a.m(e,l)):a&&(a.d(1),a=null),(!c||p&1)&&n!==(n=de(t[6])+"")&&F(o,n);const k={};p&1&&(k.component=t[6]),s.$set(k),(!c||p&5)&&q(e,"orisai-muted",!t[6].fullName.toLowerCase().includes(t[2].toLowerCase())&&!t[6].control.shortName.toLowerCase().includes(t[2].toLowerCase())),(!c||p&3)&&q(e,"orisai-active",t[1]===t[6])},i(b){c||(_(s.$$.fragment,b),c=!0)},o(b){w(s.$$.fragment,b),c=!1},d(b){b&&h(e),a&&a.d(),H(s),u=!1,m()}}}function qe(t){let e,l;return{c(){e=y("span"),l=C("\u2514"),x(e,"margin-left",t[6].depth*2+"ex")},m(n,o){$(n,e,o),$(n,l,o)},p(n,o){o&1&&x(e,"margin-left",n[6].depth*2+"ex")},d(n){n&&h(e),n&&h(l)}}}function Oe(t){let e,l,n=t[6].control!==null&&t[6].showInTree&&De(t);return{c(){n&&n.c(),e=le()},m(o,i){n&&n.m(o,i),$(o,e,i),l=!0},p(o,i){o[6].control!==null&&o[6].showInTree?n?(n.p(o,i),i&1&&_(n,1)):(n=De(o),n.c(),_(n,1),n.m(e.parentNode,e)):n&&(j(),w(n,1,1,()=>{n=null}),z())},i(o){l||(_(n),l=!0)},o(o){w(n),l=!1},d(o){n&&n.d(o),o&&h(e)}}}function Ct(t){let e,l,n,o,i,r,s=t[0],f=[];for(let u=0;uw(f[u],1,1,()=>{f[u]=null});return{c(){e=y("input"),l=L(),n=y("ul");for(let u=0;ui("select",c);return t.$$set=c=>{"list"in c&&l(0,n=c.list),"selectedComponent"in c&&l(1,o=c.selectedComponent)},[n,o,r,i,s,f]}class Lt extends A{constructor(e){super(),K(this,e,Tt,Ct,O,{list:0,selectedComponent:1})}}function Nt(t){let e,l;const n=t[1].default,o=$e(n,t,t[0],null);return{c(){e=y("div"),o&&o.c(),v(e,"class","svelte-1vmd063")},m(i,r){$(i,e,r),o&&o.m(e,null),l=!0},p(i,[r]){o&&o.p&&(!l||r&1)&&be(o,n,i,i[0],l?ge(n,i[0],r,null):ke(i[0]),null)},i(i){l||(_(o,i),l=!0)},o(i){w(o,i),l=!1},d(i){i&&h(e),o&&o.d(i)}}}function It(t,e,l){let{$$slots:n={},$$scope:o}=e;return t.$$set=i=>{"$$scope"in i&&l(0,o=i.$$scope)},[o,n]}class Ht extends A{constructor(e){super(),K(this,e,It,Nt,O,{})}}function Mt(t){let e,l,n,o;const i=t[2].default,r=$e(i,t,t[1],null);return{c(){e=y("button"),r&&r.c(),v(e,"class","svelte-2yk66i"),q(e,"orisai-active",t[0])},m(s,f){$(s,e,f),r&&r.m(e,null),l=!0,n||(o=R(e,"click",ft(t[3])),n=!0)},p(s,[f]){r&&r.p&&(!l||f&2)&&be(r,i,s,s[1],l?ge(i,s[1],f,null):ke(s[1]),null),(!l||f&1)&&q(e,"orisai-active",s[0])},i(s){l||(_(r,s),l=!0)},o(s){w(r,s),l=!1},d(s){s&&h(e),r&&r.d(s),n=!1,o()}}}function Pt(t,e,l){let{$$slots:n={},$$scope:o}=e,{active:i=!1}=e;function r(s){pt.call(this,t,s)}return t.$$set=s=>{"active"in s&&l(0,i=s.active),"$$scope"in s&&l(1,o=s.$$scope)},[i,o,n,r]}class Ue extends A{constructor(e){super(),K(this,e,Pt,Mt,O,{active:0})}}const X=[];function lt(t,e=D){let l;const n=new Set;function o(s){if(O(t,s)&&(t=s,l)){const f=!X.length;for(const c of n)c[1](),X.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&l&&(l(),l=null)}}return{set:o,update:i,subscribe:r}}var V=(t=>(t[t.Inspect=0]="Inspect",t))(V||{});const B=lt(null),_e=lt(!1);function St(t){let e,l,n,o;return{c(){e=ae("svg"),l=ae("path"),n=ae("path"),o=C(` + Inspect`),v(l,"d","M3.33333 3.33333V12.6667H5.85185V14H2.66667C2.29848 14 2 13.7015 2 13.3333V2.66667C2 2.29848 2.29848 2 2.66667 2H13.3333C13.7015 2 14 2.29848 14 2.66667V5.85185H12.6667V3.33333H3.33333Z"),v(l,"fill","currentColor"),v(n,"d","M7.4075 7.61148L9.18437 14.2747C9.22274 14.4187 9.41622 14.4438 9.49011 14.3145L10.9016 11.8444L13.5286 14.4714C13.7889 14.7317 14.211 14.7317 14.4714 14.4714C14.7317 14.211 14.7317 13.7889 14.4714 13.5286L11.8444 10.9016L14.3145 9.49011C14.4438 9.41622 14.4187 9.22274 14.2747 9.18437L7.61148 7.4075C7.48768 7.37448 7.37448 7.48768 7.4075 7.61148Z"),v(n,"fill","currentColor"),v(e,"width","16"),v(e,"height","16"),v(e,"viewBox","0 0 16 16"),v(e,"fill","none"),v(e,"xmlns","http://www.w3.org/2000/svg")},m(i,r){$(i,e,r),d(e,l),d(e,n),$(i,o,r)},p:D,d(i){i&&h(e),i&&h(o)}}}function Dt(t){let e;return{c(){e=C("Help")},m(l,n){$(l,e,n)},d(l){l&&h(e)}}}function qt(t){let e,l,n,o;return e=new Ue({props:{active:t[0]===V.Inspect,$$slots:{default:[St]},$$scope:{ctx:t}}}),e.$on("click",t[2]),n=new Ue({props:{active:t[1],$$slots:{default:[Dt]},$$scope:{ctx:t}}}),n.$on("click",t[3]),{c(){M(e.$$.fragment),l=L(),M(n.$$.fragment)},m(i,r){I(e,i,r),$(i,l,r),I(n,i,r),o=!0},p(i,r){const s={};r&1&&(s.active=i[0]===V.Inspect),r&16&&(s.$$scope={dirty:r,ctx:i}),e.$set(s);const f={};r&2&&(f.active=i[1]),r&16&&(f.$$scope={dirty:r,ctx:i}),n.$set(f)},i(i){o||(_(e.$$.fragment,i),_(n.$$.fragment,i),o=!0)},o(i){w(e.$$.fragment,i),w(n.$$.fragment,i),o=!1},d(i){H(e,i),i&&h(l),H(n,i)}}}function Ot(t){let e,l;return e=new Ht({props:{$$slots:{default:[qt]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&19&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Ut(t,e,l){let n,o;return se(t,B,s=>l(0,n=s)),se(t,_e,s=>l(1,o=s)),[n,o,()=>te(B,n=n===V.Inspect?null:V.Inspect,n),()=>te(_e,o=!o,o)]}class Kt extends A{constructor(e){super(),K(this,e,Ut,Ot,O,{})}}function At(t){let e,l,n,o,i;const r=t[2].default,s=$e(r,t,t[1],null);return{c(){e=y("div"),s&&s.c(),e.hidden=!0},m(f,c){$(f,e,c),s&&s.m(e,null),n=!0,o||(i=st(l=Rt.call(null,e,t[0])),o=!0)},p(f,[c]){s&&s.p&&(!n||c&2)&&be(s,r,f,f[1],n?ge(r,f[1],c,null):ke(f[1]),null),l&&he(l.update)&&c&1&&l.update.call(null,f[0])},i(f){n||(_(s,f),n=!0)},o(f){w(s,f),n=!1},d(f){f&&h(e),s&&s.d(f),o=!1,i()}}}function Rt(t,e="body"){let l;async function n(i){if(e=i,typeof e=="string"){if(l=document.querySelector(e),l===null&&(await mt(),l=document.querySelector(e)),l===null)throw new Error(`No element found matching css selector: "${e}"`)}else if(e instanceof HTMLElement)l=e;else throw new TypeError(`Unknown portal target type: ${e===null?"null":typeof e}. Allowed types: string (CSS selector) or HTMLElement.`);l.appendChild(t),t.hidden=!1}function o(){t.parentNode&&t.parentNode.removeChild(t)}return n(e),{update:n,destroy:o}}function Bt(t,e,l){let{$$slots:n={},$$scope:o}=e,{target:i="body"}=e;return t.$$set=r=>{"target"in r&&l(0,i=r.target),"$$scope"in r&&l(1,o=r.$$scope)},[i,o,n]}class Ft extends A{constructor(e){super(),K(this,e,Bt,At,O,{target:0})}}function jt(t){let e,l,n,o,i,r;return{c(){e=y("div"),l=y("span"),n=C(t[0]),o=C(` - - `),i=E(t[1]),k(l,"class","svelte-1vj1au"),k(e,"style",r=t[2]===null?"":` + `),i=C(t[1]),v(l,"class","svelte-w5axtv"),v(e,"style",r=t[2]===null?"":` transform: translate3d(${t[2].x}px, ${t[2].y}px, 0); left: 0px; top: 0px; width: ${t[2].width}px; height: ${t[2].height}px; - `),k(e,"class","svelte-1vj1au"),j(e,"orisai-mode-info",t[1]===U.Info),j(e,"orisai-mode-php",t[1]===U.PHP),j(e,"orisai-mode-latte",t[1]===U.Latte)},m(s,f){$(s,e,f),d(e,l),d(l,n),d(l,o),d(l,i)},p(s,f){f&1&&F(n,s[0]),f&2&&F(i,s[1]),f&4&&r!==(r=s[2]===null?"":` + `),v(e,"class","svelte-w5axtv"),q(e,"orisai-mode-info",t[1]===U.Info),q(e,"orisai-mode-php",t[1]===U.PHP),q(e,"orisai-mode-latte",t[1]===U.Latte)},m(s,f){$(s,e,f),d(e,l),d(l,n),d(l,o),d(l,i)},p(s,f){f&1&&F(n,s[0]),f&2&&F(i,s[1]),f&4&&r!==(r=s[2]===null?"":` transform: translate3d(${s[2].x}px, ${s[2].y}px, 0); left: 0px; top: 0px; width: ${s[2].width}px; height: ${s[2].height}px; - `)&&k(e,"style",r),f&2&&j(e,"orisai-mode-info",s[1]===U.Info),f&2&&j(e,"orisai-mode-php",s[1]===U.PHP),f&2&&j(e,"orisai-mode-latte",s[1]===U.Latte)},d(s){s&&h(e)}}}function zt(t){let e,l;return e=new Bt({props:{target:document.body,$$slots:{default:[Ft]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&15&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function At(t,e,l){let{name:n}=e,{selectionMode:o}=e,{rect:i=null}=e;return t.$$set=r=>{"name"in r&&l(0,n=r.name),"selectionMode"in r&&l(1,o=r.selectionMode),"rect"in r&&l(2,i=r.rect)},[n,o,i]}class Vt extends R{constructor(e){super(),K(this,e,At,zt,O,{name:0,selectionMode:1,rect:2})}}const{window:ue}=et;function Ke(t,e,l){const n=t.slice();return n[9]=e[l],n}function Re(t){let e,l;return e=new Vt({props:{name:t[9].name,selectionMode:t[0],rect:t[9].rect}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&2&&(i.name=n[9].name),o&1&&(i.selectionMode=n[0]),o&2&&(i.rect=n[9].rect),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Zt(t){let e,l,n,o,i=t[1],r=[];for(let f=0;fv(r[f],1,1,()=>{r[f]=null});return{c(){for(let f=0;fl(6,n=a));const o=We();let i=U.Info,r=[];function s(a){if(l(1,r=[]),a===null)return;const g=[];a.rootElements.forEach(b=>{const p=b.getBoundingClientRect();g.push({name:a.fullName,rect:{x:p.left,y:p.top+window.document.documentElement.scrollTop,width:p.width,height:p.height}})}),l(1,r=g)}function f(a){s(He(a.target))}function c(a){a.preventDefault(),a.stopImmediatePropagation(),o("inspect",{componentDescriptor:He(a.target),selectionMode:i}),Y(B,n=null,n),l(1,r=[])}function u(a){if(a.key==="Escape"){a.preventDefault(),a.stopImmediatePropagation(),Y(B,n=null,n);return}a.metaKey||a.ctrlKey?l(0,i=U.PHP):a.shiftKey?l(0,i=U.Latte):l(0,i=U.Info)}function m(){l(0,i=U.Info)}return[i,r,f,c,u,m]}class Gt extends R{constructor(e){super(),K(this,e,Jt,Zt,O,{})}}function Qt(t){let e,l,n=t[0].toFixed(4)+"",o,i;return{c(){e=y("div"),l=E("Render time: "),o=E(n),i=E(" ms"),k(e,"class","svelte-1pj8e1h")},m(r,s){$(r,e,s),d(e,l),d(e,o),d(e,i)},p(r,[s]){s&1&&n!==(n=r[0].toFixed(4)+"")&&F(o,n)},i:D,o:D,d(r){r&&h(e)}}}function Wt(t,e,l){let{time:n}=e;return t.$$set=o=>{"time"in o&&l(0,n=o.time)},[n]}class Xt extends R{constructor(e){super(),K(this,e,Wt,Qt,O,{time:0})}}function qe(t,e,l){const n=t.slice();return n[2]=e[l],n}function Be(t){let e,l;return e=new Xt({props:{time:t[0].template.renderTime}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.time=n[0].template.renderTime),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Fe(t){let e,l=t[0].control.dump+"",n;return{c(){e=new Qe(!1),n=ee(),e.a=n},m(o,i){e.m(l,o,i),$(o,n,i)},p(o,i){i&1&&l!==(l=o[0].control.dump+"")&&e.p(l)},d(o){o&&h(n),o&&e.d()}}}function ze(t){let e,l,n,o,i=t[0].latteTemplates[0].parametersDump+"",r=t[0].latteTemplates,s=[];for(let f=0;f1?t[2].count+"\xD7":"",g,b,p=t[2].referenceType&&Ae(t);return{c(){e=y("tr"),l=y("td"),p&&p.c(),n=T(),o=new Qe(!1),r=T(),s=y("a"),f=E("php"),u=T(),m=y("td"),g=E(a),b=T(),o.a=r,k(s,"href",c=t[2].phpFileUri),k(s,"class","InspectorPanel-php svelte-62j2r4"),k(l,"class","svelte-62j2r4"),k(m,"class","svelte-62j2r4")},m(w,P){$(w,e,P),d(e,l),p&&p.m(l,null),d(l,n),o.m(i,l),d(l,r),d(l,s),d(s,f),d(e,u),d(e,m),d(m,g),d(e,b)},p(w,P){w[2].referenceType?p?p.p(w,P):(p=Ae(w),p.c(),p.m(l,n)):p&&(p.d(1),p=null),P&1&&i!==(i=w[2].editorLink+"")&&o.p(i),P&1&&c!==(c=w[2].phpFileUri)&&k(s,"href",c),P&1&&a!==(a=w[2].count>1?w[2].count+"\xD7":"")&&F(g,a)},d(w){w&&h(e),p&&p.d()}}}function Yt(t){let e,l=de(t[0])+"",n,o,i,r,s,f,c,u,m;r=new nt({props:{component:t[0]}});let a=t[0].template!==null&&Be(t),g=t[0].control!==null&&Fe(t),b=t[0].latteTemplates!==null&&ze(t);return{c(){e=y("h2"),n=E(l),o=T(),i=y("div"),M(r.$$.fragment),s=T(),a&&a.c(),f=T(),g&&g.c(),c=T(),b&&b.c(),u=ee(),k(e,"class","svelte-62j2r4"),k(i,"class","orisai-grid svelte-62j2r4")},m(p,w){$(p,e,w),d(e,n),$(p,o,w),$(p,i,w),I(r,i,null),d(i,s),a&&a.m(i,null),$(p,f,w),g&&g.m(p,w),$(p,c,w),b&&b.m(p,w),$(p,u,w),m=!0},p(p,[w]){(!m||w&1)&&l!==(l=de(p[0])+"")&&F(n,l);const P={};w&1&&(P.component=p[0]),r.$set(P),p[0].template!==null?a?(a.p(p,w),w&1&&_(a,1)):(a=Be(p),a.c(),_(a,1),a.m(i,null)):a&&(z(),v(a,1,1,()=>{a=null}),A()),p[0].control!==null?g?g.p(p,w):(g=Fe(p),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null),p[0].latteTemplates!==null?b?b.p(p,w):(b=ze(p),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null)},i(p){m||(_(r.$$.fragment,p),_(a),m=!0)},o(p){v(r.$$.fragment,p),v(a),m=!1},d(p){p&&h(e),p&&h(o),p&&h(i),H(r),a&&a.d(),p&&h(f),g&&g.d(p),p&&h(c),b&&b.d(p),p&&h(u)}}}function xt(t,e,l){let{component:n}=e;const o={include:"#00000052",extends:"#cd1c1c7d",import:"#17c35b8f",includeblock:"#17c35b8f",embed:"#4f1ccd7d",sandbox:"black"};return t.$$set=i=>{"component"in i&&l(0,n=i.component)},[n,o]}class en extends R{constructor(e){super(),K(this,e,xt,Yt,O,{component:0,colors:1})}get colors(){return this.$$.ctx[1]}}function tn(t){let e,l;return{c(){e=y("span"),l=E(t[0]),k(e,"class","svelte-1u21lo6")},m(n,o){$(n,e,o),d(e,l)},p(n,[o]){o&1&&F(l,n[0])},i:D,o:D,d(n){n&&h(e)}}}function nn(t,e,l){let{key:n}=e;return t.$$set=o=>{"key"in o&&l(0,n=o.key)},[n]}class ne extends R{constructor(e){super(),K(this,e,nn,tn,O,{key:0})}}const{window:ln}=et;function on(t){let e,l,n;return l=new en({props:{component:t[1]}}),{c(){e=y("div"),M(l.$$.fragment),k(e,"class","svelte-152bwch")},m(o,i){$(o,e,i),I(l,e,null),n=!0},p(o,i){const r={};i&2&&(r.component=o[1]),l.$set(r)},i(o){n||(_(l.$$.fragment,o),n=!0)},o(o){v(l.$$.fragment,o),n=!1},d(o){o&&h(e),H(l)}}}function rn(t){let e,l,n,o,i,r,s,f,c,u,m,a,g,b,p,w,P,N,C,S,Z,G,Q,Ee,se;return i=new ne({props:{key:"\u2318"}}),s=new ne({props:{key:"ctrl"}}),c=new ne({props:{key:"c"}}),P=new ne({props:{key:"\u2318"}}),Q=new ne({props:{key:"\u21E7"}}),{c(){e=y("p"),l=E("Inspect element on the page by click "),n=y("b"),n.textContent="Inspect",o=E(` button or - `),M(i.$$.fragment),r=T(),M(s.$$.fragment),f=T(),M(c.$$.fragment),u=T(),m=y("p"),m.textContent="For quickly open:",a=T(),g=y("ul"),b=y("li"),p=y("b"),p.textContent="PHP class of component",w=E(" - hold "),M(P.$$.fragment),N=E(" while inspecting,"),C=T(),S=y("li"),Z=y("b"),Z.textContent="Latte template",G=E(" - hold "),M(Q.$$.fragment),Ee=E(" while inspecting.")},m(L,te){$(L,e,te),d(e,l),d(e,n),d(e,o),I(i,e,null),d(e,r),I(s,e,null),d(e,f),I(c,e,null),$(L,u,te),$(L,m,te),$(L,a,te),$(L,g,te),d(g,b),d(b,p),d(b,w),I(P,b,null),d(b,N),d(g,C),d(g,S),d(S,Z),d(S,G),I(Q,S,null),d(S,Ee),se=!0},p:D,i(L){se||(_(i.$$.fragment,L),_(s.$$.fragment,L),_(c.$$.fragment,L),_(P.$$.fragment,L),_(Q.$$.fragment,L),se=!0)},o(L){v(i.$$.fragment,L),v(s.$$.fragment,L),v(c.$$.fragment,L),v(P.$$.fragment,L),v(Q.$$.fragment,L),se=!1},d(L){L&&h(e),H(i),H(s),H(c),L&&h(u),L&&h(m),L&&h(a),L&&h(g),H(P),H(Q)}}}function Ze(t){let e,l;return e=new Gt({}),e.$on("inspect",t[4]),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p:D,i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){v(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function sn(t){let e,l,n,o,i,r,s,f,c,u,m,a,g,b;n=new Lt({props:{list:t[0],selectedComponent:t[1]}}),n.$on("select",t[5]),r=new Ut({});const p=[rn,on],w=[];function P(C,S){return C[2]?0:C[1]!==null?1:-1}~(f=P(t))&&(c=w[f]=p[f](t));let N=t[3]===V.Inspect&&Ze(t);return{c(){e=y("div"),l=y("div"),M(n.$$.fragment),o=T(),i=y("div"),M(r.$$.fragment),s=T(),c&&c.c(),u=T(),N&&N.c(),m=ee(),k(l,"class","svelte-152bwch"),k(i,"class","svelte-152bwch"),k(e,"class","orisai-grid svelte-152bwch")},m(C,S){$(C,e,S),d(e,l),I(n,l,null),d(e,o),d(e,i),I(r,i,null),d(i,s),~f&&w[f].m(i,null),$(C,u,S),N&&N.m(C,S),$(C,m,S),a=!0,g||(b=q(ln,"keydown",t[6]),g=!0)},p(C,[S]){const Z={};S&1&&(Z.list=C[0]),S&2&&(Z.selectedComponent=C[1]),n.$set(Z);let G=f;f=P(C),f===G?~f&&w[f].p(C,S):(c&&(z(),v(w[G],1,1,()=>{w[G]=null}),A()),~f?(c=w[f],c?c.p(C,S):(c=w[f]=p[f](C),c.c()),_(c,1),c.m(i,null)):c=null),C[3]===V.Inspect?N?(N.p(C,S),S&8&&_(N,1)):(N=Ze(C),N.c(),_(N,1),N.m(m.parentNode,m)):N&&(z(),v(N,1,1,()=>{N=null}),A())},i(C){a||(_(n.$$.fragment,C),_(r.$$.fragment,C),_(c),_(N),a=!0)},o(C){v(n.$$.fragment,C),v(r.$$.fragment,C),v(c),v(N),a=!1},d(C){C&&h(e),H(n),H(r),~f&&w[f].d(),C&&h(u),N&&N.d(C),C&&h(m),g=!1,b()}}}function fn(t,e,l){let n,o;ie(t,_e,u=>l(2,n=u)),ie(t,B,u=>l(3,o=u));let{componentList:i=[]}=e,r=null;function s(u){const{componentDescriptor:m,selectionMode:a}=u.detail;if(m===null){l(1,r=null);return}l(1,r=i.find(g=>g.fullName===m.fullName)||null),r!==null&&(a===U.PHP&&r.control!==null?window.location.href=r.control.editorUri:a===U.Latte&&r.template!==null&&(window.location.href=r.template.editorUri))}function f(u){l(1,r=u.detail)}function c(u){u.ctrlKey&&u.metaKey&&u.key==="c"&&(u.preventDefault(),u.stopImmediatePropagation(),Y(B,o=V.Inspect,o))}return B.subscribe(()=>Y(_e,n=!1,n)),t.$$set=u=>{"componentList"in u&&l(0,i=u.componentList)},[i,r,n,o,s,f,c]}class un extends R{constructor(e){super(),K(this,e,fn,sn,O,{componentList:0})}}const me=document.getElementById("orisai-inspector");!me.dataset.initialized&&new un({target:me,props:JSON.parse(me.dataset.props)});me.dataset.initialized="1"; + `)&&v(e,"style",r),f&2&&q(e,"orisai-mode-info",s[1]===U.Info),f&2&&q(e,"orisai-mode-php",s[1]===U.PHP),f&2&&q(e,"orisai-mode-latte",s[1]===U.Latte)},d(s){s&&h(e)}}}function zt(t){let e,l;return e=new Ft({props:{target:document.body,$$slots:{default:[jt]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,[o]){const i={};o&15&&(i.$$scope={dirty:o,ctx:n}),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Vt(t,e,l){let{name:n}=e,{selectionMode:o}=e,{rect:i=null}=e;return t.$$set=r=>{"name"in r&&l(0,n=r.name),"selectionMode"in r&&l(1,o=r.selectionMode),"rect"in r&&l(2,i=r.rect)},[n,o,i]}class Zt extends A{constructor(e){super(),K(this,e,Vt,zt,O,{name:0,selectionMode:1,rect:2})}}const{window:ce}=et;function Ke(t,e,l){const n=t.slice();return n[9]=e[l],n}function Ae(t){let e,l;return e=new Zt({props:{name:t[9].name,selectionMode:t[0],rect:t[9].rect}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&2&&(i.name=n[9].name),o&1&&(i.selectionMode=n[0]),o&2&&(i.rect=n[9].rect),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Jt(t){let e,l,n,o,i=t[1],r=[];for(let f=0;fw(r[f],1,1,()=>{r[f]=null});return{c(){for(let f=0;fl(6,n=a));const o=We();let i=U.Info,r=[];function s(a){if(l(1,r=[]),a===null)return;const g=[];a.rootElements.forEach(b=>{const p=b.getBoundingClientRect();g.push({name:a.fullName,rect:{x:p.left,y:p.top+window.document.documentElement.scrollTop,width:p.width,height:p.height}})}),l(1,r=g)}function f(a){s(He(a.target))}function c(a){a.preventDefault(),a.stopImmediatePropagation(),o("inspect",{componentDescriptor:He(a.target),selectionMode:i}),te(B,n=null,n),l(1,r=[])}function u(a){if(a.key==="Escape"){a.preventDefault(),a.stopImmediatePropagation(),te(B,n=null,n);return}a.metaKey||a.ctrlKey?l(0,i=U.PHP):a.shiftKey?l(0,i=U.Latte):l(0,i=U.Info)}function m(){l(0,i=U.Info)}return[i,r,f,c,u,m]}class Qt extends A{constructor(e){super(),K(this,e,Gt,Jt,O,{})}}function Wt(t){let e,l,n=t[0].toFixed(4)+"",o,i;return{c(){e=y("div"),l=C("Render time: "),o=C(n),i=C(" ms"),v(e,"class","svelte-org3jl")},m(r,s){$(r,e,s),d(e,l),d(e,o),d(e,i)},p(r,[s]){s&1&&n!==(n=r[0].toFixed(4)+"")&&F(o,n)},i:D,o:D,d(r){r&&h(e)}}}function Xt(t,e,l){let{time:n}=e;return t.$$set=o=>{"time"in o&&l(0,n=o.time)},[n]}class Yt extends A{constructor(e){super(),K(this,e,Xt,Wt,O,{time:0})}}function Re(t,e,l){const n=t.slice();return n[2]=e[l],n}function Be(t){let e,l;return e=new Yt({props:{time:t[0].template.renderTime}}),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p(n,o){const i={};o&1&&(i.time=n[0].template.renderTime),e.$set(i)},i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function Fe(t){let e,l=t[0].control.dump+"",n;return{c(){e=new Qe(!1),n=le(),e.a=n},m(o,i){e.m(l,o,i),$(o,n,i)},p(o,i){i&1&&l!==(l=o[0].control.dump+"")&&e.p(l)},d(o){o&&h(n),o&&e.d()}}}function je(t){let e,l,n,o,i=t[0].latteTemplates[0].parametersDump+"",r=t[0].latteTemplates,s=[];for(let f=0;f1?t[2].count+"\xD7":"",g,b,p=t[2].referenceType&&ze(t);return{c(){e=y("tr"),l=y("td"),p&&p.c(),n=L(),o=new Qe(!1),r=L(),s=y("a"),f=C("php"),u=L(),m=y("td"),g=C(a),b=L(),o.a=r,v(s,"href",c=t[2].phpFileUri),v(s,"class","InspectorPanel-php svelte-rtqx0m"),v(l,"class","svelte-rtqx0m"),v(m,"class","svelte-rtqx0m")},m(k,P){$(k,e,P),d(e,l),p&&p.m(l,null),d(l,n),o.m(i,l),d(l,r),d(l,s),d(s,f),d(e,u),d(e,m),d(m,g),d(e,b)},p(k,P){k[2].referenceType?p?p.p(k,P):(p=ze(k),p.c(),p.m(l,n)):p&&(p.d(1),p=null),P&1&&i!==(i=k[2].editorLink+"")&&o.p(i),P&1&&c!==(c=k[2].phpFileUri)&&v(s,"href",c),P&1&&a!==(a=k[2].count>1?k[2].count+"\xD7":"")&&F(g,a)},d(k){k&&h(e),p&&p.d()}}}function xt(t){let e,l=de(t[0])+"",n,o,i,r,s,f,c,u,m;r=new nt({props:{component:t[0]}});let a=t[0].template!==null&&Be(t),g=t[0].control!==null&&Fe(t),b=t[0].latteTemplates!==null&&je(t);return{c(){e=y("h2"),n=C(l),o=L(),i=y("div"),M(r.$$.fragment),s=L(),a&&a.c(),f=L(),g&&g.c(),c=L(),b&&b.c(),u=le(),v(e,"class","svelte-rtqx0m"),v(i,"class","orisai-grid svelte-rtqx0m")},m(p,k){$(p,e,k),d(e,n),$(p,o,k),$(p,i,k),I(r,i,null),d(i,s),a&&a.m(i,null),$(p,f,k),g&&g.m(p,k),$(p,c,k),b&&b.m(p,k),$(p,u,k),m=!0},p(p,[k]){(!m||k&1)&&l!==(l=de(p[0])+"")&&F(n,l);const P={};k&1&&(P.component=p[0]),r.$set(P),p[0].template!==null?a?(a.p(p,k),k&1&&_(a,1)):(a=Be(p),a.c(),_(a,1),a.m(i,null)):a&&(j(),w(a,1,1,()=>{a=null}),z()),p[0].control!==null?g?g.p(p,k):(g=Fe(p),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null),p[0].latteTemplates!==null?b?b.p(p,k):(b=je(p),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null)},i(p){m||(_(r.$$.fragment,p),_(a),m=!0)},o(p){w(r.$$.fragment,p),w(a),m=!1},d(p){p&&h(e),p&&h(o),p&&h(i),H(r),a&&a.d(),p&&h(f),g&&g.d(p),p&&h(c),b&&b.d(p),p&&h(u)}}}function en(t,e,l){let{component:n}=e;const o={include:"#00000052",extends:"#cd1c1c7d",import:"#17c35b8f",includeblock:"#17c35b8f",embed:"#4f1ccd7d",sandbox:"black"};return t.$$set=i=>{"component"in i&&l(0,n=i.component)},[n,o]}class tn extends A{constructor(e){super(),K(this,e,en,xt,O,{component:0,colors:1})}get colors(){return this.$$.ctx[1]}}function nn(t){let e,l;return{c(){e=y("span"),l=C(t[0]),v(e,"class","svelte-cvacmi")},m(n,o){$(n,e,o),d(e,l)},p(n,[o]){o&1&&F(l,n[0])},i:D,o:D,d(n){n&&h(e)}}}function ln(t,e,l){let{key:n}=e;return t.$$set=o=>{"key"in o&&l(0,n=o.key)},[n]}class ie extends A{constructor(e){super(),K(this,e,ln,nn,O,{key:0})}}const{window:on}=et;function rn(t){let e,l,n;return l=new tn({props:{component:t[1]}}),{c(){e=y("div"),M(l.$$.fragment)},m(o,i){$(o,e,i),I(l,e,null),n=!0},p(o,i){const r={};i&2&&(r.component=o[1]),l.$set(r)},i(o){n||(_(l.$$.fragment,o),n=!0)},o(o){w(l.$$.fragment,o),n=!1},d(o){o&&h(e),H(l)}}}function sn(t){let e,l,n,o,i,r,s,f,c,u,m,a,g,b,p,k,P,N,E,S,Z,G,Q,Ce,ue;return i=new ie({props:{key:"\u2318"}}),s=new ie({props:{key:"ctrl"}}),c=new ie({props:{key:"c"}}),P=new ie({props:{key:"\u2318"}}),Q=new ie({props:{key:"\u21E7"}}),{c(){e=y("p"),l=C("Inspect element on the page by click "),n=y("b"),n.textContent="Inspect",o=C(` button or + `),M(i.$$.fragment),r=L(),M(s.$$.fragment),f=L(),M(c.$$.fragment),u=L(),m=y("p"),m.textContent="For quickly open:",a=L(),g=y("ul"),b=y("li"),p=y("b"),p.textContent="PHP class of component",k=C(" - hold "),M(P.$$.fragment),N=C(" while inspecting,"),E=L(),S=y("li"),Z=y("b"),Z.textContent="Latte template",G=C(" - hold "),M(Q.$$.fragment),Ce=C(" while inspecting.")},m(T,oe){$(T,e,oe),d(e,l),d(e,n),d(e,o),I(i,e,null),d(e,r),I(s,e,null),d(e,f),I(c,e,null),$(T,u,oe),$(T,m,oe),$(T,a,oe),$(T,g,oe),d(g,b),d(b,p),d(b,k),I(P,b,null),d(b,N),d(g,E),d(g,S),d(S,Z),d(S,G),I(Q,S,null),d(S,Ce),ue=!0},p:D,i(T){ue||(_(i.$$.fragment,T),_(s.$$.fragment,T),_(c.$$.fragment,T),_(P.$$.fragment,T),_(Q.$$.fragment,T),ue=!0)},o(T){w(i.$$.fragment,T),w(s.$$.fragment,T),w(c.$$.fragment,T),w(P.$$.fragment,T),w(Q.$$.fragment,T),ue=!1},d(T){T&&h(e),H(i),H(s),H(c),T&&h(u),T&&h(m),T&&h(a),T&&h(g),H(P),H(Q)}}}function Ze(t){let e,l;return e=new Qt({}),e.$on("inspect",t[4]),{c(){M(e.$$.fragment)},m(n,o){I(e,n,o),l=!0},p:D,i(n){l||(_(e.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),l=!1},d(n){H(e,n)}}}function fn(t){let e,l,n,o,i,r,s,f,c,u,m,a,g,b;n=new Lt({props:{list:t[0],selectedComponent:t[1]}}),n.$on("select",t[5]),r=new Kt({});const p=[sn,rn],k=[];function P(E,S){return E[2]?0:E[1]!==null?1:-1}~(f=P(t))&&(c=k[f]=p[f](t));let N=t[3]===V.Inspect&&Ze(t);return{c(){e=y("div"),l=y("div"),M(n.$$.fragment),o=L(),i=y("div"),M(r.$$.fragment),s=L(),c&&c.c(),u=L(),N&&N.c(),m=le(),v(e,"class","orisai-grid svelte-5mmuxd")},m(E,S){$(E,e,S),d(e,l),I(n,l,null),d(e,o),d(e,i),I(r,i,null),d(i,s),~f&&k[f].m(i,null),$(E,u,S),N&&N.m(E,S),$(E,m,S),a=!0,g||(b=R(on,"keydown",t[6]),g=!0)},p(E,[S]){const Z={};S&1&&(Z.list=E[0]),S&2&&(Z.selectedComponent=E[1]),n.$set(Z);let G=f;f=P(E),f===G?~f&&k[f].p(E,S):(c&&(j(),w(k[G],1,1,()=>{k[G]=null}),z()),~f?(c=k[f],c?c.p(E,S):(c=k[f]=p[f](E),c.c()),_(c,1),c.m(i,null)):c=null),E[3]===V.Inspect?N?(N.p(E,S),S&8&&_(N,1)):(N=Ze(E),N.c(),_(N,1),N.m(m.parentNode,m)):N&&(j(),w(N,1,1,()=>{N=null}),z())},i(E){a||(_(n.$$.fragment,E),_(r.$$.fragment,E),_(c),_(N),a=!0)},o(E){w(n.$$.fragment,E),w(r.$$.fragment,E),w(c),w(N),a=!1},d(E){E&&h(e),H(n),H(r),~f&&k[f].d(),E&&h(u),N&&N.d(E),E&&h(m),g=!1,b()}}}function un(t,e,l){let n,o;se(t,_e,u=>l(2,n=u)),se(t,B,u=>l(3,o=u));let{componentList:i=[]}=e,r=null;function s(u){const{componentDescriptor:m,selectionMode:a}=u.detail;if(m===null){l(1,r=null);return}l(1,r=i.find(g=>g.fullName===m.fullName)||null),r!==null&&(a===U.PHP&&r.control!==null?window.location.href=r.control.editorUri:a===U.Latte&&r.template!==null&&(window.location.href=r.template.editorUri))}function f(u){l(1,r=u.detail)}function c(u){u.ctrlKey&&u.metaKey&&u.key==="c"&&(u.preventDefault(),u.stopImmediatePropagation(),te(B,o=V.Inspect,o))}return B.subscribe(()=>te(_e,n=!1,n)),t.$$set=u=>{"componentList"in u&&l(0,i=u.componentList)},[i,r,n,o,s,f,c]}class cn extends A{constructor(e){super(),K(this,e,un,fn,O,{componentList:0})}}const me=document.getElementById("orisai-inspector");!me.dataset.initialized&&new cn({target:me,props:JSON.parse(me.dataset.props)});me.dataset.initialized="1"; diff --git a/ui/src/Inspector.svelte b/ui/src/Inspector.svelte index e4fd852..ba362f3 100644 --- a/ui/src/Inspector.svelte +++ b/ui/src/Inspector.svelte @@ -91,22 +91,26 @@ {/if} - diff --git a/ui/src/lib/EditorLink.svelte b/ui/src/lib/EditorLink.svelte index 9720f15..fcffdc1 100644 --- a/ui/src/lib/EditorLink.svelte +++ b/ui/src/lib/EditorLink.svelte @@ -7,30 +7,35 @@ {type} - diff --git a/ui/src/lib/EditorLinkList.svelte b/ui/src/lib/EditorLinkList.svelte index 607e610..35f8741 100644 --- a/ui/src/lib/EditorLinkList.svelte +++ b/ui/src/lib/EditorLinkList.svelte @@ -2,9 +2,10 @@ - diff --git a/ui/src/lib/Key.svelte b/ui/src/lib/Key.svelte index 4fdeda4..8e07138 100644 --- a/ui/src/lib/Key.svelte +++ b/ui/src/lib/Key.svelte @@ -4,14 +4,15 @@ {key} - diff --git a/ui/src/lib/RenderTime.svelte b/ui/src/lib/RenderTime.svelte index c620425..bba98c8 100644 --- a/ui/src/lib/RenderTime.svelte +++ b/ui/src/lib/RenderTime.svelte @@ -6,9 +6,10 @@ Render time: {time.toFixed(4)} ms - diff --git a/ui/src/lib/Toolbar.svelte b/ui/src/lib/Toolbar.svelte index 60c6e21..820f861 100644 --- a/ui/src/lib/Toolbar.svelte +++ b/ui/src/lib/Toolbar.svelte @@ -2,18 +2,22 @@ - diff --git a/ui/src/lib/ToolbarButton.svelte b/ui/src/lib/ToolbarButton.svelte index 4ae8ad2..c4ad5e5 100644 --- a/ui/src/lib/ToolbarButton.svelte +++ b/ui/src/lib/ToolbarButton.svelte @@ -6,35 +6,41 @@ - diff --git a/ui/src/lib/inspector/ComponentDetail.svelte b/ui/src/lib/inspector/ComponentDetail.svelte index 421bc76..1389c0e 100644 --- a/ui/src/lib/inspector/ComponentDetail.svelte +++ b/ui/src/lib/inspector/ComponentDetail.svelte @@ -61,35 +61,40 @@ {/if} - diff --git a/ui/src/lib/inspector/ComponentList.svelte b/ui/src/lib/inspector/ComponentList.svelte index 2880e53..71d55f8 100644 --- a/ui/src/lib/inspector/ComponentList.svelte +++ b/ui/src/lib/inspector/ComponentList.svelte @@ -21,9 +21,7 @@ {#if component.control !== null && component.showInTree}
  • dispatch("select", component)} - class:orisai-muted={!component.fullName - .toLowerCase() - .includes(query.toLowerCase()) && + class:orisai-muted={!component.fullName.toLowerCase().includes(query.toLowerCase()) && !component.control.shortName.toLowerCase().includes(query.toLowerCase())} class:orisai-active={selectedComponent === component} > @@ -41,57 +39,68 @@ {/each} - diff --git a/ui/src/lib/inspector/Highlighter.svelte b/ui/src/lib/inspector/Highlighter.svelte index c4d7d63..09c4a00 100644 --- a/ui/src/lib/inspector/Highlighter.svelte +++ b/ui/src/lib/inspector/Highlighter.svelte @@ -31,39 +31,44 @@ - diff --git a/ui/src/lib/inspector/InspectorToolbar.svelte b/ui/src/lib/inspector/InspectorToolbar.svelte index fd11d23..b08bca8 100644 --- a/ui/src/lib/inspector/InspectorToolbar.svelte +++ b/ui/src/lib/inspector/InspectorToolbar.svelte @@ -9,13 +9,7 @@ on:click={() => ($mode = $mode === InspectorMode.Inspect ? null : InspectorMode.Inspect)} active={$mode === InspectorMode.Inspect} > - + document.getElementById("orisai-inspector") diff --git a/ui/src/orisai.pcss b/ui/src/orisai.pcss new file mode 100644 index 0000000..4f17c91 --- /dev/null +++ b/ui/src/orisai.pcss @@ -0,0 +1,17 @@ +:root { + --orisai-radius: 3px; + + --orisai-color-border: #ecebeb; + --orisai-color-border-active: #95caf5; + --orisai-color-active: #0095ff; + --orisai-color-link: #125eae; + --orisai-color-warning: #fc4d25; +} + +#orisai-inspector { + display: grid; + + & > div { + overflow: auto; + } +} diff --git a/ui/src/orisai.sass b/ui/src/orisai.sass deleted file mode 100644 index d77655d..0000000 --- a/ui/src/orisai.sass +++ /dev/null @@ -1,14 +0,0 @@ -\:root - --orisai-radius: 3px - - --orisai-color-border: #ecebeb - --orisai-color-border-active: #95caf5 - --orisai-color-active: #0095ff - --orisai-color-link: #125eae - --orisai-color-warning: #FC4D25 - -#orisai-inspector - display: grid - - > div - overflow: auto