| @@ -1,5 +1,5 @@ | ||
| 1 | -(function(){"use strict";function M(t,...e){return{__wpdHtml:!0,strings:t,values:e}}function ke(t){return!!t&&t.__wpdHtml===!0}const ye="$$wpd$$",m=/\$\$wpd\$\$(\d+)\$\$/g;function we(t){let e=t[0];for(let o=1;o<t.length;o++)e+=`${ye}${o-1}$$`+t[o];return e}const B=new WeakMap;function K(t){const e=B.get(t);if(e)return e;const o=document.createElement("template");o.innerHTML=we(t);const n=[],r=(a,c)=>{if(a.nodeType===Node.ELEMENT_NODE){const f=a;for(const b of Array.from(f.attributes)){const g=b.name,u=b.value,w=g[0];if(m.test(u))if(m.lastIndex=0,w==="@"){const h=m.exec(u);m.lastIndex=0,n.push({path:c,kind:"event",name:g.slice(1),valueIndex:h?Number(h[1]):0}),f.removeAttribute(g)}else if(w==="."){const h=m.exec(u);m.lastIndex=0,n.push({path:c,kind:"prop",name:g.slice(1),valueIndex:h?Number(h[1]):0}),f.removeAttribute(g)}else if(w==="?"){const h=m.exec(u);m.lastIndex=0,n.push({path:c,kind:"bool",name:g.slice(1),valueIndex:h?Number(h[1]):0}),f.removeAttribute(g)}else{const h=[],_=[];let x=0,C;for(m.lastIndex=0;(C=m.exec(u))!==null;)h.push(u.slice(x,C.index)),_.push(Number(C[1])),x=C.index+C[0].length;h.push(u.slice(x)),n.push({path:c,kind:"attr",name:g,template:h,valueIndices:_}),f.setAttribute(g,"")}}}const l=Array.from(a.childNodes);let p=0;for(let f=0;f<l.length;f++){const b=l[f],g=f+p;if(b.nodeType===Node.TEXT_NODE){const u=b.textContent||"";if(!m.test(u)){m.lastIndex=0;continue}m.lastIndex=0;const w=b.parentNode;let h=0,_;const x=[],C=[];for(m.lastIndex=0;(_=m.exec(u))!==null;){_.index>h&&x.push(document.createTextNode(u.slice(h,_.index)));const E=document.createTextNode("");x.push(E),C.push({path:[...c,g+x.length-1],kind:"node",valueIndex:Number(_[1])}),h=_.index+_[0].length}h<u.length&&x.push(document.createTextNode(u.slice(h)));for(const E of x)w.insertBefore(E,b);w.removeChild(b),p+=x.length-1,n.push(...C)}else r(b,[...c,g])}};r(o.content,[]);const i={template:o,buildParts:a=>{const c=[];for(const l of n){let p=a;for(const f of l.path)p=p.childNodes[f];l.kind==="node"?c.push({kind:"node",valueIndex:l.valueIndex,child:{anchor:p,state:null}}):l.kind==="attr"?c.push({kind:"attr",element:p,name:l.name,template:l.template,valueIndices:l.valueIndices}):l.kind==="event"?c.push({kind:"event",valueIndex:l.valueIndex,element:p,name:l.name}):l.kind==="prop"?c.push({kind:"prop",valueIndex:l.valueIndex,element:p,name:l.name}):l.kind==="bool"&&c.push({kind:"bool",valueIndex:l.valueIndex,element:p,name:l.name})}return c}};return B.set(t,i),i}const G=new WeakMap;function _e(t,e){for(const o of t.nodes)if(o.parentNode!==e)return!1;return!0}function Ce(t,e){const o=G.get(e);if(o&&o.strings===t.strings&&_e(o,e)){z(o.parts,t.values);return}const n=K(t.strings),r=n.template.content.cloneNode(!0),s=n.buildParts(r),i=Array.from(r.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(r),z(s,t.values),G.set(e,{strings:t.strings,parts:s,nodes:i})}function z(t,e){for(const o of t)if(o.kind==="node")Z(o.child,e[o.valueIndex]);else if(o.kind==="attr"){let n=o.template[0];for(let r=0;r<o.valueIndices.length;r++)n+=J(e[o.valueIndices[r]]),n+=o.template[r+1];n!==o.last&&(o.last=n,n===""?o.element.removeAttribute(o.name):o.element.setAttribute(o.name,n))}else if(o.kind==="event"){const n=e[o.valueIndex];n!==o.current&&(o.current&&o.element.removeEventListener(o.name,o.current),n&&o.element.addEventListener(o.name,n),o.current=n)}else if(o.kind==="prop"){const n=e[o.valueIndex];n!==o.last&&(o.last=n,o.element[o.name]=n)}else if(o.kind==="bool"){const n=!!e[o.valueIndex];n!==o.last&&(o.last=n,n?o.element.setAttribute(o.name,""):o.element.removeAttribute(o.name))}}function Z(t,e){if(e==null||e===!1){t.state&&(A(t.state),t.state=null);return}if(Array.isArray(e)){Se(t,e);return}if(ke(e)){Ee(t,e);return}if(e instanceof Node){$e(t,e);return}Ae(t,J(e))}function $e(t,e){const o=t.state;o?.shape==="node"&&o.node===e||(o&&A(o),H(t,[e]),t.state={shape:"node",node:e})}function Ae(t,e){const o=t.state;if(o?.shape==="text"){o.text!==e&&(o.node.textContent=e,o.text=e);return}o&&A(o);const n=document.createTextNode(e);H(t,[n]),t.state={shape:"text",node:n,text:e}}function Ee(t,e){const o=t.state;if(o?.shape==="template"&&o.strings===e.strings){z(o.parts,e.values);return}o&&A(o);const n=K(e.strings),r=n.template.content.cloneNode(!0),s=n.buildParts(r),i=Array.from(r.childNodes);H(t,[r]),z(s,e.values),t.state={shape:"template",strings:e.strings,parts:s,nodes:i}}function Se(t,e){const o=t.state;if(o?.shape==="array"&&o.entries.length===e.length){for(let r=0;r<e.length;r++)Z(o.entries[r],e[r]);return}o&&A(o);const n=[];for(const r of e){const s=document.createTextNode("");H(t,[s]);const i={anchor:s,state:null};Z(i,r),n.push(i)}t.state={shape:"array",entries:n}}function H(t,e){const o=t.anchor.parentNode;if(o)for(const n of e)o.insertBefore(n,t.anchor)}function A(t){if(t.shape==="text"){t.node.remove();return}if(t.shape==="template"){for(const e of t.parts)e.kind==="node"&&e.child.state&&(A(e.child.state),e.child.state=null);for(const e of t.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(t.shape==="node"){t.node.parentNode&&t.node.parentNode.removeChild(t.node);return}for(const e of t.entries)e.state&&A(e.state),e.anchor.remove()}function J(t){return t==null||t===!1?"":String(t)}const $=class $ extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(Y)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,o,n){if(o===n)return;const r=Ne(e);this._propValues[r]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(r=>String(r).trim()).filter(r=>r!=="");this.className=n.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,o){return this.dispatchEvent(new CustomEvent(e,{detail:o,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const o of e.props){if(Object.getOwnPropertyDescriptor(this,o))continue;const n=Y(o);Object.defineProperty(this,o,{get:()=>o in this._propValues?this._propValues[o]:this.getAttribute(n),set:r=>{let s;r==null||r===!1?s=null:r===!0?s="":s=String(r),this._propValues[o]=s,s===null?this.removeAttribute(n):this.setAttribute(n,s),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Ce(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const o=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=o,o.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const r=document.createElement("style");r.textContent=n.cssText,this.shadowRoot.appendChild(r)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!$._lightStylesAdopted.has(e)){$._lightStylesAdopted.add(e);for(const o of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=o.cssText,document.head.appendChild(n)}}}};$.props=[],$.styles=[],$.shadow=!0,$._lightStylesAdopted=new WeakSet;let S=$;function q(t,e){customElements.get(t)||customElements.define(t,e)}function Y(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Ne(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}const Te=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function v(t,...e){let o=t[0];for(let n=1;n<t.length;n++){const r=e[n-1];if(typeof r=="string"||typeof r=="number")o+=String(r);else if(r&&r.__wpdCss)o+=r.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof r);o+=t[n]}if(Te){const n=new CSSStyleSheet;return n.replaceSync(o),{__wpdCss:!0,sheet:n,cssText:o}}return{__wpdCss:!0,sheet:null,cssText:o}}const ee=v`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,Le=v` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,te=v` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,oe=v` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,ne=v` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,re=v` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,Ie=v` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,Me=v` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,ze=v` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,He=v` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-fg-on-accent,#fff );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,se=v` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;v` ${ee} ${Le} ${te} ${oe} ${ne} ${re} ${Ie} ${Me} ${ze} ${He} ${se} `;const Re=v` ${ee} ${te} ${oe} ${ne} ${re} ${se}:host{display:inline-flex}:host( [ fill-cell ] ){display:flex;width:100%}button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var( --os-ui-button-padding,6px 12px );border-radius:var( --os-ui-button-border-radius,6px );font:inherit;font-weight:500;cursor:pointer;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,transform 80ms ease;background:var( --os-ui-button-bg,transparent );background-image:var( --os-ui-button-bg-image,none );background-repeat:var( --os-ui-button-bg-image-repeat,repeat );background-size:var( --os-ui-button-bg-image-size,auto );background-position:var( --os-ui-button-bg-image-position,center );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ fill-cell ] ) button{width:100%;min-height:var( --os-ui-button-min-height,44px )}button:disabled{opacity:0.5;cursor:not-allowed}button:active:not(:disabled ){transform:translateY( 1px )}button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before,button:disabled::after,button:disabled .os-holo-glint{opacity:0 !important}:host( [ variant='primary' ] ) button{background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-button-fg,var( --os-ui-fg-on-accent,#fff ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 );background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --_holo-glow )}:host( [ variant='holo' ] ) button{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --os-ui-button-fg,var( --_holo-ink ) );border:var( --os-ui-button-border,1px solid transparent );box-shadow:var( --_holo-glow );font-weight:600;transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease,transform 80ms ease}:host( [ variant='holo' ] ) button:hover:not(:disabled ){background-color:transparent;background-position:74% 66%;box-shadow:var( --_holo-glow-strong )}:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:88% 82%;filter:brightness( 0.94 )}:host( [ variant='holo' ] ) button::before{display:none}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ] ) button:hover:not(:disabled ),:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:22% 28%}}:host( [ variant='secondary' ] ) button{background-color:var( --os-ui-button-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='secondary' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}:host( [ variant='danger' ] ) button{background-color:var( --os-ui-button-bg,transparent );color:var( --os-ui-button-fg,var( --os-ui-danger,#d63638 ) );border:var( --os-ui-button-border,1px solid currentColor )}:host( [ variant='danger' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}:host( [ variant='danger' ] ) button::after{display:none}:host( [ variant='link' ] ) button{background-color:transparent;background-image:none;color:var( --os-ui-button-fg,var( --wp-admin-theme-color,#2271b1 ) );border:0;padding:0;text-decoration:underline}:host( [ variant='link' ] ) button::before,:host( [ variant='link' ] ) button::after,:host( [ variant='link' ] ) .os-holo-glint,:host( [ variant='link' ] ) .os-holo-ring{display:none}:host( [ variant='link' ] ) button:active:not(:disabled ){transform:none}:host( [ busy ] ) button{pointer-events:none;opacity:0.75}:host( [ variant='holo' ][ busy ] ) button{animation:os-holo-drift 12s ease-in-out infinite}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ][ busy ] ) button{animation:none}}.os-button__spinner{box-sizing:border-box;display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:os-button-spin 0.6s linear infinite;flex-shrink:0}@keyframes os-button-spin{to{transform:rotate( 360deg )}}`,T=class T extends S{render(){const e=this.disabled!==null,o=this.busy!==null,n=this.type||"button";return M` | |
| 1 | +(function(){"use strict";function R(t,...e){return{__wpdHtml:!0,strings:t,values:e}}function Ee(t){return!!t&&t.__wpdHtml===!0}const Se="$$wpd$$",v=/\$\$wpd\$\$(\d+)\$\$/g,Ne="$$wpd-node$$",Te=/^\$\$wpd-node\$\$(\d+)\$\$$/,Me=new Set(["style","script","textarea","title"]);function Ie(t){let e="",o=!1,n=null,r=!1,s=null,i="",a=!1;for(let c=0;c<t.length;c++){const l=t[c];e+=l;for(let u=0;u<l.length;u++){const h=l[u];if(r){l.startsWith("-->",u)&&(r=!1,u+=2);continue}if(s!==null){h==="<"&&l[u+1]==="/"&&l.slice(u+2,u+2+s.length).toLowerCase()===s&&(u+=1+s.length,s=null,o=!0,a=!1,i="");continue}if(n!==null){h===n&&(n=null);continue}if(o){h==='"'||h==="'"?(n=h,a=!1):h===">"?(o=!1,a=!1,Me.has(i)&&(s=i),i=""):a&&(/[a-zA-Z0-9-]/.test(h)?i+=h.toLowerCase():a=!1);continue}if(l.startsWith("<!--",u)){r=!0,u+=3;continue}const g=l[u+1]??"";h==="<"&&/[a-zA-Z/!]/.test(g)&&(o=!0,i="",a=/[a-zA-Z]/.test(g))}c<t.length-1&&(e+=o||r||s!==null?`${Se}${c}$$`:`<!--${Ne}${c}$$-->`)}return e}const G=new WeakMap;function Y(t){const e=G.get(t);if(e)return e;const o=document.createElement("template");o.innerHTML=Ie(t);const n=[],r=(a,c)=>{if(a.nodeType===Node.ELEMENT_NODE){const h=a;for(const g of Array.from(h.attributes)){const m=g.name,p=g.value,b=m[0];if(v.test(p))if(v.lastIndex=0,b==="@"){const f=v.exec(p);v.lastIndex=0,n.push({path:c,kind:"event",name:m.slice(1),valueIndex:f?Number(f[1]):0}),h.removeAttribute(m)}else if(b==="."){const f=v.exec(p);v.lastIndex=0,n.push({path:c,kind:"prop",name:m.slice(1),valueIndex:f?Number(f[1]):0}),h.removeAttribute(m)}else if(b==="?"){const f=v.exec(p);v.lastIndex=0,n.push({path:c,kind:"bool",name:m.slice(1),valueIndex:f?Number(f[1]):0}),h.removeAttribute(m)}else{const f=[],_=[];let x=0,C;for(v.lastIndex=0;(C=v.exec(p))!==null;)f.push(p.slice(x,C.index)),_.push(Number(C[1])),x=C.index+C[0].length;f.push(p.slice(x)),n.push({path:c,kind:"attr",name:m,template:f,valueIndices:_}),h.setAttribute(m,"")}}}const l=Array.from(a.childNodes);let u=0;for(let h=0;h<l.length;h++){const g=l[h],m=h+u;if(g.nodeType===Node.COMMENT_NODE){const p=Te.exec(g.data);if(p){const b=document.createTextNode("");g.parentNode.replaceChild(b,g),n.push({path:[...c,m],kind:"node",valueIndex:Number(p[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const p=g.textContent||"";if(!v.test(p)){v.lastIndex=0;continue}v.lastIndex=0;const b=g.parentNode;let f=0,_;const x=[],C=[];for(v.lastIndex=0;(_=v.exec(p))!==null;){_.index>f&&x.push(document.createTextNode(p.slice(f,_.index)));const S=document.createTextNode("");x.push(S),C.push({path:[...c,m+x.length-1],kind:"node",valueIndex:Number(_[1])}),f=_.index+_[0].length}f<p.length&&x.push(document.createTextNode(p.slice(f)));for(const S of x)b.insertBefore(S,g);b.removeChild(g),u+=x.length-1,n.push(...C)}else r(g,[...c,m])}};r(o.content,[]);const i={template:o,buildParts:a=>{const c=[];for(const l of n){let u=a;for(const h of l.path)u=u.childNodes[h];l.kind==="node"?c.push({kind:"node",valueIndex:l.valueIndex,child:{anchor:u,state:null}}):l.kind==="attr"?c.push({kind:"attr",element:u,name:l.name,template:l.template,valueIndices:l.valueIndices}):l.kind==="event"?c.push({kind:"event",valueIndex:l.valueIndex,element:u,name:l.name}):l.kind==="prop"?c.push({kind:"prop",valueIndex:l.valueIndex,element:u,name:l.name}):l.kind==="bool"&&c.push({kind:"bool",valueIndex:l.valueIndex,element:u,name:l.name})}return c}};return G.set(t,i),i}const J=new WeakMap;function Le(t,e){for(const o of t.nodes)if(o.parentNode!==e)return!1;return!0}function ze(t,e){const o=J.get(e);if(o&&o.strings===t.strings&&Le(o,e)){H(o.parts,t.values);return}const n=Y(t.strings),r=n.template.content.cloneNode(!0),s=n.buildParts(r),i=Array.from(r.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(r),H(s,t.values),J.set(e,{strings:t.strings,parts:s,nodes:i})}function H(t,e){for(const o of t)if(o.kind==="node")F(o.child,e[o.valueIndex]);else if(o.kind==="attr"){let n=o.template[0];for(let r=0;r<o.valueIndices.length;r++)n+=ee(e[o.valueIndices[r]]),n+=o.template[r+1];n!==o.last&&(o.last=n,n===""?o.element.removeAttribute(o.name):o.element.setAttribute(o.name,n))}else if(o.kind==="event"){const n=e[o.valueIndex];n!==o.current&&(o.current&&o.element.removeEventListener(o.name,o.current),n&&o.element.addEventListener(o.name,n),o.current=n)}else if(o.kind==="prop"){const n=e[o.valueIndex];n!==o.last&&(o.last=n,o.element[o.name]=n)}else if(o.kind==="bool"){const n=!!e[o.valueIndex];n!==o.last&&(o.last=n,n?o.element.setAttribute(o.name,""):o.element.removeAttribute(o.name))}}function F(t,e){if(e==null||e===!1){t.state&&($(t.state),t.state=null);return}if(Array.isArray(e)){Ve(t,e);return}if(Ee(e)){Fe(t,e);return}if(e instanceof Node){Re(t,e);return}He(t,ee(e))}function Re(t,e){const o=t.state;o?.shape==="node"&&o.node===e||(o&&$(o),T(t,[e]),t.state={shape:"node",node:e})}function He(t,e){const o=t.state;if(o?.shape==="text"){o.text!==e&&(o.node.textContent=e,o.text=e);return}o&&$(o);const n=document.createTextNode(e);T(t,[n]),t.state={shape:"text",node:n,text:e}}function Fe(t,e){const o=t.state;if(o?.shape==="template"&&o.strings===e.strings){H(o.parts,e.values);return}o&&$(o);const n=Y(e.strings),r=n.template.content.cloneNode(!0),s=n.buildParts(r),i=Array.from(r.childNodes);T(t,[r]),H(s,e.values),t.state={shape:"template",strings:e.strings,parts:s,nodes:i}}function Ve(t,e){const o=t.state;if(o?.shape==="array"){const r=Math.min(o.entries.length,e.length);for(let s=0;s<r;s++)F(o.entries[s],e[s]);if(e.length<o.entries.length){for(let s=e.length;s<o.entries.length;s++){const i=o.entries[s];i.state&&$(i.state),i.anchor.remove()}o.entries.length=e.length}else for(let s=o.entries.length;s<e.length;s++){const i=document.createTextNode("");T(t,[i]);const a={anchor:i,state:null};F(a,e[s]),o.entries.push(a)}return}o&&$(o);const n=[];for(const r of e){const s=document.createTextNode("");T(t,[s]);const i={anchor:s,state:null};F(i,r),n.push(i)}t.state={shape:"array",entries:n}}function T(t,e){const o=t.anchor.parentNode;if(o)for(const n of e)o.insertBefore(n,t.anchor)}function $(t){if(t.shape==="text"){t.node.remove();return}if(t.shape==="template"){for(const e of t.parts)e.kind==="node"&&e.child.state&&($(e.child.state),e.child.state=null);for(const e of t.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(t.shape==="node"){t.node.parentNode&&t.node.parentNode.removeChild(t.node);return}for(const e of t.entries)e.state&&$(e.state),e.anchor.remove()}function ee(t){return t==null||t===!1?"":String(t)}const A=class A extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(te)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,o,n){if(o===n)return;const r=De(e);this._propValues[r]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(r=>String(r).trim()).filter(r=>r!=="");this.className=n.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,o){return this.dispatchEvent(new CustomEvent(e,{detail:o,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const o of e.props){if(Object.getOwnPropertyDescriptor(this,o))continue;const n=te(o);Object.defineProperty(this,o,{get:()=>o in this._propValues?this._propValues[o]:this.getAttribute(n),set:r=>{let s;r==null||r===!1?s=null:r===!0?s="":s=String(r),this._propValues[o]=s,s===null?this.removeAttribute(n):this.setAttribute(n,s),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&ze(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const o=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=o,o.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const r=document.createElement("style");r.textContent=n.cssText,this.shadowRoot.appendChild(r)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!A._lightStylesAdopted.has(e)){A._lightStylesAdopted.add(e);for(const o of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=o.cssText,document.head.appendChild(n)}}}};A.props=[],A.styles=[],A.shadow=!0,A._lightStylesAdopted=new WeakSet;let M=A;function O(t,e){customElements.get(t)||customElements.define(t,e)}function te(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function De(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}const Pe=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function k(t,...e){let o=t[0];for(let n=1;n<t.length;n++){const r=e[n-1];if(typeof r=="string"||typeof r=="number")o+=String(r);else if(r&&r.__wpdCss)o+=r.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof r);o+=t[n]}if(Pe){const n=new CSSStyleSheet;return n.replaceSync(o),{__wpdCss:!0,sheet:n,cssText:o}}return{__wpdCss:!0,sheet:null,cssText:o}}const oe=k`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,je=k` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,ne=k` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,re=k` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,se=k` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,ie=k` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,Ze=k` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,qe=k` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,Oe=k` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,Ue=k` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,ae=k` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;k` ${oe} ${je} ${ne} ${re} ${se} ${ie} ${Ze} ${qe} ${Oe} ${Ue} ${ae} `;const We=k` ${oe} ${ne} ${re} ${se} ${ie} ${ae}:host{display:inline-flex}:host( [ fill-cell ] ){display:flex;width:100%}button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var( --os-ui-button-padding,6px 12px );border-radius:var( --os-ui-button-border-radius,6px );font:inherit;font-weight:500;cursor:pointer;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,transform 80ms ease;background:var( --os-ui-button-bg,transparent );background-image:var( --os-ui-button-bg-image,none );background-repeat:var( --os-ui-button-bg-image-repeat,repeat );background-size:var( --os-ui-button-bg-image-size,auto );background-position:var( --os-ui-button-bg-image-position,center );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ fill-cell ] ) button{width:100%;min-height:var( --os-ui-button-min-height,44px )}button:disabled{opacity:0.5;cursor:not-allowed}button:active:not(:disabled ){transform:translateY( 1px )}button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before,button:disabled::after,button:disabled .os-holo-glint{opacity:0 !important}:host( [ variant='primary' ] ) button{background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-button-fg,var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 );background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --_holo-glow )}:host( [ variant='holo' ] ) button{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --os-ui-button-fg,var( --_holo-ink ) );border:var( --os-ui-button-border,1px solid transparent );box-shadow:var( --_holo-glow );font-weight:600;transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease,transform 80ms ease}:host( [ variant='holo' ] ) button:hover:not(:disabled ){background-color:transparent;background-position:74% 66%;box-shadow:var( --_holo-glow-strong )}:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:88% 82%;filter:brightness( 0.94 )}:host( [ variant='holo' ] ) button::before{display:none}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ] ) button:hover:not(:disabled ),:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:22% 28%}}:host( [ variant='secondary' ] ) button{background-color:var( --os-ui-button-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='secondary' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}:host( [ variant='danger' ] ) button{background-color:var( --os-ui-button-bg,transparent );color:var( --os-ui-button-fg,var( --os-ui-danger,#d63638 ) );border:var( --os-ui-button-border,1px solid currentColor )}:host( [ variant='danger' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}:host( [ variant='danger' ] ) button::after{display:none}:host( [ variant='link' ] ) button{background-color:transparent;background-image:none;color:var( --os-ui-button-fg,var( --wp-admin-theme-color,#2271b1 ) );border:0;padding:0;text-decoration:underline}:host( [ variant='link' ] ) button::before,:host( [ variant='link' ] ) button::after,:host( [ variant='link' ] ) .os-holo-glint,:host( [ variant='link' ] ) .os-holo-ring{display:none}:host( [ variant='link' ] ) button:active:not(:disabled ){transform:none}:host( [ busy ] ) button{pointer-events:none;opacity:0.75}:host( [ variant='holo' ][ busy ] ) button{animation:os-holo-drift 12s ease-in-out infinite}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ][ busy ] ) button{animation:none}}.os-button__spinner{box-sizing:border-box;display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:os-button-spin 0.6s linear infinite;flex-shrink:0}@keyframes os-button-spin{to{transform:rotate( 360deg )}}`,I=class I extends M{static get observedAttributes(){return[...super.observedAttributes,"aria-label"]}render(){const e=this.disabled!==null,o=this.busy!==null,n=this.type||"button",r=this.getAttribute("aria-label")||"";return R` | |
| 2 | 2 | <button |
| 3 | 3 | part="button" |
| 4 | 4 | class="os-holo-edge os-holo-sheen" |
| 5 | 5 | type=${n} |
| @@ -4,10 +4,11 @@ | ||
| 4 | 4 | class="os-holo-edge os-holo-sheen" |
| 5 | 5 | type=${n} |
| 6 | 6 | ?disabled=${e||o} |
| 7 | 7 | aria-busy=${o?"true":"false"} |
| 8 | + aria-label=${r} | |
| 8 | 9 | > |
| 9 | - ${o?M`<span class="os-button__spinner" aria-hidden="true"></span>`:""} | |
| 10 | + ${o?R`<span class="os-button__spinner" aria-hidden="true"></span>`:""} | |
| 10 | 11 | <slot></slot> |
| 11 | 12 | <!-- |
| 12 | 13 | The two motion layers. Elements rather than |
| 13 | 14 | pseudo-elements because the sheen and the hairline |
| @@ -17,9 +18,9 @@ | ||
| 17 | 18 | --> |
| 18 | 19 | <span class="os-holo-glint" aria-hidden="true"></span> |
| 19 | 20 | <span class="os-holo-ring" aria-hidden="true"></span> |
| 20 | 21 | </button> |
| 21 | - `}};T.props=["variant","disabled","type","busy","fill-cell"],T.styles=[Re],T.help=void 0;let U=T;q("os-button",U);const ie={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function ae(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ve(t){return Object.prototype.hasOwnProperty.call(ie,t)?ie[t]:null}function Pe(t,e={}){const o=Ve(t);if(!o)return"";const{size:n=24,className:r,title:s,rotate:i}=e,a=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];n!=null&&a.push(`width="${n}"`,`height="${n}"`),a.push(o.a),r&&a.push(`class="${ae(r)}"`),s?a.push('role="img"',`aria-label="${ae(s)}"`):a.push('aria-hidden="true"','focusable="false"');const c=i?`<g transform="rotate(${i} 12 12)">${o.b}</g>`:o.b;return`<svg ${a.join(" ")}>${c}</svg>`}function De(t,e={}){const o=Pe(t,e),n=document.createElement("div");n.innerHTML=o;const r=n.firstElementChild;return r instanceof SVGSVGElement?r:document.createElementNS("http://www.w3.org/2000/svg","svg")}const je=v`:host{display:flex;align-items:flex-start;gap:10px;width:100%;box-sizing:border-box;padding:10px 14px;font:var( --os-ui-notice-font,13px/1.5 var( --os-font,system-ui ) );color:var( --os-ui-notice-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-notice-bg,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );border-block-end:1px solid var( --os-ui-notice-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-inline-start:4px solid var( --os-ui-notice-accent,var( --os-ui-border,#646970 ) )}:host( [ hidden ] ){display:none}.os-notice__icon{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:var( --os-ui-notice-accent,var( --os-ui-accent,#646970 ) )}.os-notice__icon[ hidden ]{display:none}.os-notice__label{flex:1;min-width:0;word-wrap:break-word}::slotted( a ){color:var( --os-ui-notice-link,var( --wp-admin-theme-color,#2271b1 ) );border-radius:2px}::slotted( a:hover ),::slotted( a:focus-visible ){color:var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) )}::slotted( a:focus-visible ){outline:2px solid var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) );outline-offset:2px}::slotted( p:first-child ){margin-block-start:0}::slotted( p:last-child ){margin-block-end:0}.os-notice__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:inherit;opacity:0.6;cursor:pointer;border-radius:4px;transition:opacity 0.12s ease,background-color 0.12s ease}.os-notice__close:hover{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}.os-notice__close:focus-visible{opacity:1;outline:2px solid var( --wp-admin-theme-color,#2271b1 );outline-offset:1px}.os-notice__close[ hidden ]{display:none}.os-notice__close svg{width:14px;height:14px}:host( [ tone='info' ] ){--os-ui-notice-accent:var( --os-ui-notice-info,var( --os-ui-info-fg,#0969da ) );--os-ui-notice-bg:var( --os-ui-notice-info-bg,rgba( 9,105,218,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-info-border,rgba( 9,105,218,0.16 ) )}:host( [ tone='success' ] ){--os-ui-notice-accent:var( --os-ui-notice-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-notice-bg:var( --os-ui-notice-success-bg,rgba( 26,127,55,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-success-border,rgba( 26,127,55,0.16 ) )}:host( [ tone='warning' ] ){--os-ui-notice-accent:var( --os-ui-notice-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-notice-bg:var( --os-ui-notice-warning-bg,rgba( 154,103,0,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-warning-border,rgba( 154,103,0,0.16 ) )}:host( [ tone='error' ] ),:host( [ tone='danger' ] ){--os-ui-notice-accent:var( --os-ui-notice-error,var( --os-ui-danger,#cf222e ) );--os-ui-notice-bg:var( --os-ui-notice-error-bg,rgba( 207,34,46,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-error-border,rgba( 207,34,46,0.16 ) )}:host( [ tone='neutral' ] ){--os-ui-notice-accent:var( --os-ui-notice-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-notice-bg:var( --os-ui-notice-neutral-bg,rgba( 87,96,106,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-neutral-border,rgba( 87,96,106,0.16 ) )}`,Fe="desktop-mode";function ce(){return window.wp?.i18n}function d(t,e=Fe){return ce()?.__(t,e)??t}function R(t,...e){const o=ce()?.sprintf;if(o)return o(t,...e);let n=0;return t.replace(/%(?:(\d+)\$)?[sd]/g,(r,s)=>{const i=s?Number.parseInt(s,10)-1:n++;return String(e[i]??"")})}const Ze="desktop-mode-notice-dismissed";function qe(){const e=window.wp?.os?.config?.currentUserId;return typeof e=="number"&&e>0?String(e):"anon"}function le(){return`${Ze}:${qe()}`}function O(){try{const t=window.localStorage.getItem(le());if(!t)return{};const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return{}}function de(t){try{window.localStorage.setItem(le(),JSON.stringify(t))}catch{}}function Ue(t){return t?O()[t]===!0:!1}function Oe(t){if(!t)return;const e=O();e[t]=!0,de(e)}function We(t){if(!t)return;const e=O();e[t]&&(delete e[t],de(e))}const L=class L extends S{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("tone")||this.setAttribute("tone","info");const e=this.getAttribute("notice-id");e&&Ue(e)&&(this.hidden=!0)}dismiss(){this.hidden=!0;const e=this.getAttribute("notice-id");e&&Oe(e),this.emit("os-notice-dismiss",{noticeId:e??void 0})}undismiss(){const e=this.getAttribute("notice-id");e&&We(e),this.hidden=!1}render(){const e=this.getAttribute("icon"),o=!this.hasAttribute("not-dismissible");return M` | |
| 22 | + `}};I.props=["variant","disabled","type","busy","fill-cell"],I.styles=[We],I.help=void 0;let U=I;O("os-button",U);const ce={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function le(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Xe(t){return Object.prototype.hasOwnProperty.call(ce,t)?ce[t]:null}function Be(t,e={}){const o=Xe(t);if(!o)return"";const{size:n=24,className:r,title:s,rotate:i}=e,a=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];n!=null&&a.push(`width="${n}"`,`height="${n}"`),a.push(o.a),r&&a.push(`class="${le(r)}"`),s?a.push('role="img"',`aria-label="${le(s)}"`):a.push('aria-hidden="true"','focusable="false"');const c=i?`<g transform="rotate(${i} 12 12)">${o.b}</g>`:o.b;return`<svg ${a.join(" ")}>${c}</svg>`}function Ke(t,e={}){const o=Be(t,e),n=document.createElement("div");n.innerHTML=o;const r=n.firstElementChild;return r instanceof SVGSVGElement?r:document.createElementNS("http://www.w3.org/2000/svg","svg")}const Qe=k`:host{display:flex;align-items:flex-start;gap:10px;width:100%;box-sizing:border-box;padding:10px 14px;font:var( --os-ui-notice-font,13px/1.5 var( --os-font,system-ui ) );color:var( --os-ui-notice-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-notice-bg,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );border-block-end:1px solid var( --os-ui-notice-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-inline-start:4px solid var( --os-ui-notice-accent,var( --os-ui-border,#646970 ) )}:host( [ hidden ] ){display:none}.os-notice__icon{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:var( --os-ui-notice-accent,var( --os-ui-accent,#646970 ) )}.os-notice__icon[ hidden ]{display:none}.os-notice__label{flex:1;min-width:0;word-wrap:break-word}::slotted( a ){color:var( --os-ui-notice-link,var( --wp-admin-theme-color,#2271b1 ) );border-radius:2px}::slotted( a:hover ),::slotted( a:focus-visible ){color:var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) )}::slotted( a:focus-visible ){outline:2px solid var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) );outline-offset:2px}::slotted( p:first-child ){margin-block-start:0}::slotted( p:last-child ){margin-block-end:0}.os-notice__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:inherit;opacity:0.6;cursor:pointer;border-radius:4px;transition:opacity 0.12s ease,background-color 0.12s ease}.os-notice__close:hover{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}.os-notice__close:focus-visible{opacity:1;outline:2px solid var( --wp-admin-theme-color,#2271b1 );outline-offset:1px}.os-notice__close[ hidden ]{display:none}.os-notice__close svg{width:14px;height:14px}:host( [ tone='info' ] ){--os-ui-notice-accent:var( --os-ui-notice-info,var( --os-ui-info-fg,#0969da ) );--os-ui-notice-bg:var( --os-ui-notice-info-bg,rgba( 9,105,218,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-info-border,rgba( 9,105,218,0.16 ) )}:host( [ tone='success' ] ){--os-ui-notice-accent:var( --os-ui-notice-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-notice-bg:var( --os-ui-notice-success-bg,rgba( 26,127,55,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-success-border,rgba( 26,127,55,0.16 ) )}:host( [ tone='warning' ] ){--os-ui-notice-accent:var( --os-ui-notice-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-notice-bg:var( --os-ui-notice-warning-bg,rgba( 154,103,0,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-warning-border,rgba( 154,103,0,0.16 ) )}:host( [ tone='error' ] ),:host( [ tone='danger' ] ){--os-ui-notice-accent:var( --os-ui-notice-error,var( --os-ui-danger,#cf222e ) );--os-ui-notice-bg:var( --os-ui-notice-error-bg,rgba( 207,34,46,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-error-border,rgba( 207,34,46,0.16 ) )}:host( [ tone='neutral' ] ){--os-ui-notice-accent:var( --os-ui-notice-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-notice-bg:var( --os-ui-notice-neutral-bg,rgba( 87,96,106,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-neutral-border,rgba( 87,96,106,0.16 ) )}`,Ge="desktop-mode";function de(){return window.wp?.i18n}function d(t,e=Ge){return de()?.__(t,e)??t}function N(t,...e){const o=de()?.sprintf;if(o)return o(t,...e);let n=0;return t.replace(/%(?:(\d+)\$)?[sd]/g,(r,s)=>{const i=s?Number.parseInt(s,10)-1:n++;return String(e[i]??"")})}const Ye="desktop-mode-notice-dismissed";function Je(){const e=window.wp?.os?.config?.currentUserId;return typeof e=="number"&&e>0?String(e):"anon"}function ue(){return`${Ye}:${Je()}`}function W(){try{const t=window.localStorage.getItem(ue());if(!t)return{};const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return{}}function he(t){try{window.localStorage.setItem(ue(),JSON.stringify(t))}catch{}}function et(t){return t?W()[t]===!0:!1}function tt(t){if(!t)return;const e=W();e[t]=!0,he(e)}function ot(t){if(!t)return;const e=W();e[t]&&(delete e[t],he(e))}const L=class L extends M{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("tone")||this.setAttribute("tone","info");const e=this.getAttribute("notice-id");e&&et(e)&&(this.hidden=!0)}dismiss(){this.hidden=!0;const e=this.getAttribute("notice-id");e&&tt(e),this.emit("os-notice-dismiss",{noticeId:e??void 0})}undismiss(){const e=this.getAttribute("notice-id");e&&ot(e),this.hidden=!1}render(){const e=this.getAttribute("icon"),o=!this.hasAttribute("not-dismissible");return R` | |
| 22 | 23 | <span |
| 23 | 24 | class="os-notice__icon dashicons ${e??""}" |
| 24 | 25 | ?hidden=${!e} |
| 25 | 26 | aria-hidden="true" |
| @@ -31,7 +32,7 @@ | ||
| 31 | 32 | ?hidden=${!o} |
| 32 | 33 | aria-label=${d("Dismiss notice")} |
| 33 | 34 | @click=${n=>this._onDismiss(n)} |
| 34 | 35 | > |
| 35 | - ${De("close",{size:null})} | |
| 36 | + ${Ke("close",{size:null})} | |
| 36 | 37 | </button> |
| 37 | - `}_onDismiss(e){e.preventDefault(),e.stopPropagation(),this.dismiss()}};L.props=["tone","notDismissible","icon","noticeId"],L.styles=[je],L.help=void 0;let W=L;q("os-notice",W);const Xe=v`:host{display:inline-block;--_color:var( --os-ui-spinner-color,var( --wp-admin-theme-color,#21759b ) );--_accent:var( --os-ui-spinner-accent,var( --os-ui-fg-on-accent,#fff ) );--_size:var( --os-ui-spinner-size,48px );width:var( --_size );height:var( --_size );color:var( --_color );vertical-align:middle;line-height:0}:host( [ hidden ] ){display:none}:host( [ preset='inline' ] ){--os-ui-spinner-color:currentColor;--os-ui-spinner-size:16px}.root,.root svg{display:block;width:100%;height:100%}.root svg .mark{fill:var( --_accent )}@keyframes os-spinner-spin{to{transform:rotate( 360deg )}}@keyframes os-spinner-scale{0%,100%{transform:scale( 1 )}50%{transform:scale( 1.045 )}}@keyframes os-spinner-opacity{0%,100%{opacity:1}50%{opacity:0.7}}@media ( prefers-reduced-motion:reduce ){.root svg [ style*='animation' ]{animation:none !important}}`,ue=Object.freeze({classic:{sp1:12,sp2:24,sp3:40,a1:28,a2:15,a3:8,gap:4,dir2:1,dir3:-1,pulse:"none",dots:0},comet:{sp1:8,sp2:14,sp3:26,a1:50,a2:28,a3:12,gap:3,dir2:1,dir3:1,pulse:"none",dots:5},orbit:{sp1:10,sp2:10,sp3:32,a1:50,a2:50,a3:8,gap:5,dir2:-1,dir3:-1,pulse:"opacity",dots:3},pulse:{sp1:6,sp2:18,sp3:30,a1:20,a2:12,a3:6,gap:4,dir2:1,dir3:-1,pulse:"both",dots:8},inline:{sp1:8,sp2:8,sp3:8,a1:25,a2:25,a3:25,gap:0,dir2:1,dir3:1,pulse:"none",dots:0}}),k=61.26,y=61.26,he=58.453,Qe='<path d="m8.708 61.26c0 20.802 12.089 38.779 29.619 47.298l-25.069-68.686c-2.916 6.536-4.55 13.769-4.55 21.388z"/><path d="m96.74 58.608c0-6.495-2.333-10.993-4.334-14.494-2.664-4.329-5.161-7.995-5.161-12.324 0-4.831 3.664-9.328 8.825-9.328.233 0 .454.029.681.042-9.35-8.566-21.807-13.796-35.489-13.796-18.36 0-34.513 9.42-43.91 23.688 1.233.037 2.395.063 3.382.063 5.497 0 14.006-.667 14.006-.667 2.833-.167 3.167 3.994.337 4.329 0 0-2.847.335-6.015.501l19.138 56.925 11.501-34.493-8.188-22.434c-2.83-.166-5.511-.501-5.511-.501-2.832-.166-2.5-4.496.332-4.329 0 0 8.679.667 13.843.667 5.496 0 14.006-.667 14.006-.667 2.835-.167 3.168 3.994.337 4.329 0 0-2.853.335-6.015.501l18.992 56.494 5.242-17.517c2.272-7.269 4.001-12.49 4.001-16.989z"/><path d="m62.184 65.857-15.768 45.819c4.708 1.384 9.687 2.141 14.846 2.141 6.12 0 11.989-1.058 17.452-2.979-.141-.225-.269-.464-.374-.724z"/><path d="m107.376 36.046c.226 1.674.354 3.471.354 5.404 0 5.333-.996 11.328-3.996 18.824l-16.053 46.413c15.624-9.111 26.133-26.038 26.133-45.426.001-9.137-2.333-17.729-6.438-25.215z"/>',I=class I extends S{constructor(){super(...arguments),this._paintScheduled=!1}connectedCallback(){super.connectedCallback(),this._schedulePaint()}render(){return M`<div class="root" part="root"></div>`}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){this._syncCssVars();const e=this.shadowRoot?.querySelector(".root");e&&(e.innerHTML=this._buildSvg())}_syncCssVars(){const e=(o,n,r)=>{const s=this.getAttribute(o);s===null?this.style.removeProperty(n):this.style.setProperty(n,r?r(s):s)};e("color","--os-ui-spinner-color"),e("accent","--os-ui-spinner-accent"),e("size","--os-ui-spinner-size",o=>/^-?\d+(\.\d+)?$/.test(o.trim())?`${o}px`:o)}_effectiveConfig(){const e=this.getAttribute("preset")??"classic",o=ue[e]??ue.classic,n=(i,a)=>{const c=this.getAttribute(i);if(c===null)return a;const l=parseFloat(c);return Number.isFinite(l)?l:a},r=(i,a)=>{const c=this.getAttribute(i);if(c===null)return a;const l=c.toLowerCase();return l==="-1"||l==="ccw"||l==="reverse"?-1:1},s=()=>{const i=this.getAttribute("pulse");return i==="scale"||i==="opacity"||i==="both"||i==="none"?i:o.pulse};return{sp1:n("sp1",o.sp1),sp2:n("sp2",o.sp2),sp3:n("sp3",o.sp3),a1:n("a1",o.a1),a2:n("a2",o.a2),a3:n("a3",o.a3),gap:n("gap",o.gap),dir2:r("dir2",o.dir2),dir3:r("dir3",o.dir3),pulse:s(),dots:Math.max(0,Math.floor(n("dots",o.dots)))}}_buildInlineSvg(e){const o=pe(this.getAttribute("label")??"Loading"),n=9,r=(e.sp1/10).toFixed(2);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="${o}"><circle cx="12" cy="12" r="${n}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-opacity="0.22"/><circle cx="12" cy="12" r="${n}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-dasharray="${V(n,e.a1)}" style="transform-origin:12px 12px;animation: os-spinner-spin ${r}s linear infinite"/></svg>`}_buildSvg(){const e=this._effectiveConfig();if(this.getAttribute("preset")==="inline")return this._buildInlineSvg(e);const o=pe(this.getAttribute("label")??"Loading"),n=e.gap*3+14,r=-n,s=122.52+n*2,i=he+e.gap+2,a=i+e.gap+2,c=a+e.gap+1.5,l=`animation: os-spinner-spin ${(e.sp1/10).toFixed(2)}s linear infinite`,p=`animation: os-spinner-spin ${(e.sp2/10).toFixed(2)}s linear infinite${e.dir2<0?" reverse":""}`,f=`animation: os-spinner-spin ${(e.sp3/10).toFixed(2)}s linear infinite${e.dir3<0?" reverse":""}`,b=(e.sp1*1.8/10).toFixed(1),g=(e.sp1*2.3/10).toFixed(1);let u="";e.pulse==="scale"?u=`animation: os-spinner-scale ${b}s ease-in-out infinite`:e.pulse==="opacity"?u=`animation: os-spinner-opacity ${g}s ease-in-out infinite`:e.pulse==="both"&&(u=`animation: os-spinner-scale ${b}s ease-in-out infinite, os-spinner-opacity ${g}s ease-in-out infinite`);let w="";if(e.dots>0){const h=c+e.gap+1,_=2*Math.PI*h,x=1.6,C=(e.sp1*.65/10).toFixed(2);for(let E=0;E<e.dots;E++){const kt=-(E/e.dots)*_;w+=`<circle cx="${k}" cy="${y}" r="${h.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="${x}" stroke-dasharray="${x.toFixed(2)} ${(_-x).toFixed(2)}" stroke-dashoffset="${kt.toFixed(2)}" stroke-linecap="round" stroke-opacity="0.65" style="transform-origin:${k}px ${y}px;animation: os-spinner-spin ${C}s linear infinite"/>`}}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${r} ${r} ${s} ${s}" role="img" aria-label="${o}"><g style="transform-origin:${k}px ${y}px${u?";"+u:""}"><circle cx="${k}" cy="${y}" r="${he}" fill="currentColor"/><g class="mark">${Qe}</g></g><circle cx="${k}" cy="${y}" r="${i.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.6" stroke-opacity="0.2"/><circle cx="${k}" cy="${y}" r="${i.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="2.2" stroke-dasharray="${V(i,e.a1)}" stroke-linecap="round" style="transform-origin:${k}px ${y}px;${l}"/><circle cx="${k}" cy="${y}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.5" stroke-opacity="0.15"/><circle cx="${k}" cy="${y}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.6" stroke-opacity="0.8" stroke-dasharray="${V(a,e.a2)}" stroke-linecap="round" style="transform-origin:${k}px ${y}px;${p}"/><circle cx="${k}" cy="${y}" r="${c.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.4" stroke-opacity="0.12"/><circle cx="${k}" cy="${y}" r="${c.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.0" stroke-opacity="0.6" stroke-dasharray="${V(c,e.a3)}" stroke-linecap="round" style="transform-origin:${k}px ${y}px;${f}"/>`+w+"</svg>"}};I.props=["preset","size","color","accent","sp1","sp2","sp3","a1","a2","a3","gap","dir2","dir3","pulse","dots","label"],I.styles=[Xe],I.help=void 0;let X=I;function V(t,e){const o=2*Math.PI*t,n=e/100*o,r=o-n;return`${n.toFixed(2)} ${r.toFixed(2)}`}function pe(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}q("os-spinner",X);const fe="X-WP-Nonce";function Be(t,e){const o=Ke();if(!o)return e;const n=Ge(t);if(!n||!Je(n))return e;const r=e?.headers??(typeof Request<"u"&&t instanceof Request?t.headers:void 0),s=new Headers(r??{});return s.has(fe)?e:(s.set(fe,o),{...e??{},headers:s})}function Ke(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function Ge(t){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof t=="string"?new URL(t,e):t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url,e):null}catch{return null}}function Je(t){return typeof window>"u"||!window.location||t.origin!==window.location.origin?!1:!!(t.pathname.includes("/wp-json/")||t.searchParams.has("rest_route"))}function P(t,e,o={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(t,e,o);const r=Be(t,e);return fetch(t,r)}function Ye(t,e){let o=null,n=Date.now();const r=()=>{n=Date.now(),t()},s=()=>{o===null&&(o=setInterval(r,e))},i=()=>{o!==null&&(clearInterval(o),o=null)},a=()=>{if(document.hidden){i();return}Date.now()-n>=e&&r(),s()};return document.addEventListener("visibilitychange",a),document.hidden||s(),{stop(){i(),document.removeEventListener("visibilitychange",a)}}}function et(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}function ge(){return window.wp?.os}function D(){return(window.wpApiSettings?.root??"/wp-json/").replace(/\/$/,"")}function tt(){const t=window.wp?.os;return Number(t?.config?.currentUserId)||0}async function ot(t){return(await P(`${D()}/wp/v2/posts/${t}`,{method:"DELETE",credentials:"same-origin"},{source:"desktop-mode/drafts"})).ok}const j="dm-drafts__suggest";function nt(){return window.openStationConfig?.aiAssistant?.providerConfigured===!0}async function rt(t){const e=await P(`${D()}/desktop-mode/v1/draft-suggestions`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({post_id:t})},{source:"desktop-mode/drafts"});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async function st(t,e){return(await P(`${D()}/desktop-mode/v1/draft-apply`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({post_id:t,...e})},{source:"desktop-mode/drafts"})).ok}function N(t,e){ge()?.showToast?.(e?{message:t,type:e}:{message:t})}function it(t,e,o){const n=e.parentElement,r=e.nextElementSibling,s=!!r&&r.classList.contains(j);if(n?.querySelectorAll(`.${j}`).forEach(a=>a.remove()),n?.querySelectorAll(".dm-drafts__spark").forEach(a=>a.setAttribute("aria-expanded","false")),s)return;const i=document.createElement("div");i.className=j,i.id=`dm-drafts-suggest-${t}`,i.setAttribute("role","group"),i.setAttribute("aria-label",d("Writing suggestions")),i.appendChild(at()),e.after(i),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-controls",i.id),ct(t,i,e)}function at(){const t=document.createElement("div");t.className="dm-drafts__suggest-loading",t.setAttribute("aria-live","polite");const e=document.createElement("os-spinner");e.setAttribute("preset","inline"),e.setAttribute("size","14"),t.appendChild(e);const o=document.createElement("span");return o.textContent=d("Thinking…"),t.appendChild(o),t}function be(t,e,o){const n=document.createElement("os-notice");return n.className="dm-drafts__notice",n.setAttribute("tone",t),n.setAttribute("not-dismissible",""),o&&n.setAttribute("icon",o),e!==void 0&&(n.textContent=e),n}async function ct(t,e,o){try{const n=await rt(t);e.isConnected&&dt(e,n,t,o)}catch{e.isConnected&&e.replaceChildren(be("error",d("Could not get suggestions.")))}}function F(t,e,o,n,r){const s=document.createElement("os-button");return s.setAttribute("variant","ghost"),s.className=o,s.textContent=e,s.title=d("Apply to the draft"),s.addEventListener("click",()=>{s.hasAttribute("busy")||s.classList.contains("is-applied")||(s.setAttribute("busy",""),st(t,n).then(i=>{if(s.removeAttribute("busy"),i){s.setAttribute("aria-disabled","true"),s.classList.add("is-applied");const a=document.createElement("span");a.className="dm-drafts__applied-check",a.setAttribute("aria-hidden","true"),a.textContent="✓",s.appendChild(a),r?.()}else N(d("Could not apply the suggestion."),"error")}))}),s}function lt(t){const e=t.missing??[],o=e.length===0,n=be(o?"success":"warning",void 0,o?"dashicons-yes-alt":"dashicons-info-outline");if(n.classList.add("dm-drafts__readiness"),t.summary){const r=document.createElement("div");r.className="dm-drafts__readiness-summary",r.textContent=t.summary,n.appendChild(r)}if(e.length>0){const r=document.createElement("ul");r.className="dm-drafts__readiness-missing";for(const s of e){const i=document.createElement("li");i.textContent=s,r.appendChild(i)}n.appendChild(r)}return n}function dt(t,e,o,n){t.replaceChildren(),e.readiness&&(e.readiness.summary||e.readiness.missing?.length)&&t.appendChild(lt(e.readiness));const r=document.createElement("div");r.className="dm-drafts__suggest-hint",r.textContent=d("Tap a suggestion to apply it to the draft."),t.appendChild(r);const s=i=>{const a=document.createElement("div");a.className="dm-drafts__suggest-group";const c=document.createElement("div");return c.className="dm-drafts__suggest-label",c.textContent=i,a.appendChild(c),t.appendChild(a),a};if(e.titles&&e.titles.length>0){const i=s(d("Title ideas"));for(const a of e.titles)i.appendChild(F(o,a,"dm-drafts__suggest-item",{title:a},()=>{const c=n.querySelector(".dm-drafts__name");c&&(c.textContent=a),N(d("Title updated."))}))}if(e.excerpt&&s(d("Excerpt")).appendChild(F(o,e.excerpt,"dm-drafts__suggest-item",{excerpt:e.excerpt},()=>N(d("Excerpt updated.")))),e.tags&&e.tags.length>0){const i=s(d("Tags")),a=document.createElement("div");a.className="dm-drafts__suggest-tags";for(const c of e.tags)a.appendChild(F(o,c,"dm-drafts__suggest-tag",{tags:[c]},()=>N(d("Tag added."))));i.appendChild(a)}if(e.categories&&e.categories.length>0){const i=s(d("Categories")),a=document.createElement("div");a.className="dm-drafts__suggest-tags";for(const c of e.categories)a.appendChild(F(o,c,"dm-drafts__suggest-tag",{categories:[c]},()=>N(d("Category added."))));i.appendChild(a)}}const ut="desktop-mode/drafts",ht=6e4,pt=8;function ft(){return window.wp?.os?.config?.adminUrl||"/wp-admin/"}function gt(t){return`${ft()}post.php?post=${t}&action=edit`}function bt(t){const e=t.endsWith("Z")?t:t+"Z",o=Math.floor((Date.now()-new Date(e).getTime())/1e3);return o<60?d("just now"):o<3600?R(d("%dm ago"),Math.floor(o/60)):o<86400?R(d("%dh ago"),Math.floor(o/3600)):R(d("%dd ago"),Math.floor(o/86400))}async function mt(){const t=tt(),e=await P(D()+`/wp/v2/posts?status=draft&orderby=modified&order=desc&per_page=${pt}&context=edit&_fields=id,title,modified_gmt`+(t>0?`&author=${t}`:""),{credentials:"same-origin"},{source:"desktop-mode/drafts",silent:!0});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function me(t){const e=t.title?.rendered?et(t.title.rendered).trim():"";return e||(t.title?.raw??"").trim()||d("(no title)")}function ve(t,e,o){const n=document.createElement("os-button");n.className=t,n.setAttribute("variant","ghost"),n.title=o,n.setAttribute("aria-label",o);const r=document.createElement("span");return r.className=`dashicons ${e}`,n.appendChild(r),n}function xe(t,e,o,n){t.innerHTML="";const r=document.createElement("div");r.className="dm-drafts__header";const s=document.createElement("span");s.className="dm-drafts__title",s.textContent=d("Drafts");const i=document.createElement("span");if(i.className="dm-drafts__badge",e&&e.length>0&&(i.textContent=String(e.length),i.classList.add("dm-drafts__badge--visible")),r.appendChild(s),r.appendChild(i),t.appendChild(r),o){const c=document.createElement("div");c.className="dm-drafts__empty",c.textContent=d("Could not load drafts."),t.appendChild(c);return}if(!e||e.length===0){const c=document.createElement("div");c.className="dm-drafts__empty",c.textContent=d("No drafts — all caught up."),t.appendChild(c);return}const a=document.createElement("div");a.className="dm-drafts__list";for(const c of e){const l=document.createElement("div");l.className="dm-drafts__row";const p=document.createElement("a");p.className="dm-drafts__link",p.href=gt(c.id);const f=document.createElement("span");f.className="dm-drafts__name",f.textContent=me(c);const b=document.createElement("span");b.className="dm-drafts__time",b.textContent=bt(c.modified_gmt),p.appendChild(f),p.appendChild(b);const g=ve("dm-drafts__trash","dashicons-trash",d("Move to Trash"));if(g.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),vt(c,l,n)}),l.appendChild(p),nt()){const u=ve("dm-drafts__spark","dashicons-lightbulb",d("Suggest title, excerpt & tags"));u.setAttribute("aria-expanded","false"),u.addEventListener("click",w=>{w.preventDefault(),w.stopPropagation(),it(c.id,l,u)}),l.appendChild(u)}l.appendChild(g),a.appendChild(l)}t.appendChild(a)}async function vt(t,e,o){const n=ge();if(!(!n?.confirm||!await n.confirm({title:d("Move to Trash?"),message:R(d("“%s” will be moved to the Trash. You can restore it later."),me(t)),confirmLabel:d("Move to Trash"),danger:!0}))){e.classList.add("is-trashing");try{if(!await ot(t.id))throw new Error("trash failed");n?.showToast?.({message:d("Draft moved to Trash.")}),o()}catch{e.classList.remove("is-trashing"),n?.showToast?.({message:d("Could not move the draft to Trash."),type:"error"})}}}const xt=async(t,e)=>{let o=!1;const n=async()=>{if(!o&&!t.querySelector(`.${j}`))try{const a=await mt();o||xe(t,a,!1,n)}catch{o||xe(t,null,!0,n)}};await n();const r=Ye(n,ht);let s=null;const i=()=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{s=null,n()},600)};return document.addEventListener("os-window-closed",i),document.addEventListener("os-window-blurred",i),()=>{o=!0,r.stop(),s!==null&&clearTimeout(s),document.removeEventListener("os-window-closed",i),document.removeEventListener("os-window-blurred",i)}},Q=window;Q.openStationWidgets=Q.openStationWidgets??{},Q.openStationWidgets[ut]=xt})(); | |
| 38 | + `}_onDismiss(e){e.preventDefault(),e.stopPropagation(),this.dismiss()}};L.props=["tone","notDismissible","icon","noticeId"],L.styles=[Qe],L.help=void 0;let X=L;O("os-notice",X);const nt=k`:host{display:inline-block;--_color:var( --os-ui-spinner-color,var( --wp-admin-theme-color,#21759b ) );--_accent:var( --os-ui-spinner-accent,var( --os-ui-fg-on-accent,#fff ) );--_size:var( --os-ui-spinner-size,48px );width:var( --_size );height:var( --_size );color:var( --_color );vertical-align:middle;line-height:0}:host( [ hidden ] ){display:none}:host( [ preset='inline' ] ){--os-ui-spinner-color:currentColor;--os-ui-spinner-size:16px}.root,.root svg{display:block;width:100%;height:100%}.root svg .mark{fill:var( --_accent )}@keyframes os-spinner-spin{to{transform:rotate( 360deg )}}@keyframes os-spinner-scale{0%,100%{transform:scale( 1 )}50%{transform:scale( 1.045 )}}@keyframes os-spinner-opacity{0%,100%{opacity:1}50%{opacity:0.7}}@media ( prefers-reduced-motion:reduce ){.root svg [ style*='animation' ]{animation:none !important}}`,pe=Object.freeze({classic:{sp1:12,sp2:24,sp3:40,a1:28,a2:15,a3:8,gap:4,dir2:1,dir3:-1,pulse:"none",dots:0},comet:{sp1:8,sp2:14,sp3:26,a1:50,a2:28,a3:12,gap:3,dir2:1,dir3:1,pulse:"none",dots:5},orbit:{sp1:10,sp2:10,sp3:32,a1:50,a2:50,a3:8,gap:5,dir2:-1,dir3:-1,pulse:"opacity",dots:3},pulse:{sp1:6,sp2:18,sp3:30,a1:20,a2:12,a3:6,gap:4,dir2:1,dir3:-1,pulse:"both",dots:8},inline:{sp1:8,sp2:8,sp3:8,a1:25,a2:25,a3:25,gap:0,dir2:1,dir3:1,pulse:"none",dots:0}}),y=61.26,w=61.26,fe=58.453,rt='<path d="m8.708 61.26c0 20.802 12.089 38.779 29.619 47.298l-25.069-68.686c-2.916 6.536-4.55 13.769-4.55 21.388z"/><path d="m96.74 58.608c0-6.495-2.333-10.993-4.334-14.494-2.664-4.329-5.161-7.995-5.161-12.324 0-4.831 3.664-9.328 8.825-9.328.233 0 .454.029.681.042-9.35-8.566-21.807-13.796-35.489-13.796-18.36 0-34.513 9.42-43.91 23.688 1.233.037 2.395.063 3.382.063 5.497 0 14.006-.667 14.006-.667 2.833-.167 3.167 3.994.337 4.329 0 0-2.847.335-6.015.501l19.138 56.925 11.501-34.493-8.188-22.434c-2.83-.166-5.511-.501-5.511-.501-2.832-.166-2.5-4.496.332-4.329 0 0 8.679.667 13.843.667 5.496 0 14.006-.667 14.006-.667 2.835-.167 3.168 3.994.337 4.329 0 0-2.853.335-6.015.501l18.992 56.494 5.242-17.517c2.272-7.269 4.001-12.49 4.001-16.989z"/><path d="m62.184 65.857-15.768 45.819c4.708 1.384 9.687 2.141 14.846 2.141 6.12 0 11.989-1.058 17.452-2.979-.141-.225-.269-.464-.374-.724z"/><path d="m107.376 36.046c.226 1.674.354 3.471.354 5.404 0 5.333-.996 11.328-3.996 18.824l-16.053 46.413c15.624-9.111 26.133-26.038 26.133-45.426.001-9.137-2.333-17.729-6.438-25.215z"/>',z=class z extends M{constructor(){super(...arguments),this._paintScheduled=!1}connectedCallback(){super.connectedCallback(),this._schedulePaint()}render(){return R`<div class="root" part="root"></div>`}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){this._syncCssVars();const e=this.shadowRoot?.querySelector(".root");e&&(e.innerHTML=this._buildSvg())}_syncCssVars(){const e=(o,n,r)=>{const s=this.getAttribute(o);s===null?this.style.removeProperty(n):this.style.setProperty(n,r?r(s):s)};e("color","--os-ui-spinner-color"),e("accent","--os-ui-spinner-accent"),e("size","--os-ui-spinner-size",o=>/^-?\d+(\.\d+)?$/.test(o.trim())?`${o}px`:o)}_effectiveConfig(){const e=this.getAttribute("preset")??"classic",o=pe[e]??pe.classic,n=(i,a)=>{const c=this.getAttribute(i);if(c===null)return a;const l=parseFloat(c);return Number.isFinite(l)?l:a},r=(i,a)=>{const c=this.getAttribute(i);if(c===null)return a;const l=c.toLowerCase();return l==="-1"||l==="ccw"||l==="reverse"?-1:1},s=()=>{const i=this.getAttribute("pulse");return i==="scale"||i==="opacity"||i==="both"||i==="none"?i:o.pulse};return{sp1:n("sp1",o.sp1),sp2:n("sp2",o.sp2),sp3:n("sp3",o.sp3),a1:n("a1",o.a1),a2:n("a2",o.a2),a3:n("a3",o.a3),gap:n("gap",o.gap),dir2:r("dir2",o.dir2),dir3:r("dir3",o.dir3),pulse:s(),dots:Math.max(0,Math.floor(n("dots",o.dots)))}}_buildInlineSvg(e){const o=ge(this.getAttribute("label")??"Loading"),n=9,r=(e.sp1/10).toFixed(2);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="${o}"><circle cx="12" cy="12" r="${n}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-opacity="0.22"/><circle cx="12" cy="12" r="${n}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-dasharray="${V(n,e.a1)}" style="transform-origin:12px 12px;animation: os-spinner-spin ${r}s linear infinite"/></svg>`}_buildSvg(){const e=this._effectiveConfig();if(this.getAttribute("preset")==="inline")return this._buildInlineSvg(e);const o=ge(this.getAttribute("label")??"Loading"),n=e.gap*3+14,r=-n,s=122.52+n*2,i=fe+e.gap+2,a=i+e.gap+2,c=a+e.gap+1.5,l=`animation: os-spinner-spin ${(e.sp1/10).toFixed(2)}s linear infinite`,u=`animation: os-spinner-spin ${(e.sp2/10).toFixed(2)}s linear infinite${e.dir2<0?" reverse":""}`,h=`animation: os-spinner-spin ${(e.sp3/10).toFixed(2)}s linear infinite${e.dir3<0?" reverse":""}`,g=(e.sp1*1.8/10).toFixed(1),m=(e.sp1*2.3/10).toFixed(1);let p="";e.pulse==="scale"?p=`animation: os-spinner-scale ${g}s ease-in-out infinite`:e.pulse==="opacity"?p=`animation: os-spinner-opacity ${m}s ease-in-out infinite`:e.pulse==="both"&&(p=`animation: os-spinner-scale ${g}s ease-in-out infinite, os-spinner-opacity ${m}s ease-in-out infinite`);let b="";if(e.dots>0){const f=c+e.gap+1,_=2*Math.PI*f,x=1.6,C=(e.sp1*.65/10).toFixed(2);for(let S=0;S<e.dots;S++){const Zt=-(S/e.dots)*_;b+=`<circle cx="${y}" cy="${w}" r="${f.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="${x}" stroke-dasharray="${x.toFixed(2)} ${(_-x).toFixed(2)}" stroke-dashoffset="${Zt.toFixed(2)}" stroke-linecap="round" stroke-opacity="0.65" style="transform-origin:${y}px ${w}px;animation: os-spinner-spin ${C}s linear infinite"/>`}}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${r} ${r} ${s} ${s}" role="img" aria-label="${o}"><g style="transform-origin:${y}px ${w}px${p?";"+p:""}"><circle cx="${y}" cy="${w}" r="${fe}" fill="currentColor"/><g class="mark">${rt}</g></g><circle cx="${y}" cy="${w}" r="${i.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.6" stroke-opacity="0.2"/><circle cx="${y}" cy="${w}" r="${i.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="2.2" stroke-dasharray="${V(i,e.a1)}" stroke-linecap="round" style="transform-origin:${y}px ${w}px;${l}"/><circle cx="${y}" cy="${w}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.5" stroke-opacity="0.15"/><circle cx="${y}" cy="${w}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.6" stroke-opacity="0.8" stroke-dasharray="${V(a,e.a2)}" stroke-linecap="round" style="transform-origin:${y}px ${w}px;${u}"/><circle cx="${y}" cy="${w}" r="${c.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.4" stroke-opacity="0.12"/><circle cx="${y}" cy="${w}" r="${c.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.0" stroke-opacity="0.6" stroke-dasharray="${V(c,e.a3)}" stroke-linecap="round" style="transform-origin:${y}px ${w}px;${h}"/>`+b+"</svg>"}};z.props=["preset","size","color","accent","sp1","sp2","sp3","a1","a2","a3","gap","dir2","dir3","pulse","dots","label"],z.styles=[nt],z.help=void 0;let B=z;function V(t,e){const o=2*Math.PI*t,n=e/100*o,r=o-n;return`${n.toFixed(2)} ${r.toFixed(2)}`}function ge(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}O("os-spinner",B);const me="X-WP-Nonce";function st(t,e){const o=it();if(!o)return e;const n=at(t);if(!n||!ct(n))return e;const r=e?.headers??(typeof Request<"u"&&t instanceof Request?t.headers:void 0),s=new Headers(r??{});return s.has(me)?e:(s.set(me,o),{...e??{},headers:s})}function it(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function at(t){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof t=="string"?new URL(t,e):t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url,e):null}catch{return null}}function ct(t){return typeof window>"u"||!window.location||t.origin!==window.location.origin?!1:!!(t.pathname.includes("/wp-json/")||t.searchParams.has("rest_route"))}function D(t,e,o={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(t,e,o);const r=st(t,e);return fetch(t,r)}class K extends Error{constructor(e,o){super(e||o.serverMessage||`HTTP ${o.status}`),this.name="RestError",this.status=o.status,this.code=o.code,this.data=o.data,this.serverMessage=o.serverMessage??""}}function be(t){return t instanceof K}function lt(t){const e=typeof t=="object"&&t!==null?t:void 0;return{code:typeof e?.code=="string"?e.code:void 0,data:e?.data,serverMessage:typeof e?.message=="string"?e.message:""}}function dt(t,e,o=""){return new K(o,{status:t,...lt(e)})}async function P(t,e=""){let o=null;try{o=await t.json()}catch{o=null}return dt(t.status,o,e)}const ut="rest_cookie_invalid_nonce",ve=()=>d("Could not reach the site. Check your connection and try again.","desktop-mode");function ke(t){return typeof navigator<"u"&&navigator.onLine===!1?!0:t instanceof TypeError}function ht(t){return be(t)?t.code===ut||t.status===401?"session":t.status>=200&&t.status<300?"unreadable":t.status===404?"gone":t.status>=500?"server":t.status>=400?"refused":"unknown":ke(t)?"offline":"unknown"}function pt(t){return be(t)?t.serverMessage:ke(t)?ve():t instanceof Error?t.message:""}function xe(t,e){const{fallback:o,lead:n}=e,r=ht(t),s=r==="offline"||r==="unreadable"?"warning":"error";let i="",a=!0;switch(r){case"offline":i=ve();break;case"session":i=d("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":i=d("The site sent an unreadable reply. Reload the page to check whether the change went through.","desktop-mode");break;case"gone":case"refused":case"server":{const l=t;l.serverMessage?i=l.serverMessage:r==="gone"?(i=d("It no longer exists. Reload the page to catch up.","desktop-mode"),a=!1):r==="server"?(i=N(d("The server answered with error %d.","desktop-mode"),l.status),a=!1):(i=N(d("The server refused the request (HTTP %d).","desktop-mode"),l.status),a=!1);break}case"unknown":default:i=pt(t);break}let c;return n?c=i?`${n}: ${i}`:o:i?a?c=i:c=`${o} ${i}`:c=o,{message:c,reason:i,kind:r,type:s}}function ye(t,e,o){if(!t)return;const{duration:n,...r}=o,s=xe(e,r),i={message:s.message,type:s.type};n&&(i.duration=n),t(i)}function E(t){const e=window.wp?.os;return typeof e?.showToast!="function"?()=>{}:e.showToast(t)??(()=>{})}function ft(t,e){let o=null,n=Date.now();const r=()=>{n=Date.now(),t()},s=()=>{o===null&&(o=setInterval(r,e))},i=()=>{o!==null&&(clearInterval(o),o=null)},a=()=>{if(document.hidden){i();return}Date.now()-n>=e&&r(),s()};return document.addEventListener("visibilitychange",a),document.hidden||s(),{stop(){i(),document.removeEventListener("visibilitychange",a)}}}function gt(){return window.wp?.os?.config?.adminUrl||"/wp-admin/"}function mt(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}function bt(){return window.wp?.os}function j(){return(window.wpApiSettings?.root??"/wp-json/").replace(/\/$/,"")}function vt(){const t=window.wp?.os;return Number(t?.config?.currentUserId)||0}async function kt(t){const e=await D(`${j()}/wp/v2/posts/${t}`,{method:"DELETE",credentials:"same-origin"},{source:"desktop-mode/drafts"});if(!e.ok)throw await P(e)}const Z="dm-drafts__suggest";function xt(){return window.openStationConfig?.aiAssistant?.providerConfigured===!0}class we extends K{constructor(e){super(e.message,{status:e.status,code:e.code,data:e.data,serverMessage:e.serverMessage}),this.name="SuggestionsError",this.reason=yt(e)}}function yt(t){if(t.code==="openstation_ai_unavailable")return"no-provider";const e=t.data?.reason;return e==="quota"||e==="auth"||e==="unavailable"?e:"other"}async function wt(t){const e=await D(`${j()}/desktop-mode/v1/draft-suggestions`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({post_id:t})},{source:"desktop-mode/drafts"});if(!e.ok)throw new we(await P(e));return e.json()}function _t(){return window.openStationConfig?.aiAssistant?.connectorsUrl??""}async function Ct(t,e){const o=await D(`${j()}/desktop-mode/v1/draft-apply`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({post_id:t,...e})},{source:"desktop-mode/drafts"});if(!o.ok)throw await P(o)}function $t(t,e,o){const n=e.parentElement,r=e.nextElementSibling,s=!!r&&r.classList.contains(Z);if(n?.querySelectorAll(`.${Z}`).forEach(a=>a.remove()),n?.querySelectorAll(".dm-drafts__spark").forEach(a=>a.setAttribute("aria-expanded","false")),s)return;const i=document.createElement("div");i.className=Z,i.id=`dm-drafts-suggest-${t}`,i.setAttribute("role","group"),i.setAttribute("aria-label",d("Writing suggestions")),i.appendChild(At()),e.after(i),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-controls",i.id),St(t,i,e)}function At(){const t=document.createElement("div");t.className="dm-drafts__suggest-loading",t.setAttribute("aria-live","polite");const e=document.createElement("os-spinner");e.setAttribute("preset","inline"),e.setAttribute("size","14"),t.appendChild(e);const o=document.createElement("span");return o.textContent=d("Thinking…"),t.appendChild(o),t}function _e(t,e,o){const n=document.createElement("os-notice");return n.className="dm-drafts__notice",n.setAttribute("tone",t),n.setAttribute("not-dismissible",""),o&&n.setAttribute("icon",o),e!==void 0&&(n.textContent=e),n}function Et(t){const e={"no-provider":d("No AI provider is set up."),quota:d("The AI provider has no credits left or is rate limiting this site. Check its plan and billing, or try again later."),auth:d("The AI provider rejected this site’s API key."),unavailable:d("The AI provider could not be reached. Try again in a moment."),other:d("Could not get suggestions.")},o=_e("error",e[t]),n=_t();if(n&&(t==="no-provider"||t==="auth")){o.append(" ");const r=document.createElement("a");r.href=n,r.textContent=d(t==="auth"?"Check it in Connectors.":"Add one in Connectors."),r.dataset.osWindowTitle=d("Connectors"),o.appendChild(r)}return o}async function St(t,e,o){try{const n=await wt(t);e.isConnected&&Tt(e,n,t,o)}catch(n){e.isConnected&&e.replaceChildren(Et(n instanceof we?n.reason:"other"))}}function q(t,e,o,n,r){const s=document.createElement("os-button");return s.setAttribute("variant","ghost"),s.className=o,s.textContent=e,s.title=d("Apply to the draft"),s.addEventListener("click",()=>{s.hasAttribute("busy")||s.classList.contains("is-applied")||(s.setAttribute("busy",""),Ct(t,n).then(()=>{s.removeAttribute("busy"),s.setAttribute("aria-disabled","true"),s.classList.add("is-applied");const i=document.createElement("span");i.className="dm-drafts__applied-check",i.setAttribute("aria-hidden","true"),i.textContent="✓",s.appendChild(i);const a=document.createElement("span");a.className="screen-reader-text",a.textContent=d("applied"),s.appendChild(a),r?.()}).catch(i=>{s.removeAttribute("busy"),ye(E,i,{fallback:d("Could not apply the suggestion.")})}))}),s}function Nt(t){const e=t.missing??[],o=e.length===0,n=_e(o?"success":"warning",void 0,o?"dashicons-yes-alt":"dashicons-info-outline");if(n.classList.add("dm-drafts__readiness"),t.summary){const r=document.createElement("div");r.className="dm-drafts__readiness-summary",r.textContent=t.summary,n.appendChild(r)}if(e.length>0){const r=document.createElement("ul");r.className="dm-drafts__readiness-missing";for(const s of e){const i=document.createElement("li");i.textContent=s,r.appendChild(i)}n.appendChild(r)}return n}function Tt(t,e,o,n){t.replaceChildren(),e.readiness&&(e.readiness.summary||e.readiness.missing?.length)&&t.appendChild(Nt(e.readiness));const r=document.createElement("div");r.className="dm-drafts__suggest-hint",r.textContent=d("Tap a suggestion to apply it to the draft."),t.appendChild(r);const s=i=>{const a=document.createElement("div");a.className="dm-drafts__suggest-group";const c=document.createElement("div");return c.className="dm-drafts__suggest-label",c.textContent=i,a.appendChild(c),t.appendChild(a),a};if(e.titles&&e.titles.length>0){const i=s(d("Title ideas"));for(const a of e.titles)i.appendChild(q(o,a,"dm-drafts__suggest-item",{title:a},()=>{const c=n.querySelector(".dm-drafts__name");c&&(c.textContent=a),E({message:d("Title updated.")})}))}if(e.excerpt&&s(d("Excerpt")).appendChild(q(o,e.excerpt,"dm-drafts__suggest-item",{excerpt:e.excerpt},()=>E({message:d("Excerpt updated.")}))),e.tags&&e.tags.length>0){const i=s(d("Tags")),a=document.createElement("div");a.className="dm-drafts__suggest-tags";for(const c of e.tags)a.appendChild(q(o,c,"dm-drafts__suggest-tag",{tags:[c]},()=>E({message:d("Tag added.")})));i.appendChild(a)}if(e.categories&&e.categories.length>0){const i=s(d("Categories")),a=document.createElement("div");a.className="dm-drafts__suggest-tags";for(const c of e.categories)a.appendChild(q(o,c,"dm-drafts__suggest-tag",{categories:[c]},()=>E({message:d("Category added.")})));i.appendChild(a)}}const Mt="desktop-mode/drafts",It=6e4,Lt=8;function zt(t){return`${gt()}post.php?post=${t}&action=edit`}function Rt(t){const e=t.endsWith("Z")?t:t+"Z",o=Math.floor((Date.now()-new Date(e).getTime())/1e3);return o<60?d("just now"):o<3600?N(d("%dm ago"),Math.floor(o/60)):o<86400?N(d("%dh ago"),Math.floor(o/3600)):N(d("%dd ago"),Math.floor(o/86400))}async function Ht(){const t=vt(),e=await D(j()+`/wp/v2/posts?status=draft&orderby=modified&order=desc&per_page=${Lt}&context=edit&_fields=id,title,modified_gmt`+(t>0?`&author=${t}`:""),{credentials:"same-origin"},{source:"desktop-mode/drafts",silent:!0});if(!e.ok)throw await P(e);return e.json()}function Ce(t){const e=t.title?.rendered?mt(t.title.rendered).trim():"";return e||(t.title?.raw??"").trim()||d("(no title)")}function $e(t,e,o){const n=document.createElement("os-button");n.className=t,n.setAttribute("variant","ghost"),n.title=o;const r=document.createElement("span");r.className=`dashicons ${e}`,r.setAttribute("aria-hidden","true"),n.appendChild(r);const s=document.createElement("span");return s.className="screen-reader-text",s.textContent=o,n.appendChild(s),n}function Ft(t,e,o,n){t.innerHTML="";const r=document.createElement("div");r.className="dm-drafts__header";const s=document.createElement("span");s.className="dm-drafts__title",s.textContent=d("Drafts");const i=document.createElement("span");if(i.className="dm-drafts__badge",e&&e.length>0&&(i.textContent=String(e.length),i.classList.add("dm-drafts__badge--visible")),r.appendChild(s),r.appendChild(i),t.appendChild(r),o){const c=document.createElement("div");c.className="dm-drafts__empty",c.textContent=o,t.appendChild(c);return}if(!e||e.length===0){const c=document.createElement("div");c.className="dm-drafts__empty",c.textContent=d("No drafts — all caught up."),t.appendChild(c);return}const a=document.createElement("div");a.className="dm-drafts__list";for(const c of e){const l=document.createElement("div");l.className="dm-drafts__row",l.dataset.draftId=String(c.id);const u=document.createElement("a");u.className="dm-drafts__link",u.href=zt(c.id);const h=Ce(c),g=document.createElement("span");g.className="dm-drafts__name",g.textContent=h;const m=document.createElement("span");m.className="dm-drafts__time",m.textContent=Rt(c.modified_gmt),u.appendChild(g),u.appendChild(m),u.dataset.osWindowTitle=h;const p=$e("dm-drafts__trash","dashicons-trash",d("Move to Trash"));if(p.addEventListener("click",b=>{b.preventDefault(),b.stopPropagation(),Vt(c,l,n)}),l.appendChild(u),xt()){const b=$e("dm-drafts__spark","dashicons-lightbulb",d("Suggest title, excerpt & tags"));b.setAttribute("aria-expanded","false"),b.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),$t(c.id,l,b)}),l.appendChild(b)}l.appendChild(p),a.appendChild(l)}t.appendChild(a)}async function Vt(t,e,o){const n=bt();if(!(!n?.confirm||!await n.confirm({title:d("Move to Trash?"),message:N(d("“%s” will be moved to the Trash. You can restore it later."),Ce(t)),confirmLabel:d("Move to Trash"),danger:!0}))){e.classList.add("is-trashing");try{await kt(t.id),E({message:d("Draft moved to Trash.")}),o()}catch(s){e.classList.remove("is-trashing"),ye(E,s,{fallback:d("Could not move the draft to Trash.")})}}}function Dt(t){const e=t.ownerDocument.activeElement;if(!(e instanceof HTMLElement)||!t.contains(e))return null;const o=e.closest(".dm-drafts__row");if(!o?.dataset.draftId)return null;const n=Array.from(t.querySelectorAll(".dm-drafts__row")),r=["dm-drafts__trash","dm-drafts__spark"].find(s=>e.classList.contains(s));return{id:Number(o.dataset.draftId),control:r??"dm-drafts__link",index:n.indexOf(o)}}function Pt(t,e){const o=t.ownerDocument,n=o.activeElement;if(!e||n&&n!==o.body)return;const r=Array.from(t.querySelectorAll(".dm-drafts__row")),s=r.find(a=>Number(a.dataset.draftId)===e.id)??r[Math.min(e.index,r.length-1)];(s?.querySelector(`.${e.control}`)??s?.querySelector(".dm-drafts__link"))?.focus({preventScroll:!0})}function Ae(t,e,o,n){const r=Dt(t);Ft(t,e,o,n),Pt(t,r)}const jt=async(t,e)=>{let o=!1;const n=async()=>{if(!o&&!t.querySelector(`.${Z}`))try{const a=await Ht();o||Ae(t,a,null,n)}catch(a){o||Ae(t,null,xe(a,{fallback:d("Could not load drafts.")}).message,n)}};await n();const r=ft(n,It);let s=null;const i=()=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{s=null,n()},600)};return document.addEventListener("os-window-closed",i),document.addEventListener("os-window-blurred",i),()=>{o=!0,r.stop(),s!==null&&clearTimeout(s),document.removeEventListener("os-window-closed",i),document.removeEventListener("os-window-blurred",i)}},Q=window;Q.openStationWidgets=Q.openStationWidgets??{},Q.openStationWidgets[Mt]=jt})(); | |