@pie-players/pie-section-player 0.3.75 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +845 -964
- package/custom-elements.json +3922 -0
- package/dist/browser/assets/{evaluation-worker-CORp9m0K.js → evaluation-worker-0xRDVTJx.js} +82215 -73234
- package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
- package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
- package/dist/browser/chunks/calculator-element-271c142f.js +8 -9
- package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -1
- package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
- package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
- package/dist/browser/chunks/custom-element-define-2a92deb0.js +1 -0
- package/dist/browser/chunks/dist-41b39e7f.js +1 -1
- package/dist/browser/chunks/dist-ca9b9622.js +1 -1
- package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
- package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +1 -1
- package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
- package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
- package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
- package/dist/browser/chunks/provider-4c704118.js +1 -1
- package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
- package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
- package/dist/browser/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +5 -5
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
- package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
- package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
- package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
- package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +24 -30
- package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
- package/dist/browser/pie-section-player.js +61 -65
- package/dist/chunks/nl-NL-364d61b9.js +34 -6
- package/dist/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/component-definitions.d.ts +0 -2
- package/dist/components/shared/card-media-region.d.ts +3 -4
- package/dist/components/shared/framework-error-latch.d.ts +4 -2
- package/dist/components/shared/missing-tool-providers.d.ts +0 -6
- package/dist/components/shared/player-preload.d.ts +4 -9
- package/dist/components/shared/section-player-card-context.d.ts +0 -3
- package/dist/components/shared/section-player-host-runtime.d.ts +0 -2
- package/dist/components/shared/section-player-view-state.d.ts +0 -1
- package/dist/controllers/SectionController.d.ts +20 -6
- package/dist/pie-section-player.js +10987 -11045
- package/package.json +11 -9
- package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
- package/dist/browser/chunks/runtime-wcU7KOFU-ac86d7b8.js +0 -8536
- package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
- package/dist/browser/chunks/tool-instance-id-2a92deb0.js +0 -1
- package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +0 -194
- /package/dist/browser/chunks/{ItemToolBar-jx38w99s-58defccc.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
- /package/dist/chunks/{ItemToolBar-jx38w99s-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as i}from"./defineProperty-a20a667d.js";function x(n,t=!1){if(typeof n=="boolean")return n;if(n==null)return t;const e=String(n).trim().toLowerCase();return e===""?t:["false","0","off","no"].includes(e)?!1:["true","1","on","yes"].includes(e)?!0:!!e}function C(n){return n!==null&&x(n,!0)}var p=(n,t)=>{const e=n.$$p_d;return e?Object.entries(e).some(([s,o])=>o.type==="Boolean"&&(o.attribute??s.toLowerCase())===t):!1};function V(n){const t=n.prototype.attributeChangedCallback;return class extends n{attributeChangedCallback(e,s,o){const r=o!==null&&p(this,e)&&!C(o)?null:o;t?.call(this,e,s,r)}}}function b(n,t,e){const s=t.ownerDocument?.defaultView?.Event??Event;return Object.assign(new s(n,{bubbles:!0,composed:!0}),e)}var h=new WeakSet,d=new WeakSet,v=(n,t)=>typeof t=="object"&&t!==null&&n.has(t),l=class{constructor(t,e,s,o){const r=b("context-request",e,{context:t,contextTarget:e,callback:s,subscribe:o??!1});return h.add(r),r}static[Symbol.hasInstance](t){return v(h,t)}},P=class{constructor(t,e){const s=b("context-provider",e,{context:t,contextTarget:e});return d.add(s),s}static[Symbol.hasInstance](t){return v(d,t)}},m=n=>{const t=[];for(const e of n)e.requestorRef.deref()&&e.callbackRef.deref()&&t.push(e);return t},R=class{constructor(n){i(this,"host",void 0),i(this,"pendingByContext",new Map),i(this,"attached",!1),i(this,"onContextRequest",t=>{if(t.cancelBubble)return;const e=t;if(e.subscribe!==!0||typeof e.callback!="function"||e.context===void 0)return;const s=e.contextTarget??t.composedPath?.()[0];if(!s)return;let o=this.pendingByContext.get(e.context);o||(o={callbacks:new WeakMap,requests:[]},this.pendingByContext.set(e.context,o));const r=e.callback;let c=o.callbacks.get(s);c||(c=new WeakSet,o.callbacks.set(s,c)),!c.has(r)&&(c.add(r),o.requests.push({requestorRef:new WeakRef(s),callbackRef:new WeakRef(r)}),o.requests=m(o.requests))}),i(this,"onContextProvider",t=>{const e=t.context;if(e===void 0)return;const s=this.pendingByContext.get(e);if(!(!s||s.requests.length===0)){this.pendingByContext.delete(e);for(const o of s.requests){const r=o.requestorRef.deref(),c=o.callbackRef.deref();!r||!c||r.dispatchEvent(new l(e,r,c,!0))}}}),this.host=n}attach(){this.attached||(this.attached=!0,this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onContextProvider))}detach(){this.attached&&(this.attached=!1,this.host.removeEventListener("context-request",this.onContextRequest),this.host.removeEventListener("context-provider",this.onContextProvider),this.pendingByContext.clear())}},f=Symbol.for("pie.context.documentRoot");function k(n){if(!n)return;const t=n;if(t[f])return;const e=n.documentElement;if(!e)return;const s=new R(e);s.attach(),t[f]=s}var q=class{constructor(n,t){i(this,"host",void 0),i(this,"context",void 0),i(this,"subscribe",void 0),i(this,"onValue",void 0),i(this,"isConnected",!1),i(this,"isDisconnected",!1),i(this,"unsubscribe",void 0),i(this,"currentValue",void 0),i(this,"handleValue",(e,s)=>{if(this.isDisconnected){s?.();return}s!==this.unsubscribe&&(this.unsubscribe?.(),this.unsubscribe=s),!this.subscribe&&this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0),this.currentValue=e,this.onValue?.(e)}),this.host=n,this.context=t.context,this.subscribe=t.subscribe??!0,this.onValue=t.onValue}connect(){this.isConnected||(this.isConnected=!0,this.isDisconnected=!1,this.subscribe&&k(this.host.ownerDocument),this.requestValue())}disconnect(){this.isConnected&&(this.isConnected=!1,this.isDisconnected=!0,this.unsubscribe?.(),this.unsubscribe=void 0)}get value(){return this.currentValue}requestValue(){this.host.dispatchEvent(new l(this.context,this.host,this.handleValue,this.subscribe))}},O=(n,t)=>{let e;return n.dispatchEvent(new l(t,n,s=>{e=s},!1)),e},u=(n,t,e)=>{const s=new q(n,{context:t,subscribe:!0,onValue:e});s.connect();const o=r=>{r.context===t&&s.requestValue()};return n.addEventListener("context-provider",o),()=>{n.removeEventListener("context-provider",o),s.disconnect()}},a=n=>n,E=a(Symbol.for("pie.assessmentToolkit.runtimeContext")),y=a(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),g=a(Symbol.for("pie.assessmentToolkit.shellContext")),S=a(Symbol.for("pie.assessmentToolkit.regionScopeContext")),T={bubbles:!0,composed:!0,cancelable:!1};function w(n,t,e={}){return new CustomEvent(n,{detail:t,...T,...e})}function W(n,t,e,s={}){return n.dispatchEvent(w(t,e,s))}function _(n,t){return u(n,E,t)}function I(n,t){return u(n,g,t)}function N(n,t){return u(n,S,t)}function j(n,t){return u(n,y,t)}function A(n,t){let e=null;function s(){e?.coordinator.unregisterTool(e.toolId),e=null}return{sync(o,r){!o||!r||e?.coordinator===o&&e.toolId===r||(s(),o.registerTool(r,n,void 0,t),e={coordinator:o,toolId:r})},release:s}}export{A as a,g as c,O as d,P as f,x as h,I as i,a as l,V as m,N as n,W as o,l as p,_ as r,S as s,j as t,u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),c=/^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/,i={delivery:"",author:"-config",print:"-print"},d=(e,r="custom element tag")=>{if(!e||typeof e!="string")throw new Error(`Invalid ${r}: expected a non-empty string`);const t=e.trim();if(!t)throw new Error(`Invalid ${r}: tag is empty`);if(t!==t.toLowerCase())throw new Error(`Invalid ${r} "${t}": custom element names must be lowercase`);if(!t.includes("-"))throw new Error(`Invalid ${r} "${t}": custom element names must include a hyphen`);if(m.has(t))throw new Error(`Invalid ${r} "${t}": this name is reserved by the HTML spec`);if(!c.test(t))throw new Error(`Invalid ${r} "${t}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);return t},w=(e,r,t)=>`${e}${t??(i[r]!==void 0?i[r]:"")}`,u=e=>typeof DOMException<"u"&&e instanceof DOMException?e.name==="NotSupportedError"||e.code===DOMException.NOT_SUPPORTED_ERR:(typeof e=="object"&&e!==null&&"name"in e?String(e.name):"")==="NotSupportedError",f=(e,r,t="custom element tag",a={})=>{const o=d(e,t);if(customElements.get(o))return{outcome:"already-defined",tagName:o};try{return customElements.define(o,r),{outcome:"defined",tagName:o}}catch(n){if(!u(n))return{outcome:"error",tagName:o,error:n};if(customElements.get(o))return{outcome:"already-defined",tagName:o};if(!a.allowWrappedFallback)return{outcome:"error",tagName:o,error:n};try{return customElements.define(o,class extends r{}),{outcome:"defined-wrapped",tagName:o}}catch(l){return{outcome:"wrapped-error",tagName:o,error:l}}}},g=(e,r,t="custom element tag")=>{const a=f(e,r,t);if(a.outcome==="error"||a.outcome==="wrapped-error")throw a.error;return{status:a.outcome==="already-defined"?"already-defined":"defined",tagName:a.tagName}},p=["assessment","section","item","passage","rubric"],E=new Set(p);function s(e){return E.has(e)}function v(e,r,t){const a=e.trim(),o=t.trim();if(!a||!o)throw new Error("Tool instance ids require non-empty tool and scope ids");if(!s(r))throw new Error(`Unknown tool scope level '${r}'. Register custom levels with registerToolScopeLevel().`);return`${a}:${r}:${o}`}function h(e){const r=e.split(":");if(r.length!==3)return null;const[t,a,o]=r;return!t||!o||!s(a)?null:{baseToolId:t,scopeLevel:a,scopeId:o}}export{d as a,w as i,h as n,g as r,v as t};
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import{r as $t,t as yt}from"./logger-8b07fb72.js";import{t as gt}from"./preload-helper-6ad28da3.js";import{t as At}from"./sre-locales-112320af.js";var F,R=globalThis,I=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),J=new WeakMap,St=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(I&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=J.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&J.set(e,t))}return t}toString(){return this.cssText}},wt=t=>new St(typeof t=="string"?t:t+"",void 0,ht),Et=(t,e)=>{if(I)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(const r of e){const s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=r.cssText,t.appendChild(s)}},K=I?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const s of e.cssRules)r+=s.cssText;return wt(r)})(t):t,{is:xt,defineProperty:Ot,getOwnPropertyDescriptor:Tt,getOwnPropertyNames:kt,getOwnPropertySymbols:Ct,getPrototypeOf:Pt}=Object,w=globalThis,Z=w.trustedTypes,Mt=Z?Z.emptyScript:"",Rt=w.reactiveElementPolyfillSupport,T=(t,e)=>t,U={toAttribute(t,e){switch(e){case Boolean:t=t?Mt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},q=(t,e)=>!xt(t,e),G={attribute:!0,type:String,converter:U,reflect:!1,useDefault:!1,hasChanged:q};(F=Symbol).metadata??(F.metadata=Symbol("metadata")),w.litPropertyMetadata??(w.litPropertyMetadata=new WeakMap);var S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Ot(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){const{get:s,set:i}=Tt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:s,set(n){const o=s?.call(this);i?.call(this,n),this.requestUpdate(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Pt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,r=[...kt(e),...Ct(e)];for(const s of r)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const s of r)e.unshift(K(s))}else t!==void 0&&e.push(K(t));return e}static _$Eu(t,e){const r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){const i=(r.converter?.toAttribute!==void 0?r.converter:U).toAttribute(e,r.type);this._$Em=t,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const i=r.getPropertyOptions(s),n=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:U;this._$Em=s;const o=n.fromAttribute(e,i.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){const s=this.constructor,i=this[t];if(r??(r=s.getPropertyOptions(t)),!((r.hasChanged??q)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:i},n){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,n??e??this[t]),i!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,i]of this._$Ep)this[s]=i;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,i]of r){const{wrapped:n}=i,o=this[s];n!==!0||this._$AL.has(s)||o===void 0||this.C(s,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[T("elementProperties")]=new Map,S[T("finalized")]=new Map,Rt?.({ReactiveElement:S}),(w.reactiveElementVersions??(w.reactiveElementVersions=[])).push("2.1.1");var N=globalThis,D=N.trustedTypes,Q=D?D.createPolicy("lit-html",{createHTML:t=>t}):void 0,ct="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,pt="?"+_,Ut=`<${pt}>`,A=document,C=()=>A.createComment(""),P=t=>t===null||typeof t!="object"&&typeof t!="function",B=Array.isArray,Nt=t=>B(t)||typeof t?.[Symbol.iterator]=="function",z=`[
|
|
2
|
-
\f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,X=/>/g,y=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,ut=/^(?:script|style|textarea|title)$/i,Dt=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Lt=Dt(1),E=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),rt=new WeakMap,g=A.createTreeWalker(A,129);function vt(t,e){if(!B(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(e):e}var Ht=(t,e)=>{const r=t.length-1,s=[];let i,n=e===2?"<svg>":e===3?"<math>":"",o=O;for(let a=0;a<r;a++){const l=t[a];let b,h,d=-1,v=0;for(;v<l.length&&(o.lastIndex=v,h=o.exec(l),h!==null);)v=o.lastIndex,o===O?h[1]==="!--"?o=Y:h[1]!==void 0?o=X:h[2]!==void 0?(ut.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=y):h[3]!==void 0&&(o=y):o===y?h[0]===">"?(o=i??O,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,b=h[1],o=h[3]===void 0?y:h[3]==='"'?et:tt):o===et||o===tt?o=y:o===Y||o===X?o=O:(o=y,i=void 0);const m=o===y&&t[a+1].startsWith("/>")?" ":"";n+=o===O?l+Ut:d>=0?(s.push(b),l.slice(0,d)+ct+l.slice(d)+_+m):l+_+(d===-2?a:m)}return[vt(t,n+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},j=class ft{constructor({strings:e,_$litType$:r},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[b,h]=Ht(e,r);if(this.el=ft.createElement(b,s),g.currentNode=this.el.content,r===2||r===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=g.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(ct)){const v=h[o++],m=i.getAttribute(d).split(_),M=/([.?@])?(.*)/.exec(v);l.push({type:1,index:n,name:M[2],strings:m,ctor:M[1]==="."?jt:M[1]==="?"?It:M[1]==="@"?qt:H}),i.removeAttribute(d)}else d.startsWith(_)&&(l.push({type:6,index:n}),i.removeAttribute(d));if(ut.test(i.tagName)){const d=i.textContent.split(_),v=d.length-1;if(v>0){i.textContent=D?D.emptyScript:"";for(let m=0;m<v;m++)i.append(d[m],C()),g.nextNode(),l.push({type:2,index:++n});i.append(d[v],C())}}}else if(i.nodeType===8)if(i.data===pt)l.push({type:2,index:n});else{let d=-1;for(;(d=i.data.indexOf(_,d+1))!==-1;)l.push({type:7,index:n}),d+=_.length-1}n++}}static createElement(e,r){const s=A.createElement("template");return s.innerHTML=e,s}};function x(t,e,r=t,s){if(e===E)return e;let i=s!==void 0?r._$Co?.[s]:r._$Cl;const n=P(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(t),i._$AT(t,r,s)),s!==void 0?(r._$Co??(r._$Co=[]))[s]=i:r._$Cl=i),i!==void 0&&(e=x(t,i._$AS(t,e.values),i,s)),e}var zt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??A).importNode(e,!0);g.currentNode=s;let i=g.nextNode(),n=0,o=0,a=r[0];for(;a!==void 0;){if(n===a.index){let l;a.type===2?l=new V(i,i.nextSibling,this,t):a.type===1?l=new a.ctor(i,a.name,a.strings,this,t):a.type===6&&(l=new Bt(i,this,t)),this._$AV.push(l),a=r[++o]}n!==a?.index&&(i=g.nextNode(),n++)}return g.currentNode=A,s}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},V=class bt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,s,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=x(this,e,r),P(e)?e===c||e==null||e===""?(this._$AH!==c&&this._$AR(),this._$AH=c):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==c&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(A.createTextNode(e)),this._$AH=e}$(e){const{values:r,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=j.createElement(vt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(r);else{const n=new zt(i,this),o=n.u(this.options);n.p(r),this.T(o),this._$AH=n}}_$AC(e){let r=rt.get(e.strings);return r===void 0&&rt.set(e.strings,r=new j(e)),r}k(e){B(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let s,i=0;for(const n of e)i===r.length?r.push(s=new bt(this.O(C()),this.O(C()),this,this.options)):s=r[i],s._$AI(n),i++;i<r.length&&(this._$AR(s&&s._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,i){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=c}_$AI(t,e=this,r,s){const i=this.strings;let n=!1;if(i===void 0)t=x(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else{const o=t;let a,l;for(t=i[0],a=0;a<i.length-1;a++)l=x(this,o[r+a],e,a),l===E&&(l=this._$AH[a]),n||(n=!P(l)||l!==this._$AH[a]),l===c?t=c:t!==c&&(t+=(l??"")+i[a+1]),this._$AH[a]=l}n&&!s&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},jt=class extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}},It=class extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}},qt=class extends H{constructor(t,e,r,s,i){super(t,e,r,s,i),this.type=5}_$AI(t,e=this){if((t=x(this,t,e,0)??c)===E)return;const r=this._$AH,s=t===c&&r!==c||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==c&&(r===c||s);s&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Bt=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}},Vt=N.litHtmlPolyfillSupport;Vt?.(j,V),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.3.1");var Wt=(t,e,r)=>{const s=r?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const n=r?.renderBefore??null;s._$litPart$=i=new V(e.insertBefore(C(),n),n,void 0,r??{})}return i._$AI(t),i},L=globalThis,k=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};k._$litElement$=!0,k.finalized=!0,L.litElementHydrateSupport?.({LitElement:k});var Ft=L.litElementPolyfillSupport;Ft?.({LitElement:k});(L.litElementVersions??(L.litElementVersions=[])).push("4.2.1");var Jt=t=>(e,r)=>{r!==void 0?r.addInitializer((()=>{customElements.get(t)||customElements.define(t,e)})):customElements.get(t)||customElements.define(t,e)},Kt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:q},Zt=(t=Kt,e,r)=>{const{kind:s,metadata:i}=r;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((t=Object.create(t)).wrapped=!0),n.set(r.name,t),s==="accessor"){const{name:o}=r;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,t)},init(a){return a!==void 0&&this.C(o,void 0,t,a),a}}}if(s==="setter"){const{name:o}=r;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,t)}}throw Error("Unsupported decorator location: "+s)};function $(t){return(e,r)=>typeof r=="object"?Zt(t,e,r):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(t,e,r)}var Gt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,f=(t,e,r,s)=>{for(var i=s>1?void 0:s?Qt(e,r):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&Gt(e,r,i),i},u=class extends k{constructor(){super(...arguments),this.variant="primary",this.size="default",this.type="circle",this.state="default",this.iconName="home",this.disabled=!1,this.buttonAriaLabel="Icon button"}createRenderRoot(){return this}connectedCallback(){if(super.connectedCallback(),!document.querySelector('link[href*="Roboto"]')){const t=document.createElement("link");t.rel="stylesheet",t.href="https://ui.renaissance.com/fonts/Roboto/style.css",document.head.appendChild(t)}}set shape(t){this.type=t}get shape(){return this.type}get buttonClasses(){return["nds-icon-button",`nds-icon-button--${this.variant}`,`nds-icon-button--${this.size}`,`nds-icon-button--${this.type}`,this.state!=="default"?`nds-icon-button--${this.state}`:"",this.disabled?"nds-icon-button--disabled":""].filter(Boolean).join(" ")}handleClick(t){if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.dispatchEvent(new CustomEvent("icon-button-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}render(){return Lt`
|
|
4
|
-
<style>
|
|
5
|
-
nds-icon-button {
|
|
6
|
-
display: inline-block;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.nds-icon-button {
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
font-family: var(--font-family-roboto, "Roboto", sans-serif);
|
|
15
|
-
font-weight: var(--font-weight-regular, 400);
|
|
16
|
-
line-height: 1;
|
|
17
|
-
text-decoration: none;
|
|
18
|
-
background: none;
|
|
19
|
-
position: relative;
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
margin: 0;
|
|
22
|
-
padding: 0;
|
|
23
|
-
border: none;
|
|
24
|
-
transition: background-color 0.2s ease-in-out,
|
|
25
|
-
color 0.2s ease-in-out,
|
|
26
|
-
box-shadow 0.2s ease-in-out;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* ── Sizes ── */
|
|
30
|
-
.nds-icon-button--small {
|
|
31
|
-
width: var(--height-32, 32px);
|
|
32
|
-
height: var(--height-32, 32px);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.nds-icon-button--medium {
|
|
36
|
-
width: var(--height-36, 36px);
|
|
37
|
-
height: var(--height-36, 36px);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.nds-icon-button--default {
|
|
41
|
-
width: var(--height-40, 40px);
|
|
42
|
-
height: var(--height-40, 40px);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.nds-icon-button--large {
|
|
46
|
-
width: var(--height-48, 48px);
|
|
47
|
-
height: var(--height-48, 48px);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* ── Shapes ── */
|
|
51
|
-
.nds-icon-button--circle {
|
|
52
|
-
border-radius: var(--radius-circle, 50%);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.nds-icon-button--rounded {
|
|
56
|
-
border-radius: var(--radius-8, 8px);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* ── Primary ── */
|
|
60
|
-
.nds-icon-button--primary {
|
|
61
|
-
background-color: var(--color-interactive-blue, #146eb3);
|
|
62
|
-
color: var(--color-primary-white, #ffffff);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.nds-icon-button--primary:hover:not(:disabled):not(.nds-icon-button--disabled) {
|
|
66
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.nds-icon-button--primary:active:not(:disabled):not(.nds-icon-button--disabled) {
|
|
70
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* ── Secondary ── */
|
|
74
|
-
.nds-icon-button--secondary {
|
|
75
|
-
background-color: var(--color-primary-white, #ffffff);
|
|
76
|
-
color: var(--color-interactive-blue, #146eb3);
|
|
77
|
-
box-shadow: inset 0 0 0 var(--stroke-1, 1px) var(--color-interactive-blue, #146eb3);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.nds-icon-button--secondary:hover:not(:disabled):not(.nds-icon-button--disabled) {
|
|
81
|
-
background-color: var(--color-interactive-blue, #146eb3);
|
|
82
|
-
color: var(--color-primary-white, #ffffff);
|
|
83
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.nds-icon-button--secondary:active:not(:disabled):not(.nds-icon-button--disabled) {
|
|
87
|
-
background-color: var(--color-interactive-blue, #146eb3);
|
|
88
|
-
color: var(--color-primary-white, #ffffff);
|
|
89
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* ── Tertiary ── */
|
|
93
|
-
.nds-icon-button--tertiary {
|
|
94
|
-
background-color: var(--color-new-gray, #f3f5f7);
|
|
95
|
-
color: var(--color-interactive-blue, #146eb3);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.nds-icon-button--tertiary:hover:not(:disabled):not(.nds-icon-button--disabled) {
|
|
99
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-interactive-blue, #146eb3);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.nds-icon-button--tertiary:active:not(:disabled):not(.nds-icon-button--disabled) {
|
|
103
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* ── Ghost ── */
|
|
107
|
-
.nds-icon-button--ghost {
|
|
108
|
-
background-color: transparent;
|
|
109
|
-
color: var(--color-interactive-blue, #146eb3);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.nds-icon-button--ghost:hover:not(:disabled):not(.nds-icon-button--disabled) {
|
|
113
|
-
background-color: var(--color-new-gray, #f3f5f7);
|
|
114
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-interactive-blue, #146eb3);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.nds-icon-button--ghost:active:not(:disabled):not(.nds-icon-button--disabled) {
|
|
118
|
-
background-color: var(--color-new-gray, #f3f5f7);
|
|
119
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* ── Dark (for dark backgrounds) ── */
|
|
123
|
-
.nds-icon-button--dark {
|
|
124
|
-
background-color: transparent;
|
|
125
|
-
color: var(--color-primary-white, #ffffff);
|
|
126
|
-
box-shadow: inset 0 0 0 var(--stroke-1, 1px) var(--color-primary-white, #ffffff);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.nds-icon-button--dark:hover:not(:disabled):not(.nds-icon-button--disabled) {
|
|
130
|
-
background-color: var(--color-interactive-blue, #146eb3);
|
|
131
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-white, #ffffff);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.nds-icon-button--dark:active:not(:disabled):not(.nds-icon-button--disabled) {
|
|
135
|
-
background-color: var(--color-interactive-blue, #146eb3);
|
|
136
|
-
box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-white, #ffffff);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* ── Disabled ── */
|
|
140
|
-
.nds-icon-button--disabled,
|
|
141
|
-
.nds-icon-button:disabled {
|
|
142
|
-
opacity: 0.5;
|
|
143
|
-
cursor: not-allowed;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* ── Icon sizing ── */
|
|
147
|
-
.nds-icon-button__icon {
|
|
148
|
-
line-height: 1;
|
|
149
|
-
display: inline-flex;
|
|
150
|
-
align-items: center;
|
|
151
|
-
justify-content: center;
|
|
152
|
-
color: inherit;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.nds-icon-button--small .nds-icon-button__icon {
|
|
156
|
-
font-size: var(--nds-icon-small, 12px);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.nds-icon-button--medium .nds-icon-button__icon {
|
|
160
|
-
font-size: var(--nds-icon-medium, 14px);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.nds-icon-button--default .nds-icon-button__icon {
|
|
164
|
-
font-size: var(--nds-icon-default, 16px);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.nds-icon-button--large .nds-icon-button__icon {
|
|
168
|
-
font-size: var(--nds-icon-large, 20px);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/* ── Focus ── */
|
|
172
|
-
.nds-icon-button:focus-visible {
|
|
173
|
-
outline: 2px solid var(--color-focus-blue, #2b87ff);
|
|
174
|
-
outline-offset: 2px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* ── Reduced motion ── */
|
|
178
|
-
@media (prefers-reduced-motion: reduce) {
|
|
179
|
-
.nds-icon-button {
|
|
180
|
-
transition: none;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
</style>
|
|
184
|
-
<button
|
|
185
|
-
type="button"
|
|
186
|
-
class="${this.buttonClasses}"
|
|
187
|
-
?disabled="${this.disabled}"
|
|
188
|
-
aria-disabled="${this.disabled?"true":"false"}"
|
|
189
|
-
aria-label="${this.buttonAriaLabel}"
|
|
190
|
-
@click="${this.handleClick}"
|
|
191
|
-
>
|
|
192
|
-
<i class="fa-light fa-${this.iconName} nds-icon-button__icon" aria-hidden="true"></i>
|
|
193
|
-
</button>
|
|
194
|
-
`}};f([$()],u.prototype,"variant",2);f([$()],u.prototype,"size",2);f([$()],u.prototype,"type",2);f([$()],u.prototype,"state",2);f([$({attribute:"icon-name"})],u.prototype,"iconName",2);f([$({type:Boolean})],u.prototype,"disabled",2);f([$({attribute:"button-aria-label"})],u.prototype,"buttonAriaLabel",2);f([$()],u.prototype,"shape",1);u=f([Jt("nds-icon-button")],u);var st=yt("tts-math-speech",$t),de=Promise.resolve(),Yt=t=>{let e=null,r=!1;return s=>{if(!e){At(s);const i=t();e=i,i.catch(n=>{if(e===i&&(e=null),r){st.debug("speech-rule-engine failed to load again",n);return}r=!0,st.warn("speech-rule-engine failed to load; math reads as its visible text until a later read loads it.",n)})}return e}},he=Yt(()=>gt(async()=>{const{default:t}=await import("./sre-engine-ace23548.js");return{default:t}},[],import.meta.url).then(({default:t})=>{if(!t||typeof t.toSpeech!="function")throw new Error("speech-rule-engine did not expose toSpeech");return t})),it=t=>!!t&&typeof t=="object"&&!Array.isArray(t),ot=t=>typeof t=="string"&&t.trim()?t.trim():void 0,Xt=t=>{if(!it(t))return;const e=ot(t.domain),r=ot(t.style),s=it(t.engineOptions)?t.engineOptions:void 0;if(!(!e&&!r&&!s))return{...e?{domain:e}:{},...r?{style:r}:{},...s?{engineOptions:s}:{}}},te=new Set(["reserved-row","expanding-row","floating-overlay","left-aligned"]),W=t=>t&&typeof t=="object"?t:{},p=(t,e)=>t===void 0?e:t,mt=(t,e="left-aligned")=>typeof t=="string"&&te.has(t)?t:e,nt=Object.freeze([{rate:.8,label:"Slow",ariaLabel:"Slow speed"},{rate:1,label:"Normal",ariaLabel:"Normal speed",default:!0},{rate:1.25,label:"Fast",ariaLabel:"Fast speed"}]),at=t=>{if(!(typeof t!="number"||!Number.isFinite(t)||t<=0))return Math.round(t*100)/100},lt=t=>{if(typeof t!="string")return;const e=t.trim();return e.length?e:void 0},dt=t=>`${t}x`,_t=(t,e)=>t.toLowerCase()==="normal"?"Normal speed":e?`Speed ${t}`:`${t} speed`,ee=(t,e,r)=>e?e.toLowerCase().includes(t.toLowerCase())?e:`${t} ${e}`:_t(t,r),re=t=>{const e=Array.isArray(t)?t:[...nt];if(e.length===0)return[];const r=new Set,s=[];for(const o of e){const a=W(o),l=at(typeof o=="number"?o:a.rate);if(l===void 0||r.has(l))continue;r.add(l);const b=l===1?"Normal":dt(l),h=typeof o=="number"?b:lt(a.label)||b,d=typeof o=="number"?l===1?"Normal speed":_t(h,!0):ee(h,lt(a.ariaLabel),h===b);s.push({rate:l,label:h,ariaLabel:d,isDefault:!1,requestedDefault:a.default===!0||a.isDefault===!0})}if(!s.length)return re(nt);if(!r.has(1)){const o={rate:1,label:"Normal",ariaLabel:"Normal speed",isDefault:!1,requestedDefault:!1},a=s.findIndex(l=>l.rate>1);a>=0?s.splice(a,0,o):s.push(o)}const i=s.findIndex(o=>o.requestedDefault),n=i>=0?i:s.findIndex(o=>o.rate===1);return s.map(({requestedDefault:o,...a},l)=>({...a,isDefault:l===n}))},ce=Object.freeze([.8,1,1.25]),se=t=>{const e={...t,layoutMode:mt(t.layoutMode)};if(t.backend!=="server")return e;const r={...e,apiEndpoint:p(e.apiEndpoint,"/api/tts"),transportMode:p(e.transportMode,"pie"),endpointValidationMode:p(e.endpointValidationMode,"voices"),validateEndpoint:p(e.validateEndpoint,!0),includeAuthOnAssetFetch:p(e.includeAuthOnAssetFetch,!1),rate:p(e.rate,1),language:p(e.language,"en-US")};return t.serverProvider==="polly"?{...r,engine:p(r.engine,"neural"),format:p(r.format,"mp3"),speechMarksMode:p(r.speechMarksMode,"word+sentence")}:r},pe=t=>{const{enabled:e,provider:r,...s}=W(t);return se(s)},ie=t=>t.backend||"browser",ue=t=>{const e=ie(t)==="server"?t.serverProvider:void 0,r=e==="polly",s=t.transportMode||(e==="custom"?"custom":"pie"),i=Xt(t.mathSpeech);return{voice:t.defaultVoice,rate:t.rate,pitch:t.pitch,providerOptions:{...W(t.providerOptions),...t.language?{locale:t.language}:{},...r&&t.engine?{engine:t.engine}:{},...r&&typeof t.sampleRate=="number"?{sampleRate:t.sampleRate}:{},...r&&t.format?{format:t.format}:{},...r?{speechMarkTypes:t.speechMarksMode==="word+sentence"?["word","sentence"]:["word"]}:{},...s==="custom"&&typeof t.cache=="boolean"?{cache:t.cache}:{},...s==="custom"&&t.speedRate?{speedRate:t.speedRate}:{},...s==="custom"&&t.lang_id?{lang_id:t.lang_id}:{},...i?{mathSpeech:i}:{}},apiEndpoint:t.apiEndpoint,provider:e,language:t.language,transportMode:s,endpointMode:t.endpointMode,endpointValidationMode:t.endpointValidationMode,includeAuthOnAssetFetch:t.includeAuthOnAssetFetch,assetOrigins:t.assetOrigins,credentials:t.credentials,headers:t.headers,validateEndpoint:t.validateEndpoint,...typeof t.mathTokenHighlighting=="boolean"?{mathTokenHighlighting:t.mathTokenHighlighting}:{}}},oe=t=>mt(t.layoutMode),ve=t=>{switch(oe(t)){case"reserved-row":return{mount:"before-buttons",controlsRow:{reserveSpace:!0,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!1}};case"expanding-row":return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!0},headerOverlay:{expandWhenToolActive:!1}};case"floating-overlay":return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!1}};default:return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!0}}}};export{oe as a,ve as i,mt as n,pe as o,re as r,ue as t};
|
/package/dist/browser/chunks/{ItemToolBar-jx38w99s-58defccc.js → ItemToolBar-66hcwmfw-3bcb82a3.js}
RENAMED
|
File without changes
|
|
File without changes
|