PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.11
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.11
1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 All 35 releases
← All changes | assets/js/widget-notes.min.js +7 -7 1.1.7 → 1.1.11 View file →
@@ -1,20 +1,20 @@
1 -(function(){"use strict";function M(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function le(o){return!!o&&o.__wpdHtml===!0}const ce="$$wpd$$",x=/\$\$wpd\$\$(\d+)\$\$/g,de="$$wpd-node$$",ue=/^\$\$wpd-node\$\$(\d+)\$\$$/,he=new Set(["style","script","textarea","title"]);function pe(o){let e="",t=!1,n=null,s=!1,r=null,a="",c=!1;for(let l=0;l<o.length;l++){const i=o[l];e+=i;for(let d=0;d<i.length;d++){const h=i[d];if(s){i.startsWith("-->",d)&&(s=!1,d+=2);continue}if(r!==null){h==="<"&&i[d+1]==="/"&&i.slice(d+2,d+2+r.length).toLowerCase()===r&&(d+=1+r.length,r=null,t=!0,c=!1,a="");continue}if(n!==null){h===n&&(n=null);continue}if(t){h==='"'||h==="'"?(n=h,c=!1):h===">"?(t=!1,c=!1,he.has(a)&&(r=a),a=""):c&&(/[a-zA-Z0-9-]/.test(h)?a+=h.toLowerCase():c=!1);continue}if(i.startsWith("<!--",d)){s=!0,d+=3;continue}const p=i[d+1]??"";h==="<"&&/[a-zA-Z/!]/.test(p)&&(t=!0,a="",c=/[a-zA-Z]/.test(p))}l<o.length-1&&(e+=t||s||r!==null?`${ce}${l}$$`:`<!--${de}${l}$$-->`)}return e}const G=new WeakMap;function Y(o){const e=G.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=pe(o);const n=[],s=(c,l)=>{if(c.nodeType===Node.ELEMENT_NODE){const h=c;for(const p of Array.from(h.attributes)){const b=p.name,m=p.value,v=b[0];if(x.test(m))if(x.lastIndex=0,v==="@"){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"event",name:b.slice(1),valueIndex:g?Number(g[1]):0}),h.removeAttribute(b)}else if(v==="."){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"prop",name:b.slice(1),valueIndex:g?Number(g[1]):0}),h.removeAttribute(b)}else if(v==="?"){const g=x.exec(m);x.lastIndex=0,n.push({path:l,kind:"bool",name:b.slice(1),valueIndex:g?Number(g[1]):0}),h.removeAttribute(b)}else{const g=[],y=[];let w=0,k;for(x.lastIndex=0;(k=x.exec(m))!==null;)g.push(m.slice(w,k.index)),y.push(Number(k[1])),w=k.index+k[0].length;g.push(m.slice(w)),n.push({path:l,kind:"attr",name:b,template:g,valueIndices:y}),h.setAttribute(b,"")}}}const i=Array.from(c.childNodes);let d=0;for(let h=0;h<i.length;h++){const p=i[h],b=h+d;if(p.nodeType===Node.COMMENT_NODE){const m=ue.exec(p.data);if(m){const v=document.createTextNode("");p.parentNode.replaceChild(v,p),n.push({path:[...l,b],kind:"node",valueIndex:Number(m[1])})}continue}if(p.nodeType===Node.TEXT_NODE){const m=p.textContent||"";if(!x.test(m)){x.lastIndex=0;continue}x.lastIndex=0;const v=p.parentNode;let g=0,y;const w=[],k=[];for(x.lastIndex=0;(y=x.exec(m))!==null;){y.index>g&&w.push(document.createTextNode(m.slice(g,y.index)));const T=document.createTextNode("");w.push(T),k.push({path:[...l,b+w.length-1],kind:"node",valueIndex:Number(y[1])}),g=y.index+y[0].length}g<m.length&&w.push(document.createTextNode(m.slice(g)));for(const T of w)v.insertBefore(T,p);v.removeChild(p),d+=w.length-1,n.push(...k)}else s(p,[...l,b])}};s(t.content,[]);const a={template:t,buildParts:c=>{const l=[];for(const i of n){let d=c;for(const h of i.path)d=d.childNodes[h];i.kind==="node"?l.push({kind:"node",valueIndex:i.valueIndex,child:{anchor:d,state:null}}):i.kind==="attr"?l.push({kind:"attr",element:d,name:i.name,template:i.template,valueIndices:i.valueIndices}):i.kind==="event"?l.push({kind:"event",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="prop"?l.push({kind:"prop",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="bool"&&l.push({kind:"bool",valueIndex:i.valueIndex,element:d,name:i.name})}return l}};return G.set(o,a),a}const Z=new WeakMap;function fe(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function me(o,e){const t=Z.get(e);if(t&&t.strings===o.strings&&fe(t,e)){z(t.parts,o.values);return}const n=Y(o.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(s),z(r,o.values),Z.set(e,{strings:o.strings,parts:r,nodes:a})}function z(o,e){for(const t of o)if(t.kind==="node")P(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let n=t.template[0];for(let s=0;s<t.valueIndices.length;s++)n+=J(e[t.valueIndices[s]]),n+=t.template[s+1];n!==t.last&&(t.last=n,n===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,n))}else if(t.kind==="event"){const n=e[t.valueIndex];n!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),n&&t.element.addEventListener(t.name,n),t.current=n)}else if(t.kind==="prop"){const n=e[t.valueIndex];n!==t.last&&(t.last=n,t.element[t.name]=n)}else if(t.kind==="bool"){const n=!!e[t.valueIndex];n!==t.last&&(t.last=n,n?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function P(o,e){if(e==null||e===!1){o.state&&(A(o.state),o.state=null);return}if(Array.isArray(e)){we(o,e);return}if(le(e)){ve(o,e);return}if(e instanceof Node){ge(o,e);return}be(o,J(e))}function ge(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&A(t),I(o,[e]),o.state={shape:"node",node:e})}function be(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&A(t);const n=document.createTextNode(e);I(o,[n]),o.state={shape:"text",node:n,text:e}}function ve(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){z(t.parts,e.values);return}t&&A(t);const n=Y(e.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);I(o,[s]),z(r,e.values),o.state={shape:"template",strings:e.strings,parts:r,nodes:a}}function we(o,e){const t=o.state;if(t?.shape==="array"){const s=Math.min(t.entries.length,e.length);for(let r=0;r<s;r++)P(t.entries[r],e[r]);if(e.length<t.entries.length){for(let r=e.length;r<t.entries.length;r++){const a=t.entries[r];a.state&&A(a.state),a.anchor.remove()}t.entries.length=e.length}else for(let r=t.entries.length;r<e.length;r++){const a=document.createTextNode("");I(o,[a]);const c={anchor:a,state:null};P(c,e[r]),t.entries.push(c)}return}t&&A(t);const n=[];for(const s of e){const r=document.createTextNode("");I(o,[r]);const a={anchor:r,state:null};P(a,s),n.push(a)}o.state={shape:"array",entries:n}}function I(o,e){const t=o.anchor.parentNode;if(t)for(const n of e)t.insertBefore(n,o.anchor)}function A(o){if(o.shape==="text"){o.node.remove();return}if(o.shape==="template"){for(const e of o.parts)e.kind==="node"&&e.child.state&&(A(e.child.state),e.child.state=null);for(const e of o.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(o.shape==="node"){o.node.parentNode&&o.node.parentNode.removeChild(o.node);return}for(const e of o.entries)e.state&&A(e.state),e.anchor.remove()}function J(o){return o==null||o===!1?"":String(o)}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(Q)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,n){if(t===n)return;const s=_e(e);this._propValues[s]=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(s=>String(s).trim()).filter(s=>s!=="");this.className=n.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const t of e.props){if(Object.getOwnPropertyDescriptor(this,t))continue;const n=Q(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(n),set:s=>{let r;s==null||s===!1?r=null:s===!0?r="":r=String(s),this._propValues[t]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&me(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const s=document.createElement("style");s.textContent=n.cssText,this.shadowRoot.appendChild(s)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!$._lightStylesAdopted.has(e)){$._lightStylesAdopted.add(e);for(const t of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=t.cssText,document.head.appendChild(n)}}}};$.props=[],$.styles=[],$.shadow=!0,$._lightStylesAdopted=new WeakSet;let O=$;function xe(o,e){customElements.get(o)||customElements.define(o,e)}function Q(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function _e(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const ye=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function _(o,...e){let t=o[0];for(let n=1;n<o.length;n++){const s=e[n-1];if(typeof s=="string"||typeof s=="number")t+=String(s);else if(s&&s.__wpdCss)t+=s.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof s);t+=o[n]}if(ye){const n=new CSSStyleSheet;return n.replaceSync(t),{__wpdCss:!0,sheet:n,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function ke(o){const e=[],t=[];let n=null,s=o.parentElement;for(;s&&!(s===document.body||s===document.documentElement);){const a=s.id||"";if(a.startsWith("wp-window-")){n=a.slice(10);break}if(s.tagName.toLowerCase()==="os-tabpanel"){const c=s.getAttribute("for");c&&t.unshift(c)}s=s.parentElement}n&&e.push(H(n));for(const a of t)e.push("tab-"+H(a));const r=o.getAttribute("label");return r&&e.push(H(r)),e.length===0?"os-unnamed":"os-"+e.filter(a=>a!=="").join("-")}function H(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ne(o){if(o.id)return o.id;const e=ke(o);return o.id=e,e}const ee=_`: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 ) )}`,Ee=_` .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%}}`,Ce=_` .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%}}`,Ae=_` .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}}`,$e=_` .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}}`,Se=_` .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}}`,Te=_` .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%}}`,Ie=_` .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}}`,te=_` 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}}`,Re=_` 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}}`,Le=_` @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}}`;_` ${ee} ${Ee} ${Ce} ${Ae} ${$e} ${Se} ${Te} ${Ie} ${te} ${Re} ${Le} `;const ze=_` ${ee} ${te}:host{--_field-size:var( --os-ui-field-font-size,13px );--_field-radius:var( --os-ui-field-radius,6px );display:flex;flex-direction:column;gap:4px;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-textarea__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}textarea{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:var( --_field-radius );font:inherit;font-size:var( --_field-size );line-height:1.45;color:var( --os-ui-fg,#1d2327 );resize:vertical}textarea:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}textarea[ aria-invalid='true' ],textarea[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}textarea[ aria-invalid='true' ]:focus,textarea[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}:host( [ auto-grow ] ) textarea{resize:none;overflow:hidden}`,R=class R extends O{constructor(){super(...arguments),this._textareaEl=null}connectedCallback(){super.connectedCallback(),Ne(this)}render(){const e=this._attr("label")||"",t=this._attr("value")??"",n=this._attr("placeholder")||"",s=this._boolAttr("disabled"),r=this._boolAttr("readonly"),a=this._attr("aria-label")||e,c=this._attr("name")||"",l=Number(this._attr("rows"))||3,i=this._attr("maxlength"),d=this._attr("minlength"),h=this._boolAttr("invalid"),b=`${this.id||"os-unnamed"}__field`;return M`
2 - ${e?M`<label class="os-textarea__label" for=${b}>${e}</label>`:M``}
1 +(function(){"use strict";function O(t,...e){return{__wpdHtml:!0,strings:t,values:e}}function be(t){return!!t&&t.__wpdHtml===!0}const ve="$$wpd$$",x=/\$\$wpd\$\$(\d+)\$\$/g,we="$$wpd-node$$",xe=/^\$\$wpd-node\$\$(\d+)\$\$$/,_e=new Set(["style","script","textarea","title"]);function ye(t){let e="",o=!1,n=null,s=!1,r=null,a="",l=!1;for(let c=0;c<t.length;c++){const i=t[c];e+=i;for(let d=0;d<i.length;d++){const u=i[d];if(s){i.startsWith("-->",d)&&(s=!1,d+=2);continue}if(r!==null){u==="<"&&i[d+1]==="/"&&i.slice(d+2,d+2+r.length).toLowerCase()===r&&(d+=1+r.length,r=null,o=!0,l=!1,a="");continue}if(n!==null){u===n&&(n=null);continue}if(o){u==='"'||u==="'"?(n=u,l=!1):u===">"?(o=!1,l=!1,_e.has(a)&&(r=a),a=""):l&&(/[a-zA-Z0-9-]/.test(u)?a+=u.toLowerCase():l=!1);continue}if(i.startsWith("<!--",d)){s=!0,d+=3;continue}const h=i[d+1]??"";u==="<"&&/[a-zA-Z/!]/.test(h)&&(o=!0,a="",l=/[a-zA-Z]/.test(h))}c<t.length-1&&(e+=o||s||r!==null?`${ve}${c}$$`:`<!--${we}${c}$$-->`)}return e}const G=new WeakMap;function Z(t){const e=G.get(t);if(e)return e;const o=document.createElement("template");o.innerHTML=ye(t);const n=[],s=(l,c)=>{if(l.nodeType===Node.ELEMENT_NODE){const u=l;for(const h of Array.from(u.attributes)){const b=h.name,m=h.value,v=b[0];if(x.test(m))if(x.lastIndex=0,v==="@"){const g=x.exec(m);x.lastIndex=0,n.push({path:c,kind:"event",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else if(v==="."){const g=x.exec(m);x.lastIndex=0,n.push({path:c,kind:"prop",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else if(v==="?"){const g=x.exec(m);x.lastIndex=0,n.push({path:c,kind:"bool",name:b.slice(1),valueIndex:g?Number(g[1]):0}),u.removeAttribute(b)}else{const g=[],k=[];let w=0,E;for(x.lastIndex=0;(E=x.exec(m))!==null;)g.push(m.slice(w,E.index)),k.push(Number(E[1])),w=E.index+E[0].length;g.push(m.slice(w)),n.push({path:c,kind:"attr",name:b,template:g,valueIndices:k}),u.setAttribute(b,"")}}}const i=Array.from(l.childNodes);let d=0;for(let u=0;u<i.length;u++){const h=i[u],b=u+d;if(h.nodeType===Node.COMMENT_NODE){const m=xe.exec(h.data);if(m){const v=document.createTextNode("");h.parentNode.replaceChild(v,h),n.push({path:[...c,b],kind:"node",valueIndex:Number(m[1])})}continue}if(h.nodeType===Node.TEXT_NODE){const m=h.textContent||"";if(!x.test(m)){x.lastIndex=0;continue}x.lastIndex=0;const v=h.parentNode;let g=0,k;const w=[],E=[];for(x.lastIndex=0;(k=x.exec(m))!==null;){k.index>g&&w.push(document.createTextNode(m.slice(g,k.index)));const T=document.createTextNode("");w.push(T),E.push({path:[...c,b+w.length-1],kind:"node",valueIndex:Number(k[1])}),g=k.index+k[0].length}g<m.length&&w.push(document.createTextNode(m.slice(g)));for(const T of w)v.insertBefore(T,h);v.removeChild(h),d+=w.length-1,n.push(...E)}else s(h,[...c,b])}};s(o.content,[]);const a={template:o,buildParts:l=>{const c=[];for(const i of n){let d=l;for(const u of i.path)d=d.childNodes[u];i.kind==="node"?c.push({kind:"node",valueIndex:i.valueIndex,child:{anchor:d,state:null}}):i.kind==="attr"?c.push({kind:"attr",element:d,name:i.name,template:i.template,valueIndices:i.valueIndices}):i.kind==="event"?c.push({kind:"event",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="prop"?c.push({kind:"prop",valueIndex:i.valueIndex,element:d,name:i.name}):i.kind==="bool"&&c.push({kind:"bool",valueIndex:i.valueIndex,element:d,name:i.name})}return c}};return G.set(t,a),a}const J=new WeakMap;function ke(t,e){for(const o of t.nodes)if(o.parentNode!==e)return!1;return!0}function Ee(t,e){const o=J.get(e);if(o&&o.strings===t.strings&&ke(o,e)){M(o.parts,t.values);return}const n=Z(t.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(s),M(r,t.values),J.set(e,{strings:t.strings,parts:r,nodes:a})}function M(t,e){for(const o of t)if(o.kind==="node")P(o.child,e[o.valueIndex]);else if(o.kind==="attr"){let n=o.template[0];for(let s=0;s<o.valueIndices.length;s++)n+=Q(e[o.valueIndices[s]]),n+=o.template[s+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 P(t,e){if(e==null||e===!1){t.state&&(A(t.state),t.state=null);return}if(Array.isArray(e)){$e(t,e);return}if(be(e)){Ae(t,e);return}if(e instanceof Node){Ne(t,e);return}Ce(t,Q(e))}function Ne(t,e){const o=t.state;o?.shape==="node"&&o.node===e||(o&&A(o),R(t,[e]),t.state={shape:"node",node:e})}function Ce(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);R(t,[n]),t.state={shape:"text",node:n,text:e}}function Ae(t,e){const o=t.state;if(o?.shape==="template"&&o.strings===e.strings){M(o.parts,e.values);return}o&&A(o);const n=Z(e.strings),s=n.template.content.cloneNode(!0),r=n.buildParts(s),a=Array.from(s.childNodes);R(t,[s]),M(r,e.values),t.state={shape:"template",strings:e.strings,parts:r,nodes:a}}function $e(t,e){const o=t.state;if(o?.shape==="array"){const s=Math.min(o.entries.length,e.length);for(let r=0;r<s;r++)P(o.entries[r],e[r]);if(e.length<o.entries.length){for(let r=e.length;r<o.entries.length;r++){const a=o.entries[r];a.state&&A(a.state),a.anchor.remove()}o.entries.length=e.length}else for(let r=o.entries.length;r<e.length;r++){const a=document.createTextNode("");R(t,[a]);const l={anchor:a,state:null};P(l,e[r]),o.entries.push(l)}return}o&&A(o);const n=[];for(const s of e){const r=document.createTextNode("");R(t,[r]);const a={anchor:r,state:null};P(a,s),n.push(a)}t.state={shape:"array",entries:n}}function R(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 Q(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(ee)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,o,n){if(o===n)return;const s=Te(e);this._propValues[s]=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(s=>String(s).trim()).filter(s=>s!=="");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=ee(o);Object.defineProperty(this,o,{get:()=>o in this._propValues?this._propValues[o]:this.getAttribute(n),set:s=>{let r;s==null||s===!1?r=null:s===!0?r="":r=String(s),this._propValues[o]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Ee(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 s=document.createElement("style");s.textContent=n.cssText,this.shadowRoot.appendChild(s)}}}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 D=$;function Se(t,e){customElements.get(t)||customElements.define(t,e)}function ee(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Te(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}const Re=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function y(t,...e){let o=t[0];for(let n=1;n<t.length;n++){const s=e[n-1];if(typeof s=="string"||typeof s=="number")o+=String(s);else if(s&&s.__wpdCss)o+=s.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof s);o+=t[n]}if(Re){const n=new CSSStyleSheet;return n.replaceSync(o),{__wpdCss:!0,sheet:n,cssText:o}}return{__wpdCss:!0,sheet:null,cssText:o}}function Ie(t){const e=[],o=[];let n=null,s=t.parentElement;for(;s&&!(s===document.body||s===document.documentElement);){const a=s.id||"";if(a.startsWith("wp-window-")){n=a.slice(10);break}if(s.tagName.toLowerCase()==="os-tabpanel"){const l=s.getAttribute("for");l&&o.unshift(l)}s=s.parentElement}n&&e.push(F(n));for(const a of o)e.push("tab-"+F(a));const r=t.getAttribute("label");return r&&e.push(F(r)),e.length===0?"os-unnamed":"os-"+e.filter(a=>a!=="").join("-")}function F(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Le(t){if(t.id)return t.id;const e=Ie(t);return t.id=e,e}const te=y`: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 ) )}`,Me=y` .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%}}`,Pe=y` .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%}}`,ze=y` .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}}`,Oe=y` .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}}`,De=y` .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}}`,Fe=y` .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%}}`,He=y` .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=y` 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=y` 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}}`,We=y` @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}}`;y` ${te} ${Me} ${Pe} ${ze} ${Oe} ${De} ${Fe} ${He} ${oe} ${Ue} ${We} `;const qe=y` ${te} ${oe}:host{--_field-size:var( --os-ui-field-font-size,13px );--_field-radius:var( --os-ui-field-radius,6px );display:flex;flex-direction:column;gap:4px;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-textarea__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}textarea{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:8px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:var( --_field-radius );font:inherit;font-size:var( --_field-size );line-height:1.45;color:var( --os-ui-fg,#1d2327 );resize:vertical}textarea:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}textarea[ aria-invalid='true' ],textarea[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}textarea[ aria-invalid='true' ]:focus,textarea[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}:host( [ auto-grow ] ) textarea{resize:none;overflow:hidden}`,I=class I extends D{constructor(){super(...arguments),this._textareaEl=null}connectedCallback(){super.connectedCallback(),Le(this)}render(){const e=this._attr("label")||"",o=this._attr("value")??"",n=this._attr("placeholder")||"",s=this._boolAttr("disabled"),r=this._boolAttr("readonly"),a=this._attr("aria-label")||e,l=this._attr("name")||"",c=Number(this._attr("rows"))||3,i=this._attr("maxlength"),d=this._attr("minlength"),u=this._boolAttr("invalid"),b=`${this.id||"os-unnamed"}__field`;return O`
2 + ${e?O`<label class="os-textarea__label" for=${b}>${e}</label>`:O``}
3 3 <textarea
4 4 id=${b}
5 5 part="textarea"
6 - .value=${t}
6 + .value=${o}
7 7 placeholder=${n}
8 8 ?disabled=${s}
9 9 ?readonly=${r}
10 - rows=${l}
10 + rows=${c}
11 11 maxlength=${i??""}
12 12 minlength=${d??""}
13 - name=${c}
14 - aria-invalid=${h?"true":"false"}
13 + name=${l}
14 + aria-invalid=${u?"true":"false"}
15 15 aria-label=${a||""}
16 16 @input=${m=>this._onInput(m)}
17 17 @change=${m=>this._onChange(m)}
18 18 @keydown=${m=>this._onKeyDown(m)}
19 19 ></textarea>
20 - `}_attr(e){return this.getAttribute(e)}_boolAttr(e){return this.getAttribute(e)!==null}_onInput(e){const t=e.target;this._textareaEl=t,this.setAttribute("value",t.value),this.emit("os-input-change",{value:t.value}),this._boolAttr("auto-grow")&&this._autosize(t)}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(this._boolAttr("submit-on-enter")&&e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){e.preventDefault();const t=e.target;this.emit("os-submit",{value:t.value})}}_autosize(e){const t=Number(this._attr("max-rows"))||8,n=window.getComputedStyle(e),s=parseFloat(n.fontSize)||13,r=n.lineHeight,a=r==="normal"?s*1.45:parseFloat(r)||s*1.45,c=parseFloat(n.paddingTop)||0,l=parseFloat(n.paddingBottom)||0,i=a*t+c+l;e.style.height="auto";const d=Math.min(e.scrollHeight,i);e.style.height=`${d}px`}refreshAutosize(){this._textareaEl&&this._boolAttr("auto-grow")&&this._autosize(this._textareaEl)}focusInput(){(this.shadowRoot??this).querySelector("textarea")?.focus()}clear(){this.setAttribute("value","");const t=(this.shadowRoot??this).querySelector("textarea");t&&(t.value="",this._boolAttr("auto-grow")&&this._autosize(t))}};R.props=["label","value","placeholder","disabled","readonly","ariaLabel","name","rows","maxlength","minlength","invalid","autoGrow","maxRows","submitOnEnter"],R.styles=[ze],R.help=void 0;let U=R;xe("os-textarea",U);const Pe="desktop-mode";function De(){return window.wp?.i18n}function E(o,e=Pe){return De()?.__(o,e)??o}const S=["butter","blush","sky","mint","lilac","peach"];function W(o){return S.includes(o)?o:S[0]}function X(o){const e=S.indexOf(W(o));return S[(e+1)%S.length]}function Me(o){let e=2166136261;for(let n=0;n<o.length;n++)e^=o.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e>>>1||1}const Oe=56,He=52;function Ue(o){return`${o.replace(/\/$/,"")}/assets/images/pushpin.svg`}function We(o){const e=document.createElement("img");return e.src=Ue(o),e.alt="",e.width=Oe,e.height=He,e.draggable=!1,e.className="os-pinned-note__pin-img",e}const oe="X-WP-Nonce";function Xe(o,e){const t=qe();if(!t)return e;const n=Ke(o);if(!n||!Fe(n))return e;const s=e?.headers??(typeof Request<"u"&&o instanceof Request?o.headers:void 0),r=new Headers(s??{});return r.has(oe)?e:(r.set(oe,t),{...e??{},headers:r})}function qe(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function Ke(o){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof o=="string"?new URL(o,e):o instanceof URL?o:typeof Request<"u"&&o instanceof Request?new URL(o.url,e):null}catch{return null}}function Fe(o){return typeof window>"u"||!window.location||o.origin!==window.location.origin?!1:!!(o.pathname.includes("/wp-json/")||o.searchParams.has("rest_route"))}function je(o,e,t={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(o,e,t);const s=Xe(o,e);return fetch(o,s)}let q=null;function Be(o){q=o}function Ve(){if(!q)throw new Error("[openstation] notes REST client called before installNotesRestDeps().");return q}function Ge(o){const e=window.openStationConfig;return typeof e?.restNonce=="string"&&e.restNonce?e.restNonce:o}class Ye extends Error{constructor(e){super("Note was changed by another session."),this.status=409,this.name="NotesConflictError",this.current=e}}async function Ze(o,e){const{baseUrl:t,nonce:n}=Ve(),s=t,r=new Headers(e.headers??{});r.set("X-WP-Nonce",Ge(n)),e.body&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const a=await je(s,{...e,headers:r,credentials:"same-origin"},{source:"desktop-mode/notes"}),c=await a.text();let l=null;if(c)try{l=JSON.parse(c)}catch{l=null}if(!a.ok){if(a.status===409){const d=l?.data?.current;throw new Ye(d??null)}const i=l;throw new Error(`[openstation] notes REST ${a.status}: ${i?.code??""} ${i?.message??""}`.trim())}if(l===null)throw new Error(`[openstation] notes REST ${a.status}: empty or unparseable body.`);return l}function Je(o){return Ze("",{method:"POST",body:JSON.stringify(o)})}const Qe="note-draft",et="os-note-created",tt="desktop-mode/notes";function ot(){return window.openStationConfig??{}}function nt(){return window.wp?.os?.dragManager??null}const st=(o,e)=>{let t=!1;const n=ot(),s=!!n.notesUrl;s&&Be({baseUrl:n.notesUrl,nonce:n.restNonce??""});let r=W(e.storage.get("color")??S[0]);const a=!1;let c="";const l=document.createElement("div");l.className="dm-notes-pad";const i=document.createElement("div");i.className="dm-notes-pad__stack";const d=document.createElement("div");d.className="dm-notes-pad__under dm-notes-pad__under--2";const h=document.createElement("div");h.className="dm-notes-pad__under dm-notes-pad__under--1";const p=document.createElement("div");p.className="dm-notes-pad__sheet";const b=document.createElement("div");b.className="dm-notes-pad__peel",b.setAttribute("aria-hidden","true");const m=document.createElement("span");m.className="dm-notes-pad__peel-hint",m.textContent=E("Drag to pin","desktop-mode"),b.appendChild(m);const v=document.createElement("os-textarea");v.className="dm-notes-pad__editor",v.setAttribute("aria-label",E("New note","desktop-mode")),v.setAttribute("placeholder",E("Write a note…","desktop-mode")),v.setAttribute("rows","5"),v.setAttribute("auto-grow",""),v.setAttribute("max-rows","8");const g=document.createElement("button");g.type="button",g.className="dm-notes-pad__corner",p.append(b,v,g),i.append(d,h,p);const y=document.createElement("div");y.className="dm-notes-pad__footer";const w=document.createElement("div");w.className="dm-notes-pad__swatches",w.setAttribute("role","radiogroup"),w.setAttribute("aria-label",E("Paper color","desktop-mode"));const k=new Map;for(const f of S){const u=document.createElement("button");u.type="button",u.className="dm-notes-pad__swatch",u.dataset.noteColor=f,u.setAttribute("role","radio"),u.setAttribute("aria-label",f),u.addEventListener("click",()=>ne(f)),k.set(f,u),w.appendChild(u)}y.append(w),l.append(i,y),o.appendChild(l);function T(){const f=X(r),u=X(f);p.dataset.noteColor=r,i.dataset.noteColor=r,h.dataset.noteColor=f,d.dataset.noteColor=u,g.dataset.noteColor=f,g.setAttribute("aria-label",`${E("Next paper color","desktop-mode")}: ${f}`);for(const[N,C]of k)C.setAttribute("aria-checked",N===r?"true":"false"),C.classList.toggle("is-selected",N===r)}function ne(f){r=W(f),e.storage.set("color",r),T()}const se=()=>ne(X(r));g.addEventListener("click",se),T();const rt=f=>{c=f.detail.value};v.addEventListener("os-input-change",rt);const at=f=>{const u=f;u.key==="Enter"&&(u.ctrlKey||u.metaKey)&&(u.preventDefault(),lt()),u.stopPropagation()};["keydown","keypress","keyup"].forEach(f=>v.addEventListener(f,u=>{f==="keydown"?at(u):u.stopPropagation()}));const re=()=>{c="",v.setAttribute("value","")},F=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||p.animate?.([{transform:"translateX(0)"},{transform:"translateX(-4px)"},{transform:"translateX(4px)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-out"})},it=()=>{const u=document.createElement("div");u.className="os-pinned-note-ghost",u.dataset.noteColor=r,u.style.width="208px";const N=document.createElement("div");N.className="os-pinned-note-ghost__swing",N.dataset.noteColor=r;const C=208/2,D=10;N.style.transformOrigin=`${C}px ${D}px`;const L=document.createElement("span");L.className="os-pinned-note__pin",L.style.setProperty("--dm-pin-dx","0px"),L.style.setProperty("--dm-pin-rot","0deg"),L.appendChild(We(e.pluginUrl));const B=document.createElement("div");B.className="os-pinned-note__paper os-pinned-note-ghost__paper";const V=document.createElement("div");return V.className="os-pinned-note__body",V.textContent=c,B.appendChild(V),N.append(L,B),u.appendChild(N),{root:u,tipX:C,tipY:D}},ae=f=>{if(t||!s||f.target?.closest("os-textarea, .dm-notes-pad__corner"))return;if(!c.trim()){F();return}const N=nt();if(!N)return;f.preventDefault(),p.ownerDocument.defaultView?.getSelection()?.removeAllRanges();const C=it(),D={text:c,color:r,isPublic:a};N.start({payload:{type:Qe,source:p,data:D,ghost:{element:C.root,offsetX:C.tipX,offsetY:C.tipY,hint:{neutral:E("Drop on the desktop to pin","desktop-mode"),accept:E("Pin here","desktop-mode"),reject:E("Can’t pin here","desktop-mode")}}},origin:f,onClickOnly:()=>v.focusInput?.(),onCommit:()=>{re(),ie()}})};p.addEventListener("pointerdown",ae);const ie=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||p.animate?.([{transform:"translate(3px, 4px) rotate(1.1deg)",opacity:.9},{transform:"translate(-1px, -2px) rotate(-0.4deg)",offset:.7},{transform:"translate(0, 0) rotate(0deg)",opacity:1}],{duration:260,easing:"cubic-bezier(0.2, 0.7, 0.2, 1)"})};let j=!1;async function lt(){if(!(t||!s||j)){if(!c.trim()){F(),v.focusInput?.();return}j=!0;try{const f=Math.floor(Date.now()/1e3)%5,u=await Je({text:c,color:r,x:.55+f*.04,y:.12+f*.05,public:a,seed:Me(c)});if(t)return;re(),ie(),document.dispatchEvent(new CustomEvent(et,{detail:{note:u}}))}catch(f){console.error("[openstation] note pad: create failed:",f),F();const u=window.wp?.os?.showToast;u?.({message:E("Could not pin the note. Please try again.","desktop-mode"),duration:5e3})}finally{j=!1}}}return s||(l.classList.add("dm-notes-pad--unavailable"),v.setAttribute("disabled","")),()=>{t=!0,p.removeEventListener("pointerdown",ae),g.removeEventListener("click",se)}},K=window;K.openStationWidgets=K.openStationWidgets??{},K.openStationWidgets[tt]=st})();
20 + `}_attr(e){return this.getAttribute(e)}_boolAttr(e){return this.getAttribute(e)!==null}_onInput(e){const o=e.target;this._textareaEl=o,this.setAttribute("value",o.value),this.emit("os-input-change",{value:o.value}),this._boolAttr("auto-grow")&&this._autosize(o)}_onChange(e){const o=e.target;this.emit("os-input-commit",{value:o.value})}_onKeyDown(e){if(!(!this._boolAttr("submit-on-enter")||e.isComposing||e.keyCode===229)&&e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){e.preventDefault();const o=e.target;this.emit("os-submit",{value:o.value})}}_autosize(e){const o=Number(this._attr("max-rows"))||8,n=window.getComputedStyle(e),s=parseFloat(n.fontSize)||13,r=n.lineHeight,a=r==="normal"?s*1.45:parseFloat(r)||s*1.45,l=parseFloat(n.paddingTop)||0,c=parseFloat(n.paddingBottom)||0,i=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0),d=a*o+l+c+i;e.style.height="auto",e.style.overflowY="hidden";const u=e.value?e.scrollHeight+i:a*(Number(this._attr("rows"))||3)+l+c+i,h=Math.min(u,d);e.style.height=`${Math.ceil(h)}px`,e.style.overflowY=u>Math.ceil(d)?"auto":"hidden"}refreshAutosize(){this._textareaEl&&this._boolAttr("auto-grow")&&this._autosize(this._textareaEl)}focusInput(){(this.shadowRoot??this).querySelector("textarea")?.focus()}clear(){this.setAttribute("value","");const o=(this.shadowRoot??this).querySelector("textarea");o&&(o.value="",this._boolAttr("auto-grow")&&this._autosize(o))}};I.props=["label","value","placeholder","disabled","readonly","ariaLabel","name","rows","maxlength","minlength","invalid","autoGrow","maxRows","submitOnEnter"],I.styles=[qe],I.help=void 0;let H=I;Se("os-textarea",H);const Ke="desktop-mode";function ne(){return window.wp?.i18n}function _(t,e=Ke){return ne()?.__(t,e)??t}function se(t,...e){const o=ne()?.sprintf;if(o)return o(t,...e);let n=0;return t.replace(/%(?:(\d+)\$)?[sd]/g,(s,r)=>{const a=r?Number.parseInt(r,10)-1:n++;return String(e[a]??"")})}const re="X-WP-Nonce";function Xe(t,e){const o=Be();if(!o)return e;const n=je(t);if(!n||!Ve(n))return e;const s=e?.headers??(typeof Request<"u"&&t instanceof Request?t.headers:void 0),r=new Headers(s??{});return r.has(re)?e:(r.set(re,o),{...e??{},headers:r})}function Be(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function je(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 Ve(t){return typeof window>"u"||!window.location||t.origin!==window.location.origin?!1:!!(t.pathname.includes("/wp-json/")||t.searchParams.has("rest_route"))}function Ye(t,e,o={}){const n=window.wp?.os?.fetch;if(typeof n=="function")return n(t,e,o);const s=Xe(t,e);return fetch(t,s)}class U 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 ae(t){return t instanceof U}function ie(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 Ge(t,e,o=""){return new U(o,{status:t,...ie(e)})}function le(t,e){return new U(e,{status:t,code:"openstation_bad_response"})}function Ze(t){const{prefix:e,source:o,conflict:n}=t;return async(s,r={})=>{const a=new Headers(r.headers??{});a.set("X-WP-Nonce",t.nonce()),r.body&&!a.has("Content-Type")&&a.set("Content-Type","application/json");const l=await Ye(t.url(s),{...r,headers:a,credentials:"same-origin"},{source:o}),c=await l.text();let i=null,d=null;if(c)try{i=JSON.parse(c)}catch(u){d=u}if(!l.ok){if(l.status===409&&n){const b=n(i);if(b)throw b}const{code:u,serverMessage:h}=ie(i);throw Ge(l.status,i,`${e} ${l.status}: ${u??""} ${h}`.trim())}if(i===null){if(d&&c){const u=c.slice(0,120).replace(/\s+/g," ");throw le(l.status,`${e} ${l.status} returned non-JSON body — ${d.message}. First 120 chars: ${u}`)}throw le(l.status,`${e} ${l.status}: empty or unparseable body.`)}return i}}const Je="rest_cookie_invalid_nonce",ce=()=>_("Could not reach the site. Check your connection and try again.","desktop-mode");function de(t){return typeof navigator<"u"&&navigator.onLine===!1?!0:t instanceof TypeError}function Qe(t){return ae(t)?t.code===Je||t.status===401?"session":t.status>=200&&t.status<300?"unreadable":t.status===404?"gone":t.status>=500?"server":t.status>=400?"refused":"unknown":de(t)?"offline":"unknown"}function et(t){return ae(t)?t.serverMessage:de(t)?ce():t instanceof Error?t.message:""}function tt(t,e){const{fallback:o,lead:n}=e,s=Qe(t),r=s==="offline"||s==="unreadable"?"warning":"error";let a="",l=!0;switch(s){case"offline":a=ce();break;case"session":a=_("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":a=_("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 i=t;i.serverMessage?a=i.serverMessage:s==="gone"?(a=_("It no longer exists. Reload the page to catch up.","desktop-mode"),l=!1):s==="server"?(a=se(_("The server answered with error %d.","desktop-mode"),i.status),l=!1):(a=se(_("The server refused the request (HTTP %d).","desktop-mode"),i.status),l=!1);break}case"unknown":default:a=et(t);break}let c;return n?c=a?`${n}: ${a}`:o:a?l?c=a:c=`${o} ${a}`:c=o,{message:c,reason:a,kind:s,type:r}}function ot(t,e,o){if(!t)return;const{duration:n,...s}=o,r=tt(e,s),a={message:r.message,type:r.type};n&&(a.duration=n),t(a)}function nt(t){const e=window.wp?.os;return typeof e?.showToast!="function"?()=>{}:e.showToast(t)??(()=>{})}const S=["butter","blush","sky","mint","lilac","peach"];function W(t){return S.includes(t)?t:S[0]}function q(t){const e=S.indexOf(W(t));return S[(e+1)%S.length]}function st(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return e>>>1||1}const rt=56,at=52;function it(t){return`${t.replace(/\/$/,"")}/assets/images/pushpin.svg`}function lt(t){const e=document.createElement("img");return e.src=it(t),e.alt="",e.width=rt,e.height=at,e.draggable=!1,e.className="os-pinned-note__pin-img",e}const ct="http://localhost/";function dt(t,e){const o=typeof window<"u"&&window.location?window.location.href:ct,n=new URL(t,o),s=e.replace(/^\/+/,""),r=s.indexOf("?"),a=r===-1?s:s.slice(0,r),l=r===-1?"":s.slice(r+1);if(n.searchParams.has("rest_route")){const c=n.searchParams.get("rest_route")??"/",i=c.endsWith("/")?c:c+"/";n.searchParams.set("rest_route",i+a)}else{const c=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";n.pathname=c+a}return l&&new URLSearchParams(l).forEach((i,d)=>{n.searchParams.append(d,i)}),n.toString()}let K=null;function ut(t){K=t}function ue(){if(!K)throw new Error("[openstation] notes REST client called before installNotesRestDeps().");return K}function ht(t){const e=window.openStationConfig;return typeof e?.restNonce=="string"&&e.restNonce?e.restNonce:t}class pt extends Error{constructor(e){super("Note was changed by another session."),this.status=409,this.name="NotesConflictError",this.current=e}}const ft=Ze({prefix:"[openstation] notes REST",source:"desktop-mode/notes",url:t=>{const{baseUrl:e}=ue();return t?dt(e,t):e},nonce:()=>ht(ue().nonce),conflict:t=>{const e=t?.data?.current;return new pt(e??null)}});function mt(t){return ft("",{method:"POST",body:JSON.stringify(t)})}const gt="note-draft",bt="os-note-created",vt="desktop-mode/notes";function wt(){return window.openStationConfig??{}}function xt(){return window.wp?.os?.dragManager??null}const _t=(t,e)=>{let o=!1;const n=wt(),s=!!n.notesUrl;s&&ut({baseUrl:n.notesUrl,nonce:n.restNonce??""});let r=W(e.storage.get("color")??S[0]);const a=!1;let l="";const c=document.createElement("div");c.className="dm-notes-pad";const i=document.createElement("div");i.className="dm-notes-pad__stack";const d=document.createElement("div");d.className="dm-notes-pad__under dm-notes-pad__under--2";const u=document.createElement("div");u.className="dm-notes-pad__under dm-notes-pad__under--1";const h=document.createElement("div");h.className="dm-notes-pad__sheet";const b=document.createElement("div");b.className="dm-notes-pad__peel",b.setAttribute("aria-hidden","true");const m=document.createElement("span");m.className="dm-notes-pad__peel-hint",m.textContent=_("Drag to pin","desktop-mode"),b.appendChild(m);const v=document.createElement("os-textarea");v.className="dm-notes-pad__editor",v.setAttribute("aria-label",_("New note","desktop-mode")),v.setAttribute("placeholder",_("Write a note…","desktop-mode")),v.setAttribute("rows","5"),v.setAttribute("auto-grow",""),v.setAttribute("max-rows","8");const g=document.createElement("button");g.type="button",g.className="dm-notes-pad__corner",h.append(b,v,g),i.append(d,u,h);const k=document.createElement("div");k.className="dm-notes-pad__footer";const w=document.createElement("div");w.className="dm-notes-pad__swatches",w.setAttribute("role","radiogroup"),w.setAttribute("aria-label",_("Paper color","desktop-mode"));const E=new Map;for(const p of S){const f=document.createElement("button");f.type="button",f.className="dm-notes-pad__swatch",f.dataset.noteColor=p,f.setAttribute("role","radio"),f.setAttribute("aria-label",p),f.addEventListener("click",()=>he(p)),E.set(p,f),w.appendChild(f)}k.append(w),c.append(i,k),t.appendChild(c);function T(){const p=q(r),f=q(p);h.dataset.noteColor=r,i.dataset.noteColor=r,u.dataset.noteColor=p,d.dataset.noteColor=f,g.dataset.noteColor=p,g.setAttribute("aria-label",`${_("Next paper color","desktop-mode")}: ${p}`);for(const[N,C]of E)C.setAttribute("aria-checked",N===r?"true":"false"),C.classList.toggle("is-selected",N===r)}function he(p){r=W(p),e.storage.set("color",r),T()}const pe=()=>he(q(r));g.addEventListener("click",pe),T();const yt=p=>{l=p.detail.value};v.addEventListener("os-input-change",yt);const kt=p=>{const f=p;f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),Nt()),f.stopPropagation()};["keydown","keypress","keyup"].forEach(p=>v.addEventListener(p,f=>{p==="keydown"?kt(f):f.stopPropagation()}));const fe=()=>{l="",v.setAttribute("value","")},B=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||h.animate?.([{transform:"translateX(0)"},{transform:"translateX(-4px)"},{transform:"translateX(4px)"},{transform:"translateX(0)"}],{duration:200,easing:"ease-out"})},Et=()=>{const f=document.createElement("div");f.className="os-pinned-note-ghost",f.dataset.noteColor=r,f.style.width="208px";const N=document.createElement("div");N.className="os-pinned-note-ghost__swing",N.dataset.noteColor=r;const C=208/2,z=10;N.style.transformOrigin=`${C}px ${z}px`;const L=document.createElement("span");L.className="os-pinned-note__pin",L.style.setProperty("--dm-pin-dx","0px"),L.style.setProperty("--dm-pin-rot","0deg"),L.appendChild(lt(e.pluginUrl));const V=document.createElement("div");V.className="os-pinned-note__paper os-pinned-note-ghost__paper";const Y=document.createElement("div");return Y.className="os-pinned-note__body",Y.textContent=l,V.appendChild(Y),N.append(L,V),f.appendChild(N),{root:f,tipX:C,tipY:z}},me=p=>{if(o||!s||p.target?.closest("os-textarea, .dm-notes-pad__corner"))return;if(!l.trim()){B();return}const N=xt();if(!N)return;p.preventDefault(),h.ownerDocument.defaultView?.getSelection()?.removeAllRanges();const C=Et(),z={text:l,color:r,isPublic:a};N.start({payload:{type:gt,source:h,data:z,ghost:{element:C.root,offsetX:C.tipX,offsetY:C.tipY,hint:{neutral:_("Drop on the desktop to pin","desktop-mode"),accept:_("Pin here","desktop-mode"),reject:_("Can’t pin here","desktop-mode")}}},origin:p,onClickOnly:()=>v.focusInput?.(),onCommit:()=>{fe(),ge()}})};h.addEventListener("pointerdown",me);const ge=()=>{typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||h.animate?.([{transform:"translate(3px, 4px) rotate(1.1deg)",opacity:.9},{transform:"translate(-1px, -2px) rotate(-0.4deg)",offset:.7},{transform:"translate(0, 0) rotate(0deg)",opacity:1}],{duration:260,easing:"cubic-bezier(0.2, 0.7, 0.2, 1)"})};let j=!1;async function Nt(){if(!(o||!s||j)){if(!l.trim()){B(),v.focusInput?.();return}j=!0;try{const p=Math.floor(Date.now()/1e3)%5,f=await mt({text:l,color:r,x:.55+p*.04,y:.12+p*.05,public:a,seed:st(l)});if(o)return;fe(),ge(),document.dispatchEvent(new CustomEvent(bt,{detail:{note:f}}))}catch(p){console.error("[openstation] note pad: create failed:",p),B(),ot(nt,p,{fallback:_("Could not pin the note. Please try again.","desktop-mode"),duration:5e3})}finally{j=!1}}}return s||(c.classList.add("dm-notes-pad--unavailable"),v.setAttribute("disabled","")),()=>{o=!0,h.removeEventListener("pointerdown",me),g.removeEventListener("click",pe)}},X=window;X.openStationWidgets=X.openStationWidgets??{},X.openStationWidgets[vt]=_t})();