@astl/astrolabe 0.1.1 → 0.1.2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cdn/astrolabe-editor.js +55 -19
  3. package/dist/cdn/astrolabe-editor.js.map +1 -1
  4. package/dist/cdn/astrolabe.standalone.js +74 -20
  5. package/dist/cdn/chunks/{help-form-DaC6KaFG.js → help-form-CDg3TCwI.js} +2 -2
  6. package/dist/cdn/chunks/{help-form-DaC6KaFG.js.map → help-form-CDg3TCwI.js.map} +1 -1
  7. package/dist/cdn/chunks/{insert-menu-LgrifBYT.js → insert-menu-7vANVmTK.js} +2 -2
  8. package/dist/cdn/chunks/{insert-menu-LgrifBYT.js.map → insert-menu-7vANVmTK.js.map} +1 -1
  9. package/dist/cdn/chunks/{issue-list-BgnXzXRM.js → issue-list-BT9qvnZU.js} +2 -2
  10. package/dist/cdn/chunks/{issue-list-BgnXzXRM.js.map → issue-list-BT9qvnZU.js.map} +1 -1
  11. package/dist/cdn/chunks/messages-D1aJfyS_.js +2 -0
  12. package/dist/cdn/chunks/messages-D1aJfyS_.js.map +1 -0
  13. package/dist/cdn/chunks/{source-view-DXKPFCl9.js → source-view-CZVxgTNQ.js} +2 -2
  14. package/dist/cdn/chunks/{source-view-DXKPFCl9.js.map → source-view-CZVxgTNQ.js.map} +1 -1
  15. package/dist/cdn/chunks/{style-form-D5haJtWM.js → style-form-DUGbG_kL.js} +2 -2
  16. package/dist/cdn/chunks/{style-form-D5haJtWM.js.map → style-form-DUGbG_kL.js.map} +1 -1
  17. package/dist/cdn/chunks/{style-messages-BbZpeD2a.js → style-messages-qdf3pZbT.js} +2 -2
  18. package/dist/cdn/chunks/{style-messages-BbZpeD2a.js.map → style-messages-qdf3pZbT.js.map} +1 -1
  19. package/dist/cdn/chunks/{style-rules-D45PZLCv.js → style-rules-D17QGzXk.js} +2 -2
  20. package/dist/cdn/chunks/{style-rules-D45PZLCv.js.map → style-rules-D17QGzXk.js.map} +1 -1
  21. package/dist/cdn/chunks/{styles-DxJJxVNH.js → styles-CdJT6Pp9.js} +2 -2
  22. package/dist/cdn/chunks/{styles-DxJJxVNH.js.map → styles-CdJT6Pp9.js.map} +1 -1
  23. package/dist/cdn/chunks/{surface-CgxfAwCR.js → surface-C6wtQkTY.js} +21 -3
  24. package/dist/cdn/chunks/{surface-CgxfAwCR.js.map → surface-C6wtQkTY.js.map} +1 -1
  25. package/package.json +9 -9
  26. package/dist/cdn/chunks/messages-9xiYDvRT.js +0 -2
  27. package/dist/cdn/chunks/messages-9xiYDvRT.js.map +0 -1
@@ -4568,7 +4568,7 @@ overflow-wrap: anywhere;
4568
4568
  <summary lang=${n.lang} dir=${n.dir}>${this.t(`ui.transcript`)}</summary>
4569
4569
  <div class="text"><slot data-tag="astl-transcript"></slot></div>
4570
4570
  </details>`:R}
4571
- </div>`}},Rj={manifest:$p,element:Lj,messages:Pj}})),Bj=[{tag:`astl-gap`,load:async()=>(await Promise.resolve().then(()=>(ED(),vD))).gapElement},{tag:`astl-choice`,load:async()=>(await Promise.resolve().then(()=>(HD(),RD))).choiceElement},{tag:`astl-select`,load:async()=>(await Promise.resolve().then(()=>(cO(),KD))).selectElement},{tag:`astl-true-false`,load:async()=>(await Promise.resolve().then(()=>(_O(),fO))).trueFalseElement},{tag:`astl-order`,load:async()=>(await Promise.resolve().then(()=>(LO(),OO))).orderElement},{tag:`astl-categorise`,load:async()=>(await Promise.resolve().then(()=>(ZO(),UO))).categoriseElement},{tag:`astl-match`,load:async()=>(await Promise.resolve().then(()=>(ck(),tk))).matchElement},{tag:`astl-word-bank`,load:async()=>(await Promise.resolve().then(()=>(yk(),fk))).wordBankElement},{tag:`astl-drop`,load:async()=>(await Promise.resolve().then(()=>(Ok(),Ck))).dropElement},{tag:`astl-word-search`,load:async()=>(await Promise.resolve().then(()=>(Bk(),Mk))).wordSearchElement},{tag:`astl-memory`,load:async()=>(await Promise.resolve().then(()=>(Qk(),Wk))).memoryElement},{tag:`astl-crossword`,load:async()=>(await Promise.resolve().then(()=>(cA(),nA))).crosswordElement},{tag:`astl-flash-cards`,load:async()=>(await Promise.resolve().then(()=>(gA(),fA))).flashCardsElement},{tag:`astl-long-answer`,load:async()=>(await Promise.resolve().then(()=>(TA(),bA))).longAnswerElement},{tag:`astl-mark-words`,load:async()=>(await Promise.resolve().then(()=>(NA(),kA))).markWordsElement},{tag:`astl-callout`,load:async()=>(await Promise.resolve().then(()=>(VA(),LA))).calloutElement},{tag:`astl-hotspot`,load:async()=>(await Promise.resolve().then(()=>(ij(),ej))).hotspotElement},{tag:`astl-image-drop`,load:async()=>(await Promise.resolve().then(()=>(hj(),cj))).imageDropElement},{tag:`astl-image-label`,load:async()=>(await Promise.resolve().then(()=>(Cj(),yj))).imageLabelElement},{tag:`astl-video`,load:async()=>(await Promise.resolve().then(()=>(Mj(),Dj))).videoElement},{tag:`astl-audio`,load:async()=>(await Promise.resolve().then(()=>(zj(),Ij))).audioElement}];function Vj(e){return e===32||e===9||e===10||e===12||e===13}function Hj(e){return e>=65&&e<=90||e>=97&&e<=122}function Uj(e,t){if(e.startsWith(`<!-->`,t))return t+5;if(e.startsWith(`<!--->`,t))return t+6;let n=[e.indexOf(`-->`,t+4),e.indexOf(`--!>`,t+4)].filter(e=>e>=0);if(n.length===0)return e.length;let r=Math.min(...n);return r+(e.startsWith(`-->`,r)?3:4)}function Wj(e,t){let n=e.indexOf(`>`,t);return n<0?e.length:n+1}function Gj(e,t,n){let r=RegExp(`</${n}(?=[\\t\\n\\f\\r />])`,`gi`);return r.lastIndex=t,r.exec(e)?.index??e.length}function Kj(e,t,n){let r=e.length,i=t+(n===`end`?2:1),a=i;for(;i<r;){let t=e.charCodeAt(i);if(Vj(t)||t===47||t===62)break;i++}let o=e.slice(a,i).toLowerCase(),s=[],c=(e,r)=>({type:n,name:o,start:t,end:e,attributes:s,selfClosing:r});for(;i<r;){let t=e.charCodeAt(i);if(Vj(t)){i++;continue}if(t===62)return c(i+1,!1);if(t===47){if(e.charCodeAt(i+1)===62)return c(i+2,!0);i++;continue}let n=i;for(i++;i<r;){let t=e.charCodeAt(i);if(Vj(t)||t===47||t===62||t===61)break;i++}let a=e.slice(n,i).toLowerCase(),o=i;for(;o<r&&Vj(e.charCodeAt(o));)o++;if(e.charCodeAt(o)!==61){s.push({name:a,raw:null,start:n,end:i});continue}for(o++;o<r&&Vj(e.charCodeAt(o));)o++;let l=e[o];if(l===`"`||l===`'`){let t=e.indexOf(l,o+1),c=t<0?r:t+1;s.push({name:a,raw:e.slice(o+1,t<0?r:t),start:n,end:c}),i=c}else{let t=o;for(;t<r&&!Vj(e.charCodeAt(t))&&e.charCodeAt(t)!==62;)t++;s.push({name:a,raw:e.slice(o,t),start:n,end:t}),i=t}}return c(r,!1)}function qj(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.indexOf(`<`,r);if(i<0)break;r=i;let a=e.charCodeAt(r+1);if(e.startsWith(`<!--`,r))r=Uj(e,r);else if(a===33||a===63)r=Wj(e,r+2);else if(a===47){let n=e.charCodeAt(r+2);if(Hj(n)){let n=Kj(e,r,`end`);t.push(n),r=n.end}else r=n===62?r+3:Wj(e,r+2)}else if(Hj(a)){let i=Kj(e,r,`start`);t.push(i),r=i.end,oM.has(i.name)?r=Gj(e,r,i.name):i.name===`plaintext`&&(r=n)}else r++}return t}function Jj(e){return e.includes(`-`)}function Yj(e){let t=[],n=[],r=e=>(n[n.length-1]?.children??t).push(e),i=(e,t,n)=>r({name:e.name,start:e.start,end:t,startTag:e.startTag,endTag:n,children:e.children});for(let t of qj(e)){if(t.type===`start`){sM.has(t.name)||t.selfClosing&&Jj(t.name)?r({name:t.name,start:t.start,end:t.end,startTag:t,endTag:null,children:[]}):n.push({name:t.name,start:t.start,startTag:t,children:[]});continue}let e=n.length-1;for(;e>=0&&n[e]?.name!==t.name;)e--;if(!(e<0)){for(;n.length-1>e;)i(n.pop(),t.start,null);i(n.pop(),t.end,t)}}for(;n.length>0;)i(n.pop(),e.length,null);return t}function Xj(e){if(!e.includes(`&`))return e;let[t]=Rc(`<b title="${e.replaceAll(`"`,`&quot;`)}"></b>`);return t?.type===`element`?t.attrs.title??e:e}function Zj(e,t){let n=e.attributes.find(e=>e.name===t);return n===void 0?null:n.raw===null?``:Xj(n.raw)}function Qj(e){let t=[],n=e=>{for(let r of e){let{name:e}=r;if(e===`astl-style`||e===`astl-columns`||e===`astl-column`||Je.has(e))n(r.children);else{if(e===`astl-page`||Jj(e)&&e!==cM){let n=Zj(r.startTag,`id`);if(t.push({tag:e,id:n,start:r.start,end:r.end,range:r}),e!==`astl-page`)continue}n(r.children)}}};return n(Yj(e)),t}function $j(e){return Qj(e).map(({tag:e,id:t,start:n,end:r})=>({tag:e,id:t,start:n,end:r}))}function eM(e){let t=new Set;for(let n of qj(e)){if(n.type!==`start`)continue;let e=Zj(n,`id`);e!==null&&t.add(e)}return t}function tM(e){return e.replace(uM,mM)}function nM(e){return e.replace(dM,mM)}function rM(e){return e.replace(fM,mM)}function iM(e,t){let n=e;for(let e of[...t].sort((e,t)=>t.start-e.start))n=n.slice(0,e.start)+e.text+n.slice(e.end);return n}function aM(e,t){let n=t;for(;n>0&&Vj(e.charCodeAt(n-1));)n--;return n}var oM,sM,cM,lM,uM,dM,fM,pM,mM,hM=n((()=>{w(),Qp(),oM=new Set([`script`,`style`,`textarea`,`title`,`xmp`,`iframe`,`noembed`,`noframes`,`noscript`]),sM=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),cM=`astl-doc`,lM=String.fromCodePoint(160),uM=RegExp(`[&<>${lM}]`,`g`),dM=RegExp(`[&"<>${lM}]`,`g`),fM=RegExp(`[&<>"'${lM}]`,`g`),pM={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,[lM]:`&nbsp;`},mM=e=>pM[e]??e}));function gM(e,t,n,r){if(!TM.test(n))throw TypeError(`Invalid attribute name "${n}"`);let i=t.attributes.filter(e=>e.name===n),a=i[0];if(r===null||r===!1)return i.map(t=>({start:aM(e,t.start),end:t.end,text:``}));if(a!==void 0){let e=Zj(t,n)??``;if(r===!0?e===``||e.toLowerCase()===n:e===r)return[]}let o=r===!0?n:`${n}="${nM(r)}"`;if(a!==void 0)return[{start:a.start,end:a.end,text:o}];let s=t.attributes[t.attributes.length-1]?.end??t.start+1+t.name.length;return[{start:s,end:s,text:` ${o}`}]}function _M(e,t){return e.children.flatMap(e=>e.name===t?[e]:_M(e,t))}function vM(e,t){let[n]=Rc(e.slice(t.start,t.end));return h(n)?g(n):``}function yM(e){return e.endTag?.start??e.end}function bM(e,t,n){let r=t.startTag;if(r.selfClosing&&t.endTag===null){let i=e.slice(r.start,aM(e,r.end-2));return{start:t.start,end:t.end,text:`${i}>${n}</${t.name}>`}}return{start:r.end,end:yM(t),text:n}}function xM(e,t,n){return t.startTag.selfClosing&&t.endTag===null?bM(e,t,n):t.endTag===null?{start:t.end,end:t.end,text:`${n}</${t.name}>`}:{start:t.endTag.start,end:t.endTag.start,text:n}}function SM(e,t,n){let[r,i]=n;if(r===void 0)return``;let a=i===void 0?e.slice(Math.max(t.startTag.end,aM(e,r.start)),r.start):e.slice(r.end,i.start);return/^\s*$/.test(a)?a:``}function CM(e,t,n,r){let i=_M(t,n),a=[];if(i.forEach((t,n)=>{let i=r[n];i===void 0?a.push({start:aM(e,t.start),end:t.end,text:``}):vM(e,t)!==i&&a.push(bM(e,t,tM(i)))}),r.length>i.length){let o=SM(e,t,i),s=r.slice(i.length).map(e=>`<${n}>${tM(e)}</${n}>`),c=i[i.length-1];c===void 0?a.push(xM(e,t,s.join(o))):a.push({start:c.end,end:c.end,text:s.map(e=>o+e).join(``)})}return a}function wM(e,t){let n=Yj(e)[0];if(n===void 0)return e;switch(t.kind){case`attribute`:return iM(e,gM(e,n.startTag,t.name,t.value));case`child-flag`:case`child-choice`:{let r=_M(n,t.tag)[t.index];return r===void 0?e:iM(e,gM(e,r.startTag,t.attribute,t.value))}case`text-list`:return iM(e,CM(e,n,t.tag,t.values));case`child-attributes`:{let n=e;for(let[e,r]of Object.entries(t.attributes))n=wM(n,{kind:`child-choice`,tag:t.tag,attribute:e,index:t.index,value:r});return n}case`child-add`:{if(!TM.test(t.tag))throw TypeError(`Invalid tag name "${t.tag}"`);let r=Object.entries(t.attributes).map(([e,t])=>{if(!TM.test(e))throw TypeError(`Invalid attribute name "${e}"`);return` ${e}="${nM(t)}"`}),i=`<${t.tag}${r.join(``)}></${t.tag}>`,a=_M(n,t.tag),o=a.at(-1)??n.children.at(-1);if(o===void 0)return iM(e,[xM(e,n,i)]);let s=SM(e,n,a.length>0?a:n.children);return iM(e,[{start:o.end,end:o.end,text:s+i}])}case`child-remove`:{let r=_M(n,t.tag)[t.index];return r===void 0?e:iM(e,[{start:aM(e,r.start),end:r.end,text:``}])}}}var TM,EM=n((()=>{w(),Qp(),hM(),TM=/^[a-z][a-z0-9-]*$/}));function DM(e){let t=e=>({kind:`attribute`,name:e.name,label:`editor.${e.name}`}),n=e=>e.visibility!==`derived`,r=e.scoring===null?[]:[`scoring`,`points`],i=jt(e).filter(e=>r.includes(e.name));return[...e.attributes.filter(n).map(t),...e.children.filter(e=>e.visibility===`private`&&e.content===`text`).map(e=>({kind:`text-list`,tag:e.tag,label:`editor.${e.tag}`})),...e.children.flatMap(e=>e.attributes.filter(e=>(e.type===`boolean`||e.type===`enum`)&&n(e)).map(t=>({kind:t.type===`boolean`?`child-flag`:`child-choice`,tag:e.tag,attribute:t.name,label:`editor.${e.tag}.${t.name}`}))),...i.map(t)]}function OM(e,t,n){return(t.name===`scoring`&&e.scoring!==null?Object.keys(e.scoring.modes):[...t.values??[]]).map(e=>({value:e,label:n.message(`editor.value.${t.name}.${e}`,e)}))}function kM(e,t){return t.name===`scoring`&&e.scoring!==null?e.scoring.default:t.default===void 0?null:String(t.default)}function AM(e,t,n,r,i=n.name,a=()=>null){let o=jt(t).find(e=>e.name===n.name);if(o===void 0)return null;let s=o.name,c=r.message(n.label,i),l=n.help===void 0?null:r.message(n.help,``),u={kind:`attribute`,name:s,label:c,help:l===``?null:l},d=GM(e,s),f=o.required===!0,p=n.options===void 0?null:a(GM(e,n.options.from)??``);if(p!==null&&n.options!==void 0){let e=d??``;return{...u,control:`select`,value:e,options:RM(p,n.options.tag,r)(e)}}let m=s===`scoring`&&t.scoring!==null;if(o.type===`enum`||m){let e=OM(t,o,r),n=d??kM(t,o)??``;return n===``&&!e.some(e=>e.value===``)?e.unshift({value:``,label:r.unset}):e.some(e=>e.value===n)||e.push({value:n,label:n}),{...u,control:`select`,value:n,options:e}}if(o.type===`number`||o.type===`integer`)return{...u,control:`number`,value:d??kM(t,o)??``,min:o.min??null,max:o.max??null,step:o.type===`integer`?`1`:`any`,required:f};if(o.type===`boolean`)return{...u,control:`checkbox`,checked:d!==null};let h=o.type===`url`?n.accept??null:null;return{...u,control:`text`,value:d??``,required:f,accept:h}}function jM(e){return new Map(e.flatMap(e=>e.kind===`picture-regions`||e.kind===`picture-points`?[[e.tag,e.kind]]:[]))}function MM(e,t){let n=e.children.find(e=>e.tag===t)?.attributes.find(e=>e.name===`shape`);if(n===void 0)return[`rect`];let r=[`rect`,`circle`,`polygon`].filter(e=>n.values?.includes(e));return r.length>0?r:[`rect`]}function NM(e,t,n,r,i=[n],a=()=>null){let o=n.help===void 0?null:r.message(n.help,``)||null,s=`tag`in n?jM(i).get(n.tag):void 0,c=(e,t)=>LM(e,t,r,s);switch(n.kind){case`attribute`:return AM(e,t,n,r,n.name,a);case`text-list`:return{kind:`text-list`,tag:n.tag,label:r.message(n.label,n.tag),help:o,values:KM(e,n.tag).map(g),max:t.children.find(e=>e.tag===n.tag)?.max??null,multiline:n.multiline===!0};case`child-flag`:{let t=KM(e,n.tag).map((e,t)=>({index:t,id:GM(e,`id`),label:c(e,t),checked:GM(e,n.attribute)!==null})),i={count:t.length,checked:t.filter(e=>e.checked).length},a=`${n.tag} ${n.attribute}`,o=n.help===void 0?null:r.message(n.help,``,i)||null;return{kind:`child-flag`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,a,i),help:o,children:t}}case`child-text`:return{kind:`child-text`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,`${n.tag} ${n.attribute}`),help:o,children:KM(e,n.tag).map((e,t)=>({index:t,id:GM(e,`id`),label:c(e,t),value:GM(e,n.attribute)??``}))};case`child-choice`:{let i=zM(e,t,n,r);return i===null?null:{kind:`child-choice`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,`${n.tag} ${n.attribute}`),help:o,control:i.control,children:KM(e,n.tag).map((e,t)=>{let r=GM(e,n.attribute)??``,a=i.options(r);return{index:t,id:GM(e,`id`),label:c(e,t),value:r,options:a}})}}case`child-table`:return PM(e,t,n,r,o);case`picture-regions`:case`picture-points`:{let a={tag:n.tag,label:r.message(n.label,n.tag),help:o,elementTag:e.tag,srcAttribute:n.src,src:GM(e,n.src)??``},s=KM(e,n.tag);if(n.kind===`picture-points`)return{...a,kind:`picture-points`,points:s.map((e,t)=>({index:t,id:GM(e,`id`)??``,x:FM(GM(e,`x`)),y:FM(GM(e,`y`)),label:GM(e,`label`)??``}))};let c=i.find(e=>e.kind===`child-flag`&&e.tag===n.tag),l=c!==void 0&&`attribute`in c?c.attribute:null;return{...a,kind:`picture-regions`,shapes:MM(t,n.tag),flag:l,regions:s.map((e,t)=>{let n=GM(e,`shape`);return{index:t,id:GM(e,`id`)??``,shape:n===`circle`||n===`polygon`?n:`rect`,x:FM(GM(e,`x`)),y:FM(GM(e,`y`)),width:FM(GM(e,`width`)),height:FM(GM(e,`height`)),r:FM(GM(e,`r`)),points:IM(GM(e,`points`)),label:GM(e,`label`)??``,flagged:l!==null&&GM(e,l)!==null}})}}}}function PM(e,t,n,r,i){let a=t.children.find(e=>e.tag===n.tag);if(a===void 0)return null;let o=n.columns.flatMap(e=>{let t=a.attributes.find(t=>t.name===e.attribute);if(t===void 0)return[];let n=t.type===`integer`||t.type===`number`;return[{attribute:t.name,label:r.message(e.label,t.name),control:t.type===`enum`?`select`:n?`number`:`text`,options:(t.values??[]).map(e=>({value:e,label:r.message(`editor.value.${t.name}.${e}`,e)})),min:t.min??null,max:t.max??null,step:t.type===`integer`?`1`:`any`,required:t.required===!0}]}),s=KM(e,n.tag),c=n.tag.replace(/^astl-/,``),l=new Set(s.map(e=>GM(e,`id`))),u=s.length+1;for(;l.has(`${c}-${u}`);)u++;let d={id:`${c}-${u}`};for(let e of a.attributes)e.required===!0&&e.name!==`id`&&(d[e.name]=e.values?.[0]??(e.min===void 0?``:String(e.min)));return{kind:`child-table`,tag:n.tag,label:r.message(n.label,n.tag),help:i,columns:o,rows:s.map((e,t)=>({index:t,id:GM(e,`id`),label:LM(e,t,r),values:o.map(t=>GM(e,t.attribute)??``)})),added:d,min:a.min,max:a.max}}function FM(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}function IM(e){return(e??``).trim().split(/\s+/).filter(e=>e!==``).map(e=>{let[t=``,n=``]=e.split(`,`);return[FM(t),FM(n)]})}function LM(e,t,n,r){let i=qM(e).replace(/\s+/g,` `).trim();return i!==``||r===void 0?i||n.untitled(t+1):(GM(e,`label`)??``).replace(/\s+/g,` `).trim()||(r===`picture-regions`?n.region(t+1):n.point(t+1))}function RM(e,t,n){let r=KM(e,t).flatMap((e,t)=>{let r=GM(e,`id`);return r===null||r===``?[]:[{value:r,label:LM(e,t,n)}]});return e=>e===``?[{value:``,label:n.unset},...r]:r.some(t=>t.value===e)?r:[...r,{value:e,label:e}]}function zM(e,t,n,r){if(n.options===void 0){let e=t.children.find(e=>e.tag===n.tag)?.attributes.find(e=>e.name===n.attribute);if(e?.type!==`enum`)return null;let i=(e.values??[]).map(t=>({value:t,label:r.message(`editor.value.${e.name}.${t}`,t)}));return{control:`radios`,options:()=>i}}return{control:`select`,options:RM(e,n.options,r)}}function BM(e,t,n,r){let i=GM(e,`style-template`)??``,a=[{value:``,label:n},...r];return a.some(e=>e.value===i)||a.push({value:i,label:i}),{kind:`attribute`,control:`select`,name:wt,label:t,help:null,value:i,options:a}}function VM(e,t){if(t.variants===null)return null;let n=GM(e,`variant`);return n!==null&&t.variants.values.includes(n)?n:t.variants.default}function HM(e,t){return e.kind!==`attribute`||e.variants===void 0||e.variants.includes(t??``)}function UM(e,t,n,r,i){let a=e=>n.some(t=>t.kind===`attribute`&&t.name===e),o=[];if(t.variants!==null&&!a(`variant`)){let n=AM(e,t,{kind:`attribute`,name:`variant`,label:`editor.variant`},r,r.variant);n!==null&&o.push(n)}let s=GM(e,wt)!==null;if((i.length>0||s)&&!a(`style-template`)){let t=r.message(`editor.${wt}`,r.styleTemplate);o.push(BM(e,t,r.sameAsDocument,i))}return o}function WM(e,t,n,r,i=[],a=()=>null){let o=n?.fields??DM(t),s=VM(e,t),c=o.filter(e=>HM(e,s)).flatMap(n=>NM(e,t,n,r,o,a)??[]);return{tag:e.tag,id:GM(e,`id`),label:n===null?e.tag:r.message(n.label,e.tag),icon:n?.icon??null,fields:[...c,...UM(e,t,c,r,i)]}}var GM,KM,qM,JM=n((()=>{w(),GM=(e,t)=>Object.hasOwn(e.attrs,t)?e.attrs[t]??``:null,KM=(e,t)=>e.children.flatMap(e=>e.type===`element`?e.tag===t?[e]:KM(e,t):[]),qM=e=>e.type===`text`?e.value:e.tag===`img`?` ${e.attrs.alt??``} `:e.children.map(qM).join(``)})),YM,XM=n((()=>{YM={"insert.title":`Insert`,"insert.components":`Components`,"insert.exercises":`Exercises`,"insert.content":`Content`,"insert.picture":`Picture`,"insert.picture.description":`A picture with alt text and an optional caption`,"insert.pageBreak":`Page break`,"insert.pageBreak.description":`Split the exercise into steps at the cursor`,"insert.hint":`Hint`,"insert.hint.description":`One students ask for: for the question at the cursor, else for the page`,"insert.explanation":`Explanation`,"insert.explanation.description":`Why the answer is right, shown once it is checked`,"insert.feedback":`Feedback`,"insert.feedback.description":`A text by the verdict, shown once the answer is checked`,"insert.text":`Text`,"insert.text.description":`A paragraph after this block`,"insert.noMatch":`Nothing matches “{query}”.`,"toolbar.label":`Format and insert`,"toolbar.style":`Text style: {style}`,"toolbar.paragraph":`Paragraph`,"toolbar.heading":`Heading`,"toolbar.subheading":`Subheading`,"toolbar.bold":`Bold`,"toolbar.italic":`Italic`,"toolbar.underline":`Underline`,"toolbar.link":`Link`,"toolbar.link.address":`Link address`,"toolbar.link.apply":`Apply`,"toolbar.link.remove":`Remove link`,"toolbar.link.blocked":`This address is not allowed here.`,"toolbar.bulleted":`Bulleted list`,"toolbar.numbered":`Numbered list`,"toolbar.undo":`Undo`,"toolbar.redo":`Redo`,"toolbar.elements":`Elements`,"toolbar.templates":`Templates`,"toolbar.layouts":`Layout`,"toolbar.view":`View`,"toolbar.search":`Search`,"block.text":`Text`,"block.gap":`Gap`,"issue.onPage":`{n} on page {page}`,"picture.title":`Add a picture`,"picture.editTitle":`Edit the picture`,"picture.file":`Upload a picture`,"picture.library":`Choose from the library`,"picture.urlOnly":`This editor adds pictures by their address only: it has no upload.`,"picture.src":`Picture address (URL)`,"picture.alt":`Alt text`,"picture.altHelp":`What the picture shows, for students who cannot see it. Do not give an answer away.`,"picture.decorative":`Decorative: screen readers skip it (alt="")`,"picture.caption":`Caption (optional)`,"picture.cancel":`Cancel`,"picture.insert":`Insert`,"picture.save":`Save`,"picture.uploading":`Uploading…`,"picture.uploaded":`Uploaded.`,"picture.uploadFailed":`The upload failed. Try again, or give the picture's address.`,"picture.uploadBlocked":`The upload gave an address the URL policy does not allow.`,"picture.picked":`Chosen from the library.`,"picture.pickFailed":`The library did not open. Try again, or give the picture's address.`,"picture.pickBlocked":`The library returned an address the URL policy does not allow.`,"picture.srcMissing":`Give the picture's address, or upload it.`,"picture.srcBlocked":`The URL policy does not allow this address.`,"picture.altMissing":`Describe the picture, or mark it as decorative.`,"picture.altRequired":`Describe the picture: students who cannot see it need its alt text for the task.`,"picture.pasteRefused":`This editor has no upload, so a picture file cannot be pasted or dropped. Add it with Insert, Picture, by its address.`,"field.picture.src":`Picture address (URL)`,"field.regions.draw":`Drag on the picture to draw a zone, or add one and type its numbers.`,"field.points.place":`Click the picture to place a pin, or add one and type its position.`,"field.region":`Zone {n}`,"field.region.add":`Add a zone`,"field.region.remove":`Remove zone {n}`,"field.point":`Pin {n}`,"field.point.add":`Add a pin`,"field.point.remove":`Remove pin {n}`,"field.shape":`Shape`,"field.shape.rect":`Rectangle`,"field.shape.circle":`Circle`,"field.shape.polygon":`Polygon`,"field.x":`From the left (%)`,"field.y":`From the top (%)`,"field.width":`Width (%)`,"field.height":`Height (%)`,"field.cx":`Centre from the left (%)`,"field.cy":`Centre from the top (%)`,"field.r":`Radius (% of the width)`,"field.vertex.x":`Point {n} from the left (%)`,"field.vertex.y":`Point {n} from the top (%)`,"field.vertex.add":`Add a point`,"field.vertex.remove":`Remove point {n}`,"field.label":`Label`,"field.label.optional":`Label (optional)`,"field.more":`Only the first {shown} of {count} are listed here: edit the others in the source.`,"inspector.title":`Properties`,"inspector.delete":`Delete`,"inspector.moveUp":`Move up`,"inspector.moveDown":`Move down`,"inspector.empty":`Put the cursor in an exercise element to edit its answers and settings.`,"inspector.unsupported":`Element {tag} cannot be edited here.`,"inspector.unset":`(not set)`,"inspector.item":`{label} {n}`,"inspector.add":`Add`,"inspector.remove":`Remove`,"inspector.removeItem":`Remove: {label} {n}`,"inspector.untitled":`Item {n} (empty)`,"inspector.variant":`Variant`,"inspector.styleTemplate":`Element style`,"inspector.styleTemplate.inherit":`Same as the exercise`,"inspector.styleTemplate.default":`Default look`,"inspector.document":`Exercise`,"inspector.documentStyle":`Look of the whole exercise`,"inspector.upload":`Upload a file`,"inspector.uploadItem":`Upload a file: {label}`,"inspector.uploading":`Uploading…`,"inspector.uploaded":`Uploaded.`,"inspector.uploadFailed":`The upload failed. Try again, or type its address.`,"inspector.uploadBlocked":`The upload gave an address the URL policy does not allow.`,"issues.title":`Problems`,"issues.errors":`{count, plural, one {# error} other {# errors}}`,"issues.warnings":`{count, plural, one {# warning} other {# warnings}}`,"issues.summary":`{errors}, {warnings}`,"issues.none":`No errors or warnings.`,"severity.error":`Error`,"severity.warning":`Warning`,"label.text":`{label}: {text}`,"preview.title":`Student view`,"preview.show":`Preview`,"preview.refresh":`Refresh preview`,"preview.hint":`Press Preview to try the exercise the way a student will see it.`,"preview.loading":`Preparing the preview…`,"preview.stale":`The document changed after this preview. Refresh it to see the changes.`,"preview.invalid":`{count, plural, one {Fix this error to see the preview:} other {Fix these # errors to see the preview:}}`,"preview.failed":`The preview could not be shown.`,"surface.label":`Exercise content`,"surface.pageNumber":`Page {page} of {pages}`,"surface.pageTitle":`Page title`,"surface.pageJoin":`Join with page {previous}`,"surface.pageAdded":`Page {page} added`,"surface.pageJoined":`Page {page} joined with page {previous}`,"surface.pageDelete":`Delete page`,"surface.pageDeleted":`Deleted page {n}`,"surface.pageAddTitle":`Add title`,"surface.pageRemoveTitle":`Remove title`,"surface.pageTitleOf":`Title of page {page}`,"surface.pageTitleRemoved":`Removed the title of page {page}`,"surface.points":`{points, plural, one {# pt} other {# pts}}`,"surface.items":`{n, plural, one {# item} other {# items}}`,"surface.blockMovedUp":`Block moved up, now block {n}`,"surface.blockMovedDown":`Block moved down, now block {n}`,"surface.blockRemoved":`Block {n} deleted`,"surface.addOption":`Add option`,"surface.chip.empty":`No answer`,"surface.chip.more":`+{n}`,"surface.picture.alt":`Picture: {alt}`,"surface.picture.decorative":`Picture, decorative (no alt text)`,"surface.picture.noAlt":`Picture without alt text`,"surface.picture.blocked":`(not shown: the URL policy does not allow its address)`,"surface.picture.edit":`Edit`,"surface.loading":`Loading the editor…`,"surface.failed":`The editor could not be loaded. Reload the page to try again.`,"view.visual":`Visual`,"view.source":`HTML`,"view.sourceLabel":`The exercise as HTML`,"view.sourceErrors":`{n, plural, one {The HTML has # error. Fix it to go back.} other {The HTML has # errors. Fix them to go back.}}`,"status.elements":`{n, plural, one {# element} other {# elements}}`,"status.errors":`{n, plural, one {# error} other {# errors}}`,"status.warnings":`{n, plural, one {# warning} other {# warnings}}`,"status.ready":`Ready to share`,"insert.layouts":`Layout`,"insert.layout.two":`Two columns`,"insert.layout.two.description":`Two columns of the same width.`,"insert.layout.three":`Three columns`,"insert.layout.three.description":`Three columns of the same width.`,"insert.layout.wide-narrow":`Wide + narrow`,"insert.layout.wide-narrow.description":`A wide column, then a narrow one.`,"insert.layout.narrow-wide":`Narrow + wide`,"insert.layout.narrow-wide.description":`A narrow column, then a wide one.`,"insert.layout.picture-text":`Picture beside text`,"insert.layout.picture-text.description":`A picture you choose, with text next to it.`,"layout.section":`Columns`,"layout.change":`Change layout`,"layout.other":`Another layout`,"layout.unwrap":`Remove layout`,"layout.delete":`Delete with content`,"layout.confirm":`Delete the layout and its content?`,"layout.confirmDelete":`Yes, delete`,"layout.cancel":`Cancel`,"toolbar.font":`Font: {value}`,"toolbar.font.name":`Font`,"toolbar.size":`Size: {value}`,"toolbar.size.name":`Size`,"toolbar.color":`Text colour`,"toolbar.highlight":`Highlight`,"toolbar.align":`Alignment`,"toolbar.align.start":`Left`,"toolbar.align.center":`Centre`,"toolbar.align.end":`Right`,"toolbar.align.justify":`Justified`,"toolbar.spacing":`Spacing`,"toolbar.spacing.line":`Line height`,"toolbar.spacing.after":`Space after`,"toolbar.spacing.none":`None`,"toolbar.spacing.small":`Small`,"toolbar.spacing.medium":`Medium`,"toolbar.spacing.large":`Large`,"toolbar.clear":`Clear formatting`,"toolbar.default":`Default`,"toolbar.myStyles":`My styles`,"toolbar.readyStyles":`Ready styles`,"style.preset.note":`Note`,"style.preset.tip":`Tip`,"style.preset.important":`Important`,"style.preset.definition":`Definition`,"style.preset.example":`Example`,"style.preset.quote":`Quote`,"style.preset.highlight":`Highlight`,"style.preset.small-print":`Small print`,"style.color.theme":`Theme colours`,"style.color.swatch":`Theme colour {n}`,"style.color.custom":`Custom colour`,"style.color.picker":`Pick a colour`,"style.color.invalid":`Write a colour as #rrggbb.`,"style.color.none":`No colour`,"style.close":`Close`,"style.form.none":`Put the cursor in what you want to style.`,"style.target.picture":`Picture style`,"style.target.figure":`Picture and caption style`,"style.target.block":`Block style`,"style.target.component":`Element style`,"style.target.column":`Column style`,"style.target.layout":`Layout style`,"style.position.inline":`In the text`,"style.position.start":`On the left`,"style.position.end":`On the right`,"style.position.center":`Centred`,"style.position.full":`Full width`,"style.rules.open":`Manage styles…`,"style.rules.title":`Styles`,"inspector.style":`Style`,"surface.picture.place":`Position and size: {position}, {width}`,"surface.picture.placeAuto":`Position and size: {position}`,"style.target.more":`{target}…`,"help.cost":`costs {percent}%`,"help.when.correct":`Correct`,"help.when.incorrect":`Wrong`,"help.when.partial":`Partly correct`,"help.when.omitted":`Skipped`,"help.costLabel":`Cost of the hint`,"help.whenLabel":`For the result`}})),ZM,QM=n((()=>{ZM={"insert.title":`Wstaw`,"insert.components":`Elementy`,"insert.exercises":`Ćwiczenia`,"insert.content":`Treść`,"insert.picture":`Obrazek`,"insert.picture.description":`Obrazek z tekstem alternatywnym i podpisem do wyboru`,"insert.pageBreak":`Podział strony`,"insert.pageBreak.description":`Podziel ćwiczenie na kroki od miejsca kursora`,"insert.hint":`Podpowiedź`,"insert.hint.description":`Na prośbę ucznia: do pytania przy kursorze, a poza nim do strony`,"insert.explanation":`Wyjaśnienie`,"insert.explanation.description":`Dlaczego odpowiedź jest dobra, widoczne po sprawdzeniu`,"insert.feedback":`Informacja zwrotna`,"insert.feedback.description":`Tekst zależny od wyniku, widoczny po sprawdzeniu`,"insert.text":`Tekst`,"insert.text.description":`Akapit po tym bloku`,"insert.noMatch":`Nic nie pasuje do „{query}”.`,"toolbar.label":`Formatowanie i wstawianie`,"toolbar.style":`Styl tekstu: {style}`,"toolbar.paragraph":`Akapit`,"toolbar.heading":`Nagłówek`,"toolbar.subheading":`Podtytuł`,"toolbar.bold":`Pogrubienie`,"toolbar.italic":`Kursywa`,"toolbar.underline":`Podkreślenie`,"toolbar.link":`Link`,"toolbar.link.address":`Adres linku`,"toolbar.link.apply":`Zastosuj`,"toolbar.link.remove":`Usuń link`,"toolbar.link.blocked":`Tego adresu nie można tu użyć.`,"toolbar.bulleted":`Lista punktowana`,"toolbar.numbered":`Lista numerowana`,"toolbar.undo":`Cofnij`,"toolbar.redo":`Ponów`,"toolbar.elements":`Elementy`,"toolbar.templates":`Szablony`,"toolbar.layouts":`Układ`,"toolbar.view":`Widok`,"toolbar.search":`Szukaj`,"block.text":`Tekst`,"block.gap":`Luka`,"issue.onPage":`{n} na stronie {page}`,"picture.title":`Dodaj obrazek`,"picture.editTitle":`Edytuj obrazek`,"picture.file":`Wgraj obrazek`,"picture.library":`Wybierz z biblioteki`,"picture.urlOnly":`Ten edytor dodaje obrazki tylko po adresie: nie ma wgrywania.`,"picture.src":`Adres obrazka (URL)`,"picture.alt":`Tekst alternatywny`,"picture.altHelp":`Co przedstawia obrazek, dla uczniów, którzy go nie widzą. Nie zdradzaj odpowiedzi.`,"picture.decorative":`Ozdobny: czytniki ekranu go pomijają (alt="")`,"picture.caption":`Podpis (opcjonalny)`,"picture.cancel":`Anuluj`,"picture.insert":`Wstaw`,"picture.save":`Zapisz`,"picture.uploading":`Wgrywam…`,"picture.uploaded":`Wgrano.`,"picture.uploadFailed":`Nie udało się wgrać obrazka. Spróbuj ponownie albo podaj jego adres.`,"picture.uploadBlocked":`Wgrywanie zwróciło adres, na który nie pozwala polityka adresów.`,"picture.picked":`Wybrano z biblioteki.`,"picture.pickFailed":`Nie udało się otworzyć biblioteki. Spróbuj ponownie albo podaj adres obrazka.`,"picture.pickBlocked":`Biblioteka zwróciła adres, na który nie pozwala polityka adresów.`,"picture.srcMissing":`Podaj adres obrazka albo go wgraj.`,"picture.srcBlocked":`Polityka adresów nie pozwala na ten adres.`,"picture.altMissing":`Opisz obrazek albo oznacz go jako ozdobny.`,"picture.altRequired":`Opisz obrazek: uczniowie, którzy go nie widzą, potrzebują tekstu alternatywnego do zadania.`,"picture.pasteRefused":`Ten edytor nie ma wgrywania, więc nie można wkleić ani upuścić pliku obrazka. Dodaj go przez Wstaw, Obrazek, podając adres.`,"field.picture.src":`Adres obrazka (URL)`,"field.regions.draw":`Przeciągnij po obrazku, aby narysować strefę, albo dodaj ją i wpisz jej liczby.`,"field.points.place":`Kliknij obrazek, aby wbić pinezkę, albo dodaj ją i wpisz jej położenie.`,"field.region":`Strefa {n}`,"field.region.add":`Dodaj strefę`,"field.region.remove":`Usuń strefę {n}`,"field.point":`Pinezka {n}`,"field.point.add":`Dodaj pinezkę`,"field.point.remove":`Usuń pinezkę {n}`,"field.shape":`Kształt`,"field.shape.rect":`Prostokąt`,"field.shape.circle":`Koło`,"field.shape.polygon":`Wielokąt`,"field.x":`Od lewej (%)`,"field.y":`Od góry (%)`,"field.width":`Szerokość (%)`,"field.height":`Wysokość (%)`,"field.cx":`Środek od lewej (%)`,"field.cy":`Środek od góry (%)`,"field.r":`Promień (% szerokości)`,"field.vertex.x":`Punkt {n} od lewej (%)`,"field.vertex.y":`Punkt {n} od góry (%)`,"field.vertex.add":`Dodaj punkt`,"field.vertex.remove":`Usuń punkt {n}`,"field.label":`Etykieta`,"field.label.optional":`Etykieta (opcjonalna)`,"field.more":`Tu widać tylko pierwsze {shown} z {count}: pozostałe edytuj w źródle.`,"inspector.title":`Właściwości`,"inspector.delete":`Usuń`,"inspector.moveUp":`Przenieś wyżej`,"inspector.moveDown":`Przenieś niżej`,"inspector.empty":`Umieść kursor w elemencie ćwiczenia, aby edytować jego odpowiedzi i ustawienia.`,"inspector.unsupported":`Elementu {tag} nie można tu edytować.`,"inspector.unset":`(nie ustawiono)`,"inspector.item":`{label} {n}`,"inspector.add":`Dodaj`,"inspector.remove":`Usuń`,"inspector.removeItem":`Usuń: {label} {n}`,"inspector.untitled":`Element {n} (pusty)`,"inspector.variant":`Wariant`,"inspector.styleTemplate":`Styl elementu`,"inspector.styleTemplate.inherit":`Jak całe ćwiczenie`,"inspector.styleTemplate.default":`Domyślny wygląd`,"inspector.document":`Ćwiczenie`,"inspector.documentStyle":`Wygląd całego ćwiczenia`,"inspector.upload":`Wgraj plik`,"inspector.uploadItem":`Wgraj plik: {label}`,"inspector.uploading":`Wgrywam…`,"inspector.uploaded":`Wgrano.`,"inspector.uploadFailed":`Nie udało się wgrać pliku. Spróbuj ponownie albo wpisz jego adres.`,"inspector.uploadBlocked":`Wgrywanie zwróciło adres, na który nie pozwala polityka adresów.`,"issues.title":`Problemy`,"issues.errors":`{count, plural, one {# błąd} few {# błędy} many {# błędów} other {# błędu}}`,"issues.warnings":`{count, plural, one {# ostrzeżenie} few {# ostrzeżenia} many {# ostrzeżeń} other {# ostrzeżenia}}`,"issues.summary":`{errors}, {warnings}`,"issues.none":`Brak błędów i ostrzeżeń.`,"severity.error":`Błąd`,"severity.warning":`Ostrzeżenie`,"label.text":`{label}: {text}`,"preview.title":`Widok ucznia`,"preview.show":`Podgląd`,"preview.refresh":`Odśwież podgląd`,"preview.hint":`Naciśnij „Podgląd”, aby wypróbować ćwiczenie tak, jak zobaczy je uczeń.`,"preview.loading":`Przygotowuję podgląd…`,"preview.stale":`Dokument zmienił się po tym podglądzie. Odśwież go, aby zobaczyć zmiany.`,"preview.invalid":`{count, plural, one {Popraw ten błąd, aby zobaczyć podgląd:} few {Popraw te # błędy, aby zobaczyć podgląd:} many {Popraw tych # błędów, aby zobaczyć podgląd:} other {Popraw te # błędu, aby zobaczyć podgląd:}}`,"preview.failed":`Nie udało się pokazać podglądu.`,"surface.label":`Treść ćwiczenia`,"surface.pageNumber":`Strona {page} z {pages}`,"surface.pageTitle":`Tytuł strony`,"surface.pageJoin":`Połącz ze stroną {previous}`,"surface.pageAdded":`Dodano stronę {page}`,"surface.pageJoined":`Strona {page} połączona ze stroną {previous}`,"surface.pageDelete":`Usuń stronę`,"surface.pageDeleted":`Usunięto stronę {n}`,"surface.pageAddTitle":`Dodaj tytuł`,"surface.pageRemoveTitle":`Usuń tytuł`,"surface.pageTitleOf":`Tytuł strony {page}`,"surface.pageTitleRemoved":`Usunięto tytuł strony {page}`,"surface.points":`{points, plural, one {# pkt} few {# pkt} many {# pkt} other {# pkt}}`,"surface.items":`{n, plural, one {# element} few {# elementy} many {# elementów} other {# elementu}}`,"surface.blockMovedUp":`Blok przesunięty w górę, teraz to blok {n}`,"surface.blockMovedDown":`Blok przesunięty w dół, teraz to blok {n}`,"surface.blockRemoved":`Usunięto blok {n}`,"surface.addOption":`Dodaj odpowiedź`,"surface.chip.empty":`Brak odpowiedzi`,"surface.chip.more":`+{n}`,"surface.picture.alt":`Obrazek: {alt}`,"surface.picture.decorative":`Obrazek ozdobny (bez tekstu alternatywnego)`,"surface.picture.noAlt":`Obrazek bez tekstu alternatywnego`,"surface.picture.blocked":`(niepokazany: polityka adresów nie pozwala na jego adres)`,"surface.picture.edit":`Edytuj`,"surface.loading":`Wczytuję edytor…`,"surface.failed":`Nie udało się wczytać edytora. Odśwież stronę, aby spróbować ponownie.`,"view.visual":`Wizualny`,"view.source":`HTML`,"view.sourceLabel":`Ćwiczenie jako HTML`,"view.sourceErrors":`{n, plural, one {HTML ma # błąd. Popraw go, aby wrócić.} few {HTML ma # błędy. Popraw je, aby wrócić.} many {HTML ma # błędów. Popraw je, aby wrócić.} other {HTML ma # błędu. Popraw go, aby wrócić.}}`,"status.elements":`{n, plural, one {# element} few {# elementy} many {# elementów} other {# elementu}}`,"status.errors":`{n, plural, one {# błąd} few {# błędy} many {# błędów} other {# błędu}}`,"status.warnings":`{n, plural, one {# ostrzeżenie} few {# ostrzeżenia} many {# ostrzeżeń} other {# ostrzeżenia}}`,"status.ready":`Gotowe do udostępnienia`,"insert.layouts":`Układ`,"insert.layout.two":`Dwie kolumny`,"insert.layout.two.description":`Dwie kolumny tej samej szerokości.`,"insert.layout.three":`Trzy kolumny`,"insert.layout.three.description":`Trzy kolumny tej samej szerokości.`,"insert.layout.wide-narrow":`Szeroka + wąska`,"insert.layout.wide-narrow.description":`Szeroka kolumna, a po niej wąska.`,"insert.layout.narrow-wide":`Wąska + szeroka`,"insert.layout.narrow-wide.description":`Wąska kolumna, a po niej szeroka.`,"insert.layout.picture-text":`Obrazek obok tekstu`,"insert.layout.picture-text.description":`Wybrany obrazek, a obok niego tekst.`,"layout.section":`Kolumny`,"layout.change":`Zmień układ`,"layout.other":`Inny układ`,"layout.unwrap":`Usuń układ`,"layout.delete":`Usuń z zawartością`,"layout.confirm":`Usunąć układ razem z zawartością?`,"layout.confirmDelete":`Tak, usuń`,"layout.cancel":`Anuluj`,"toolbar.font":`Czcionka: {value}`,"toolbar.font.name":`Czcionka`,"toolbar.size":`Rozmiar: {value}`,"toolbar.size.name":`Rozmiar`,"toolbar.color":`Kolor tekstu`,"toolbar.highlight":`Wyróżnienie`,"toolbar.align":`Wyrównanie`,"toolbar.align.start":`Do lewej`,"toolbar.align.center":`Do środka`,"toolbar.align.end":`Do prawej`,"toolbar.align.justify":`Wyjustowane`,"toolbar.spacing":`Odstępy`,"toolbar.spacing.line":`Interlinia`,"toolbar.spacing.after":`Odstęp po`,"toolbar.spacing.none":`Brak`,"toolbar.spacing.small":`Mały`,"toolbar.spacing.medium":`Średni`,"toolbar.spacing.large":`Duży`,"toolbar.clear":`Wyczyść formatowanie`,"toolbar.default":`Domyślnie`,"toolbar.myStyles":`Moje style`,"toolbar.readyStyles":`Gotowe style`,"style.preset.note":`Uwaga`,"style.preset.tip":`Wskazówka`,"style.preset.important":`Ważne`,"style.preset.definition":`Definicja`,"style.preset.example":`Przykład`,"style.preset.quote":`Cytat`,"style.preset.highlight":`Wyróżnienie`,"style.preset.small-print":`Mały druk`,"style.color.theme":`Kolory motywu`,"style.color.swatch":`Kolor motywu {n}`,"style.color.custom":`Własny kolor`,"style.color.picker":`Wybierz kolor`,"style.color.invalid":`Wpisz kolor jako #rrggbb.`,"style.color.none":`Bez koloru`,"style.close":`Zamknij`,"style.form.none":`Ustaw kursor w tym, co chcesz ostylować.`,"style.target.picture":`Styl obrazka`,"style.target.figure":`Styl obrazka z podpisem`,"style.target.block":`Styl bloku`,"style.target.component":`Styl elementu`,"style.target.column":`Styl kolumny`,"style.target.layout":`Styl układu`,"style.position.inline":`W tekście`,"style.position.start":`Po lewej`,"style.position.end":`Po prawej`,"style.position.center":`Na środku`,"style.position.full":`Cała szerokość`,"style.rules.open":`Zarządzaj stylami…`,"style.rules.title":`Style`,"inspector.style":`Styl`,"surface.picture.place":`Położenie i rozmiar: {position}, {width}`,"surface.picture.placeAuto":`Położenie i rozmiar: {position}`,"style.target.more":`{target}…`,"help.cost":`koszt {percent}%`,"help.when.correct":`Dobrze`,"help.when.incorrect":`Źle`,"help.when.partial":`Częściowo dobrze`,"help.when.omitted":`Pominięte`,"help.costLabel":`Koszt podpowiedzi`,"help.whenLabel":`Dla wyniku`}})),H,$M,eN=n((()=>{XM(),QM(),H=`astl.editor`,$M=[{namespace:H,locale:`en`,messages:YM},{namespace:H,locale:`pl`,messages:ZM}]}));function tN(e,t=``){let n=e===`picture-text`?cN(t.startsWith(`<figure`)?t:`<p>${t}</p>`)+cN():sN[e].map(e=>cN(`<p></p>`,e)).join(``);return`<astl-columns${e===`picture-text`?` style="align-items: start"`:``}>${n}</astl-columns>`}var nN,rN,iN,aN,oN,sN,cN,lN=n((()=>{nN=e=>new Map(e.split(`;`).flatMap(e=>{let t=e.indexOf(`:`);return t<0?[]:[[e.slice(0,t).trim().toLowerCase(),e.slice(t+1).trim().toLowerCase()]]})),rN=[{name:`Arial`,stack:`Arial, Helvetica, sans-serif`},{name:`Verdana`,stack:`Verdana, Geneva, sans-serif`},{name:`Georgia`,stack:`Georgia, serif`},{name:`Times New Roman`,stack:`"Times New Roman", Times, serif`},{name:`Courier New`,stack:`"Courier New", Courier, monospace`}],iN=[{name:`note`,style:`background-color: #fff4d6; border-inline-start: 4px solid #b7791f; padding: 12px 16px; border-radius: 6px`},{name:`tip`,style:`background-color: #e7f6ec; border-inline-start: 4px solid #2f855a; padding: 12px 16px; border-radius: 6px`},{name:`important`,style:`background-color: #fdecec; border-inline-start: 4px solid #c53030; padding: 12px 16px; border-radius: 6px`},{name:`definition`,style:`background-color: #eef1fe; border: 1px solid #5a67d8; padding: 12px 16px; border-radius: 6px`},{name:`example`,style:`border: 2px dashed #718096; padding: 12px 16px; border-radius: 6px`},{name:`quote`,style:`border-inline-start: 3px solid #a0aec0; padding-inline-start: 16px; font-style: italic; color: #4a5568`},{name:`highlight`,style:`background-color: #fff3a3`,text:!0},{name:`small-print`,style:`font-size: 14px; color: #4a5568`,text:!0}],aN=[`two`,`three`,`wide-narrow`,`narrow-wide`,`picture-text`],oN=[`two`,`three`,`wide-narrow`,`narrow-wide`],sN={two:[null,null],three:[null,null,null],"wide-narrow":[2,null],"narrow-wide":[null,2]},cN=(e=`<p></p>`,t=null)=>`<astl-column${t===null?``:` style="flex-grow: ${t}"`}>${e}</astl-column>`}));function uN(e){let t=Fn(`font-family: ${e.stack}`).declarations[0]?.[1];if(t===void 0)throw TypeError(`Font "${e.name}": the style allow-list refuses its stack`);return{name:e.name,stack:t}}function dN(e,t){let n=new Set;return e.map(e=>{let{name:r}=e;if(!kn(r))throw TypeError(`Style "${r}": not a style name`);if(n.has(r))throw TypeError(`Style "${r}" is given twice`);n.add(r);let{style:i,removed:a}=Fn(e.style);if(a.length>0)throw TypeError(`Style "${r}": the style allow-list refuses ${a.join(`, `)}`);return{...e,style:i,label:e.label??t(r)}})}function fN(e){return e instanceof Error&&e.name===`UploadRefused`&&e.message.trim()!==``?e.message:void 0}function pN(e){let t=typeof e==`number`?e:typeof e==`string`&&/^[1-9]\d*$/.test(e)?Number(e):NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function mN(e){let t=(e,t)=>{let n=pN(t);return n===void 0?``:` ${e}="${n}"`},n=`<img src="${rM(String(e.src))}" alt="${rM(String(e.alt))}"${t(`width`,e.width)}${t(`height`,e.height)}>`,r=String(e.caption??``).trim();return r===``?n:`<figure>${n}<figcaption>${rM(r)}</figcaption></figure>`}function hN(){let e=crypto.getRandomValues(new Uint8Array(16));return`preview-${Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}`}function gN(e,t){for(let n=1;;n++){let r=`${e}-${n}`;if(!t.has(r))return r}}function _N(e){return e.find(e=>e.type===`element`)??null}function vN(e){let t=e.filter(e=>e!==null);return t.length===0?null:Math.round(t.reduce((e,t)=>e+t,0)*100)/100}function yN(e,t){let n={errors:0,warnings:0};for(let r of e)t(r)&&(r.severity===`error`?n.errors++:n.warnings++);return n}function bN(e){let{engine:t,locale:n}=e,r=new Map(t.manifests.map(e=>[e.tag,e])),i=new Map;for(let t of e.descriptors){let e=t.manifest.tag;if(i.has(e))throw TypeError(`Editor descriptor for <${e}> is given twice`);if(!r.has(e))throw TypeError(`Editor descriptor <${e}> has no component in the engine`);if(!Ae(`${t.idPrefix}-1`))throw TypeError(`Editor descriptor <${e}>: idPrefix "${t.idPrefix}" does not make valid ids`);let n=(t.templates??[]).map(e=>e.id);if(n.some((e,t)=>!SN.test(e)||n.indexOf(e)!==t))throw TypeError(`Editor descriptor <${e}>: template ids must be distinct kebab-case names`);i.set(e,t)}let a=e.styleTemplates??[],o=t=>vt({catalogs:[...$M,...zf,...e.descriptors.flatMap(e=>e.messages??[]),...t,...a.flatMap(e=>e.catalogs??[]),...e.catalogs??[]]}),s=o([]),c=[],l=e=>{let t=e.filter(e=>!c.includes(e));t.length!==0&&(c=[...c,...t],s=o(c))},u=null,d=(e,t,r)=>s.t(n,e,t,r),f=e=>i.get(e)?.manifest??r.get(e)??null,m=hN(),g=e=>({message:(t,n,r)=>{let i=d(e.messages,t,r);return i===t?n:i},unset:d(H,`inspector.unset`),untitled:e=>d(H,`inspector.untitled`,{n:e}),region:e=>d(H,`field.region`,{n:e}),point:e=>d(H,`field.point`,{n:e}),variant:d(H,`inspector.variant`),styleTemplate:d(H,`inspector.styleTemplate`),sameAsDocument:d(H,`inspector.styleTemplate.inherit`)}),_=(e,t)=>a.filter(n=>n.scopes.includes(e)&&(t===void 0||n.components===void 0||n.components.includes(t))).map(e=>{let t=d(e.messages,`label`);return{value:e.name,label:t===`label`?e.name:t}}),v=e=>{let t=i.get(e);if(t===void 0)return e;let n=d(t.manifest.messages,t.label);return n===t.label?e:n},y=e=>{if(r.get(e.tag)?.graded!==!0)return null;let t=Object.hasOwn(e.attrs,`points`)?Number(e.attrs.points):NaN;return Number.isFinite(t)&&t>0?t:wN},b=e=>{let{issues:n}=t.validate(e),i=e=>Object.hasOwn(e.attrs,`id`)?e.attrs.id??null:null,a=e=>{let t=i(e),r=yN(n,e=>t!==null&&e.at.element===t);return{id:t,tag:e.tag,label:v(e.tag),points:y(e),...r}},o=(e,t=[])=>{for(let n of e)n.type===`element`&&(r.has(n.tag)?t.push(a(n)):o(n.children,t));return t},s=(e,t,r)=>{let a=new Set(r.flatMap(e=>e.id===null?[]:[e.id])),o=vN(r.map(e=>e.points)),s=t===null?d(H,o===null?`block.text`:`block.gap`):v(t.tag);return{kind:e,id:t===null?null:i(t),tag:t?.tag??null,label:s,points:o,components:r,...yN(n,e=>e.at.element!==null&&a.has(e.at.element))}},c=e=>{let t=[],n=[],i=()=>{n.some(e=>e.type===`element`||e.value.trim()!==``)&&t.push(s(`text`,null,o(n))),n=[]};for(let o of e)if(o.type===`element`&&o.tag===`astl-columns`){i();for(let e of o.children)h(e,`astl-column`)&&t.push(...c(e.children))}else o.type===`element`&&r.get(o.tag)?.display===`block`?(i(),t.push(s(`component`,o,[a(o)]))):n.push(o);return i(),t},l=(e,t,r)=>{let i=c(r);return{id:e,label:t,...yN(n,t=>e===null?t.at.page===null&&t.at.tag!==null&&t.at.tag!==`astl-doc`:t.at.page===e),components:o(r),blocks:i,points:vN(i.map(e=>e.points))}},u=Rc(e),f=u.find(e=>h(e,Fe)),p=CN(f?.children??u),m=[];if(p.some(e=>h(e,`astl-page`))){let e=[],t=()=>{let t=l(null,null,e);t.components.length>0&&m.push(t),e=[]};for(let n of p){if(!h(n,`astl-page`)){e.push(n);continue}t();let r=e=>Object.hasOwn(n.attrs,e)?n.attrs[e]??null:null;m.push(l(r(`id`),r(`label`),n.children))}t()}else m.push(l(null,null,p));return{pages:m,...yN(n,()=>!0),points:vN(m.map(e=>e.points))}},x=null,ee=e=>{if(x?.source===e)return x.names;let t=new Map,n=Rc(e),i=CN(n.find(e=>h(e,`astl-doc`))?.children??n),a=i.some(e=>h(e,Ie)),o=(e,n,r)=>{let i=Object.hasOwn(e.attrs,`id`)?e.attrs.id:void 0;i===void 0||i===``||t.has(i)||t.set(i,{n,page:r})},s=(e,t,n)=>{for(let i of e){if(i.type!==`element`)continue;if(!r.has(i.tag)){s(i.children,t,n);continue}let e=(n.get(i.tag)??0)+1;n.set(i.tag,e),o(i,e,t)}},c=(e,t)=>{let n=new Map,i=0,a=!1,c=e=>{for(let l of e)if(l.type===`element`&&l.tag===`astl-columns`){for(let e of l.children)a=!1,h(e,`astl-column`)&&c(e.children);a=!1}else l.type===`element`&&r.get(l.tag)?.display===`block`?(i++,a=!1,o(l,i,t)):(!a&&(l.type===`element`||l.value.trim()!==``)&&(i++,a=!0),s([l],t,n))};c(e)};return a?i.filter(e=>h(e,Ie)).forEach((e,t)=>{c(e.children,t+1)}):c(i,null),x={source:e,names:t},t};function te(e,t){let n=[];for(let{tag:a,id:o,range:s}of Qj(e)){if(o!==null&&o.trim()!==``||a!==`astl-page`&&!r.has(a))continue;let e=a===`astl-page`?`page`:i.get(a)?.idPrefix??a.replace(/^astl-/,``),c=gN(Ae(`${e}-1`)?e:`item`,t);t.add(c);let l=s.startTag.attributes.find(e=>e.name===`id`),u=s.startTag.start+1+a.length;n.push(l===void 0?{start:u,end:u,text:` id="${c}"`}:{start:l.start,end:l.end,text:`id="${c}"`})}return iM(e,n)}function ie(e,t,n){let r=[];for(let{tag:a,range:o}of Qj(e)){let s=i.get(a)?.companion,c=s===void 0?void 0:i.get(s.tag);if(s===void 0||c===void 0||Zj(o.startTag,s.attribute))continue;let l=e=>$j(e).find(e=>e.tag===s.tag&&e.id)?.id,u=l(e)??l(t)??gN(c.idPrefix,n),d=wM(e.slice(o.start,o.end),{kind:`attribute`,name:s.attribute,value:u});r.push({start:o.start,end:o.end,text:d})}return iM(e,r)}function ae(e,t,n,r=``){let a=i.get(e);if(a===void 0)throw TypeError(`No editor descriptor for <${e}>`);let o=n===void 0?null:a.templates?.find(e=>e.id===n);if(o===void 0)throw TypeError(`Editor descriptor <${e}> has no template "${n}"`);let s=eM(t),c=gN(a.idPrefix,s),l=a.manifest.messages,u=(o?.template??a.template).replace(/\{\{t:([^}]+)\}\}/g,(e,t)=>rM(d(l,t.trim()))).replace(/\{\{id\}\}/g,c).replace(/\{\{selection\}\}/g,()=>rM(r));for(let e of eM(u))s.add(e);return ie(te(u,s),t,s)}return{engine:t,locale:n,descriptors:[...i.values()],elements:e.elements??[],styleTemplates:a,urlPolicy:re(e.urlPolicy??ne),fonts:(e.fonts??rN).map(uN),styles:dN(e.styles??iN,e=>{let t=`style.preset.${e}`,n=d(H,t);return n===t?e:n}),uploadAsset:e.uploadAsset??null,pickPicture:e.pickPicture??null,descriptor:e=>i.get(e)??null,templates:e=>i.get(e)?.templates??[],t:d,loadMenuMessages:()=>u??=Promise.resolve(e.menuMessages?.()??[]).then(l,e=>{u=null,console.error(e)}),addMessages:l,instantiate:ae,withCompanion(e,t,n){let r=i.get(e)?.companion;if(r===void 0||!i.has(r.tag))return null;let a=Yj(t).find(e=>e.name===Fe);if(a===void 0)return null;let o=a.children.filter(e=>e.name===Ie),s=Qj(t),c=e=>o.find(t=>t.start<=e.start&&e.end<=t.end)??a,l=e=>s.flatMap(t=>t.tag===r.tag&&t.id&&e.start<=t.start&&t.end<=e.end?[t.id]:[]),u=e=>Zj(e.startTag,r.attribute)??``,d=s.find(t=>t.tag===e&&(n===void 0?!l(c(t.range)).includes(u(t.range)):t.id===n));if(d===void 0)return null;let f=c(d.range),p=l(f);if(p.includes(u(d.range)))return null;let[m]=p,h=m===void 0?ae(r.tag,t):``,g=m??$j(h).find(e=>e.tag===r.tag)?.id??``,_=t.slice(d.start,d.end),v=f.endTag?.start??f.end;return iM(t,[{start:d.start,end:d.end,text:wM(_,{kind:`attribute`,name:r.attribute,value:g})},{start:v,end:v,text:h}])},inspect(e,t){let n=_N(Rc(e));if(n===null)return null;let r=f(n.tag);if(r===null)return null;let a=_(`component`,n.tag);return WM(n,r,i.get(n.tag)??null,g(r),a,e=>{if(t===void 0||e===``)return null;let n=$j(t).find(t=>t.id===e);return n===void 0?null:_N(Rc(t.slice(n.start,n.end)))})},inspectDocument(e){let t=qj(e).find(e=>e.type===`start`);if(t?.name!==`astl-doc`)return null;let n=Zj(t,wt),r=_(`document`);if(r.length===0&&n===null)return null;let i=p(Fe,n===null?{}:{[wt]:n}),a=d(H,`inspector.documentStyle`),o=d(H,`inspector.styleTemplate.default`);return{tag:Fe,id:null,label:d(H,`inspector.document`),icon:null,fields:[BM(i,a,o,r)]}},update:wM,validate:e=>t.validate(e),describe(e,r,i){let{id:a}=e.params,o=r!==void 0&&e.namespace!==`astl.engine`&&a===e.at.element&&typeof a==`string`?ee(r).get(a):void 0,s=o===void 0?void 0:o.page===null||i?.page===!1?String(o.n):d(H,`issue.onPage`,{n:o.n,page:o.page}),c=s===void 0?e:{...e,params:{...e.params,id:s}},l=d(c.namespace,c.code,c.params);return l===c.code?t.describe(c,n):l},assignIds:e=>te(e,eM(e)),outline:b,async preview(e,n){let r=await t.compile(e,{salt:m});return r.ok?{ok:!0,view:r.view,checker:En(t,r.key,n?.policy),issues:r.issues}:{ok:!1,issues:r.issues}}}}var xN,SN,CN,wN,TN=n((()=>{w(),Or(),Qp(),EM(),JM(),eN(),hM(),lN(),xN=class extends Error{constructor(e,t){super(e,t),this.name=`UploadRefused`}},SN=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,CN=e=>e.flatMap(e=>h(e,`astl-style`)?CN(e.children):[e]),wN=Number(It.find(e=>e.name===`points`)?.default??1)})),EN,DN=n((()=>{w(),z(),eN(),EN=class extends OC{static properties={authoring:{attribute:!1},adapter:{attribute:!1}};#e=null;constructor(){super(),this.authoring=null,this.adapter=null}connectedCallback(){super.connectedCallback(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#n()}willUpdate(e){e.has(`adapter`)&&this.#t()}#t(){let e=this.isConnected?this.adapter:null;if((this.#e?.adapter??null)===e||(this.#n(),e===null))return;let t=[e.onChange(()=>this.sourceChanged()),e.onSelectionChange(e=>this.selectionChanged(e)),e.onCursorChange?.(()=>this.cursorChanged())??(()=>{})];this.#e={adapter:e,off:()=>{for(let e of t)e()}}}#n(){this.#e?.off(),this.#e=null}sourceChanged(){this.requestUpdate()}selectionChanged(e){this.requestUpdate()}cursorChanged(){}t(e,t){return this.authoring?.t(`astl.editor`,e,t)??e}get ui(){let e=this.authoring?.locale??`en`;return{lang:e,dir:Me(e)}}}})),ON,kN=n((()=>{ON={"style.section.text":`Text`,"style.section.box":`Background and border`,"style.section.spacing":`Spacing`,"style.section.size":`Size and position`,"style.section.named":`Named style`,"style.section.own":`Own CSS`,"style.field.font-family":`Font`,"style.field.font-size":`Font size`,"style.field.font-weight":`Weight`,"style.field.font-style":`Slant`,"style.field.color":`Text colour`,"style.field.text-align":`Alignment`,"style.field.line-height":`Line height`,"style.field.background-color":`Background`,"style.field.border-width":`Border width`,"style.field.border-style":`Border style`,"style.field.border-color":`Border colour`,"style.field.border-radius":`Corners`,"style.field.padding":`Padding`,"style.field.margin-block-start":`Space before`,"style.field.margin-block-end":`Space after`,"style.field.width":`Width`,"style.field.position":`Position`,"style.field.gap":`Space between columns`,"style.field.align-items":`Align columns`,"style.field.flex-grow":`Share of the width`,"style.field.named":`Style`,"style.field.own":`CSS declarations`,"style.value.normal":`Normal`,"style.value.bold":`Bold`,"style.value.italic":`Italic`,"style.value.start":`Left`,"style.value.center":`Centre`,"style.value.end":`Right`,"style.value.justify":`Justified`,"style.value.none":`None`,"style.value.solid":`Solid`,"style.value.dashed":`Dashed`,"style.value.dotted":`Dotted`,"style.value.double":`Double`,"style.value.stretch":`Same height`,"style.named.none":`No style`,"style.save.label":`Name of the new style`,"style.save":`Save as a style`,"style.refused.property":`"{name}" is not allowed: an exercise's style cannot move it out of its place, cover other content or load anything.`,"style.refused.value":`This value of "{name}" is not allowed: check its unit and its limits.`,"style.refused.text":`"{name}" is not a declaration: write it as property: value.`,"style.refused.length":`This style is too long: at most {max} characters.`,"style.rules.tags":`Text styles`,"style.rules.empty":`No styles of your own yet. Add one here, or save an element's style.`,"style.rules.edit":`Edit style: {label}`,"style.rules.rename":`Rename style: {label}`,"style.rules.renameShort":`Rename`,"style.rules.renameField":`New name of style: {label}`,"style.rules.delete":`Delete style: {label}`,"style.rules.deleteShort":`Delete`,"style.rules.newLabel":`Name of a new style`,"style.rules.add":`Add style`,"style.tag.paragraph":`Paragraph`,"style.tag.heading":`Heading`,"style.tag.subheading":`Subheading`,"style.tag.quote":`Quote`,"style.tag.list":`List`,"style.tag.caption":`Caption`,"style.tag.picture":`Picture`}})),AN,jN=n((()=>{AN={"style.section.text":`Tekst`,"style.section.box":`Tło i obramowanie`,"style.section.spacing":`Odstępy`,"style.section.size":`Rozmiar i położenie`,"style.section.named":`Styl nazwany`,"style.section.own":`Własny CSS`,"style.field.font-family":`Czcionka`,"style.field.font-size":`Rozmiar czcionki`,"style.field.font-weight":`Grubość`,"style.field.font-style":`Pochylenie`,"style.field.color":`Kolor tekstu`,"style.field.text-align":`Wyrównanie`,"style.field.line-height":`Interlinia`,"style.field.background-color":`Tło`,"style.field.border-width":`Grubość obramowania`,"style.field.border-style":`Rodzaj obramowania`,"style.field.border-color":`Kolor obramowania`,"style.field.border-radius":`Narożniki`,"style.field.padding":`Wypełnienie`,"style.field.margin-block-start":`Odstęp przed`,"style.field.margin-block-end":`Odstęp po`,"style.field.width":`Szerokość`,"style.field.position":`Położenie`,"style.field.gap":`Odstęp między kolumnami`,"style.field.align-items":`Wyrównanie kolumn`,"style.field.flex-grow":`Udział w szerokości`,"style.field.named":`Styl`,"style.field.own":`Deklaracje CSS`,"style.value.normal":`Normalna`,"style.value.bold":`Pogrubiona`,"style.value.italic":`Pochylona`,"style.value.start":`Do lewej`,"style.value.center":`Do środka`,"style.value.end":`Do prawej`,"style.value.justify":`Wyjustowane`,"style.value.none":`Brak`,"style.value.solid":`Ciągłe`,"style.value.dashed":`Kreskowane`,"style.value.dotted":`Kropkowane`,"style.value.double":`Podwójne`,"style.value.stretch":`Równa wysokość`,"style.named.none":`Bez stylu`,"style.save.label":`Nazwa nowego stylu`,"style.save":`Zapisz jako styl`,"style.refused.property":`„{name}” jest niedozwolone: styl ćwiczenia nie może przenosić go poza jego miejsce, zasłaniać innych treści ani niczego wczytywać.`,"style.refused.value":`Ta wartość „{name}” jest niedozwolona: sprawdź jednostkę i dopuszczalny zakres.`,"style.refused.text":`„{name}” to nie jest deklaracja: wpisz ją jako właściwość: wartość.`,"style.refused.length":`Ten styl jest za długi: najwyżej {max} znaków.`,"style.rules.tags":`Style tekstu`,"style.rules.empty":`Nie masz jeszcze własnych stylów. Dodaj styl tutaj albo zapisz styl elementu.`,"style.rules.edit":`Edytuj styl: {label}`,"style.rules.rename":`Zmień nazwę stylu: {label}`,"style.rules.renameShort":`Zmień nazwę`,"style.rules.renameField":`Nowa nazwa stylu: {label}`,"style.rules.delete":`Usuń styl: {label}`,"style.rules.deleteShort":`Usuń`,"style.rules.newLabel":`Nazwa nowego stylu`,"style.rules.add":`Dodaj styl`,"style.tag.paragraph":`Akapit`,"style.tag.heading":`Nagłówek`,"style.tag.subheading":`Podtytuł`,"style.tag.quote":`Cytat`,"style.tag.list":`Lista`,"style.tag.caption":`Podpis`,"style.tag.picture":`Obrazek`}})),MN,NN=n((()=>{kN(),jN(),eN(),MN=[{namespace:H,locale:`en`,messages:ON},{namespace:H,locale:`pl`,messages:AN}]}));function PN(e){let t=nN(e),n=t.get(`float`);if(n===`inline-start`||n===`left`)return`start`;if(n===`inline-end`||n===`right`)return`end`;if(t.get(`width`)===`100%`&&(t.get(`display`)===`block`||!t.has(`display`)))return`full`;let r=t.get(`margin`)?.split(/\s+/);return t.get(`margin-inline`)===`auto`||[`left`,`right`].every(e=>t.get(`margin-${e}`)===`auto`)||r!==void 0&&r.length===2&&r[1]===`auto`?`center`:`inline`}function FN(e,t,n=!1){let r={};for(let e of VN)r[e]=null;return PN(t)===`full`&&(r.width=null),n&&e===`center`&&(PN(t)===`full`||!nN(t).has(`width`))&&(r.width=`50%`),{...r,...HN[e]}}function IN(e,t){return{width:`${t}%`,...PN(e)===`full`&&t<100?{display:null}:{}}}function LN(e){let t=[],n=[];for(let[r,i]of nN(e))(UN.has(r)?t:n).push(`${r}: ${i}`);return{placed:t.join(`; `),rest:n.join(`; `)}}function RN(e){let t=/^(\d+(?:\.\d+)?)%$/.exec(nN(e).get(`width`)??``);return t===null?null:Number(t[1])}function zN(e,t){let n=e.normalize(`NFD`).replace(/\p{M}/gu,``).replace(/[łŁ]/g,`l`).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^[^a-z]+|-+$/g,``).slice(0,56),r=kn(n)?n:`style`;if(r!==`style`&&!t.has(r))return r;let i=1;for(;t.has(`${r}-${i}`);)i++;return`${r}-${i}`}var BN,VN,HN,UN,WN=n((()=>{Or(),lN(),BN=[`inline`,`start`,`end`,`center`,`full`],VN=[`float`,`display`,`margin`,...[`left`,`right`,`bottom`].map(e=>`margin-${e}`),`margin-inline`,`margin-inline-start`,`margin-inline-end`,`margin-block-end`],HN={inline:{},start:{float:`inline-start`,"margin-inline-end":`16px`,"margin-block-end":`8px`},end:{float:`inline-end`,"margin-inline-start":`16px`,"margin-block-end":`8px`},center:{display:`block`,"margin-inline":`auto`},full:{display:`block`,width:`100%`}},UN=new Set([...VN,`width`])}));function GN(e){let t=e==null?null:Mn(e);if(t===null)return null;let n=e=>Math.round(e).toString(16).padStart(2,`0`);return`#${n(t[0])}${n(t[1])}${n(t[2])}`}function KN(e){let{id:t,value:n,t:r,invalid:i,ground:a=!1}=e,o=GN(n),s=e=>`var(--astl-palette-${e}${a?`-soft`:``})`;return I`<div class="swatches" role="group" aria-label=${r(`style.color.theme`)}>
4571
+ </div>`}},Rj={manifest:$p,element:Lj,messages:Pj}})),Bj=[{tag:`astl-gap`,load:async()=>(await Promise.resolve().then(()=>(ED(),vD))).gapElement},{tag:`astl-choice`,load:async()=>(await Promise.resolve().then(()=>(HD(),RD))).choiceElement},{tag:`astl-select`,load:async()=>(await Promise.resolve().then(()=>(cO(),KD))).selectElement},{tag:`astl-true-false`,load:async()=>(await Promise.resolve().then(()=>(_O(),fO))).trueFalseElement},{tag:`astl-order`,load:async()=>(await Promise.resolve().then(()=>(LO(),OO))).orderElement},{tag:`astl-categorise`,load:async()=>(await Promise.resolve().then(()=>(ZO(),UO))).categoriseElement},{tag:`astl-match`,load:async()=>(await Promise.resolve().then(()=>(ck(),tk))).matchElement},{tag:`astl-word-bank`,load:async()=>(await Promise.resolve().then(()=>(yk(),fk))).wordBankElement},{tag:`astl-drop`,load:async()=>(await Promise.resolve().then(()=>(Ok(),Ck))).dropElement},{tag:`astl-word-search`,load:async()=>(await Promise.resolve().then(()=>(Bk(),Mk))).wordSearchElement},{tag:`astl-memory`,load:async()=>(await Promise.resolve().then(()=>(Qk(),Wk))).memoryElement},{tag:`astl-crossword`,load:async()=>(await Promise.resolve().then(()=>(cA(),nA))).crosswordElement},{tag:`astl-flash-cards`,load:async()=>(await Promise.resolve().then(()=>(gA(),fA))).flashCardsElement},{tag:`astl-long-answer`,load:async()=>(await Promise.resolve().then(()=>(TA(),bA))).longAnswerElement},{tag:`astl-mark-words`,load:async()=>(await Promise.resolve().then(()=>(NA(),kA))).markWordsElement},{tag:`astl-callout`,load:async()=>(await Promise.resolve().then(()=>(VA(),LA))).calloutElement},{tag:`astl-hotspot`,load:async()=>(await Promise.resolve().then(()=>(ij(),ej))).hotspotElement},{tag:`astl-image-drop`,load:async()=>(await Promise.resolve().then(()=>(hj(),cj))).imageDropElement},{tag:`astl-image-label`,load:async()=>(await Promise.resolve().then(()=>(Cj(),yj))).imageLabelElement},{tag:`astl-video`,load:async()=>(await Promise.resolve().then(()=>(Mj(),Dj))).videoElement},{tag:`astl-audio`,load:async()=>(await Promise.resolve().then(()=>(zj(),Ij))).audioElement}];function Vj(e){return e===32||e===9||e===10||e===12||e===13}function Hj(e){return e>=65&&e<=90||e>=97&&e<=122}function Uj(e,t){if(e.startsWith(`<!-->`,t))return t+5;if(e.startsWith(`<!--->`,t))return t+6;let n=[e.indexOf(`-->`,t+4),e.indexOf(`--!>`,t+4)].filter(e=>e>=0);if(n.length===0)return e.length;let r=Math.min(...n);return r+(e.startsWith(`-->`,r)?3:4)}function Wj(e,t){let n=e.indexOf(`>`,t);return n<0?e.length:n+1}function Gj(e,t,n){let r=RegExp(`</${n}(?=[\\t\\n\\f\\r />])`,`gi`);return r.lastIndex=t,r.exec(e)?.index??e.length}function Kj(e,t,n){let r=e.length,i=t+(n===`end`?2:1),a=i;for(;i<r;){let t=e.charCodeAt(i);if(Vj(t)||t===47||t===62)break;i++}let o=e.slice(a,i).toLowerCase(),s=[],c=(e,r)=>({type:n,name:o,start:t,end:e,attributes:s,selfClosing:r});for(;i<r;){let t=e.charCodeAt(i);if(Vj(t)){i++;continue}if(t===62)return c(i+1,!1);if(t===47){if(e.charCodeAt(i+1)===62)return c(i+2,!0);i++;continue}let n=i;for(i++;i<r;){let t=e.charCodeAt(i);if(Vj(t)||t===47||t===62||t===61)break;i++}let a=e.slice(n,i).toLowerCase(),o=i;for(;o<r&&Vj(e.charCodeAt(o));)o++;if(e.charCodeAt(o)!==61){s.push({name:a,raw:null,start:n,end:i});continue}for(o++;o<r&&Vj(e.charCodeAt(o));)o++;let l=e[o];if(l===`"`||l===`'`){let t=e.indexOf(l,o+1),c=t<0?r:t+1;s.push({name:a,raw:e.slice(o+1,t<0?r:t),start:n,end:c}),i=c}else{let t=o;for(;t<r&&!Vj(e.charCodeAt(t))&&e.charCodeAt(t)!==62;)t++;s.push({name:a,raw:e.slice(o,t),start:n,end:t}),i=t}}return c(r,!1)}function qj(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.indexOf(`<`,r);if(i<0)break;r=i;let a=e.charCodeAt(r+1);if(e.startsWith(`<!--`,r))r=Uj(e,r);else if(a===33||a===63)r=Wj(e,r+2);else if(a===47){let n=e.charCodeAt(r+2);if(Hj(n)){let n=Kj(e,r,`end`);t.push(n),r=n.end}else r=n===62?r+3:Wj(e,r+2)}else if(Hj(a)){let i=Kj(e,r,`start`);t.push(i),r=i.end,oM.has(i.name)?r=Gj(e,r,i.name):i.name===`plaintext`&&(r=n)}else r++}return t}function Jj(e){return e.includes(`-`)}function Yj(e){let t=[],n=[],r=e=>(n[n.length-1]?.children??t).push(e),i=(e,t,n)=>r({name:e.name,start:e.start,end:t,startTag:e.startTag,endTag:n,children:e.children});for(let t of qj(e)){if(t.type===`start`){sM.has(t.name)||t.selfClosing&&Jj(t.name)?r({name:t.name,start:t.start,end:t.end,startTag:t,endTag:null,children:[]}):n.push({name:t.name,start:t.start,startTag:t,children:[]});continue}let e=n.length-1;for(;e>=0&&n[e]?.name!==t.name;)e--;if(!(e<0)){for(;n.length-1>e;)i(n.pop(),t.start,null);i(n.pop(),t.end,t)}}for(;n.length>0;)i(n.pop(),e.length,null);return t}function Xj(e){if(!e.includes(`&`))return e;let[t]=Rc(`<b title="${e.replaceAll(`"`,`&quot;`)}"></b>`);return t?.type===`element`?t.attrs.title??e:e}function Zj(e,t){let n=e.attributes.find(e=>e.name===t);return n===void 0?null:n.raw===null?``:Xj(n.raw)}function Qj(e){let t=[],n=e=>{for(let r of e){let{name:e}=r;if(e===`astl-style`||e===`astl-columns`||e===`astl-column`||Je.has(e))n(r.children);else{if(e===`astl-page`||Jj(e)&&e!==cM){let n=Zj(r.startTag,`id`);if(t.push({tag:e,id:n,start:r.start,end:r.end,range:r}),e!==`astl-page`)continue}n(r.children)}}};return n(Yj(e)),t}function $j(e){return Qj(e).map(({tag:e,id:t,start:n,end:r})=>({tag:e,id:t,start:n,end:r}))}function eM(e){let t=new Set;for(let n of qj(e)){if(n.type!==`start`)continue;let e=Zj(n,`id`);e!==null&&t.add(e)}return t}function tM(e){return e.replace(uM,mM)}function nM(e){return e.replace(dM,mM)}function rM(e){return e.replace(fM,mM)}function iM(e,t){let n=e;for(let e of[...t].sort((e,t)=>t.start-e.start))n=n.slice(0,e.start)+e.text+n.slice(e.end);return n}function aM(e,t){let n=t;for(;n>0&&Vj(e.charCodeAt(n-1));)n--;return n}var oM,sM,cM,lM,uM,dM,fM,pM,mM,hM=n((()=>{w(),Qp(),oM=new Set([`script`,`style`,`textarea`,`title`,`xmp`,`iframe`,`noembed`,`noframes`,`noscript`]),sM=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),cM=`astl-doc`,lM=String.fromCodePoint(160),uM=RegExp(`[&<>${lM}]`,`g`),dM=RegExp(`[&"<>${lM}]`,`g`),fM=RegExp(`[&<>"'${lM}]`,`g`),pM={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,[lM]:`&nbsp;`},mM=e=>pM[e]??e}));function gM(e,t,n,r){if(!TM.test(n))throw TypeError(`Invalid attribute name "${n}"`);let i=t.attributes.filter(e=>e.name===n),a=i[0];if(r===null||r===!1)return i.map(t=>({start:aM(e,t.start),end:t.end,text:``}));if(a!==void 0){let e=Zj(t,n)??``;if(r===!0?e===``||e.toLowerCase()===n:e===r)return[]}let o=r===!0?n:`${n}="${nM(r)}"`;if(a!==void 0)return[{start:a.start,end:a.end,text:o}];let s=t.attributes[t.attributes.length-1]?.end??t.start+1+t.name.length;return[{start:s,end:s,text:` ${o}`}]}function _M(e,t){return e.children.flatMap(e=>e.name===t?[e]:_M(e,t))}function vM(e,t){let[n]=Rc(e.slice(t.start,t.end));return h(n)?g(n):``}function yM(e){return e.endTag?.start??e.end}function bM(e,t,n){let r=t.startTag;if(r.selfClosing&&t.endTag===null){let i=e.slice(r.start,aM(e,r.end-2));return{start:t.start,end:t.end,text:`${i}>${n}</${t.name}>`}}return{start:r.end,end:yM(t),text:n}}function xM(e,t,n){return t.startTag.selfClosing&&t.endTag===null?bM(e,t,n):t.endTag===null?{start:t.end,end:t.end,text:`${n}</${t.name}>`}:{start:t.endTag.start,end:t.endTag.start,text:n}}function SM(e,t,n){let[r,i]=n;if(r===void 0)return``;let a=i===void 0?e.slice(Math.max(t.startTag.end,aM(e,r.start)),r.start):e.slice(r.end,i.start);return/^\s*$/.test(a)?a:``}function CM(e,t,n,r){let i=_M(t,n),a=[];if(i.forEach((t,n)=>{let i=r[n];i===void 0?a.push({start:aM(e,t.start),end:t.end,text:``}):vM(e,t)!==i&&a.push(bM(e,t,tM(i)))}),r.length>i.length){let o=SM(e,t,i),s=r.slice(i.length).map(e=>`<${n}>${tM(e)}</${n}>`),c=i[i.length-1];c===void 0?a.push(xM(e,t,s.join(o))):a.push({start:c.end,end:c.end,text:s.map(e=>o+e).join(``)})}return a}function wM(e,t){let n=Yj(e)[0];if(n===void 0)return e;switch(t.kind){case`attribute`:return iM(e,gM(e,n.startTag,t.name,t.value));case`child-flag`:case`child-choice`:{let r=_M(n,t.tag)[t.index];return r===void 0?e:iM(e,gM(e,r.startTag,t.attribute,t.value))}case`text-list`:return iM(e,CM(e,n,t.tag,t.values));case`child-attributes`:{let n=e;for(let[e,r]of Object.entries(t.attributes))n=wM(n,{kind:`child-choice`,tag:t.tag,attribute:e,index:t.index,value:r});return n}case`child-add`:{if(!TM.test(t.tag))throw TypeError(`Invalid tag name "${t.tag}"`);let r=Object.entries(t.attributes).map(([e,t])=>{if(!TM.test(e))throw TypeError(`Invalid attribute name "${e}"`);return` ${e}="${nM(t)}"`}),i=`<${t.tag}${r.join(``)}></${t.tag}>`,a=_M(n,t.tag),o=a.at(-1)??n.children.at(-1);if(o===void 0)return iM(e,[xM(e,n,i)]);let s=SM(e,n,a.length>0?a:n.children);return iM(e,[{start:o.end,end:o.end,text:s+i}])}case`child-remove`:{let r=_M(n,t.tag)[t.index];return r===void 0?e:iM(e,[{start:aM(e,r.start),end:r.end,text:``}])}}}var TM,EM=n((()=>{w(),Qp(),hM(),TM=/^[a-z][a-z0-9-]*$/}));function DM(e){let t=e=>({kind:`attribute`,name:e.name,label:`editor.${e.name}`}),n=e=>e.visibility!==`derived`,r=e.scoring===null?[]:[`scoring`,`points`],i=jt(e).filter(e=>r.includes(e.name));return[...e.attributes.filter(n).map(t),...e.children.filter(e=>e.visibility===`private`&&e.content===`text`).map(e=>({kind:`text-list`,tag:e.tag,label:`editor.${e.tag}`})),...e.children.flatMap(e=>e.attributes.filter(e=>(e.type===`boolean`||e.type===`enum`)&&n(e)).map(t=>({kind:t.type===`boolean`?`child-flag`:`child-choice`,tag:e.tag,attribute:t.name,label:`editor.${e.tag}.${t.name}`}))),...i.map(t)]}function OM(e,t,n){return(t.name===`scoring`&&e.scoring!==null?Object.keys(e.scoring.modes):[...t.values??[]]).map(e=>({value:e,label:n.message(`editor.value.${t.name}.${e}`,e)}))}function kM(e,t){return t.name===`scoring`&&e.scoring!==null?e.scoring.default:t.default===void 0?null:String(t.default)}function AM(e,t,n,r,i=n.name,a=()=>null){let o=jt(t).find(e=>e.name===n.name);if(o===void 0)return null;let s=o.name,c=r.message(n.label,i),l=n.help===void 0?null:r.message(n.help,``),u={kind:`attribute`,name:s,label:c,help:l===``?null:l},d=GM(e,s),f=o.required===!0,p=n.options===void 0?null:a(GM(e,n.options.from)??``);if(p!==null&&n.options!==void 0){let e=d??``;return{...u,control:`select`,value:e,options:RM(p,n.options.tag,r)(e)}}let m=s===`scoring`&&t.scoring!==null;if(o.type===`enum`||m){let e=OM(t,o,r),n=d??kM(t,o)??``;return n===``&&!e.some(e=>e.value===``)?e.unshift({value:``,label:r.unset}):e.some(e=>e.value===n)||e.push({value:n,label:n}),{...u,control:`select`,value:n,options:e}}if(o.type===`number`||o.type===`integer`)return{...u,control:`number`,value:d??kM(t,o)??``,min:o.min??null,max:o.max??null,step:o.type===`integer`?`1`:`any`,required:f};if(o.type===`boolean`)return{...u,control:`checkbox`,checked:d!==null};let h=o.type===`url`?n.accept??null:null;return{...u,control:`text`,value:d??``,required:f,accept:h}}function jM(e){return new Map(e.flatMap(e=>e.kind===`picture-regions`||e.kind===`picture-points`?[[e.tag,e.kind]]:[]))}function MM(e,t){let n=e.children.find(e=>e.tag===t)?.attributes.find(e=>e.name===`shape`);if(n===void 0)return[`rect`];let r=[`rect`,`circle`,`polygon`].filter(e=>n.values?.includes(e));return r.length>0?r:[`rect`]}function NM(e,t,n,r,i=[n],a=()=>null){let o=n.help===void 0?null:r.message(n.help,``)||null,s=`tag`in n?jM(i).get(n.tag):void 0,c=(e,t)=>LM(e,t,r,s);switch(n.kind){case`attribute`:return AM(e,t,n,r,n.name,a);case`text-list`:return{kind:`text-list`,tag:n.tag,label:r.message(n.label,n.tag),help:o,values:KM(e,n.tag).map(g),max:t.children.find(e=>e.tag===n.tag)?.max??null,multiline:n.multiline===!0};case`child-flag`:{let t=KM(e,n.tag).map((e,t)=>({index:t,id:GM(e,`id`),label:c(e,t),checked:GM(e,n.attribute)!==null})),i={count:t.length,checked:t.filter(e=>e.checked).length},a=`${n.tag} ${n.attribute}`,o=n.help===void 0?null:r.message(n.help,``,i)||null;return{kind:`child-flag`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,a,i),help:o,children:t}}case`child-text`:return{kind:`child-text`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,`${n.tag} ${n.attribute}`),help:o,children:KM(e,n.tag).map((e,t)=>({index:t,id:GM(e,`id`),label:c(e,t),value:GM(e,n.attribute)??``}))};case`child-choice`:{let i=zM(e,t,n,r);return i===null?null:{kind:`child-choice`,tag:n.tag,attribute:n.attribute,label:r.message(n.label,`${n.tag} ${n.attribute}`),help:o,control:i.control,children:KM(e,n.tag).map((e,t)=>{let r=GM(e,n.attribute)??``,a=i.options(r);return{index:t,id:GM(e,`id`),label:c(e,t),value:r,options:a}})}}case`child-table`:return PM(e,t,n,r,o);case`picture-regions`:case`picture-points`:{let a={tag:n.tag,label:r.message(n.label,n.tag),help:o,elementTag:e.tag,srcAttribute:n.src,src:GM(e,n.src)??``},s=KM(e,n.tag);if(n.kind===`picture-points`)return{...a,kind:`picture-points`,points:s.map((e,t)=>({index:t,id:GM(e,`id`)??``,x:FM(GM(e,`x`)),y:FM(GM(e,`y`)),label:GM(e,`label`)??``}))};let c=i.find(e=>e.kind===`child-flag`&&e.tag===n.tag),l=c!==void 0&&`attribute`in c?c.attribute:null;return{...a,kind:`picture-regions`,shapes:MM(t,n.tag),flag:l,regions:s.map((e,t)=>{let n=GM(e,`shape`);return{index:t,id:GM(e,`id`)??``,shape:n===`circle`||n===`polygon`?n:`rect`,x:FM(GM(e,`x`)),y:FM(GM(e,`y`)),width:FM(GM(e,`width`)),height:FM(GM(e,`height`)),r:FM(GM(e,`r`)),points:IM(GM(e,`points`)),label:GM(e,`label`)??``,flagged:l!==null&&GM(e,l)!==null}})}}}}function PM(e,t,n,r,i){let a=t.children.find(e=>e.tag===n.tag);if(a===void 0)return null;let o=n.columns.flatMap(e=>{let t=a.attributes.find(t=>t.name===e.attribute);if(t===void 0)return[];let n=t.type===`integer`||t.type===`number`;return[{attribute:t.name,label:r.message(e.label,t.name),control:t.type===`enum`?`select`:n?`number`:`text`,options:(t.values??[]).map(e=>({value:e,label:r.message(`editor.value.${t.name}.${e}`,e)})),min:t.min??null,max:t.max??null,step:t.type===`integer`?`1`:`any`,required:t.required===!0}]}),s=KM(e,n.tag),c=n.tag.replace(/^astl-/,``),l=new Set(s.map(e=>GM(e,`id`))),u=s.length+1;for(;l.has(`${c}-${u}`);)u++;let d={id:`${c}-${u}`};for(let e of a.attributes)e.required===!0&&e.name!==`id`&&(d[e.name]=e.values?.[0]??(e.min===void 0?``:String(e.min)));return{kind:`child-table`,tag:n.tag,label:r.message(n.label,n.tag),help:i,columns:o,rows:s.map((e,t)=>({index:t,id:GM(e,`id`),label:LM(e,t,r),values:o.map(t=>GM(e,t.attribute)??``)})),added:d,min:a.min,max:a.max}}function FM(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}function IM(e){return(e??``).trim().split(/\s+/).filter(e=>e!==``).map(e=>{let[t=``,n=``]=e.split(`,`);return[FM(t),FM(n)]})}function LM(e,t,n,r){let i=qM(e).replace(/\s+/g,` `).trim();return i!==``||r===void 0?i||n.untitled(t+1):(GM(e,`label`)??``).replace(/\s+/g,` `).trim()||(r===`picture-regions`?n.region(t+1):n.point(t+1))}function RM(e,t,n){let r=KM(e,t).flatMap((e,t)=>{let r=GM(e,`id`);return r===null||r===``?[]:[{value:r,label:LM(e,t,n)}]});return e=>e===``?[{value:``,label:n.unset},...r]:r.some(t=>t.value===e)?r:[...r,{value:e,label:e}]}function zM(e,t,n,r){if(n.options===void 0){let e=t.children.find(e=>e.tag===n.tag)?.attributes.find(e=>e.name===n.attribute);if(e?.type!==`enum`)return null;let i=(e.values??[]).map(t=>({value:t,label:r.message(`editor.value.${e.name}.${t}`,t)}));return{control:`radios`,options:()=>i}}return{control:`select`,options:RM(e,n.options,r)}}function BM(e,t,n,r){let i=GM(e,`style-template`)??``,a=[{value:``,label:n},...r];return a.some(e=>e.value===i)||a.push({value:i,label:i}),{kind:`attribute`,control:`select`,name:wt,label:t,help:null,value:i,options:a}}function VM(e,t){if(t.variants===null)return null;let n=GM(e,`variant`);return n!==null&&t.variants.values.includes(n)?n:t.variants.default}function HM(e,t){return e.kind!==`attribute`||e.variants===void 0||e.variants.includes(t??``)}function UM(e,t,n,r,i){let a=e=>n.some(t=>t.kind===`attribute`&&t.name===e),o=[];if(t.variants!==null&&!a(`variant`)){let n=AM(e,t,{kind:`attribute`,name:`variant`,label:`editor.variant`},r,r.variant);n!==null&&o.push(n)}let s=GM(e,wt)!==null;if((i.length>0||s)&&!a(`style-template`)){let t=r.message(`editor.${wt}`,r.styleTemplate);o.push(BM(e,t,r.sameAsDocument,i))}return o}function WM(e,t,n,r,i=[],a=()=>null){let o=n?.fields??DM(t),s=VM(e,t),c=o.filter(e=>HM(e,s)).flatMap(n=>NM(e,t,n,r,o,a)??[]);return{tag:e.tag,id:GM(e,`id`),label:n===null?e.tag:r.message(n.label,e.tag),icon:n?.icon??null,fields:[...c,...UM(e,t,c,r,i)]}}var GM,KM,qM,JM=n((()=>{w(),GM=(e,t)=>Object.hasOwn(e.attrs,t)?e.attrs[t]??``:null,KM=(e,t)=>e.children.flatMap(e=>e.type===`element`?e.tag===t?[e]:KM(e,t):[]),qM=e=>e.type===`text`?e.value:e.tag===`img`?` ${e.attrs.alt??``} `:e.children.map(qM).join(``)})),YM,XM=n((()=>{YM={"insert.title":`Insert`,"insert.components":`Components`,"insert.exercises":`Exercises`,"insert.content":`Content`,"insert.picture":`Picture`,"insert.picture.description":`A picture with alt text and an optional caption`,"insert.pageBreak":`Page break`,"insert.pageBreak.description":`Split the exercise into steps at the cursor`,"insert.hint":`Hint`,"insert.hint.description":`One students ask for: for the question at the cursor, else for the page`,"insert.explanation":`Explanation`,"insert.explanation.description":`Why the answer is right, shown once it is checked`,"insert.feedback":`Feedback`,"insert.feedback.description":`A text by the verdict, shown once the answer is checked`,"insert.text":`Text`,"insert.text.description":`A paragraph after this block`,"insert.noMatch":`Nothing matches “{query}”.`,"toolbar.label":`Format and insert`,"toolbar.style":`Text style: {style}`,"toolbar.paragraph":`Paragraph`,"toolbar.heading":`Heading`,"toolbar.subheading":`Subheading`,"toolbar.bold":`Bold`,"toolbar.italic":`Italic`,"toolbar.underline":`Underline`,"toolbar.link":`Link`,"toolbar.link.address":`Link address`,"toolbar.link.apply":`Apply`,"toolbar.link.remove":`Remove link`,"toolbar.link.blocked":`This address is not allowed here.`,"toolbar.bulleted":`Bulleted list`,"toolbar.numbered":`Numbered list`,"toolbar.undo":`Undo`,"toolbar.redo":`Redo`,"toolbar.elements":`Elements`,"toolbar.templates":`Templates`,"toolbar.layouts":`Layout`,"toolbar.view":`View`,"toolbar.search":`Search`,"block.text":`Text`,"block.gap":`Gap`,"issue.onPage":`{n} on page {page}`,"picture.title":`Add a picture`,"picture.editTitle":`Edit the picture`,"picture.file":`Upload a picture`,"picture.library":`Choose from the library`,"picture.urlOnly":`This editor adds pictures by their address only: it has no upload.`,"picture.src":`Picture address (URL)`,"picture.alt":`Alt text`,"picture.altHelp":`What the picture shows, for students who cannot see it. Do not give an answer away.`,"picture.decorative":`Decorative: screen readers skip it (alt="")`,"picture.caption":`Caption (optional)`,"picture.cancel":`Cancel`,"picture.insert":`Insert`,"picture.save":`Save`,"picture.uploading":`Uploading…`,"picture.uploaded":`Uploaded.`,"picture.uploadFailed":`The upload failed. Try again, or give the picture's address.`,"picture.uploadBlocked":`The upload gave an address the URL policy does not allow.`,"picture.picked":`Chosen from the library.`,"picture.pickFailed":`The library did not open. Try again, or give the picture's address.`,"picture.pickBlocked":`The library returned an address the URL policy does not allow.`,"picture.srcMissing":`Give the picture's address, or upload it.`,"picture.srcBlocked":`The URL policy does not allow this address.`,"picture.altMissing":`Describe the picture, or mark it as decorative.`,"picture.altRequired":`Describe the picture: students who cannot see it need its alt text for the task.`,"picture.pasteRefused":`This editor has no upload, so a picture file cannot be pasted or dropped. Add it with Insert, Picture, by its address.`,"field.picture.src":`Picture address (URL)`,"field.regions.draw":`Drag on the picture to draw a zone, or add one and type its numbers.`,"field.points.place":`Click the picture to place a pin, or add one and type its position.`,"field.region":`Zone {n}`,"field.region.add":`Add a zone`,"field.region.remove":`Remove zone {n}`,"field.point":`Pin {n}`,"field.point.add":`Add a pin`,"field.point.remove":`Remove pin {n}`,"field.shape":`Shape`,"field.shape.rect":`Rectangle`,"field.shape.circle":`Circle`,"field.shape.polygon":`Polygon`,"field.x":`From the left (%)`,"field.y":`From the top (%)`,"field.width":`Width (%)`,"field.height":`Height (%)`,"field.cx":`Centre from the left (%)`,"field.cy":`Centre from the top (%)`,"field.r":`Radius (% of the width)`,"field.vertex.x":`Point {n} from the left (%)`,"field.vertex.y":`Point {n} from the top (%)`,"field.vertex.add":`Add a point`,"field.vertex.remove":`Remove point {n}`,"field.label":`Label`,"field.label.optional":`Label (optional)`,"field.more":`Only the first {shown} of {count} are listed here: edit the others in the source.`,"inspector.title":`Properties`,"inspector.delete":`Delete`,"inspector.moveUp":`Move up`,"inspector.moveDown":`Move down`,"inspector.empty":`Put the cursor in an exercise element to edit its answers and settings.`,"inspector.unsupported":`Element {tag} cannot be edited here.`,"inspector.unset":`(not set)`,"inspector.item":`{label} {n}`,"inspector.add":`Add`,"inspector.remove":`Remove`,"inspector.removeItem":`Remove: {label} {n}`,"inspector.untitled":`Item {n} (empty)`,"inspector.variant":`Variant`,"inspector.styleTemplate":`Element style`,"inspector.styleTemplate.inherit":`Same as the exercise`,"inspector.styleTemplate.default":`Default look`,"inspector.document":`Exercise`,"inspector.documentStyle":`Look of the whole exercise`,"inspector.upload":`Upload a file`,"inspector.uploadItem":`Upload a file: {label}`,"inspector.uploading":`Uploading…`,"inspector.uploaded":`Uploaded.`,"inspector.uploadFailed":`The upload failed. Try again, or type its address.`,"inspector.uploadBlocked":`The upload gave an address the URL policy does not allow.`,"issues.title":`Problems`,"issues.errors":`{count, plural, one {# error} other {# errors}}`,"issues.warnings":`{count, plural, one {# warning} other {# warnings}}`,"issues.summary":`{errors}, {warnings}`,"issues.none":`No errors or warnings.`,"severity.error":`Error`,"severity.warning":`Warning`,"label.text":`{label}: {text}`,"preview.title":`Student view`,"preview.show":`Preview`,"preview.refresh":`Refresh preview`,"preview.hint":`Press Preview to try the exercise the way a student will see it.`,"preview.loading":`Preparing the preview…`,"preview.stale":`The document changed after this preview. Refresh it to see the changes.`,"preview.invalid":`{count, plural, one {Fix this error to see the preview:} other {Fix these # errors to see the preview:}}`,"preview.failed":`The preview could not be shown.`,"surface.label":`Exercise content`,"surface.pageNumber":`Page {page} of {pages}`,"surface.pageTitle":`Page title`,"surface.pageJoin":`Join with page {previous}`,"surface.pageAdded":`Page {page} added`,"surface.pageJoined":`Page {page} joined with page {previous}`,"surface.pageDelete":`Delete page`,"surface.pageDeleted":`Deleted page {n}`,"surface.pageAddTitle":`Add title`,"surface.pageRemoveTitle":`Remove title`,"surface.pageTitleOf":`Title of page {page}`,"surface.pageTitleRemoved":`Removed the title of page {page}`,"surface.points":`{points, plural, one {# pt} other {# pts}}`,"surface.items":`{n, plural, one {# item} other {# items}}`,"surface.blockMovedUp":`Block moved up, now block {n}`,"surface.blockMovedDown":`Block moved down, now block {n}`,"surface.blockRemoved":`Block {n} deleted`,"surface.addOption":`Add option`,"surface.chip.empty":`No answer`,"surface.chip.more":`+{n}`,"surface.picture.alt":`Picture: {alt}`,"surface.picture.decorative":`Picture, decorative (no alt text)`,"surface.picture.noAlt":`Picture without alt text`,"surface.picture.blocked":`(not shown: the URL policy does not allow its address)`,"surface.picture.edit":`Edit`,"surface.loading":`Loading the editor…`,"surface.failed":`The editor could not be loaded. Reload the page to try again.`,"view.visual":`Visual`,"view.source":`HTML`,"view.visualHint":`Edit the exercise as formatted text`,"view.sourceHint":`Edit the exercise as HTML`,"view.sourceLabel":`The exercise as HTML`,"view.sourceErrors":`{n, plural, one {The HTML has # error. Fix it to go back.} other {The HTML has # errors. Fix them to go back.}}`,"status.elements":`{n, plural, one {# element} other {# elements}}`,"status.errors":`{n, plural, one {# error} other {# errors}}`,"status.warnings":`{n, plural, one {# warning} other {# warnings}}`,"status.ready":`Ready to share`,"insert.layouts":`Layout`,"insert.layout.two":`Two columns`,"insert.layout.two.description":`Two columns of the same width.`,"insert.layout.three":`Three columns`,"insert.layout.three.description":`Three columns of the same width.`,"insert.layout.wide-narrow":`Wide + narrow`,"insert.layout.wide-narrow.description":`A wide column, then a narrow one.`,"insert.layout.narrow-wide":`Narrow + wide`,"insert.layout.narrow-wide.description":`A narrow column, then a wide one.`,"insert.layout.picture-text":`Picture beside text`,"insert.layout.picture-text.description":`A picture you choose, with text next to it.`,"layout.section":`Columns`,"layout.change":`Change layout`,"layout.other":`Another layout`,"layout.unwrap":`Remove layout`,"layout.delete":`Delete with content`,"layout.confirm":`Delete the layout and its content?`,"layout.confirmDelete":`Yes, delete`,"layout.cancel":`Cancel`,"toolbar.font":`Font: {value}`,"toolbar.font.name":`Font`,"toolbar.size":`Size: {value}`,"toolbar.size.name":`Size`,"toolbar.color":`Text colour`,"toolbar.highlight":`Highlight`,"toolbar.align":`Alignment`,"toolbar.align.start":`Left`,"toolbar.align.center":`Centre`,"toolbar.align.end":`Right`,"toolbar.align.justify":`Justified`,"toolbar.spacing":`Spacing`,"toolbar.spacing.line":`Line height`,"toolbar.spacing.after":`Space after`,"toolbar.spacing.none":`None`,"toolbar.spacing.small":`Small`,"toolbar.spacing.medium":`Medium`,"toolbar.spacing.large":`Large`,"toolbar.clear":`Clear formatting`,"toolbar.default":`Default`,"toolbar.myStyles":`My styles`,"toolbar.readyStyles":`Ready styles`,"style.preset.note":`Note`,"style.preset.tip":`Tip`,"style.preset.important":`Important`,"style.preset.definition":`Definition`,"style.preset.example":`Example`,"style.preset.quote":`Quote`,"style.preset.highlight":`Highlight`,"style.preset.small-print":`Small print`,"style.color.theme":`Theme colours`,"style.color.swatch":`Theme colour {n}`,"style.color.custom":`Custom colour`,"style.color.picker":`Pick a colour`,"style.color.invalid":`Write a colour as #rrggbb.`,"style.color.none":`No colour`,"style.close":`Close`,"style.form.none":`Put the cursor in what you want to style.`,"style.target.picture":`Picture style`,"style.target.figure":`Picture and caption style`,"style.target.block":`Block style`,"style.target.component":`Element style`,"style.target.column":`Column style`,"style.target.layout":`Layout style`,"style.position.inline":`In the text`,"style.position.start":`On the left`,"style.position.end":`On the right`,"style.position.center":`Centred`,"style.position.full":`Full width`,"style.rules.open":`Manage styles…`,"style.rules.title":`Styles`,"inspector.style":`Style`,"surface.picture.place":`Position and size: {position}, {width}`,"surface.picture.placeAuto":`Position and size: {position}`,"style.target.more":`{target}…`,"help.cost":`costs {percent}%`,"help.when.correct":`Correct`,"help.when.incorrect":`Wrong`,"help.when.partial":`Partly correct`,"help.when.omitted":`Skipped`,"help.costLabel":`Cost of the hint`,"help.whenLabel":`For the result`}})),ZM,QM=n((()=>{ZM={"insert.title":`Wstaw`,"insert.components":`Elementy`,"insert.exercises":`Ćwiczenia`,"insert.content":`Treść`,"insert.picture":`Obrazek`,"insert.picture.description":`Obrazek z tekstem alternatywnym i podpisem do wyboru`,"insert.pageBreak":`Podział strony`,"insert.pageBreak.description":`Podziel ćwiczenie na kroki od miejsca kursora`,"insert.hint":`Podpowiedź`,"insert.hint.description":`Na prośbę ucznia: do pytania przy kursorze, a poza nim do strony`,"insert.explanation":`Wyjaśnienie`,"insert.explanation.description":`Dlaczego odpowiedź jest dobra, widoczne po sprawdzeniu`,"insert.feedback":`Informacja zwrotna`,"insert.feedback.description":`Tekst zależny od wyniku, widoczny po sprawdzeniu`,"insert.text":`Tekst`,"insert.text.description":`Akapit po tym bloku`,"insert.noMatch":`Nic nie pasuje do „{query}”.`,"toolbar.label":`Formatowanie i wstawianie`,"toolbar.style":`Styl tekstu: {style}`,"toolbar.paragraph":`Akapit`,"toolbar.heading":`Nagłówek`,"toolbar.subheading":`Podtytuł`,"toolbar.bold":`Pogrubienie`,"toolbar.italic":`Kursywa`,"toolbar.underline":`Podkreślenie`,"toolbar.link":`Link`,"toolbar.link.address":`Adres linku`,"toolbar.link.apply":`Zastosuj`,"toolbar.link.remove":`Usuń link`,"toolbar.link.blocked":`Tego adresu nie można tu użyć.`,"toolbar.bulleted":`Lista punktowana`,"toolbar.numbered":`Lista numerowana`,"toolbar.undo":`Cofnij`,"toolbar.redo":`Ponów`,"toolbar.elements":`Elementy`,"toolbar.templates":`Szablony`,"toolbar.layouts":`Układ`,"toolbar.view":`Widok`,"toolbar.search":`Szukaj`,"block.text":`Tekst`,"block.gap":`Luka`,"issue.onPage":`{n} na stronie {page}`,"picture.title":`Dodaj obrazek`,"picture.editTitle":`Edytuj obrazek`,"picture.file":`Wgraj obrazek`,"picture.library":`Wybierz z biblioteki`,"picture.urlOnly":`Ten edytor dodaje obrazki tylko po adresie: nie ma wgrywania.`,"picture.src":`Adres obrazka (URL)`,"picture.alt":`Tekst alternatywny`,"picture.altHelp":`Co przedstawia obrazek, dla uczniów, którzy go nie widzą. Nie zdradzaj odpowiedzi.`,"picture.decorative":`Ozdobny: czytniki ekranu go pomijają (alt="")`,"picture.caption":`Podpis (opcjonalny)`,"picture.cancel":`Anuluj`,"picture.insert":`Wstaw`,"picture.save":`Zapisz`,"picture.uploading":`Wgrywam…`,"picture.uploaded":`Wgrano.`,"picture.uploadFailed":`Nie udało się wgrać obrazka. Spróbuj ponownie albo podaj jego adres.`,"picture.uploadBlocked":`Wgrywanie zwróciło adres, na który nie pozwala polityka adresów.`,"picture.picked":`Wybrano z biblioteki.`,"picture.pickFailed":`Nie udało się otworzyć biblioteki. Spróbuj ponownie albo podaj adres obrazka.`,"picture.pickBlocked":`Biblioteka zwróciła adres, na który nie pozwala polityka adresów.`,"picture.srcMissing":`Podaj adres obrazka albo go wgraj.`,"picture.srcBlocked":`Polityka adresów nie pozwala na ten adres.`,"picture.altMissing":`Opisz obrazek albo oznacz go jako ozdobny.`,"picture.altRequired":`Opisz obrazek: uczniowie, którzy go nie widzą, potrzebują tekstu alternatywnego do zadania.`,"picture.pasteRefused":`Ten edytor nie ma wgrywania, więc nie można wkleić ani upuścić pliku obrazka. Dodaj go przez Wstaw, Obrazek, podając adres.`,"field.picture.src":`Adres obrazka (URL)`,"field.regions.draw":`Przeciągnij po obrazku, aby narysować strefę, albo dodaj ją i wpisz jej liczby.`,"field.points.place":`Kliknij obrazek, aby wbić pinezkę, albo dodaj ją i wpisz jej położenie.`,"field.region":`Strefa {n}`,"field.region.add":`Dodaj strefę`,"field.region.remove":`Usuń strefę {n}`,"field.point":`Pinezka {n}`,"field.point.add":`Dodaj pinezkę`,"field.point.remove":`Usuń pinezkę {n}`,"field.shape":`Kształt`,"field.shape.rect":`Prostokąt`,"field.shape.circle":`Koło`,"field.shape.polygon":`Wielokąt`,"field.x":`Od lewej (%)`,"field.y":`Od góry (%)`,"field.width":`Szerokość (%)`,"field.height":`Wysokość (%)`,"field.cx":`Środek od lewej (%)`,"field.cy":`Środek od góry (%)`,"field.r":`Promień (% szerokości)`,"field.vertex.x":`Punkt {n} od lewej (%)`,"field.vertex.y":`Punkt {n} od góry (%)`,"field.vertex.add":`Dodaj punkt`,"field.vertex.remove":`Usuń punkt {n}`,"field.label":`Etykieta`,"field.label.optional":`Etykieta (opcjonalna)`,"field.more":`Tu widać tylko pierwsze {shown} z {count}: pozostałe edytuj w źródle.`,"inspector.title":`Właściwości`,"inspector.delete":`Usuń`,"inspector.moveUp":`Przenieś wyżej`,"inspector.moveDown":`Przenieś niżej`,"inspector.empty":`Umieść kursor w elemencie ćwiczenia, aby edytować jego odpowiedzi i ustawienia.`,"inspector.unsupported":`Elementu {tag} nie można tu edytować.`,"inspector.unset":`(nie ustawiono)`,"inspector.item":`{label} {n}`,"inspector.add":`Dodaj`,"inspector.remove":`Usuń`,"inspector.removeItem":`Usuń: {label} {n}`,"inspector.untitled":`Element {n} (pusty)`,"inspector.variant":`Wariant`,"inspector.styleTemplate":`Styl elementu`,"inspector.styleTemplate.inherit":`Jak całe ćwiczenie`,"inspector.styleTemplate.default":`Domyślny wygląd`,"inspector.document":`Ćwiczenie`,"inspector.documentStyle":`Wygląd całego ćwiczenia`,"inspector.upload":`Wgraj plik`,"inspector.uploadItem":`Wgraj plik: {label}`,"inspector.uploading":`Wgrywam…`,"inspector.uploaded":`Wgrano.`,"inspector.uploadFailed":`Nie udało się wgrać pliku. Spróbuj ponownie albo wpisz jego adres.`,"inspector.uploadBlocked":`Wgrywanie zwróciło adres, na który nie pozwala polityka adresów.`,"issues.title":`Problemy`,"issues.errors":`{count, plural, one {# błąd} few {# błędy} many {# błędów} other {# błędu}}`,"issues.warnings":`{count, plural, one {# ostrzeżenie} few {# ostrzeżenia} many {# ostrzeżeń} other {# ostrzeżenia}}`,"issues.summary":`{errors}, {warnings}`,"issues.none":`Brak błędów i ostrzeżeń.`,"severity.error":`Błąd`,"severity.warning":`Ostrzeżenie`,"label.text":`{label}: {text}`,"preview.title":`Widok ucznia`,"preview.show":`Podgląd`,"preview.refresh":`Odśwież podgląd`,"preview.hint":`Naciśnij „Podgląd”, aby wypróbować ćwiczenie tak, jak zobaczy je uczeń.`,"preview.loading":`Przygotowuję podgląd…`,"preview.stale":`Dokument zmienił się po tym podglądzie. Odśwież go, aby zobaczyć zmiany.`,"preview.invalid":`{count, plural, one {Popraw ten błąd, aby zobaczyć podgląd:} few {Popraw te # błędy, aby zobaczyć podgląd:} many {Popraw tych # błędów, aby zobaczyć podgląd:} other {Popraw te # błędu, aby zobaczyć podgląd:}}`,"preview.failed":`Nie udało się pokazać podglądu.`,"surface.label":`Treść ćwiczenia`,"surface.pageNumber":`Strona {page} z {pages}`,"surface.pageTitle":`Tytuł strony`,"surface.pageJoin":`Połącz ze stroną {previous}`,"surface.pageAdded":`Dodano stronę {page}`,"surface.pageJoined":`Strona {page} połączona ze stroną {previous}`,"surface.pageDelete":`Usuń stronę`,"surface.pageDeleted":`Usunięto stronę {n}`,"surface.pageAddTitle":`Dodaj tytuł`,"surface.pageRemoveTitle":`Usuń tytuł`,"surface.pageTitleOf":`Tytuł strony {page}`,"surface.pageTitleRemoved":`Usunięto tytuł strony {page}`,"surface.points":`{points, plural, one {# pkt} few {# pkt} many {# pkt} other {# pkt}}`,"surface.items":`{n, plural, one {# element} few {# elementy} many {# elementów} other {# elementu}}`,"surface.blockMovedUp":`Blok przesunięty w górę, teraz to blok {n}`,"surface.blockMovedDown":`Blok przesunięty w dół, teraz to blok {n}`,"surface.blockRemoved":`Usunięto blok {n}`,"surface.addOption":`Dodaj odpowiedź`,"surface.chip.empty":`Brak odpowiedzi`,"surface.chip.more":`+{n}`,"surface.picture.alt":`Obrazek: {alt}`,"surface.picture.decorative":`Obrazek ozdobny (bez tekstu alternatywnego)`,"surface.picture.noAlt":`Obrazek bez tekstu alternatywnego`,"surface.picture.blocked":`(niepokazany: polityka adresów nie pozwala na jego adres)`,"surface.picture.edit":`Edytuj`,"surface.loading":`Wczytuję edytor…`,"surface.failed":`Nie udało się wczytać edytora. Odśwież stronę, aby spróbować ponownie.`,"view.visual":`Wizualny`,"view.source":`HTML`,"view.visualHint":`Edytuj ćwiczenie jako sformatowany tekst`,"view.sourceHint":`Edytuj ćwiczenie jako HTML`,"view.sourceLabel":`Ćwiczenie jako HTML`,"view.sourceErrors":`{n, plural, one {HTML ma # błąd. Popraw go, aby wrócić.} few {HTML ma # błędy. Popraw je, aby wrócić.} many {HTML ma # błędów. Popraw je, aby wrócić.} other {HTML ma # błędu. Popraw go, aby wrócić.}}`,"status.elements":`{n, plural, one {# element} few {# elementy} many {# elementów} other {# elementu}}`,"status.errors":`{n, plural, one {# błąd} few {# błędy} many {# błędów} other {# błędu}}`,"status.warnings":`{n, plural, one {# ostrzeżenie} few {# ostrzeżenia} many {# ostrzeżeń} other {# ostrzeżenia}}`,"status.ready":`Gotowe do udostępnienia`,"insert.layouts":`Układ`,"insert.layout.two":`Dwie kolumny`,"insert.layout.two.description":`Dwie kolumny tej samej szerokości.`,"insert.layout.three":`Trzy kolumny`,"insert.layout.three.description":`Trzy kolumny tej samej szerokości.`,"insert.layout.wide-narrow":`Szeroka + wąska`,"insert.layout.wide-narrow.description":`Szeroka kolumna, a po niej wąska.`,"insert.layout.narrow-wide":`Wąska + szeroka`,"insert.layout.narrow-wide.description":`Wąska kolumna, a po niej szeroka.`,"insert.layout.picture-text":`Obrazek obok tekstu`,"insert.layout.picture-text.description":`Wybrany obrazek, a obok niego tekst.`,"layout.section":`Kolumny`,"layout.change":`Zmień układ`,"layout.other":`Inny układ`,"layout.unwrap":`Usuń układ`,"layout.delete":`Usuń z zawartością`,"layout.confirm":`Usunąć układ razem z zawartością?`,"layout.confirmDelete":`Tak, usuń`,"layout.cancel":`Anuluj`,"toolbar.font":`Czcionka: {value}`,"toolbar.font.name":`Czcionka`,"toolbar.size":`Rozmiar: {value}`,"toolbar.size.name":`Rozmiar`,"toolbar.color":`Kolor tekstu`,"toolbar.highlight":`Wyróżnienie`,"toolbar.align":`Wyrównanie`,"toolbar.align.start":`Do lewej`,"toolbar.align.center":`Do środka`,"toolbar.align.end":`Do prawej`,"toolbar.align.justify":`Wyjustowane`,"toolbar.spacing":`Odstępy`,"toolbar.spacing.line":`Interlinia`,"toolbar.spacing.after":`Odstęp po`,"toolbar.spacing.none":`Brak`,"toolbar.spacing.small":`Mały`,"toolbar.spacing.medium":`Średni`,"toolbar.spacing.large":`Duży`,"toolbar.clear":`Wyczyść formatowanie`,"toolbar.default":`Domyślnie`,"toolbar.myStyles":`Moje style`,"toolbar.readyStyles":`Gotowe style`,"style.preset.note":`Uwaga`,"style.preset.tip":`Wskazówka`,"style.preset.important":`Ważne`,"style.preset.definition":`Definicja`,"style.preset.example":`Przykład`,"style.preset.quote":`Cytat`,"style.preset.highlight":`Wyróżnienie`,"style.preset.small-print":`Mały druk`,"style.color.theme":`Kolory motywu`,"style.color.swatch":`Kolor motywu {n}`,"style.color.custom":`Własny kolor`,"style.color.picker":`Wybierz kolor`,"style.color.invalid":`Wpisz kolor jako #rrggbb.`,"style.color.none":`Bez koloru`,"style.close":`Zamknij`,"style.form.none":`Ustaw kursor w tym, co chcesz ostylować.`,"style.target.picture":`Styl obrazka`,"style.target.figure":`Styl obrazka z podpisem`,"style.target.block":`Styl bloku`,"style.target.component":`Styl elementu`,"style.target.column":`Styl kolumny`,"style.target.layout":`Styl układu`,"style.position.inline":`W tekście`,"style.position.start":`Po lewej`,"style.position.end":`Po prawej`,"style.position.center":`Na środku`,"style.position.full":`Cała szerokość`,"style.rules.open":`Zarządzaj stylami…`,"style.rules.title":`Style`,"inspector.style":`Styl`,"surface.picture.place":`Położenie i rozmiar: {position}, {width}`,"surface.picture.placeAuto":`Położenie i rozmiar: {position}`,"style.target.more":`{target}…`,"help.cost":`koszt {percent}%`,"help.when.correct":`Dobrze`,"help.when.incorrect":`Źle`,"help.when.partial":`Częściowo dobrze`,"help.when.omitted":`Pominięte`,"help.costLabel":`Koszt podpowiedzi`,"help.whenLabel":`Dla wyniku`}})),H,$M,eN=n((()=>{XM(),QM(),H=`astl.editor`,$M=[{namespace:H,locale:`en`,messages:YM},{namespace:H,locale:`pl`,messages:ZM}]}));function tN(e,t=``){let n=e===`picture-text`?cN(t.startsWith(`<figure`)?t:`<p>${t}</p>`)+cN():sN[e].map(e=>cN(`<p></p>`,e)).join(``);return`<astl-columns${e===`picture-text`?` style="align-items: start"`:``}>${n}</astl-columns>`}var nN,rN,iN,aN,oN,sN,cN,lN=n((()=>{nN=e=>new Map(e.split(`;`).flatMap(e=>{let t=e.indexOf(`:`);return t<0?[]:[[e.slice(0,t).trim().toLowerCase(),e.slice(t+1).trim().toLowerCase()]]})),rN=[{name:`Arial`,stack:`Arial, Helvetica, sans-serif`},{name:`Verdana`,stack:`Verdana, Geneva, sans-serif`},{name:`Georgia`,stack:`Georgia, serif`},{name:`Times New Roman`,stack:`"Times New Roman", Times, serif`},{name:`Courier New`,stack:`"Courier New", Courier, monospace`}],iN=[{name:`note`,style:`background-color: #fff4d6; border-inline-start: 4px solid #b7791f; padding: 12px 16px; border-radius: 6px`},{name:`tip`,style:`background-color: #e7f6ec; border-inline-start: 4px solid #2f855a; padding: 12px 16px; border-radius: 6px`},{name:`important`,style:`background-color: #fdecec; border-inline-start: 4px solid #c53030; padding: 12px 16px; border-radius: 6px`},{name:`definition`,style:`background-color: #eef1fe; border: 1px solid #5a67d8; padding: 12px 16px; border-radius: 6px`},{name:`example`,style:`border: 2px dashed #718096; padding: 12px 16px; border-radius: 6px`},{name:`quote`,style:`border-inline-start: 3px solid #a0aec0; padding-inline-start: 16px; font-style: italic; color: #4a5568`},{name:`highlight`,style:`background-color: #fff3a3`,text:!0},{name:`small-print`,style:`font-size: 14px; color: #4a5568`,text:!0}],aN=[`two`,`three`,`wide-narrow`,`narrow-wide`,`picture-text`],oN=[`two`,`three`,`wide-narrow`,`narrow-wide`],sN={two:[null,null],three:[null,null,null],"wide-narrow":[2,null],"narrow-wide":[null,2]},cN=(e=`<p></p>`,t=null)=>`<astl-column${t===null?``:` style="flex-grow: ${t}"`}>${e}</astl-column>`}));function uN(e){let t=Fn(`font-family: ${e.stack}`).declarations[0]?.[1];if(t===void 0)throw TypeError(`Font "${e.name}": the style allow-list refuses its stack`);return{name:e.name,stack:t}}function dN(e,t){let n=new Set;return e.map(e=>{let{name:r}=e;if(!kn(r))throw TypeError(`Style "${r}": not a style name`);if(n.has(r))throw TypeError(`Style "${r}" is given twice`);n.add(r);let{style:i,removed:a}=Fn(e.style);if(a.length>0)throw TypeError(`Style "${r}": the style allow-list refuses ${a.join(`, `)}`);return{...e,style:i,label:e.label??t(r)}})}function fN(e){return e instanceof Error&&e.name===`UploadRefused`&&e.message.trim()!==``?e.message:void 0}function pN(e){let t=typeof e==`number`?e:typeof e==`string`&&/^[1-9]\d*$/.test(e)?Number(e):NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function mN(e){let t=(e,t)=>{let n=pN(t);return n===void 0?``:` ${e}="${n}"`},n=`<img src="${rM(String(e.src))}" alt="${rM(String(e.alt))}"${t(`width`,e.width)}${t(`height`,e.height)}>`,r=String(e.caption??``).trim();return r===``?n:`<figure>${n}<figcaption>${rM(r)}</figcaption></figure>`}function hN(){let e=crypto.getRandomValues(new Uint8Array(16));return`preview-${Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}`}function gN(e,t){for(let n=1;;n++){let r=`${e}-${n}`;if(!t.has(r))return r}}function _N(e){return e.find(e=>e.type===`element`)??null}function vN(e){let t=e.filter(e=>e!==null);return t.length===0?null:Math.round(t.reduce((e,t)=>e+t,0)*100)/100}function yN(e,t){let n={errors:0,warnings:0};for(let r of e)t(r)&&(r.severity===`error`?n.errors++:n.warnings++);return n}function bN(e){let{engine:t,locale:n}=e,r=new Map(t.manifests.map(e=>[e.tag,e])),i=new Map;for(let t of e.descriptors){let e=t.manifest.tag;if(i.has(e))throw TypeError(`Editor descriptor for <${e}> is given twice`);if(!r.has(e))throw TypeError(`Editor descriptor <${e}> has no component in the engine`);if(!Ae(`${t.idPrefix}-1`))throw TypeError(`Editor descriptor <${e}>: idPrefix "${t.idPrefix}" does not make valid ids`);let n=(t.templates??[]).map(e=>e.id);if(n.some((e,t)=>!SN.test(e)||n.indexOf(e)!==t))throw TypeError(`Editor descriptor <${e}>: template ids must be distinct kebab-case names`);i.set(e,t)}let a=e.styleTemplates??[],o=t=>vt({catalogs:[...$M,...zf,...e.descriptors.flatMap(e=>e.messages??[]),...t,...a.flatMap(e=>e.catalogs??[]),...e.catalogs??[]]}),s=o([]),c=[],l=e=>{let t=e.filter(e=>!c.includes(e));t.length!==0&&(c=[...c,...t],s=o(c))},u=null,d=(e,t,r)=>s.t(n,e,t,r),f=e=>i.get(e)?.manifest??r.get(e)??null,m=hN(),g=e=>({message:(t,n,r)=>{let i=d(e.messages,t,r);return i===t?n:i},unset:d(H,`inspector.unset`),untitled:e=>d(H,`inspector.untitled`,{n:e}),region:e=>d(H,`field.region`,{n:e}),point:e=>d(H,`field.point`,{n:e}),variant:d(H,`inspector.variant`),styleTemplate:d(H,`inspector.styleTemplate`),sameAsDocument:d(H,`inspector.styleTemplate.inherit`)}),_=(e,t)=>a.filter(n=>n.scopes.includes(e)&&(t===void 0||n.components===void 0||n.components.includes(t))).map(e=>{let t=d(e.messages,`label`);return{value:e.name,label:t===`label`?e.name:t}}),v=e=>{let t=i.get(e);if(t===void 0)return e;let n=d(t.manifest.messages,t.label);return n===t.label?e:n},y=e=>{if(r.get(e.tag)?.graded!==!0)return null;let t=Object.hasOwn(e.attrs,`points`)?Number(e.attrs.points):NaN;return Number.isFinite(t)&&t>0?t:wN},b=e=>{let{issues:n}=t.validate(e),i=e=>Object.hasOwn(e.attrs,`id`)?e.attrs.id??null:null,a=e=>{let t=i(e),r=yN(n,e=>t!==null&&e.at.element===t);return{id:t,tag:e.tag,label:v(e.tag),points:y(e),...r}},o=(e,t=[])=>{for(let n of e)n.type===`element`&&(r.has(n.tag)?t.push(a(n)):o(n.children,t));return t},s=(e,t,r)=>{let a=new Set(r.flatMap(e=>e.id===null?[]:[e.id])),o=vN(r.map(e=>e.points)),s=t===null?d(H,o===null?`block.text`:`block.gap`):v(t.tag);return{kind:e,id:t===null?null:i(t),tag:t?.tag??null,label:s,points:o,components:r,...yN(n,e=>e.at.element!==null&&a.has(e.at.element))}},c=e=>{let t=[],n=[],i=()=>{n.some(e=>e.type===`element`||e.value.trim()!==``)&&t.push(s(`text`,null,o(n))),n=[]};for(let o of e)if(o.type===`element`&&o.tag===`astl-columns`){i();for(let e of o.children)h(e,`astl-column`)&&t.push(...c(e.children))}else o.type===`element`&&r.get(o.tag)?.display===`block`?(i(),t.push(s(`component`,o,[a(o)]))):n.push(o);return i(),t},l=(e,t,r)=>{let i=c(r);return{id:e,label:t,...yN(n,t=>e===null?t.at.page===null&&t.at.tag!==null&&t.at.tag!==`astl-doc`:t.at.page===e),components:o(r),blocks:i,points:vN(i.map(e=>e.points))}},u=Rc(e),f=u.find(e=>h(e,Fe)),p=CN(f?.children??u),m=[];if(p.some(e=>h(e,`astl-page`))){let e=[],t=()=>{let t=l(null,null,e);t.components.length>0&&m.push(t),e=[]};for(let n of p){if(!h(n,`astl-page`)){e.push(n);continue}t();let r=e=>Object.hasOwn(n.attrs,e)?n.attrs[e]??null:null;m.push(l(r(`id`),r(`label`),n.children))}t()}else m.push(l(null,null,p));return{pages:m,...yN(n,()=>!0),points:vN(m.map(e=>e.points))}},x=null,ee=e=>{if(x?.source===e)return x.names;let t=new Map,n=Rc(e),i=CN(n.find(e=>h(e,`astl-doc`))?.children??n),a=i.some(e=>h(e,Ie)),o=(e,n,r)=>{let i=Object.hasOwn(e.attrs,`id`)?e.attrs.id:void 0;i===void 0||i===``||t.has(i)||t.set(i,{n,page:r})},s=(e,t,n)=>{for(let i of e){if(i.type!==`element`)continue;if(!r.has(i.tag)){s(i.children,t,n);continue}let e=(n.get(i.tag)??0)+1;n.set(i.tag,e),o(i,e,t)}},c=(e,t)=>{let n=new Map,i=0,a=!1,c=e=>{for(let l of e)if(l.type===`element`&&l.tag===`astl-columns`){for(let e of l.children)a=!1,h(e,`astl-column`)&&c(e.children);a=!1}else l.type===`element`&&r.get(l.tag)?.display===`block`?(i++,a=!1,o(l,i,t)):(!a&&(l.type===`element`||l.value.trim()!==``)&&(i++,a=!0),s([l],t,n))};c(e)};return a?i.filter(e=>h(e,Ie)).forEach((e,t)=>{c(e.children,t+1)}):c(i,null),x={source:e,names:t},t};function te(e,t){let n=[];for(let{tag:a,id:o,range:s}of Qj(e)){if(o!==null&&o.trim()!==``||a!==`astl-page`&&!r.has(a))continue;let e=a===`astl-page`?`page`:i.get(a)?.idPrefix??a.replace(/^astl-/,``),c=gN(Ae(`${e}-1`)?e:`item`,t);t.add(c);let l=s.startTag.attributes.find(e=>e.name===`id`),u=s.startTag.start+1+a.length;n.push(l===void 0?{start:u,end:u,text:` id="${c}"`}:{start:l.start,end:l.end,text:`id="${c}"`})}return iM(e,n)}function ie(e,t,n){let r=[];for(let{tag:a,range:o}of Qj(e)){let s=i.get(a)?.companion,c=s===void 0?void 0:i.get(s.tag);if(s===void 0||c===void 0||Zj(o.startTag,s.attribute))continue;let l=e=>$j(e).find(e=>e.tag===s.tag&&e.id)?.id,u=l(e)??l(t)??gN(c.idPrefix,n),d=wM(e.slice(o.start,o.end),{kind:`attribute`,name:s.attribute,value:u});r.push({start:o.start,end:o.end,text:d})}return iM(e,r)}function ae(e,t,n,r=``){let a=i.get(e);if(a===void 0)throw TypeError(`No editor descriptor for <${e}>`);let o=n===void 0?null:a.templates?.find(e=>e.id===n);if(o===void 0)throw TypeError(`Editor descriptor <${e}> has no template "${n}"`);let s=eM(t),c=gN(a.idPrefix,s),l=a.manifest.messages,u=(o?.template??a.template).replace(/\{\{t:([^}]+)\}\}/g,(e,t)=>rM(d(l,t.trim()))).replace(/\{\{id\}\}/g,c).replace(/\{\{selection\}\}/g,()=>rM(r));for(let e of eM(u))s.add(e);return ie(te(u,s),t,s)}return{engine:t,locale:n,descriptors:[...i.values()],elements:e.elements??[],styleTemplates:a,urlPolicy:re(e.urlPolicy??ne),fonts:(e.fonts??rN).map(uN),styles:dN(e.styles??iN,e=>{let t=`style.preset.${e}`,n=d(H,t);return n===t?e:n}),uploadAsset:e.uploadAsset??null,pickPicture:e.pickPicture??null,descriptor:e=>i.get(e)??null,templates:e=>i.get(e)?.templates??[],t:d,loadMenuMessages:()=>u??=Promise.resolve(e.menuMessages?.()??[]).then(l,e=>{u=null,console.error(e)}),addMessages:l,instantiate:ae,withCompanion(e,t,n){let r=i.get(e)?.companion;if(r===void 0||!i.has(r.tag))return null;let a=Yj(t).find(e=>e.name===Fe);if(a===void 0)return null;let o=a.children.filter(e=>e.name===Ie),s=Qj(t),c=e=>o.find(t=>t.start<=e.start&&e.end<=t.end)??a,l=e=>s.flatMap(t=>t.tag===r.tag&&t.id&&e.start<=t.start&&t.end<=e.end?[t.id]:[]),u=e=>Zj(e.startTag,r.attribute)??``,d=s.find(t=>t.tag===e&&(n===void 0?!l(c(t.range)).includes(u(t.range)):t.id===n));if(d===void 0)return null;let f=c(d.range),p=l(f);if(p.includes(u(d.range)))return null;let[m]=p,h=m===void 0?ae(r.tag,t):``,g=m??$j(h).find(e=>e.tag===r.tag)?.id??``,_=t.slice(d.start,d.end),v=f.endTag?.start??f.end;return iM(t,[{start:d.start,end:d.end,text:wM(_,{kind:`attribute`,name:r.attribute,value:g})},{start:v,end:v,text:h}])},inspect(e,t){let n=_N(Rc(e));if(n===null)return null;let r=f(n.tag);if(r===null)return null;let a=_(`component`,n.tag);return WM(n,r,i.get(n.tag)??null,g(r),a,e=>{if(t===void 0||e===``)return null;let n=$j(t).find(t=>t.id===e);return n===void 0?null:_N(Rc(t.slice(n.start,n.end)))})},inspectDocument(e){let t=qj(e).find(e=>e.type===`start`);if(t?.name!==`astl-doc`)return null;let n=Zj(t,wt),r=_(`document`);if(r.length===0&&n===null)return null;let i=p(Fe,n===null?{}:{[wt]:n}),a=d(H,`inspector.documentStyle`),o=d(H,`inspector.styleTemplate.default`);return{tag:Fe,id:null,label:d(H,`inspector.document`),icon:null,fields:[BM(i,a,o,r)]}},update:wM,validate:e=>t.validate(e),describe(e,r,i){let{id:a}=e.params,o=r!==void 0&&e.namespace!==`astl.engine`&&a===e.at.element&&typeof a==`string`?ee(r).get(a):void 0,s=o===void 0?void 0:o.page===null||i?.page===!1?String(o.n):d(H,`issue.onPage`,{n:o.n,page:o.page}),c=s===void 0?e:{...e,params:{...e.params,id:s}},l=d(c.namespace,c.code,c.params);return l===c.code?t.describe(c,n):l},assignIds:e=>te(e,eM(e)),outline:b,async preview(e,n){let r=await t.compile(e,{salt:m});return r.ok?{ok:!0,view:r.view,checker:En(t,r.key,n?.policy),issues:r.issues}:{ok:!1,issues:r.issues}}}}var xN,SN,CN,wN,TN=n((()=>{w(),Or(),Qp(),EM(),JM(),eN(),hM(),lN(),xN=class extends Error{constructor(e,t){super(e,t),this.name=`UploadRefused`}},SN=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,CN=e=>e.flatMap(e=>h(e,`astl-style`)?CN(e.children):[e]),wN=Number(It.find(e=>e.name===`points`)?.default??1)})),EN,DN=n((()=>{w(),z(),eN(),EN=class extends OC{static properties={authoring:{attribute:!1},adapter:{attribute:!1}};#e=null;constructor(){super(),this.authoring=null,this.adapter=null}connectedCallback(){super.connectedCallback(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#n()}willUpdate(e){e.has(`adapter`)&&this.#t()}#t(){let e=this.isConnected?this.adapter:null;if((this.#e?.adapter??null)===e||(this.#n(),e===null))return;let t=[e.onChange(()=>this.sourceChanged()),e.onSelectionChange(e=>this.selectionChanged(e)),e.onCursorChange?.(()=>this.cursorChanged())??(()=>{})];this.#e={adapter:e,off:()=>{for(let e of t)e()}}}#n(){this.#e?.off(),this.#e=null}sourceChanged(){this.requestUpdate()}selectionChanged(e){this.requestUpdate()}cursorChanged(){}t(e,t){return this.authoring?.t(`astl.editor`,e,t)??e}get ui(){let e=this.authoring?.locale??`en`;return{lang:e,dir:Me(e)}}}})),ON,kN=n((()=>{ON={"style.section.text":`Text`,"style.section.box":`Background and border`,"style.section.spacing":`Spacing`,"style.section.size":`Size and position`,"style.section.named":`Named style`,"style.section.own":`Own CSS`,"style.field.font-family":`Font`,"style.field.font-size":`Font size`,"style.field.font-weight":`Weight`,"style.field.font-style":`Slant`,"style.field.color":`Text colour`,"style.field.text-align":`Alignment`,"style.field.line-height":`Line height`,"style.field.background-color":`Background`,"style.field.border-width":`Border width`,"style.field.border-style":`Border style`,"style.field.border-color":`Border colour`,"style.field.border-radius":`Corners`,"style.field.padding":`Padding`,"style.field.margin-block-start":`Space before`,"style.field.margin-block-end":`Space after`,"style.field.width":`Width`,"style.field.position":`Position`,"style.field.gap":`Space between columns`,"style.field.align-items":`Align columns`,"style.field.flex-grow":`Share of the width`,"style.field.named":`Style`,"style.field.own":`CSS declarations`,"style.value.normal":`Normal`,"style.value.bold":`Bold`,"style.value.italic":`Italic`,"style.value.start":`Left`,"style.value.center":`Centre`,"style.value.end":`Right`,"style.value.justify":`Justified`,"style.value.none":`None`,"style.value.solid":`Solid`,"style.value.dashed":`Dashed`,"style.value.dotted":`Dotted`,"style.value.double":`Double`,"style.value.stretch":`Same height`,"style.named.none":`No style`,"style.save.label":`Name of the new style`,"style.save":`Save as a style`,"style.refused.property":`"{name}" is not allowed: an exercise's style cannot move it out of its place, cover other content or load anything.`,"style.refused.value":`This value of "{name}" is not allowed: check its unit and its limits.`,"style.refused.text":`"{name}" is not a declaration: write it as property: value.`,"style.refused.length":`This style is too long: at most {max} characters.`,"style.rules.tags":`Text styles`,"style.rules.empty":`No styles of your own yet. Add one here, or save an element's style.`,"style.rules.edit":`Edit style: {label}`,"style.rules.rename":`Rename style: {label}`,"style.rules.renameShort":`Rename`,"style.rules.renameField":`New name of style: {label}`,"style.rules.delete":`Delete style: {label}`,"style.rules.deleteShort":`Delete`,"style.rules.newLabel":`Name of a new style`,"style.rules.add":`Add style`,"style.tag.paragraph":`Paragraph`,"style.tag.heading":`Heading`,"style.tag.subheading":`Subheading`,"style.tag.quote":`Quote`,"style.tag.list":`List`,"style.tag.caption":`Caption`,"style.tag.picture":`Picture`}})),AN,jN=n((()=>{AN={"style.section.text":`Tekst`,"style.section.box":`Tło i obramowanie`,"style.section.spacing":`Odstępy`,"style.section.size":`Rozmiar i położenie`,"style.section.named":`Styl nazwany`,"style.section.own":`Własny CSS`,"style.field.font-family":`Czcionka`,"style.field.font-size":`Rozmiar czcionki`,"style.field.font-weight":`Grubość`,"style.field.font-style":`Pochylenie`,"style.field.color":`Kolor tekstu`,"style.field.text-align":`Wyrównanie`,"style.field.line-height":`Interlinia`,"style.field.background-color":`Tło`,"style.field.border-width":`Grubość obramowania`,"style.field.border-style":`Rodzaj obramowania`,"style.field.border-color":`Kolor obramowania`,"style.field.border-radius":`Narożniki`,"style.field.padding":`Wypełnienie`,"style.field.margin-block-start":`Odstęp przed`,"style.field.margin-block-end":`Odstęp po`,"style.field.width":`Szerokość`,"style.field.position":`Położenie`,"style.field.gap":`Odstęp między kolumnami`,"style.field.align-items":`Wyrównanie kolumn`,"style.field.flex-grow":`Udział w szerokości`,"style.field.named":`Styl`,"style.field.own":`Deklaracje CSS`,"style.value.normal":`Normalna`,"style.value.bold":`Pogrubiona`,"style.value.italic":`Pochylona`,"style.value.start":`Do lewej`,"style.value.center":`Do środka`,"style.value.end":`Do prawej`,"style.value.justify":`Wyjustowane`,"style.value.none":`Brak`,"style.value.solid":`Ciągłe`,"style.value.dashed":`Kreskowane`,"style.value.dotted":`Kropkowane`,"style.value.double":`Podwójne`,"style.value.stretch":`Równa wysokość`,"style.named.none":`Bez stylu`,"style.save.label":`Nazwa nowego stylu`,"style.save":`Zapisz jako styl`,"style.refused.property":`„{name}” jest niedozwolone: styl ćwiczenia nie może przenosić go poza jego miejsce, zasłaniać innych treści ani niczego wczytywać.`,"style.refused.value":`Ta wartość „{name}” jest niedozwolona: sprawdź jednostkę i dopuszczalny zakres.`,"style.refused.text":`„{name}” to nie jest deklaracja: wpisz ją jako właściwość: wartość.`,"style.refused.length":`Ten styl jest za długi: najwyżej {max} znaków.`,"style.rules.tags":`Style tekstu`,"style.rules.empty":`Nie masz jeszcze własnych stylów. Dodaj styl tutaj albo zapisz styl elementu.`,"style.rules.edit":`Edytuj styl: {label}`,"style.rules.rename":`Zmień nazwę stylu: {label}`,"style.rules.renameShort":`Zmień nazwę`,"style.rules.renameField":`Nowa nazwa stylu: {label}`,"style.rules.delete":`Usuń styl: {label}`,"style.rules.deleteShort":`Usuń`,"style.rules.newLabel":`Nazwa nowego stylu`,"style.rules.add":`Dodaj styl`,"style.tag.paragraph":`Akapit`,"style.tag.heading":`Nagłówek`,"style.tag.subheading":`Podtytuł`,"style.tag.quote":`Cytat`,"style.tag.list":`Lista`,"style.tag.caption":`Podpis`,"style.tag.picture":`Obrazek`}})),MN,NN=n((()=>{kN(),jN(),eN(),MN=[{namespace:H,locale:`en`,messages:ON},{namespace:H,locale:`pl`,messages:AN}]}));function PN(e){let t=nN(e),n=t.get(`float`);if(n===`inline-start`||n===`left`)return`start`;if(n===`inline-end`||n===`right`)return`end`;if(t.get(`width`)===`100%`&&(t.get(`display`)===`block`||!t.has(`display`)))return`full`;let r=t.get(`margin`)?.split(/\s+/);return t.get(`margin-inline`)===`auto`||[`left`,`right`].every(e=>t.get(`margin-${e}`)===`auto`)||r!==void 0&&r.length===2&&r[1]===`auto`?`center`:`inline`}function FN(e,t,n=!1){let r={};for(let e of VN)r[e]=null;return PN(t)===`full`&&(r.width=null),n&&e===`center`&&(PN(t)===`full`||!nN(t).has(`width`))&&(r.width=`50%`),{...r,...HN[e]}}function IN(e,t){return{width:`${t}%`,...PN(e)===`full`&&t<100?{display:null}:{}}}function LN(e){let t=[],n=[];for(let[r,i]of nN(e))(UN.has(r)?t:n).push(`${r}: ${i}`);return{placed:t.join(`; `),rest:n.join(`; `)}}function RN(e){let t=/^(\d+(?:\.\d+)?)%$/.exec(nN(e).get(`width`)??``);return t===null?null:Number(t[1])}function zN(e,t){let n=e.normalize(`NFD`).replace(/\p{M}/gu,``).replace(/[łŁ]/g,`l`).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^[^a-z]+|-+$/g,``).slice(0,56),r=kn(n)?n:`style`;if(r!==`style`&&!t.has(r))return r;let i=1;for(;t.has(`${r}-${i}`);)i++;return`${r}-${i}`}var BN,VN,HN,UN,WN=n((()=>{Or(),lN(),BN=[`inline`,`start`,`end`,`center`,`full`],VN=[`float`,`display`,`margin`,...[`left`,`right`,`bottom`].map(e=>`margin-${e}`),`margin-inline`,`margin-inline-start`,`margin-inline-end`,`margin-block-end`],HN={inline:{},start:{float:`inline-start`,"margin-inline-end":`16px`,"margin-block-end":`8px`},end:{float:`inline-end`,"margin-inline-start":`16px`,"margin-block-end":`8px`},center:{display:`block`,"margin-inline":`auto`},full:{display:`block`,width:`100%`}},UN=new Set([...VN,`width`])}));function GN(e){let t=e==null?null:Mn(e);if(t===null)return null;let n=e=>Math.round(e).toString(16).padStart(2,`0`);return`#${n(t[0])}${n(t[1])}${n(t[2])}`}function KN(e){let{id:t,value:n,t:r,invalid:i,ground:a=!1}=e,o=GN(n),s=e=>`var(--astl-palette-${e}${a?`-soft`:``})`;return I`<div class="swatches" role="group" aria-label=${r(`style.color.theme`)}>
4572
4572
  ${qN.map(t=>I`<button
4573
4573
  type="button"
4574
4574
  class="swatch"
@@ -6425,13 +6425,18 @@ border: var(--astl-outline-width) solid var(--astl-line);
6425
6425
  border-radius: var(--astl-radius-l);
6426
6426
  background: var(--astl-surface);
6427
6427
  }
6428
+ .formats,
6429
+ .actions {
6430
+ display: contents;
6431
+ }
6428
6432
  .group {
6429
6433
  display: flex;
6430
6434
  flex-wrap: wrap;
6431
6435
  align-items: center;
6432
6436
  gap: var(--astl-space-1);
6433
6437
  }
6434
- .group + .group {
6438
+ .group + .group,
6439
+ .formats + .actions > .group:first-child {
6435
6440
  position: relative;
6436
6441
  margin-inline-start: calc(-1 * var(--astl-space-2) - var(--astl-outline-width));
6437
6442
  padding-inline-start: calc(var(--astl-space-2) + var(--astl-outline-width));
@@ -6447,9 +6452,39 @@ margin-inline-start: auto;
6447
6452
  }
6448
6453
  @container (inline-size < 30rem) {
6449
6454
  .bar {
6450
- flex-wrap: nowrap;
6455
+ flex-flow: column nowrap;
6456
+ align-items: stretch;
6457
+ }
6458
+ .formats,
6459
+ .actions {
6460
+ display: flex;
6461
+ align-items: center;
6462
+ }
6463
+ .actions {
6464
+ flex-wrap: wrap;
6465
+ gap: var(--astl-space-1);
6466
+ }
6467
+ .actions > .group:not(.views, .history) {
6468
+ display: contents;
6469
+ }
6470
+ .actions .separator {
6471
+ display: none;
6472
+ }
6473
+ .actions > .group {
6474
+ margin-inline-start: 0;
6475
+ }
6476
+ .actions > .history {
6477
+ margin-inline-start: auto;
6478
+ padding-inline-start: 0;
6479
+ }
6480
+ .formats {
6481
+ --ring: calc(var(--astl-focus-width) + var(--astl-focus-offset));
6482
+ gap: var(--astl-space-1) calc(2 * var(--astl-space-2) + var(--astl-outline-width));
6451
6483
  overflow-x: auto;
6452
6484
  scrollbar-width: thin;
6485
+ padding: var(--ring);
6486
+ margin-block: calc(-1 * var(--ring)) 0;
6487
+ margin-inline: calc(-1 * var(--ring));
6453
6488
  background:
6454
6489
  linear-gradient(90deg, var(--astl-surface) 50%, #0000) left / 1.5rem no-repeat local,
6455
6490
  linear-gradient(-90deg, var(--astl-surface) 50%, #0000) right / 1.5rem no-repeat local,
@@ -6457,7 +6492,7 @@ radial-gradient(farthest-side at 0, var(--astl-outline), #0000) left / 0.5rem no
6457
6492
  radial-gradient(farthest-side at 100%, var(--astl-outline), #0000) right / 0.5rem no-repeat,
6458
6493
  var(--astl-surface);
6459
6494
  }
6460
- .group {
6495
+ .formats > .group {
6461
6496
  flex: none;
6462
6497
  flex-wrap: nowrap;
6463
6498
  }
@@ -6645,7 +6680,7 @@ border-color: Highlight;
6645
6680
  color: GrayText;
6646
6681
  }
6647
6682
  }
6648
- `,sI=class extends EN{static properties={...EN.properties,featured:{attribute:!1},views:{attribute:!1},view:{}};static styles=[QN,ZN(`astl-insert-menu, astl-picture-dialog, astl-style-form, astl-style-rules`),iI,aI,oI];#e=rI;#t=null;#n=null;#r=null;#i=`block`;#a=!1;#o=`elements`;#s=``;#c=!1;#l=null;#u=[];#d=new SO(this,{count:()=>this.#u.length,item:e=>this.renderRoot.querySelector(`.bar [data-item="${e}"]`),axis:`inline`});constructor(){super(),this.featured=[],this.views=[],this.view=``}get menu(){return this.renderRoot.querySelector(`astl-insert-menu`)}async openMenu(e){await this.#g(e)}async openStyle(e){let t={target:e};this.#_(!1);let n=new CustomEvent(WP,{detail:t,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(n)&&(await HP(),this.#i=e,await this.#g(`panel`))}async#f(){if(this.#r!==null)return!0;try{let e=await Promise.resolve().then(()=>(GF(),FF)),t=this.renderRoot,n=e.stylePopupStyles.styleSheet;return this.#r===null&&n!==void 0&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]),this.#r=e,!0}catch(e){return console.error(e),!1}}connectedCallback(){super.connectedCallback(),this.#p(),document.addEventListener(`pointerdown`,this.#m,!0),document.addEventListener(`keydown`,this.#h)}disconnectedCallback(){super.disconnectedCallback(),this.#p(),document.removeEventListener(`pointerdown`,this.#m,!0),document.removeEventListener(`keydown`,this.#h)}willUpdate(e){super.willUpdate(e),e.has(`adapter`)&&this.#p(),this.#e=this.adapter?.formatState?.()??rI,this.#t=this.adapter?.style?.state()??null}#p(){let e=this.isConnected?this.adapter:null;if((this.#l?.adapter??null)===e)return;this.#l?.off(),this.#l=null;let t=e?.onCursorChange;e!==null&&t!==void 0&&(this.#l={adapter:e,off:t.call(e,()=>this.requestUpdate())})}#m=e=>{if(this.#n===null)return;let t=e.composedPath(),n=this.renderRoot.querySelector(`#${eI(this.#n)}`),r=this.renderRoot.querySelector(`[data-popup="${tI(this.#n)}"]`);n!==null&&t.includes(n)||r!==null&&t.includes(r)||t.some(e=>e instanceof Element&&e.localName===`astl-picture-dialog`)||this.#_(!1)};#h=e=>{if(this.#n!==`panel`||e.key!==`Escape`)return;let t=this.renderRoot.querySelector(`#panel`),n=t!==null&&e.composedPath().includes(t);n&&e.defaultPrevented||(e.preventDefault(),this.#_(n))};async#g(e){if((e===`panel`||QF.has(e))&&!await this.#f())return;this.#n!==null&&this.#n!==e&&this.#_(!1),this.#n=e,this.#c=!1,this.#a=!1,$F(e)&&(this.#s=``,this.#o=e),this.requestUpdate(),await this.updateComplete;let t=this.renderRoot.querySelector(`#${eI(e)}`),n=this.renderRoot.querySelector(`[data-popup="${tI(e)}"]`);t!==null&&n!==null&&(t.matches(`:popover-open`)||t.showPopover(),this.menu?.requestUpdate(),this.#v(t,n),(e===`style`||QF.has(e)?t.querySelector(`[aria-checked="true"], [aria-pressed="true"]`)??t.querySelector(`button`):e===`panel`?t:t.querySelector(`input`))?.focus())}#_(e){let t=this.#n;if(t===null)return;this.#n=null;let n=this.renderRoot.querySelector(`#${eI(t)}`);n?.matches(`:popover-open`)===!0&&n.hidePopover(),e&&this.renderRoot.querySelector(`[data-popup="${tI(t)}"]`)?.focus(),this.requestUpdate()}#v(e,t){let n=t.getBoundingClientRect(),r=getComputedStyle(t).direction===`rtl`,i=e.offsetWidth,a=document.documentElement.clientWidth,o=r?a-n.right:n.left,s=Math.max(8,Math.min(o,a-i-8));e.style.setProperty(`inset-inline-start`,`${s}px`);let c=document.documentElement.clientHeight-e.offsetHeight-8;e.style.setProperty(`inset-block-start`,`${Math.max(8,Math.min(n.bottom+4,c))}px`)}#y(){this.adapter?.focus?.()}#b(e,t){this.#e.enabled.includes(e)&&(this.adapter?.format?.(e,t),this.#y(),this.requestUpdate())}#x(e){this.adapter?.style?.setText(e),this.#_(!1),this.#y(),this.requestUpdate()}#S(e){this.adapter?.style?.setTarget(`block`,e),this.#_(!1),this.#y(),this.requestUpdate()}#C(e=!1){let t=this.#t;return t===null?null:t.hasSelection&&!e?`text`:t.targets[0]?.kind??null}#w(e=!1){let t=this.#C(e);return t===`text`?this.#t?.textClass??null:this.#t?.targets.find(e=>e.kind===t)?.className??null}#T(e){return this.authoring?.styles.some(t=>t.name===e&&t.text!==!0)??!1}#E(e,t){let n=this.#T(e),r=this.#C(n);r!==null&&(t===void 0?this.adapter?.style?.setClass(r,this.#w(n)===e?null:e):this.adapter?.style?.setClass(r,e,t)),this.#_(!1),this.#y(),this.requestUpdate()}#D(){let e=this.#t?.text[`font-family`];return e===void 0?``:this.authoring?.fonts.find(t=>t.stack===e)?.name??(e.split(`,`)[0]??``).replace(/"/g,``).trim()}#O(){let e=this.#t;if(e===null)return{fonts:[],colors:[],blocks:[],clear:[]};let{text:t,textEnabled:n,targets:r}=e,i=r.some(e=>e.kind===`block`),a=(e,t,n,r,i)=>({id:e,label:t,text:null,icon:r,iconName:i,disabled:!n,popup:e,press:()=>{this.#n===e?this.#_(!0):this.#g(e)}}),o=this.#D(),s=/^(\d+(?:\.\d+)?)px$/.exec(t[`font-size`]??``)?.[1]??t[`font-size`]??``,c=(e,t,r)=>({...a(e,this.t(t,{value:r===``?this.t(`toolbar.default`):r}),n,KF.chevron,`chevron`),text:r===``?this.t(`toolbar.${e}.name`):r,menu:!0}),l=r.find(e=>e.kind===`block`)?.style??``,u=nN(l).get(`text-align`),d=u===`right`||u===`end`?`align-end`:u===`center`?`align-center`:u===`justify`?`align-justify`:`align-start`;return{fonts:[c(`font`,`toolbar.font`,o),c(`size`,`toolbar.size`,s)],colors:[{...a(`color`,this.t(`toolbar.color`),n,KF.color,`color`),bar:t.color??null},{...a(`highlight`,this.t(`toolbar.highlight`),n,KF.highlight,`highlight`),bar:t[`background-color`]??null}],blocks:[a(`align`,this.t(`toolbar.align`),i,KF[d],d),a(`spacing`,this.t(`toolbar.spacing`),i,KF.spacing,`spacing`)],clear:[{id:`clear`,label:this.t(`toolbar.clear`),text:null,icon:KF.clear,iconName:`clear`,disabled:!n&&!i,press:()=>{this.adapter?.style?.clear(),this.#y(),this.requestUpdate()}}]}}async#k(e){let t=this.menu,n=this.adapter;if(t!==null&&n!==null){if(e===`text`)n.insert(`<p></p>`),this.#y();else{if(e===`picture`)await t.insertPicture();else if(e===`page-break`)t.insertPageBreak();else{let[n=``,r]=e.split(`:`);await t.add(n,r)}this.#y()}}}#A(){let e=this.authoring;if(e===null)return[];let t=this.adapter===null,n=[];for(let r of this.featured){if(r===`text`||r===`picture`){let e=this.t(r===`text`?`insert.text`:`insert.picture`);n.push({id:`insert-${r}`,label:e,text:e,icon:r===`text`?KF.text:ZP.picture,iconName:r===`text`?`text`:`image`,disabled:t,data:{content:r},press:()=>void this.#k(r)});continue}if(r===`page-break`){if(this.adapter?.splitPage===void 0)continue;let e=this.t(`insert.pageBreak`);n.push({id:`insert-page-break`,label:e,text:e,icon:ZP.page,iconName:`files`,data:{content:r},press:()=>void this.#k(r)});continue}let[i=``,a]=r.split(`:`),o=e.descriptor(i);if(o===null)continue;let s=a===void 0?null:e.templates(i).find(e=>e.id===a);if(s===void 0)continue;let c=e.t(o.manifest.messages,s?.label??o.label),l=s?.icon??o.icon;n.push({id:`insert-${r}`,label:c,text:c,icon:QP.get(l)??ZP[o.manifest.display],iconName:l,disabled:t,data:a===void 0?{tag:i}:{tag:i,template:a},press:()=>void this.#k(r)})}return n}#j(){let e=this.adapter,t=this.authoring,n=this.#e,r=[],i=(e,t)=>({id:e,label:this.t(`toolbar.${e}`),text:null,icon:KF[e],iconName:e,pressed:n.active.includes(e),disabled:!n.enabled.includes(e),...t===void 0?{}:{popup:t},press:()=>{t===void 0?this.#b(e):this.#g(t)}});if(e?.format!==void 0&&e.formatState!==void 0){let t=qF.find(e=>n.active.includes(e)),a=this.#w(),o=a===null?void 0:e.style?.rules().find(e=>e.name===a),s=o?.label??o?.name??this.t(`toolbar.${t??`paragraph`}`),c=this.#O();r.push([`group`,[{id:`style`,label:this.t(`toolbar.style`,{style:s}),text:s,icon:KF.chevron,iconName:`chevron`,menu:!0,disabled:!qF.some(e=>n.enabled.includes(e))&&(this.#t?.targets.length??0)===0,popup:`style`,press:()=>void this.#g(`style`)}]]),c.fonts.length>0&&r.push([`group`,c.fonts]),r.push([`group`,[...XF.map(e=>i(e)),i(`link`,`link`)]]),c.colors.length>0&&r.push([`group`,c.colors]),c.blocks.length>0&&r.push([`group`,c.blocks]),r.push([`group`,[...ZF.map(e=>i(e)),...c.clear]])}let a=(t,n)=>({id:t,label:this.t(`toolbar.${t}`),text:this.t(`toolbar.${t}`),icon:KF[n],iconName:n,disabled:e===null,popup:t,press:()=>{this.#n===t?this.#_(!0):this.#g(t)}}),o=t?.descriptors.some(e=>(e.templates??[]).length>0)===!0;if(r.push([`group inserts`,[...this.#A(),a(`elements`,`add`),...o?[a(`templates`,`templates`)]:[],...e?.style===void 0?[]:[a(`layouts`,`layouts`)]]]),e?.wrap!==void 0&&t!==null){let e=t.descriptors.filter(e=>e.wrap!==void 0);e.length>0&&r.push([`group`,e.map(e=>{let n=t.t(e.manifest.messages,e.wrap?.label??``);return{id:`wrap-${e.manifest.tag}`,label:n,text:n,icon:KF.wrap,iconName:`wrap`,data:{wrap:e.manifest.tag},press:()=>{this.adapter?.wrap?.(e.manifest.tag),this.#y()}}})])}if(this.views.length>0&&r.push([`group views`,this.views.map(e=>({id:`view-${e.name}`,label:e.label,text:e.label,icon:null,iconName:``,checked:e.name===this.view,press:()=>{if(e.name===this.view)return;let t={view:e.name};this.dispatchEvent(new CustomEvent(nI,{detail:t,bubbles:!0,composed:!0}))}}))]),e?.undo!==void 0&&e.redo!==void 0){let t=t=>({id:t,label:this.t(`toolbar.${t}`),text:null,icon:KF[t],iconName:t,disabled:!n[t],press:()=>{n[t]&&(e[t]?.(),this.#y())}});r.push([`group history`,[t(`undo`),t(`redo`)]])}return r}#M(e){let t=e.target.closest(`[data-item]`);if(t===null)return;let n=Number(t.dataset.item),r=this.#u[n];(r?.popup===`style`||QF.has(r?.popup??``))&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),r?.disabled!==!0&&r?.popup!==void 0&&this.#g(r.popup)):this.#d.keydown(e,n)}#N(e,t){let n=e.disabled===!0,r=e.checked===void 0?e.text===null?`button icon-button`:`button`:`button view`;return I`<button
6683
+ `,sI=class extends EN{static properties={...EN.properties,featured:{attribute:!1},views:{attribute:!1},view:{}};static styles=[QN,ZN(`astl-insert-menu, astl-picture-dialog, astl-style-form, astl-style-rules`),iI,aI,oI];#e=rI;#t=null;#n=null;#r=null;#i=`block`;#a=!1;#o=`elements`;#s=``;#c=!1;#l=null;#u=[];#d=new SO(this,{count:()=>this.#u.length,item:e=>this.renderRoot.querySelector(`.bar [data-item="${e}"]`),axis:`inline`});constructor(){super(),this.featured=[],this.views=[],this.view=``}get menu(){return this.renderRoot.querySelector(`astl-insert-menu`)}async openMenu(e){await this.#g(e)}async openStyle(e){let t={target:e};this.#_(!1);let n=new CustomEvent(WP,{detail:t,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(n)&&(await HP(),this.#i=e,await this.#g(`panel`))}async#f(){if(this.#r!==null)return!0;try{let e=await Promise.resolve().then(()=>(GF(),FF)),t=this.renderRoot,n=e.stylePopupStyles.styleSheet;return this.#r===null&&n!==void 0&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]),this.#r=e,!0}catch(e){return console.error(e),!1}}connectedCallback(){super.connectedCallback(),this.#p(),document.addEventListener(`pointerdown`,this.#m,!0),document.addEventListener(`keydown`,this.#h)}disconnectedCallback(){super.disconnectedCallback(),this.#p(),document.removeEventListener(`pointerdown`,this.#m,!0),document.removeEventListener(`keydown`,this.#h)}willUpdate(e){super.willUpdate(e),e.has(`adapter`)&&this.#p(),this.#e=this.adapter?.formatState?.()??rI,this.#t=this.adapter?.style?.state()??null}#p(){let e=this.isConnected?this.adapter:null;if((this.#l?.adapter??null)===e)return;this.#l?.off(),this.#l=null;let t=e?.onCursorChange;e!==null&&t!==void 0&&(this.#l={adapter:e,off:t.call(e,()=>this.requestUpdate())})}#m=e=>{if(this.#n===null)return;let t=e.composedPath(),n=this.renderRoot.querySelector(`#${eI(this.#n)}`),r=this.renderRoot.querySelector(`[data-popup="${tI(this.#n)}"]`);n!==null&&t.includes(n)||r!==null&&t.includes(r)||t.some(e=>e instanceof Element&&e.localName===`astl-picture-dialog`)||this.#_(!1)};#h=e=>{if(this.#n!==`panel`||e.key!==`Escape`)return;let t=this.renderRoot.querySelector(`#panel`),n=t!==null&&e.composedPath().includes(t);n&&e.defaultPrevented||(e.preventDefault(),this.#_(n))};async#g(e){if((e===`panel`||QF.has(e))&&!await this.#f())return;this.#n!==null&&this.#n!==e&&this.#_(!1),this.#n=e,this.#c=!1,this.#a=!1,$F(e)&&(this.#s=``,this.#o=e),this.requestUpdate(),await this.updateComplete;let t=this.renderRoot.querySelector(`#${eI(e)}`),n=this.renderRoot.querySelector(`[data-popup="${tI(e)}"]`);t!==null&&n!==null&&(t.matches(`:popover-open`)||t.showPopover(),this.menu?.requestUpdate(),this.#v(t,n),(e===`style`||QF.has(e)?t.querySelector(`[aria-checked="true"], [aria-pressed="true"]`)??t.querySelector(`button`):e===`panel`?t:t.querySelector(`input`))?.focus())}#_(e){let t=this.#n;if(t===null)return;this.#n=null;let n=this.renderRoot.querySelector(`#${eI(t)}`);n?.matches(`:popover-open`)===!0&&n.hidePopover(),e&&this.renderRoot.querySelector(`[data-popup="${tI(t)}"]`)?.focus(),this.requestUpdate()}#v(e,t){let n=t.getBoundingClientRect(),r=getComputedStyle(t).direction===`rtl`,i=e.offsetWidth,a=document.documentElement.clientWidth,o=r?a-n.right:n.left,s=Math.max(8,Math.min(o,a-i-8));e.style.setProperty(`inset-inline-start`,`${s}px`);let c=document.documentElement.clientHeight-e.offsetHeight-8;e.style.setProperty(`inset-block-start`,`${Math.max(8,Math.min(n.bottom+4,c))}px`)}#y(){this.adapter?.focus?.()}#b(e,t){this.#e.enabled.includes(e)&&(this.adapter?.format?.(e,t),this.#y(),this.requestUpdate())}#x(e){this.adapter?.style?.setText(e),this.#_(!1),this.#y(),this.requestUpdate()}#S(e){this.adapter?.style?.setTarget(`block`,e),this.#_(!1),this.#y(),this.requestUpdate()}#C(e=!1){let t=this.#t;return t===null?null:t.hasSelection&&!e?`text`:t.targets[0]?.kind??null}#w(e=!1){let t=this.#C(e);return t===`text`?this.#t?.textClass??null:this.#t?.targets.find(e=>e.kind===t)?.className??null}#T(e){return this.authoring?.styles.some(t=>t.name===e&&t.text!==!0)??!1}#E(e,t){let n=this.#T(e),r=this.#C(n);r!==null&&(t===void 0?this.adapter?.style?.setClass(r,this.#w(n)===e?null:e):this.adapter?.style?.setClass(r,e,t)),this.#_(!1),this.#y(),this.requestUpdate()}#D(){let e=this.#t?.text[`font-family`];return e===void 0?``:this.authoring?.fonts.find(t=>t.stack===e)?.name??(e.split(`,`)[0]??``).replace(/"/g,``).trim()}#O(){let e=this.#t;if(e===null)return{fonts:[],colors:[],blocks:[],clear:[]};let{text:t,textEnabled:n,targets:r}=e,i=r.some(e=>e.kind===`block`),a=(e,t,n,r,i)=>({id:e,label:t,text:null,icon:r,iconName:i,disabled:!n,popup:e,press:()=>{this.#n===e?this.#_(!0):this.#g(e)}}),o=this.#D(),s=/^(\d+(?:\.\d+)?)px$/.exec(t[`font-size`]??``)?.[1]??t[`font-size`]??``,c=(e,t,r)=>({...a(e,this.t(t,{value:r===``?this.t(`toolbar.default`):r}),n,KF.chevron,`chevron`),text:r===``?this.t(`toolbar.${e}.name`):r,menu:!0}),l=r.find(e=>e.kind===`block`)?.style??``,u=nN(l).get(`text-align`),d=u===`right`||u===`end`?`align-end`:u===`center`?`align-center`:u===`justify`?`align-justify`:`align-start`;return{fonts:[c(`font`,`toolbar.font`,o),c(`size`,`toolbar.size`,s)],colors:[{...a(`color`,this.t(`toolbar.color`),n,KF.color,`color`),bar:t.color??null},{...a(`highlight`,this.t(`toolbar.highlight`),n,KF.highlight,`highlight`),bar:t[`background-color`]??null}],blocks:[a(`align`,this.t(`toolbar.align`),i,KF[d],d),a(`spacing`,this.t(`toolbar.spacing`),i,KF.spacing,`spacing`)],clear:[{id:`clear`,label:this.t(`toolbar.clear`),text:null,icon:KF.clear,iconName:`clear`,disabled:!n&&!i,press:()=>{this.adapter?.style?.clear(),this.#y(),this.requestUpdate()}}]}}async#k(e){let t=this.menu,n=this.adapter;if(t!==null&&n!==null){if(e===`text`)n.insert(`<p></p>`),this.#y();else{if(e===`picture`)await t.insertPicture();else if(e===`page-break`)t.insertPageBreak();else{let[n=``,r]=e.split(`:`);await t.add(n,r)}this.#y()}}}#A(){let e=this.authoring;if(e===null)return[];let t=this.adapter===null,n=[];for(let r of this.featured){if(r===`text`||r===`picture`){let e=this.t(r===`text`?`insert.text`:`insert.picture`);n.push({id:`insert-${r}`,label:e,text:e,icon:r===`text`?KF.text:ZP.picture,iconName:r===`text`?`text`:`image`,disabled:t,data:{content:r},press:()=>void this.#k(r)});continue}if(r===`page-break`){if(this.adapter?.splitPage===void 0)continue;let e=this.t(`insert.pageBreak`);n.push({id:`insert-page-break`,label:e,text:e,icon:ZP.page,iconName:`files`,data:{content:r},press:()=>void this.#k(r)});continue}let[i=``,a]=r.split(`:`),o=e.descriptor(i);if(o===null)continue;let s=a===void 0?null:e.templates(i).find(e=>e.id===a);if(s===void 0)continue;let c=e.t(o.manifest.messages,s?.label??o.label),l=s?.icon??o.icon;n.push({id:`insert-${r}`,label:c,text:c,icon:QP.get(l)??ZP[o.manifest.display],iconName:l,disabled:t,data:a===void 0?{tag:i}:{tag:i,template:a},press:()=>void this.#k(r)})}return n}#j(){let e=this.adapter,t=this.authoring,n=this.#e,r=[],i=(e,t)=>({id:e,label:this.t(`toolbar.${e}`),text:null,icon:KF[e],iconName:e,pressed:n.active.includes(e),disabled:!n.enabled.includes(e),...t===void 0?{}:{popup:t},press:()=>{t===void 0?this.#b(e):this.#g(t)}});if(e?.format!==void 0&&e.formatState!==void 0){let t=qF.find(e=>n.active.includes(e)),a=this.#w(),o=a===null?void 0:e.style?.rules().find(e=>e.name===a),s=o?.label??o?.name??this.t(`toolbar.${t??`paragraph`}`),c=this.#O();r.push([`group`,[{id:`style`,label:this.t(`toolbar.style`,{style:s}),text:s,icon:KF.chevron,iconName:`chevron`,menu:!0,disabled:!qF.some(e=>n.enabled.includes(e))&&(this.#t?.targets.length??0)===0,popup:`style`,press:()=>void this.#g(`style`)}]]),c.fonts.length>0&&r.push([`group`,c.fonts]),r.push([`group`,[...XF.map(e=>i(e)),i(`link`,`link`)]]),c.colors.length>0&&r.push([`group`,c.colors]),c.blocks.length>0&&r.push([`group`,c.blocks]),r.push([`group`,[...ZF.map(e=>i(e)),...c.clear]])}let a=(t,n)=>({id:t,label:this.t(`toolbar.${t}`),text:this.t(`toolbar.${t}`),icon:KF[n],iconName:n,disabled:e===null,popup:t,press:()=>{this.#n===t?this.#_(!0):this.#g(t)}}),o=t?.descriptors.some(e=>(e.templates??[]).length>0)===!0;if(r.push([`group inserts`,[...this.#A(),a(`elements`,`add`),...o?[a(`templates`,`templates`)]:[],...e?.style===void 0?[]:[a(`layouts`,`layouts`)]]]),e?.wrap!==void 0&&t!==null){let e=t.descriptors.filter(e=>e.wrap!==void 0);e.length>0&&r.push([`group`,e.map(e=>{let n=t.t(e.manifest.messages,e.wrap?.label??``);return{id:`wrap-${e.manifest.tag}`,label:n,text:n,icon:KF.wrap,iconName:`wrap`,data:{wrap:e.manifest.tag},press:()=>{this.adapter?.wrap?.(e.manifest.tag),this.#y()}}})])}if(this.views.length>1&&r.push([`group views`,this.views.map(e=>({id:`view-${e.name}`,label:e.label,text:e.label,icon:null,iconName:``,checked:e.name===this.view,...e.description===void 0?{}:{description:e.description},press:()=>{if(e.name===this.view)return;let t={view:e.name};this.dispatchEvent(new CustomEvent(nI,{detail:t,bubbles:!0,composed:!0}))}}))]),e?.undo!==void 0&&e.redo!==void 0){let t=t=>({id:t,label:this.t(`toolbar.${t}`),text:null,icon:KF[t],iconName:t,disabled:!n[t],press:()=>{n[t]&&(e[t]?.(),this.#y())}});r.push([`group history`,[t(`undo`),t(`redo`)]])}return r}#M(e){let t=e.target.closest(`[data-item]`);if(t===null)return;let n=Number(t.dataset.item),r=this.#u[n];(r?.popup===`style`||QF.has(r?.popup??``))&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),r?.disabled!==!0&&r?.popup!==void 0&&this.#g(r.popup)):this.#d.keydown(e,n)}#N(e,t){let n=e.disabled===!0,r=e.checked===void 0?e.text===null?`button icon-button`:`button`:`button view`;return I`<button
6649
6684
  type="button"
6650
6685
  part=${r}
6651
6686
  class=${e.text===null?`icon-only`:`labelled`}
@@ -6657,7 +6692,7 @@ color: GrayText;
6657
6692
  data-popup=${e.popup??R}
6658
6693
  tabindex=${this.#d.tabIndex(t)}
6659
6694
  aria-label=${e.text===null||e.menu===!0?e.label:R}
6660
- title=${e.text===null?e.label:R}
6695
+ title=${e.description??(e.text===null?e.label:R)}
6661
6696
  aria-pressed=${e.pressed===void 0?R:String(e.pressed)}
6662
6697
  role=${e.checked===void 0?R:`radio`}
6663
6698
  aria-checked=${e.checked===void 0?R:String(e.checked)}
@@ -6790,7 +6825,12 @@ color: GrayText;
6790
6825
  .filter=${this.#s}
6791
6826
  .groups=${JF[this.#o]}
6792
6827
  ></astl-insert-menu>
6793
- </div>`}render(){if(this.authoring===null)return R;let{lang:e,dir:t}=this.ui,n=this.views.length>0&&this.view!==this.views[0]?.name,r=this.#j().map(([e,t])=>[e,n?t.map(e=>e.checked===void 0?{...e,disabled:!0}:e):t]);this.#u=r.flatMap(([,e])=>e);let i=0;return I`<div
6828
+ </div>`}render(){if(this.authoring===null)return R;let{lang:e,dir:t}=this.ui,n=this.views.length>0&&this.view!==this.views[0]?.name,r=this.#j().map(([e,t])=>[e,n?t.map(e=>e.checked===void 0?{...e,disabled:!0}:e):t]);this.#u=r.flatMap(([,e])=>e);let i=0,a=([e,t],n)=>I`<div class=${e} role=${e===`group views`?`radiogroup`:`presentation`}
6829
+ part=${e===`group views`?`views`:R}
6830
+ aria-label=${e===`group views`?this.t(`toolbar.view`):R}>
6831
+ ${n===0||e===`group views`?R:I`<span class="separator" part="separator" aria-hidden="true"></span>`}
6832
+ ${t.map(e=>this.#N(e,i++))}
6833
+ </div>`,o=Math.max(0,r.findIndex(([e])=>e===`group inserts`));return I`<div
6794
6834
  class="bar"
6795
6835
  part="toolbar"
6796
6836
  role="toolbar"
@@ -6800,18 +6840,14 @@ color: GrayText;
6800
6840
  @mousedown=${e=>{e.target.closest(`button`)!==null&&e.preventDefault()}}
6801
6841
  @keydown=${e=>this.#M(e)}
6802
6842
  >
6803
- ${r.map(([e,t],n)=>I`<div class=${e} role=${e===`group views`?`radiogroup`:`presentation`}
6804
- part=${e===`group views`?`views`:R}
6805
- aria-label=${e===`group views`?this.t(`toolbar.view`):R}>
6806
- ${n===0||e===`group views`?R:I`<span class="separator" part="separator" aria-hidden="true"></span>`}
6807
- ${t.map(e=>this.#N(e,i++))}
6808
- </div>`)}
6843
+ ${o===0?R:I`<div class="formats">${r.slice(0,o).map((e,t)=>a(e,t))}</div>`}
6844
+ <div class="actions">${r.slice(o).map((e,t)=>a(e,o+t))}</div>
6809
6845
  </div>
6810
6846
  <div lang=${e} dir=${t}>
6811
6847
  ${this.#L()} ${this.#R()} ${this.#z()} ${this.#I()}
6812
6848
  </div>
6813
6849
  <astl-picture-dialog .authoring=${this.authoring}></astl-picture-dialog>`}updated(e){super.updated(e);let t=this.menu;t!==null&&(t.dialog=this.renderRoot.querySelector(`astl-picture-dialog`));for(let e of this.renderRoot.querySelectorAll(`.color-mark`))e.style.background=e.dataset.color??``;for(let e of this.renderRoot.querySelectorAll(`[data-font]`))e.style.fontFamily=e.dataset.font??``;if(this.#n===null)return;let n=this.renderRoot.querySelector(`#${eI(this.#n)}`),r=this.renderRoot.querySelector(`[data-popup="${tI(this.#n)}"]`);n!==null&&r!==null&&n.matches(`:popover-open`)&&this.#v(n,r)}}}));function lI(e=customElements){VP(e);for(let[t,n]of uI){let r=e.get(t);if(r!==n){if(r!==void 0)throw Error(`<${t}> is already defined by another class`);e.define(t,n)}}}var uI,dI=n((()=>{iF(),_F(),yF(),xF(),jF(),PF(),JP(),cI(),uI=[[`astl-insert-menu`,rF],[`astl-inspector`,gF],[`astl-issues`,vF],[`astl-preview`,NF],[`astl-toolbar`,sI],[`astl-picture-dialog`,bF],[`astl-picture-field`,AF]]}));function fI(e){let t=Yj(e),n=t.find(e=>e.name===Fe),r=n?.children??t,i=r.findIndex(e=>e.name!==he),a=i<0?[]:r.slice(i);return{start:(i<0?r.at(-1):r[i-1])?.end??n?.startTag.end??0,end:n===void 0?e.length:bI(n),blocks:a,pages:a.filter(e=>e.name===Ie)}}function pI(e){let t=1;for(;e.has(`page-${t}`);)t++;return e.add(`page-${t}`),`page-${t}`}function mI(e){let t=0;for(let n of qj(e)){if(e.slice(t,n.start).trim()!==``||n.type===`start`&&(n.name===`br`||n.name===`img`||n.name.includes(`-`)))return!1;t=n.end}return e.slice(t).trim()===``}function hI(e,t){let n=[e];for(let r=e;;){if(t<r.startTag.end||t>bI(r))return null;let e=r.children.find(e=>e.start<t&&t<e.end);if(e===void 0)return n;if(e.name.includes(`-`))return null;n.push(e),r=e}}function gI(e,t){let n=fI(e),r=n.pages.find(e=>e.startTag.end<=t&&t<=bI(e));if(n.pages.length>0?r===void 0:t<n.start||t>n.end)return null;let[i,a]=r===void 0?[n.start,n.end]:[r.startTag.end,bI(r)],o=r?.children??n.blocks,s=t,c=``,l=``,u=o.find(e=>e.start<t&&t<e.end);if(u!==void 0){let n=yI.has(u.name)?hI(u,t):null;n===null?s=u.end:mI(e.slice(u.startTag.end,t))?s=u.start:mI(e.slice(t,bI(u)))?s=u.end:(c=n.map(e=>`</${e.name}>`).reverse().join(``),l=n.map(t=>e.slice(t.startTag.start,t.startTag.end)).join(``))}let d=eM(e),f=r===void 0?`<astl-page id="${pI(d)}">`:``,p=pI(d),m=(r?.startTag.attributes??[]).filter(e=>le.has(e.name)||e.name===`class`).map(t=>` ${e.slice(t.start,t.end)}`).join(``),h=l!==``||o.some(e=>e.end<=s)?``:`<p></p>`,g=l===``&&!o.some(e=>e.start>=s),_=`${e.slice(0,i)}${f}${e.slice(i,s)}${c}${h}</astl-page><astl-page id="${p}"${m}>${g?`<p>`:l}`;return{source:_+`${g?`</p>`:``}${e.slice(s,a)}${f===``?``:`</astl-page>`}${e.slice(a)}`,caret:_.length,id:p}}function _I(e,t){let n=fI(e),r=eM(e),i=n.pages.find(e=>Zj(e.startTag,`id`)===t)??n.pages.at(-1),a=i===void 0?`${e.slice(0,n.start)}<astl-page id="${pI(r)}">${e.slice(n.start,n.end)}</astl-page>`:e.slice(0,i.end),o=pI(r),s=`${a}<astl-page id="${o}"><p>`;return{source:`${s}</p></astl-page>${e.slice(i?.end??n.end)}`,caret:s.length,id:o}}function vI(e,t){let{pages:n}=fI(e),r=n.findIndex(e=>Zj(e.startTag,`id`)===t),i=n[r-1]?.endTag,a=n[r]?.startTag;if(r<1||i==null||a===void 0)return null;let o=e.slice(0,i.start)+e.slice(i.end,a.start);return{source:o+e.slice(a.end),caret:o.length}}var yI,bI,xI=n((()=>{w(),hM(),yI=new Set([`p`,`h2`,`h3`,`h4`]),bI=e=>e.endTag?.start??e.end}));function SI(e,t){return e?.id===t?.id&&e?.tag===t?.tag}function CI(e,t,n){let r=$j(e),i=r.filter(e=>DI(e)&&(t===n?e.start<t:e.start<n)&&t<e.end),a=i[i.length-1];if(a!==void 0)return[a.end,a.end];let o=qj(e),s=e=>o.find(t=>t.start<e&&e<t.end),c=s(t);if(c!==void 0)return[c.end,c.end];if(s(n)!==void 0)return[t,t];let l=o.find(e=>e.type===`start`&&e.name===`astl-doc`),u=o.findLast(e=>e.type===`end`&&e.name===`astl-doc`);if(l===void 0||t>=l.end&&(u===void 0||n<=u.start))return[t,n];let d=r.filter(e=>e.tag===Ie),f=d[d.length-1],p=(f&&o.find(e=>e.type===`end`&&e.name===`astl-page`&&e.end===f.end))?.start??u?.start??e.length;return[p,p]}function wI(e,t){let n=e.value.slice(0,t).split(`
6814
- `).length-1,r=Number.parseFloat(getComputedStyle(e).lineHeight)||20;e.scrollTop=Math.max(0,n*r-e.clientHeight/3),e.setSelectionRange(t,t)}function TI(e){let t=new Set,n=new Set,r=null,i=()=>{let t=e.value;return r?.value!==t&&(r={value:t,elements:$j(t)}),r.elements},a=e=>i().find(t=>DI(t)&&t.id===e)??null,o=()=>{let t=e.selectionStart,n=i().find(e=>DI(e)&&e.start<=t&&t<e.end);return n?.id?{id:n.id,tag:n.tag}:null},s=o(),c=()=>{let e=o();if(!SI(e,s)){s=e;for(let t of[...n])t(e)}},l=()=>{for(let e of[...t])e();c()};e.addEventListener(`input`,l);for(let t of EI)e.addEventListener(t,c);let u=t=>{let n=e.value,r=Math.min(n.length,t.length),i=0;for(;i<r&&n[i]===t[i];)i++;let a=0;for(;a<r-i&&n[n.length-1-a]===t[t.length-1-a];)a++;e.setRangeText(t.slice(i,t.length-a),i,n.length-a,`preserve`),l()},d=t=>{u(t.source),wI(e,t.caret),c()};return{getSource:()=>e.value,setSource:u,insert(t){let[n,r]=CI(e.value,e.selectionStart,e.selectionEnd);e.setRangeText(t,n,r,`select`),l()},getElement(t){let n=a(t);return n===null?null:e.value.slice(n.start,n.end)},replaceElement(t,n){let r=a(t);if(r===null)return;let{selectionStart:i,selectionEnd:o,selectionDirection:s}=e,c=n.length-(r.end-r.start),u=e=>e<r.start?e:e>=r.end?e+c:Math.min(e,r.start+Math.max(0,n.length-1));e.setRangeText(n,r.start,r.end,`preserve`),e.setSelectionRange(u(i),u(o),s),l()},getSelection:o,select(t){let n=i().find(e=>e.id===t);n!==void 0&&(wI(e,n.start),e.focus(),c())},splitPage(){let t=gI(e.value,e.selectionStart);return t!==null&&d(t),t?.id??null},addPage(t){let n=_I(e.value,t);return d(n),n.id},mergePage(t){let n=vI(e.value,t);return n!==null&&d(n),n!==null},onChange(e){return t.add(e),()=>t.delete(e)},onSelectionChange(e){return n.add(e),()=>n.delete(e)},destroy(){e.removeEventListener(`input`,l);for(let t of EI)e.removeEventListener(t,c);t.clear(),n.clear()}}}var EI,DI,OI=n((()=>{w(),xI(),hM(),EI=[`select`,`keyup`,`click`,`focus`],DI=e=>e.tag!==Ie})),kI=n((()=>{TN(),dI(),iF(),_F(),dF(),yF(),xF(),jF(),PF(),JP(),cI(),eN(),hM(),lN(),WN(),OI()}));EC(),$E(),uD();
6850
+ `).length-1,r=Number.parseFloat(getComputedStyle(e).lineHeight)||20;e.scrollTop=Math.max(0,n*r-e.clientHeight/3),e.setSelectionRange(t,t)}function TI(e){let t=new Set,n=new Set,r=null,i=()=>{let t=e.value;return r?.value!==t&&(r={value:t,elements:$j(t)}),r.elements},a=e=>i().find(t=>DI(t)&&t.id===e)??null,o=()=>{let t=e.selectionStart,n=i().find(e=>DI(e)&&e.start<=t&&t<e.end);return n?.id?{id:n.id,tag:n.tag}:null},s=o(),c=()=>{let e=o();if(!SI(e,s)){s=e;for(let t of[...n])t(e)}},l=()=>{for(let e of[...t])e();c()};e.addEventListener(`input`,l);for(let t of EI)e.addEventListener(t,c);let u=t=>{let n=e.value,r=Math.min(n.length,t.length),i=0;for(;i<r&&n[i]===t[i];)i++;let a=0;for(;a<r-i&&n[n.length-1-a]===t[t.length-1-a];)a++;e.setRangeText(t.slice(i,t.length-a),i,n.length-a,`preserve`),l()},d=t=>{u(t.source),wI(e,t.caret),c()};return{editsSource:!0,getSource:()=>e.value,setSource:u,insert(t){let[n,r]=CI(e.value,e.selectionStart,e.selectionEnd);e.setRangeText(t,n,r,`select`),l()},getElement(t){let n=a(t);return n===null?null:e.value.slice(n.start,n.end)},replaceElement(t,n){let r=a(t);if(r===null)return;let{selectionStart:i,selectionEnd:o,selectionDirection:s}=e,c=n.length-(r.end-r.start),u=e=>e<r.start?e:e>=r.end?e+c:Math.min(e,r.start+Math.max(0,n.length-1));e.setRangeText(n,r.start,r.end,`preserve`),e.setSelectionRange(u(i),u(o),s),l()},getSelection:o,select(t){let n=i().find(e=>e.id===t);n!==void 0&&(wI(e,n.start),e.focus(),c())},splitPage(){let t=gI(e.value,e.selectionStart);return t!==null&&d(t),t?.id??null},addPage(t){let n=_I(e.value,t);return d(n),n.id},mergePage(t){let n=vI(e.value,t);return n!==null&&d(n),n!==null},onChange(e){return t.add(e),()=>t.delete(e)},onSelectionChange(e){return n.add(e),()=>n.delete(e)},destroy(){e.removeEventListener(`input`,l);for(let t of EI)e.removeEventListener(t,c);t.clear(),n.clear()}}}var EI,DI,OI=n((()=>{w(),xI(),hM(),EI=[`select`,`keyup`,`click`,`focus`],DI=e=>e.tag!==Ie})),kI=n((()=>{TN(),dI(),iF(),_F(),dF(),yF(),xF(),jF(),PF(),JP(),cI(),eN(),hM(),lN(),WN(),OI()}));EC(),$E(),uD();
6815
6851
  /**
6816
6852
  * @license
6817
6853
  * Copyright 2021 Google LLC
@@ -7152,6 +7188,10 @@ cursor: pointer;
7152
7188
  .astl-surface :is(.astl-page-join, .astl-page-delete, .astl-page-add-title, .astl-page-remove-title)[hidden] {
7153
7189
  display: none;
7154
7190
  }
7191
+ /* Beside the title the button keeps its words whole (it broke "Remove" at 320 px): the title gives way instead. */
7192
+ .astl-surface .astl-page-remove-title {
7193
+ flex: none;
7194
+ }
7155
7195
 
7156
7196
  /* A component in text (a gap): a chip with an icon, its answer and a badge counting the other answers, a long word
7157
7197
  broken inside it rather than past the column. Without an answer it says so, dashed and with a warning icon: never
@@ -7590,12 +7630,26 @@ border-block-end: var(--astl-outline-width) solid var(--astl-accent);
7590
7630
  background: var(--astl-accent-soft);
7591
7631
  }
7592
7632
 
7593
- /* The selected atom or block gets the focus ring. */
7633
+ /* The selected atom or block gets the focus ring. A chip sits in running text, where a ring around it covers the
7634
+ words beside it: its ring is inside it, and it is filled (its border is the accent already). An empty chip keeps
7635
+ its colours: the solid ring stands out on its dashed one. */
7594
7636
  .astl-surface .ProseMirror-selectednode {
7595
7637
  outline: var(--astl-focus-width) solid var(--astl-focus);
7596
7638
  outline-offset: var(--astl-focus-offset);
7597
7639
  }
7640
+ .astl-surface .astl-chip.ProseMirror-selectednode {
7641
+ outline-offset: calc(-1 * var(--astl-focus-width));
7642
+ }
7643
+ .astl-surface .astl-chip.ProseMirror-selectednode:not([data-empty]) {
7644
+ background: var(--astl-accent);
7645
+ color: var(--astl-on-accent);
7646
+ }
7598
7647
  @media (forced-colors: active) {
7648
+ .astl-surface .astl-chip.ProseMirror-selectednode:not([data-empty]) {
7649
+ background: Highlight;
7650
+ color: HighlightText;
7651
+ forced-color-adjust: none;
7652
+ }
7599
7653
  .astl-surface .astl-frame-current {
7600
7654
  --frame: Highlight;
7601
7655
  }
@@ -7977,18 +8031,18 @@ padding: var(--astl-focus-width);
7977
8031
  margin: calc(-1 * var(--astl-focus-width));
7978
8032
  }
7979
8033
  }
7980
- `],j6=e=>`load`in e?e.tag:e.manifest.tag,M6=null;function N6(){return M6??=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),M6}function P6(e,t){return Np({components:t,secret:N6(),slotKinds:[...e.slotKinds.values()],profile:e.profile,catalogs:e.catalogs,styleTemplates:[...e.styleTemplates.values()],...e.urlPolicy===null?{}:{urlPolicy:e.urlPolicy},...e.groundColors===null?{}:{groundColors:e.groundColors}})}var F6={components:new Map,editors:new Map,elements:new Map,styleTemplates:new Map,slotKinds:new Map,catalogs:[],profile:{},urlPolicy:null,groundColors:null,uploadAsset:null,pickPicture:null,fonts:rN,styles:iN,featured:[],views:[],menuMessages:null},I6=null;function L6(){return I6??={...F6,engine:P6(F6,[]),version:0},I6}var R6=new Set;function z6(e,t,n,r){let i=new Map(e);for(let e of t??[]){let t=n(e),a=i.get(t);if(a!==void 0&&a!==e)throw Error(`${r} ${t} is already registered`);i.set(t,e)}return i}function B6(e){let t=I6??{...F6,version:0},n=e=>e.manifest.tag,r={components:z6(t.components,e.components,n,`Component`),editors:z6(t.editors,e.editors,n,`Editor descriptor`),elements:z6(t.elements,e.elements,j6,`Preview element`),styleTemplates:z6(t.styleTemplates,e.styleTemplates,e=>e.name,`Style template`),slotKinds:z6(t.slotKinds,e.slotKinds,e=>e.kind,`Slot kind`),catalogs:[...new Set([...t.catalogs,...e.catalogs??[]])],profile:{...t.profile,...e.profile},urlPolicy:e.urlPolicy??t.urlPolicy,groundColors:e.groundColors??t.groundColors,uploadAsset:e.uploadAsset??t.uploadAsset,pickPicture:e.pickPicture??t.pickPicture,fonts:e.fonts??t.fonts,styles:e.styles??t.styles,featured:e.featured??t.featured,views:e.views??t.views,menuMessages:e.menuMessages??t.menuMessages},i=[`components`,`editors`,`elements`,`styleTemplates`,`slotKinds`],a=e=>JSON.stringify(Object.entries(e).sort());if(I6!==null&&i.every(e=>r[e].size===t[e].size)&&r.catalogs.length===t.catalogs.length&&r.urlPolicy===t.urlPolicy&&JSON.stringify(r.groundColors)===JSON.stringify(t.groundColors)&&r.uploadAsset===t.uploadAsset&&r.pickPicture===t.pickPicture&&r.menuMessages===t.menuMessages&&JSON.stringify(r.fonts)===JSON.stringify(t.fonts)&&JSON.stringify(r.styles)===JSON.stringify(t.styles)&&r.featured.join(` `)===t.featured.join(` `)&&JSON.stringify(r.views)===JSON.stringify(t.views)&&a(r.profile)===a(t.profile))return;let o=P6(r,[...r.components.values()]);bN({engine:o,descriptors:[...r.editors.values()],locale:`en`,fonts:r.fonts,styles:r.styles}),I6={...r,engine:o,version:t.version+1};for(let e of R6)e.requestUpdate()}function V6(e,t,n){let r=e=>[...e.entries()].filter(([e])=>n===null||n.includes(e)).map(([,e])=>e);return bN({engine:n===null?e.engine:P6(e,r(e.components)),descriptors:r(e.editors),elements:r(e.elements),locale:t,catalogs:e.catalogs,styleTemplates:[...e.styleTemplates.values()],fonts:e.fonts,styles:e.styles,...e.urlPolicy===null?{}:{urlPolicy:e.urlPolicy},...e.uploadAsset===null?{}:{uploadAsset:e.uploadAsset},...e.pickPicture===null?{}:{pickPicture:e.pickPicture},...e.menuMessages===null?{}:{menuMessages:e.menuMessages}})}var H6=[`light`,`dark`,`hc`,`auto`],U6=`astl-editor-change`,W6=`astl-editor-ready`,G6=`astl-editor-view`,K6=[`visual`,`source`],q6=300,J6=[`issues`,`inspector`],Y6={fromAttribute:e=>e===null?null:e.split(/\s+/).filter(e=>e!==``)},X6={fromAttribute:e=>{try{return e===null?null:JSON.parse(e)}catch{return null}}},Z6=[`chevron`,`bold`,`italic`,`underline`,`link`,`bulleted`,`numbered`,`undo`,`redo`,`wrap`,`text`,`image`,`files`,`add`,`templates`],Q6=`header: inspector-header, id: inspector-id, actions: inspector-actions, issue: inspector-issue, field: inspector-field, label: inspector-label, style: inspector-style`,$6=null,e8=null,t8=class extends OC{static properties={locale:{},components:{converter:Y6},featured:{converter:Y6},panels:{converter:Y6},view:{},views:{converter:X6},theme:{},previewPolicy:{attribute:!1},adapter:{attribute:!1}};static styles=A6;#e=null;#t=null;#n=null;#r=!1;#i=!1;#a=null;#o=null;#s=0;#c=null;#l=()=>{};#u=new Promise(e=>{this.#l=e});#d={ask:e=>this.renderRoot.querySelector(`astl-picture-dialog`)?.ask(e)??Promise.resolve(null),refuse:()=>{this.#a={key:`picture.pasteRefused`},this.requestUpdate()},style:e=>{this.renderRoot.querySelector(`astl-toolbar`)?.openStyle(e)}};#f=e=>{this.#o=e};#p={start:!1,end:!1};#m=e=>{let t=e.target,n=t.name===`end`?`end`:`start`,r=t.assignedElements().length>0;this.#p[n]!==r&&(this.#p[n]=r,this.requestUpdate())};#h=null;#g=null;#_=[];#v=null;#y;#b=null;#x=null;constructor(){if(super(),this.locale=null,this.components=null,this.featured=null,this.panels=null,this.view=`visual`,this.views=null,this.theme=`auto`,this.previewPolicy=null,this.adapter=null,Object.hasOwn(this,`value`)){let e=this.value;delete this.value,typeof e==`string`&&(this.value=e)}}get value(){return this.adapter?.getSource()??this.#e??`<astl-doc lang="${this.authoring.locale}"></astl-doc>`}set value(e){this.adapter===null?this.#e=e:this.adapter.setSource(e)}get ready(){return this.#u}async preview(){await this.updateComplete,await this.renderRoot.querySelector(`astl-preview`)?.refresh()}get authoring(){let e=L6(),t=this.#k(e),n=this.components,r=typeof n==`string`?n.split(/\s+/).filter(e=>e!==``):n,i=`${e.version}\n${t}\n${r===null?`*`:r.join(` `)}`;return this.#b?.key!==i&&(this.#b={key:i,authoring:V6(e,t,r)}),this.#b.authoring}connectedCallback(){super.connectedCallback(),R6.add(this),this.#t===!0&&this.#D(),this.#O()}disconnectedCallback(){super.disconnectedCallback(),R6.delete(this),clearTimeout(this.#y),this.#c=null,this.#O();let e=this.#n;e!==null&&(this.#e=e.adapter.getSource(),e.destroy(),this.#n=null,this.adapter=null)}#S(){let e=this.views??L6().views;return Array.isArray(e)?e:[]}#C(){return[...K6,...this.#S().map(e=>e.name)].includes(this.view)?this.view:`visual`}#w(){let e=this.#g??this.#h??this.value,t=this.authoring.validate(e).issues.filter(e=>e.severity===`error`);return this.#_=t,t.length>0?(this.#a={key:`view.sourceErrors`,params:{n:t.length}},this.#s++,!1):(this.#g!==null&&e8?.formatHtml(this.#g)!==this.#h&&(this.value=this.#g),this.#g=null,!0)}#T(e){clearTimeout(this.#y),this.#y=setTimeout(()=>{let e=this.adapter;this.#v=e===null?null:this.authoring.outline(e.getSource()),this.requestUpdate()},e)}willUpdate(e){if(e.has(`theme`)&&(this.dataset.theme=this.#A()),e.has(`view`)){let t=e.get(`view`);t===`source`&&this.view!==`source`&&!this.#w()?this.view=`source`:this.view===`source`&&t!==`source`&&(this.#h=this.#g=null,this.#_=[],e8===null&&Promise.resolve().then(()=>(HI(),jI)).then(e=>{e8=e,this.requestUpdate()},e=>console.error(e)))}let t=this.#n;if(t!==null&&this.adapter!==t.adapter&&(this.adapter===null&&(this.#e=t.adapter.getSource()),t.destroy(),this.#n=null),this.adapter!==null&&this.#n===null)this.#t=!1,this.#e!==null&&this.adapter.setSource(this.#e),this.#e=null;else if(this.adapter===null&&this.#n===null)this.isConnected&&(this.#t===null||e.has(`adapter`))&&this.#E();else if(this.#n!==null&&$6!==null&&this.#n.authoring!==this.authoring){let e=this.#n.adapter.getSource();this.#n.destroy(),this.#n=$6.createSurface(this,this.authoring,L6().engine.manifests,e,this.#d,this.#f),this.adapter=this.#n.adapter}this.#O()}updated(e){e.has(`theme`)&&this.renderRoot.querySelector(`astl-preview`)?.requestUpdate();let t=this.adapter;t!==null&&t!==this.#c&&this.isConnected&&(this.#c=t,this.#T(0),this.#l(),this.dispatchEvent(new Event(W6,{bubbles:!0,composed:!0})));let n=e.get(`view`);e.has(`view`)&&n!==void 0&&n!==this.view&&this.dispatchEvent(new CustomEvent(G6,{detail:{view:this.view},bubbles:!0,composed:!0}))}#E(){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>this.requestUpdate(`adapter`),{once:!0}):(this.#t=this.querySelector(`:scope > [slot="surface"]`)===null,this.#t&&this.#D())}async#D(){if(!(this.#r||this.#n!==null)){this.#r=!0,this.#i=!1;try{if($6??=await Promise.resolve().then(()=>(O6(),E6)),!this.isConnected||!this.#t||this.adapter!==null||this.#n!==null)return;this.#n=$6.createSurface(this,this.authoring,L6().engine.manifests,this.value,this.#d,this.#f),this.#e=null,this.adapter=this.#n.adapter}catch(e){this.#i=!0,console.error(e)}finally{this.#r=!1,this.requestUpdate()}}}#O(){let e=this.isConnected?this.adapter:null;(this.#x?.adapter??null)!==e&&(this.#x?.off(),this.#x=e===null?null:{adapter:e,off:e.onChange(()=>{let e=this.#o;this.#o=null,(this.#a!==null||e!==null)&&(this.#a=e,e!==null&&this.#s++,this.requestUpdate()),this.#T(q6),this.dispatchEvent(new Event(U6,{bubbles:!0,composed:!0}))})})}#k(e){let t=this.locale?[this.locale]:this.lang?[this.lang]:[...navigator.languages??[],navigator.language].filter(e=>!!e),n=[...$M,...e.catalogs].filter(e=>e.namespace===H).map(e=>e.locale);return gt(t,[...new Set(n)],`en`)}#A(){let e=this.theme;return e!==null&&H6.includes(e)?e:`auto`}render(){let{authoring:e,adapter:t}=this,n=this.#A(),r=this.#i?{key:`surface.failed`}:this.#t&&t===null?{key:`surface.loading`}:this.#a,i=e.locale,a=e=>typeof e==`string`?e.split(/\s+/).filter(e=>e!==``):e,o=a(this.featured)??L6().featured,s=(a(this.panels)??J6).filter(e=>J6.includes(e)),c=new Set([...Z6,...e.descriptors.flatMap(e=>[e.icon,...(e.templates??[]).map(t=>t.icon??e.icon)])]),l=[`toolbar: toolbar-bar`,`button: toolbar-button`,`icon-button: toolbar-icon-button`,`views: toolbar-views`,`view: toolbar-view`,`separator: toolbar-separator`,`icon: toolbar-icon`,`insert`,`menu: insert-menu`,`style-menu`,`style-colors`,`style-panel`].concat([...c].map(e=>`icon-${e}`)).join(`, `),u=r=>r===`issues`?I`<astl-issues part="issues" data-theme=${n} .authoring=${e} .adapter=${t}></astl-issues>`:I`<astl-inspector part="inspector" exportparts=${Q6} data-theme=${n} .authoring=${e} .adapter=${t}></astl-inspector>`,d=(t,n)=>e.t(H,t,n),f=this.#C(),p=[...K6.map(e=>({name:e,label:d(`view.${e}`)})),...this.#S()],m=f!==`visual`;return I`<div class=${s.length===0||m?`layout solo`:`layout`}>
8034
+ `],j6=e=>`load`in e?e.tag:e.manifest.tag,M6=null;function N6(){return M6??=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),M6}function P6(e,t){return Np({components:t,secret:N6(),slotKinds:[...e.slotKinds.values()],profile:e.profile,catalogs:e.catalogs,styleTemplates:[...e.styleTemplates.values()],...e.urlPolicy===null?{}:{urlPolicy:e.urlPolicy},...e.groundColors===null?{}:{groundColors:e.groundColors}})}var F6={components:new Map,editors:new Map,elements:new Map,styleTemplates:new Map,slotKinds:new Map,catalogs:[],profile:{},urlPolicy:null,groundColors:null,uploadAsset:null,pickPicture:null,fonts:rN,styles:iN,featured:[],views:[],menuMessages:null},I6=null;function L6(){return I6??={...F6,engine:P6(F6,[]),version:0},I6}var R6=new Set;function z6(e,t,n,r){let i=new Map(e);for(let e of t??[]){let t=n(e),a=i.get(t);if(a!==void 0&&a!==e)throw Error(`${r} ${t} is already registered`);i.set(t,e)}return i}function B6(e){let t=I6??{...F6,version:0},n=e=>e.manifest.tag,r={components:z6(t.components,e.components,n,`Component`),editors:z6(t.editors,e.editors,n,`Editor descriptor`),elements:z6(t.elements,e.elements,j6,`Preview element`),styleTemplates:z6(t.styleTemplates,e.styleTemplates,e=>e.name,`Style template`),slotKinds:z6(t.slotKinds,e.slotKinds,e=>e.kind,`Slot kind`),catalogs:[...new Set([...t.catalogs,...e.catalogs??[]])],profile:{...t.profile,...e.profile},urlPolicy:e.urlPolicy??t.urlPolicy,groundColors:e.groundColors??t.groundColors,uploadAsset:e.uploadAsset??t.uploadAsset,pickPicture:e.pickPicture??t.pickPicture,fonts:e.fonts??t.fonts,styles:e.styles??t.styles,featured:e.featured??t.featured,views:e.views??t.views,menuMessages:e.menuMessages??t.menuMessages},i=[`components`,`editors`,`elements`,`styleTemplates`,`slotKinds`],a=e=>JSON.stringify(Object.entries(e).sort());if(I6!==null&&i.every(e=>r[e].size===t[e].size)&&r.catalogs.length===t.catalogs.length&&r.urlPolicy===t.urlPolicy&&JSON.stringify(r.groundColors)===JSON.stringify(t.groundColors)&&r.uploadAsset===t.uploadAsset&&r.pickPicture===t.pickPicture&&r.menuMessages===t.menuMessages&&JSON.stringify(r.fonts)===JSON.stringify(t.fonts)&&JSON.stringify(r.styles)===JSON.stringify(t.styles)&&r.featured.join(` `)===t.featured.join(` `)&&JSON.stringify(r.views)===JSON.stringify(t.views)&&a(r.profile)===a(t.profile))return;let o=P6(r,[...r.components.values()]);bN({engine:o,descriptors:[...r.editors.values()],locale:`en`,fonts:r.fonts,styles:r.styles}),I6={...r,engine:o,version:t.version+1};for(let e of R6)e.requestUpdate()}function V6(e,t,n){let r=e=>[...e.entries()].filter(([e])=>n===null||n.includes(e)).map(([,e])=>e);return bN({engine:n===null?e.engine:P6(e,r(e.components)),descriptors:r(e.editors),elements:r(e.elements),locale:t,catalogs:e.catalogs,styleTemplates:[...e.styleTemplates.values()],fonts:e.fonts,styles:e.styles,...e.urlPolicy===null?{}:{urlPolicy:e.urlPolicy},...e.uploadAsset===null?{}:{uploadAsset:e.uploadAsset},...e.pickPicture===null?{}:{pickPicture:e.pickPicture},...e.menuMessages===null?{}:{menuMessages:e.menuMessages}})}var H6=[`light`,`dark`,`hc`,`auto`],U6=`astl-editor-change`,W6=`astl-editor-ready`,G6=`astl-editor-view`,K6=[`visual`,`source`],q6=300,J6=[`issues`,`inspector`],Y6={fromAttribute:e=>e===null?null:e.split(/\s+/).filter(e=>e!==``)},X6={fromAttribute:e=>{try{return e===null?null:JSON.parse(e)}catch{return null}}},Z6=[`chevron`,`bold`,`italic`,`underline`,`link`,`bulleted`,`numbered`,`undo`,`redo`,`wrap`,`text`,`image`,`files`,`add`,`templates`],Q6=`header: inspector-header, id: inspector-id, actions: inspector-actions, issue: inspector-issue, field: inspector-field, label: inspector-label, style: inspector-style`,$6=null,e8=null,t8=class extends OC{static properties={locale:{},components:{converter:Y6},featured:{converter:Y6},panels:{converter:Y6},view:{},views:{converter:X6},theme:{},previewPolicy:{attribute:!1},adapter:{attribute:!1}};static styles=A6;#e=null;#t=null;#n=null;#r=!1;#i=!1;#a=null;#o=null;#s=0;#c=null;#l=()=>{};#u=new Promise(e=>{this.#l=e});#d={ask:e=>this.renderRoot.querySelector(`astl-picture-dialog`)?.ask(e)??Promise.resolve(null),refuse:()=>{this.#a={key:`picture.pasteRefused`},this.requestUpdate()},style:e=>{this.renderRoot.querySelector(`astl-toolbar`)?.openStyle(e)}};#f=e=>{this.#o=e};#p={start:!1,end:!1};#m=e=>{let t=e.target,n=t.name===`end`?`end`:`start`,r=t.assignedElements().length>0;this.#p[n]!==r&&(this.#p[n]=r,this.requestUpdate())};#h=null;#g=null;#_=[];#v=null;#y;#b=null;#x=null;constructor(){if(super(),this.locale=null,this.components=null,this.featured=null,this.panels=null,this.view=`visual`,this.views=null,this.theme=`auto`,this.previewPolicy=null,this.adapter=null,Object.hasOwn(this,`value`)){let e=this.value;delete this.value,typeof e==`string`&&(this.value=e)}}get value(){return this.adapter?.getSource()??this.#e??`<astl-doc lang="${this.authoring.locale}"></astl-doc>`}set value(e){this.adapter===null?this.#e=e:this.adapter.setSource(e)}get ready(){return this.#u}async preview(){await this.updateComplete,await this.renderRoot.querySelector(`astl-preview`)?.refresh()}get authoring(){let e=L6(),t=this.#A(e),n=this.components,r=typeof n==`string`?n.split(/\s+/).filter(e=>e!==``):n,i=`${e.version}\n${t}\n${r===null?`*`:r.join(` `)}`;return this.#b?.key!==i&&(this.#b={key:i,authoring:V6(e,t,r)}),this.#b.authoring}connectedCallback(){super.connectedCallback(),R6.add(this),this.#t===!0&&this.#O(),this.#k()}disconnectedCallback(){super.disconnectedCallback(),R6.delete(this),clearTimeout(this.#y),this.#c=null,this.#k();let e=this.#n;e!==null&&(this.#e=e.adapter.getSource(),e.destroy(),this.#n=null,this.adapter=null)}#S(){let e=this.views??L6().views;return Array.isArray(e)?e:[]}#C(){return this.adapter?.editsSource===!0?[`visual`]:K6}#w(){return[...this.#C(),...this.#S().map(e=>e.name)].includes(this.view)?this.view:`visual`}#T(){let e=this.#g??this.#h??this.value,t=this.authoring.validate(e).issues.filter(e=>e.severity===`error`);return this.#_=t,t.length>0?(this.#a={key:`view.sourceErrors`,params:{n:t.length}},this.#s++,!1):(this.#g!==null&&e8?.formatHtml(this.#g)!==this.#h&&(this.value=this.#g),this.#g=null,!0)}#E(e){clearTimeout(this.#y),this.#y=setTimeout(()=>{let e=this.adapter;this.#v=e===null?null:this.authoring.outline(e.getSource()),this.requestUpdate()},e)}willUpdate(e){if(e.has(`theme`)&&(this.dataset.theme=this.#j()),e.has(`view`)&&this.adapter?.editsSource!==!0){let t=e.get(`view`);t===`source`&&this.view!==`source`&&!this.#T()?this.view=`source`:this.view===`source`&&t!==`source`&&(this.#h=this.#g=null,this.#_=[],e8===null&&Promise.resolve().then(()=>(HI(),jI)).then(e=>{e8=e,this.requestUpdate()},e=>console.error(e)))}let t=this.#n;if(t!==null&&this.adapter!==t.adapter&&(this.adapter===null&&(this.#e=t.adapter.getSource()),t.destroy(),this.#n=null),this.adapter!==null&&this.#n===null)this.#t=!1,this.#e!==null&&this.adapter.setSource(this.#e),this.#e=null;else if(this.adapter===null&&this.#n===null)this.isConnected&&(this.#t===null||e.has(`adapter`))&&this.#D();else if(this.#n!==null&&$6!==null&&this.#n.authoring!==this.authoring){let e=this.#n.adapter.getSource();this.#n.destroy(),this.#n=$6.createSurface(this,this.authoring,L6().engine.manifests,e,this.#d,this.#f),this.adapter=this.#n.adapter}this.#k()}updated(e){e.has(`theme`)&&this.renderRoot.querySelector(`astl-preview`)?.requestUpdate();let t=this.adapter;t!==null&&t!==this.#c&&this.isConnected&&(this.#c=t,this.#E(0),this.#l(),this.dispatchEvent(new Event(W6,{bubbles:!0,composed:!0})));let n=e.get(`view`);e.has(`view`)&&n!==void 0&&n!==this.view&&this.dispatchEvent(new CustomEvent(G6,{detail:{view:this.view},bubbles:!0,composed:!0}))}#D(){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>this.requestUpdate(`adapter`),{once:!0}):(this.#t=this.querySelector(`:scope > [slot="surface"]`)===null,this.#t&&this.#O())}async#O(){if(!(this.#r||this.#n!==null)){this.#r=!0,this.#i=!1;try{if($6??=await Promise.resolve().then(()=>(O6(),E6)),!this.isConnected||!this.#t||this.adapter!==null||this.#n!==null)return;this.#n=$6.createSurface(this,this.authoring,L6().engine.manifests,this.value,this.#d,this.#f),this.#e=null,this.adapter=this.#n.adapter}catch(e){this.#i=!0,console.error(e)}finally{this.#r=!1,this.requestUpdate()}}}#k(){let e=this.isConnected?this.adapter:null;(this.#x?.adapter??null)!==e&&(this.#x?.off(),this.#x=e===null?null:{adapter:e,off:e.onChange(()=>{let e=this.#o;this.#o=null,(this.#a!==null||e!==null)&&(this.#a=e,e!==null&&this.#s++,this.requestUpdate()),this.#E(q6),this.dispatchEvent(new Event(U6,{bubbles:!0,composed:!0}))})})}#A(e){let t=this.locale?[this.locale]:this.lang?[this.lang]:[...navigator.languages??[],navigator.language].filter(e=>!!e),n=[...$M,...e.catalogs].filter(e=>e.namespace===H).map(e=>e.locale);return gt(t,[...new Set(n)],`en`)}#j(){let e=this.theme;return e!==null&&H6.includes(e)?e:`auto`}render(){let{authoring:e,adapter:t}=this,n=this.#j(),r=this.#i?{key:`surface.failed`}:this.#t&&t===null?{key:`surface.loading`}:this.#a,i=e.locale,a=e=>typeof e==`string`?e.split(/\s+/).filter(e=>e!==``):e,o=a(this.featured)??L6().featured,s=(a(this.panels)??J6).filter(e=>J6.includes(e)),c=new Set([...Z6,...e.descriptors.flatMap(e=>[e.icon,...(e.templates??[]).map(t=>t.icon??e.icon)])]),l=[`toolbar: toolbar-bar`,`button: toolbar-button`,`icon-button: toolbar-icon-button`,`views: toolbar-views`,`view: toolbar-view`,`separator: toolbar-separator`,`icon: toolbar-icon`,`insert`,`menu: insert-menu`,`style-menu`,`style-colors`,`style-panel`].concat([...c].map(e=>`icon-${e}`)).join(`, `),u=r=>r===`issues`?I`<astl-issues part="issues" data-theme=${n} .authoring=${e} .adapter=${t}></astl-issues>`:I`<astl-inspector part="inspector" exportparts=${Q6} data-theme=${n} .authoring=${e} .adapter=${t}></astl-inspector>`,d=(t,n)=>e.t(H,t,n),f=this.#w(),p=[...this.#C().map(e=>{let n=t?.editsSource===!0?`source`:e;return{name:e,label:d(`view.${n}`),description:d(`view.${n}Hint`)}}),...this.#S()],m=f!==`visual`;return I`<div class=${s.length===0||m?`layout solo`:`layout`}>
7981
8035
  <astl-toolbar part="toolbar" exportparts=${l} data-theme=${n} .authoring=${e}
7982
8036
  .adapter=${t} .featured=${o} .views=${p} .view=${f}
7983
8037
  @astl-toolbar-view=${e=>{this.view=e.detail.view}}></astl-toolbar>
7984
- ${this.#j()}
8038
+ ${this.#M()}
7985
8039
  <div class="work" part="work">
7986
8040
  <div class="start" part="start" ?hidden=${m||!this.#p.start}>
7987
8041
  <slot name="start" @slotchange=${this.#m}></slot>
7988
8042
  </div>
7989
8043
  <div class="surface" part="surface">
7990
8044
  ${m?R:I`<slot name="surface"></slot>`}
7991
- ${f===`source`?this.#M():m?I`<slot name="view-${f}"></slot>`:R}
8045
+ ${f===`source`?this.#N():m?I`<slot name="view-${f}"></slot>`:R}
7992
8046
  <p class=${r===null?`status idle`:`status`} role="status" lang=${i} dir=${Me(i)}
7993
8047
  >${AI(this.#s,r===null?``:e.t(H,r.key,r.params))}</p>
7994
8048
  <astl-picture-dialog data-theme=${n} .authoring=${e}></astl-picture-dialog>
@@ -8000,8 +8054,8 @@ margin: calc(-1 * var(--astl-focus-width));
8000
8054
  </div>
8001
8055
  <astl-preview part="preview" data-theme=${n} .authoring=${e} .adapter=${t}
8002
8056
  .policy=${this.previewPolicy??Ht}></astl-preview>
8003
- </div>`}#j(){let e=this.#v;if(e===null)return R;let{authoring:t}=this,n=(e,n)=>t.t(H,e,n),r=e.pages.reduce((e,t)=>e+t.components.length,0),i=e.errors===0,a=t.locale;return I`<p class="status-line" part="status-line" lang=${a} dir=${Me(a)}>
8057
+ </div>`}#M(){let e=this.#v;if(e===null)return R;let{authoring:t}=this,n=(e,n)=>t.t(H,e,n),r=e.pages.reduce((e,t)=>e+t.components.length,0),i=e.errors===0,a=t.locale;return I`<p class="status-line" part="status-line" lang=${a} dir=${Me(a)}>
8004
8058
  <span class="counts"><span>${n(`status.elements`,{n:r})}</span>${e.points===null?R:I`<span>${n(`surface.points`,{points:e.points})}</span>`}</span>
8005
8059
  <span class=${i?`ready`:`counts error`}>${i?n(`status.ready`):I`<span>${n(`status.errors`,{n:e.errors})}</span><span>${n(`status.warnings`,{n:e.warnings})}</span>`}</span>
8006
- </p>`}#M(){let e=e8;return e===null?R:(this.#h??=e.formatHtml(this.value),e.renderSource(this.renderRoot,this.authoring,this.#g??this.#h,this.#_,e=>{this.#g=e}))}};kI();var n8=`astl-editor`;function r8(e){let t=e.registry??customElements,n=t.get(n8);if(n!==void 0&&n!==t8)throw Error(`<${n8}> is already defined by another class`);lI(t),B6(e),n===void 0&&t.define(n8,t8)}var i8,a8=n((()=>{i8={"editor.description":`A sound to listen to, with an optional transcript.`}})),o8,s8=n((()=>{o8={"editor.description":`Dźwięk do odsłuchania, z opcjonalną transkrypcją.`}})),c8,l8,u8=n((()=>{a8(),s8(),c8=`astl.audio`,l8=[{namespace:c8,locale:`en`,messages:i8},{namespace:c8,locale:`pl`,messages:o8}]})),d8,f8=n((()=>{d8={"editor.description":`A tip, information or a warning in a box.`}})),p8,m8=n((()=>{p8={"editor.description":`Wskazówka, informacja albo ostrzeżenie w ramce.`}})),h8,g8,_8=n((()=>{f8(),m8(),h8=`astl.callout`,g8=[{namespace:h8,locale:`en`,messages:d8},{namespace:h8,locale:`pl`,messages:p8}]})),v8,y8=n((()=>{v8={"editor.description":`The student sorts cards into groups.`,"template.sort.description":`Two groups and four cards to sort`}})),b8,x8=n((()=>{b8={"editor.description":`Uczeń przyporządkowuje karty do grup.`,"template.sort.description":`Dwie grupy i cztery karty do posortowania`}})),S8,C8,w8=n((()=>{y8(),x8(),S8=`astl.categorise`,C8=[{namespace:S8,locale:`en`,messages:v8},{namespace:S8,locale:`pl`,messages:b8}]})),T8,E8=n((()=>{T8={"editor.description":`The student picks one answer or several.`,"template.choice.description":`A question with three answers, one of them right`}})),D8,O8=n((()=>{D8={"editor.description":`Uczeń wybiera jedną odpowiedź albo kilka.`,"template.choice.description":`Pytanie z trzema odpowiedziami, z których jedna jest poprawna`}})),k8,A8,j8=n((()=>{E8(),O8(),k8=`astl.choice`,A8=[{namespace:k8,locale:`en`,messages:T8},{namespace:k8,locale:`pl`,messages:D8}]})),M8,N8=n((()=>{M8={"editor.description":`Words that cross in a grid of squares, with numbered clues.`,"template.crossword.description":`A 5 by 5 grid, two words crossing at their first letter`}})),P8,F8=n((()=>{P8={"editor.description":`Hasła krzyżujące się w siatce kratek, z ponumerowanymi wskazówkami.`,"template.crossword.description":`Siatka 5 na 5, dwa hasła ze wspólną pierwszą literą`}})),I8,L8,R8=n((()=>{N8(),F8(),I8=`astl.crossword`,L8=[{namespace:I8,locale:`en`,messages:M8},{namespace:I8,locale:`pl`,messages:P8}]})),z8,B8=n((()=>{z8={"editor.description":`The student puts a word from a word bank into the text.`}})),V8,H8=n((()=>{V8={"editor.description":`Uczeń wstawia do tekstu słowo z banku słów.`}})),U8,W8,G8=n((()=>{B8(),H8(),U8=`astl.drop`,W8=[{namespace:U8,locale:`en`,messages:z8},{namespace:U8,locale:`pl`,messages:V8}]})),K8,q8=n((()=>{K8={"editor.description":`Cards to learn from, turned over one by one.`,"editor.template.cards.description":`Four cards to learn from, two with a picture on the front`}})),J8,Y8=n((()=>{J8={"editor.description":`Karty do nauki, odwracane po kolei.`,"editor.template.cards.description":`Cztery karty do nauki, dwie z obrazkiem na przodzie`}})),X8,Z8,Q8=n((()=>{q8(),Y8(),X8=`astl.flash-cards`,Z8=[{namespace:X8,locale:`en`,messages:K8},{namespace:X8,locale:`pl`,messages:J8}]})),$8,e5=n((()=>{$8={"editor.description":`The student types a word or a number.`,"template.fill.description":`A sentence with two words to type in`}})),t5,n5=n((()=>{t5={"editor.description":`Uczeń wpisuje słowo lub liczbę.`,"template.fill.description":`Zdanie z dwoma słowami do wpisania`}})),r5,i5,a5=n((()=>{e5(),n5(),r5=`astl.gap`,i5=[{namespace:r5,locale:`en`,messages:$8},{namespace:r5,locale:`pl`,messages:t5}]})),o5,s5=n((()=>{o5={"editor.description":`The student picks the right places on a picture.`,"template.find.description":`A picture with five places to pick, three of them right`}})),c5,l5=n((()=>{c5={"editor.description":`Uczeń wskazuje właściwe miejsca na obrazku.`,"template.find.description":`Obrazek z pięcioma miejscami do wskazania, z których trzy są właściwe`}})),u5,d5,f5=n((()=>{s5(),l5(),u5=`astl.hotspot`,d5=[{namespace:u5,locale:`en`,messages:o5},{namespace:u5,locale:`pl`,messages:c5}]})),p5,m5=n((()=>{p5={"editor.description":`The student puts labels on the zones of a picture.`,"template.drag.description":`Three zones on a picture and four labels, one of them extra`}})),h5,g5=n((()=>{h5={"editor.description":`Uczeń umieszcza podpisy w strefach obrazka.`,"template.drag.description":`Trzy strefy na obrazku i cztery podpisy, w tym jeden dodatkowy`}})),_5,v5,y5=n((()=>{m5(),g5(),_5=`astl.image-drop`,v5=[{namespace:_5,locale:`en`,messages:p5},{namespace:_5,locale:`pl`,messages:h5}]})),b5,x5=n((()=>{b5={"editor.description":`The student writes a name for each pin on a picture.`,"template.label.description":`Three pins to name, one of them with two accepted spellings`}})),S5,C5=n((()=>{S5={"editor.description":`Uczeń wpisuje nazwę każdej pinezki na obrazku.`,"template.label.description":`Trzy pinezki do podpisania, jedna z dwoma przyjmowanymi zapisami`}})),w5,T5,E5=n((()=>{x5(),C5(),w5=`astl.image-label`,T5=[{namespace:w5,locale:`en`,messages:b5},{namespace:w5,locale:`pl`,messages:S5}]})),D5,O5=n((()=>{D5={"editor.description":`An answer in the student's own words, marked by the teacher.`,"editor.template.write.description":`A question answered in a few sentences, read by the teacher`}})),k5,A5=n((()=>{k5={"editor.description":`Odpowiedź własnymi słowami, oceniana przez nauczyciela.`,"editor.template.write.description":`Pytanie, na które uczeń odpowiada kilkoma zdaniami, a czyta je nauczyciel`}})),j5,M5,N5=n((()=>{O5(),A5(),j5=`astl.long-answer`,M5=[{namespace:j5,locale:`en`,messages:D5},{namespace:j5,locale:`pl`,messages:k5}]})),P5,F5=n((()=>{P5={"editor.description":`The student highlights or crosses out words in a text.`,"template.select.description":`A sentence with three marked words, two of them correct`,"template.odd.description":`Three lines of four words, one odd word in each`}})),I5,L5=n((()=>{I5={"editor.description":`Uczeń podkreśla albo skreśla wyrazy w tekście.`,"template.select.description":`Zdanie z trzema oznaczonymi wyrazami, dwa z nich poprawne`,"template.odd.description":`Trzy wiersze po cztery wyrazy, w każdym jeden niepasujący`}})),R5,z5,B5=n((()=>{F5(),L5(),R5=`astl.mark-words`,z5=[{namespace:R5,locale:`en`,messages:P5},{namespace:R5,locale:`pl`,messages:I5}]})),V5,H5=n((()=>{V5={"editor.description":`The student matches rows with columns or joins lines.`,"template.matching.description":`A grid of three animals and their homes`,"template.lines.description":`Three pairs of opposites to join with lines`}})),U5,W5=n((()=>{U5={"editor.description":`Uczeń dopasowuje wiersze do kolumn albo łączy linie.`,"template.matching.description":`Tabela: trzy zwierzęta i ich domy`,"template.lines.description":`Trzy pary przeciwieństw do połączenia liniami`}})),G5,K5,q5=n((()=>{H5(),W5(),G5=`astl.match`,K5=[{namespace:G5,locale:`en`,messages:V5},{namespace:G5,locale:`pl`,messages:U5}]})),J5,Y5=n((()=>{J5={"editor.description":`The student turns two cards at a time and finds the pairs.`,"template.memory.description":`Three pairs of cards: animals and their young`}})),X5,Z5=n((()=>{X5={"editor.description":`Uczeń odkrywa po dwie karty i szuka par.`,"template.memory.description":`Trzy pary kart: zwierzęta i ich młode`}})),Q5,$5,e7=n((()=>{Y5(),Z5(),Q5=`astl.memory`,$5=[{namespace:Q5,locale:`en`,messages:J5},{namespace:Q5,locale:`pl`,messages:X5}]})),t7,n7=n((()=>{t7={"editor.description":`The student puts items in the right order.`,"template.cycle.description":`Four stages of a life cycle to put in order`}})),r7,i7=n((()=>{r7={"editor.description":`Uczeń układa elementy we właściwej kolejności.`,"template.cycle.description":`Cztery etapy życia do ułożenia po kolei`}})),a7,o7,s7=n((()=>{n7(),i7(),a7=`astl.order`,o7=[{namespace:a7,locale:`en`,messages:t7},{namespace:a7,locale:`pl`,messages:r7}]})),c7,l7=n((()=>{c7={"editor.description":`The student picks one answer inside the text.`,"template.list.description":`A sentence with a drop-down list of three words`,"template.click.description":`Two sentences, each with words to click`}})),u7,d7=n((()=>{u7={"editor.description":`Uczeń wybiera jedną odpowiedź w tekście.`,"template.list.description":`Zdanie z listą rozwijaną trzech słów`,"template.click.description":`Dwa zdania, w każdym słowa do kliknięcia`}})),f7,p7,m7=n((()=>{l7(),d7(),f7=`astl.select`,p7=[{namespace:f7,locale:`en`,messages:c7},{namespace:f7,locale:`pl`,messages:u7}]})),h7,g7=n((()=>{h7={"editor.description":`The student marks each statement true or false.`,"template.tf.description":`Three statements to mark true or false`}})),_7,v7=n((()=>{_7={"editor.description":`Uczeń zaznacza przy każdym zdaniu prawdę albo fałsz.`,"template.tf.description":`Trzy zdania do oceny: prawda czy fałsz`}})),y7,b7,x7=n((()=>{g7(),v7(),y7=`astl.true-false`,b7=[{namespace:y7,locale:`en`,messages:h7},{namespace:y7,locale:`pl`,messages:_7}]})),S7,C7=n((()=>{S7={"editor.description":`A video file, or a YouTube or Vimeo video.`,"editor.template.watch.description":`A video with a tip, then a sentence with a gap`}})),w7,T7=n((()=>{w7={"editor.description":`Plik wideo albo film z YouTube lub Vimeo.`,"editor.template.watch.description":`Film ze wskazówką, a potem zdanie z luką`}})),E7,D7,O7=n((()=>{C7(),T7(),E7=`astl.video`,D7=[{namespace:E7,locale:`en`,messages:S7},{namespace:E7,locale:`pl`,messages:w7}]})),k7,A7=n((()=>{k7={"editor.description":`Words the student puts into the gaps of the text.`,"editor.template.dragWords.description":`A sentence with two gaps and a bank of three words, one of them extra.`}})),j7,M7=n((()=>{j7={"editor.description":`Słowa, które uczeń wstawia do luk w tekście.`,"editor.template.dragWords.description":`Zdanie z dwiema lukami i bankiem trzech słów, z których jedno jest zbędne.`}})),N7,P7,F7=n((()=>{A7(),M7(),N7=`astl.word-bank`,P7=[{namespace:N7,locale:`en`,messages:k7},{namespace:N7,locale:`pl`,messages:j7}]})),I7,L7=n((()=>{I7={"editor.description":`Hidden words in a grid of letters.`,"editor.template.wordSearch.description":`Three animals to find in a grid of letters`}})),R7,z7=n((()=>{R7={"editor.description":`Ukryte słowa w siatce liter.`,"editor.template.wordSearch.description":`Trzy zwierzęta do znalezienia w siatce liter`}})),B7,V7,H7=n((()=>{L7(),z7(),B7=`astl.word-search`,V7=[{namespace:B7,locale:`en`,messages:I7},{namespace:B7,locale:`pl`,messages:R7}]})),U7=r({builtInMenuMessages:()=>W7}),W7,G7=n((()=>{u8(),_8(),w8(),j8(),R8(),G8(),Q8(),a5(),f5(),y5(),E5(),N5(),B5(),q5(),e7(),s7(),m7(),x7(),O7(),F7(),H7(),W7=[...l8,...g8,...C8,...A8,...L8,...W8,...Z8,...i5,...d5,...v5,...T5,...M5,...z5,...K5,...$5,...o7,...p7,...b7,...D7,...P7,...V7]}));kI(),Kw(),w();var K7=[],q7=async()=>(await Promise.resolve().then(()=>(G7(),U7))).builtInMenuMessages;function J7(e={}){let t=e.components??Ix,n=new Set(t.map(e=>e.manifest.tag)),{surface:r,ink:i}=Tw.themes.light;r8({styleTemplates:Fw,groundColors:{surface:r,ink:i},featured:K7,menuMessages:q7,...e,components:t,editors:e.editors??hS.filter(e=>n.has(e.manifest.tag)),elements:e.elements??Bj.filter(e=>n.has(e.tag))})}em(),mm(),Tm(),Wm(),dh(),Lh(),eg(),mg(),Gg(),u_(),A_(),J_(),sv(),xv(),Vv(),ly(),Oy(),Ky(),cb(),Ab(),qb();var Y7=[pg,Um,Dy,Gy,cy,wm,bv,kb,Ih,Kb,Bv,uh,$h,q_,ov,pm,Wg,l_,k_,sb,$p];Qp(),Kw(),w(),Or(),Qp();var X7=`astrolabe-in-browser-key`;function Z7(e={}){let{surface:t,ink:n}=Tw.themes.light;return Np({components:Ix,styleTemplates:Fw,groundColors:{surface:t,ink:n},...e})}function Q7(e=Z7({secret:X7})){return async(t,n)=>{let r=await e.compile(t,{salt:location.pathname});if(!r.ok){let t=r.issues.filter(e=>e.severity===`error`).map(t=>e.describe(t,n.locale)).join(`
8060
+ </p>`}#N(){let e=e8;return e===null?R:(this.#h??=e.formatHtml(this.value),e.renderSource(this.renderRoot,this.authoring,this.#g??this.#h,this.#_,e=>{this.#g=e}))}};kI();var n8=`astl-editor`;function r8(e){let t=e.registry??customElements,n=t.get(n8);if(n!==void 0&&n!==t8)throw Error(`<${n8}> is already defined by another class`);lI(t),B6(e),n===void 0&&t.define(n8,t8)}var i8,a8=n((()=>{i8={"editor.description":`A sound to listen to, with an optional transcript.`}})),o8,s8=n((()=>{o8={"editor.description":`Dźwięk do odsłuchania, z opcjonalną transkrypcją.`}})),c8,l8,u8=n((()=>{a8(),s8(),c8=`astl.audio`,l8=[{namespace:c8,locale:`en`,messages:i8},{namespace:c8,locale:`pl`,messages:o8}]})),d8,f8=n((()=>{d8={"editor.description":`A tip, information or a warning in a box.`}})),p8,m8=n((()=>{p8={"editor.description":`Wskazówka, informacja albo ostrzeżenie w ramce.`}})),h8,g8,_8=n((()=>{f8(),m8(),h8=`astl.callout`,g8=[{namespace:h8,locale:`en`,messages:d8},{namespace:h8,locale:`pl`,messages:p8}]})),v8,y8=n((()=>{v8={"editor.description":`The student sorts cards into groups.`,"template.sort.description":`Two groups and four cards to sort`}})),b8,x8=n((()=>{b8={"editor.description":`Uczeń przyporządkowuje karty do grup.`,"template.sort.description":`Dwie grupy i cztery karty do posortowania`}})),S8,C8,w8=n((()=>{y8(),x8(),S8=`astl.categorise`,C8=[{namespace:S8,locale:`en`,messages:v8},{namespace:S8,locale:`pl`,messages:b8}]})),T8,E8=n((()=>{T8={"editor.description":`The student picks one answer or several.`,"template.choice.description":`A question with three answers, one of them right`}})),D8,O8=n((()=>{D8={"editor.description":`Uczeń wybiera jedną odpowiedź albo kilka.`,"template.choice.description":`Pytanie z trzema odpowiedziami, z których jedna jest poprawna`}})),k8,A8,j8=n((()=>{E8(),O8(),k8=`astl.choice`,A8=[{namespace:k8,locale:`en`,messages:T8},{namespace:k8,locale:`pl`,messages:D8}]})),M8,N8=n((()=>{M8={"editor.description":`Words that cross in a grid of squares, with numbered clues.`,"template.crossword.description":`A 5 by 5 grid, two words crossing at their first letter`}})),P8,F8=n((()=>{P8={"editor.description":`Hasła krzyżujące się w siatce kratek, z ponumerowanymi wskazówkami.`,"template.crossword.description":`Siatka 5 na 5, dwa hasła ze wspólną pierwszą literą`}})),I8,L8,R8=n((()=>{N8(),F8(),I8=`astl.crossword`,L8=[{namespace:I8,locale:`en`,messages:M8},{namespace:I8,locale:`pl`,messages:P8}]})),z8,B8=n((()=>{z8={"editor.description":`The student puts a word from a word bank into the text.`}})),V8,H8=n((()=>{V8={"editor.description":`Uczeń wstawia do tekstu słowo z banku słów.`}})),U8,W8,G8=n((()=>{B8(),H8(),U8=`astl.drop`,W8=[{namespace:U8,locale:`en`,messages:z8},{namespace:U8,locale:`pl`,messages:V8}]})),K8,q8=n((()=>{K8={"editor.description":`Cards to learn from, turned over one by one.`,"editor.template.cards.description":`Four cards to learn from, two with a picture on the front`}})),J8,Y8=n((()=>{J8={"editor.description":`Karty do nauki, odwracane po kolei.`,"editor.template.cards.description":`Cztery karty do nauki, dwie z obrazkiem na przodzie`}})),X8,Z8,Q8=n((()=>{q8(),Y8(),X8=`astl.flash-cards`,Z8=[{namespace:X8,locale:`en`,messages:K8},{namespace:X8,locale:`pl`,messages:J8}]})),$8,e5=n((()=>{$8={"editor.description":`The student types a word or a number.`,"template.fill.description":`A sentence with two words to type in`}})),t5,n5=n((()=>{t5={"editor.description":`Uczeń wpisuje słowo lub liczbę.`,"template.fill.description":`Zdanie z dwoma słowami do wpisania`}})),r5,i5,a5=n((()=>{e5(),n5(),r5=`astl.gap`,i5=[{namespace:r5,locale:`en`,messages:$8},{namespace:r5,locale:`pl`,messages:t5}]})),o5,s5=n((()=>{o5={"editor.description":`The student picks the right places on a picture.`,"template.find.description":`A picture with five places to pick, three of them right`}})),c5,l5=n((()=>{c5={"editor.description":`Uczeń wskazuje właściwe miejsca na obrazku.`,"template.find.description":`Obrazek z pięcioma miejscami do wskazania, z których trzy są właściwe`}})),u5,d5,f5=n((()=>{s5(),l5(),u5=`astl.hotspot`,d5=[{namespace:u5,locale:`en`,messages:o5},{namespace:u5,locale:`pl`,messages:c5}]})),p5,m5=n((()=>{p5={"editor.description":`The student puts labels on the zones of a picture.`,"template.drag.description":`Three zones on a picture and four labels, one of them extra`}})),h5,g5=n((()=>{h5={"editor.description":`Uczeń umieszcza podpisy w strefach obrazka.`,"template.drag.description":`Trzy strefy na obrazku i cztery podpisy, w tym jeden dodatkowy`}})),_5,v5,y5=n((()=>{m5(),g5(),_5=`astl.image-drop`,v5=[{namespace:_5,locale:`en`,messages:p5},{namespace:_5,locale:`pl`,messages:h5}]})),b5,x5=n((()=>{b5={"editor.description":`The student writes a name for each pin on a picture.`,"template.label.description":`Three pins to name, one of them with two accepted spellings`}})),S5,C5=n((()=>{S5={"editor.description":`Uczeń wpisuje nazwę każdej pinezki na obrazku.`,"template.label.description":`Trzy pinezki do podpisania, jedna z dwoma przyjmowanymi zapisami`}})),w5,T5,E5=n((()=>{x5(),C5(),w5=`astl.image-label`,T5=[{namespace:w5,locale:`en`,messages:b5},{namespace:w5,locale:`pl`,messages:S5}]})),D5,O5=n((()=>{D5={"editor.description":`An answer in the student's own words, marked by the teacher.`,"editor.template.write.description":`A question answered in a few sentences, read by the teacher`}})),k5,A5=n((()=>{k5={"editor.description":`Odpowiedź własnymi słowami, oceniana przez nauczyciela.`,"editor.template.write.description":`Pytanie, na które uczeń odpowiada kilkoma zdaniami, a czyta je nauczyciel`}})),j5,M5,N5=n((()=>{O5(),A5(),j5=`astl.long-answer`,M5=[{namespace:j5,locale:`en`,messages:D5},{namespace:j5,locale:`pl`,messages:k5}]})),P5,F5=n((()=>{P5={"editor.description":`The student highlights or crosses out words in a text.`,"template.select.description":`A sentence with three marked words, two of them correct`,"template.odd.description":`Three lines of four words, one odd word in each`}})),I5,L5=n((()=>{I5={"editor.description":`Uczeń podkreśla albo skreśla wyrazy w tekście.`,"template.select.description":`Zdanie z trzema oznaczonymi wyrazami, dwa z nich poprawne`,"template.odd.description":`Trzy wiersze po cztery wyrazy, w każdym jeden niepasujący`}})),R5,z5,B5=n((()=>{F5(),L5(),R5=`astl.mark-words`,z5=[{namespace:R5,locale:`en`,messages:P5},{namespace:R5,locale:`pl`,messages:I5}]})),V5,H5=n((()=>{V5={"editor.description":`The student matches rows with columns or joins lines.`,"template.matching.description":`A grid of three animals and their homes`,"template.lines.description":`Three pairs of opposites to join with lines`}})),U5,W5=n((()=>{U5={"editor.description":`Uczeń dopasowuje wiersze do kolumn albo łączy linie.`,"template.matching.description":`Tabela: trzy zwierzęta i ich domy`,"template.lines.description":`Trzy pary przeciwieństw do połączenia liniami`}})),G5,K5,q5=n((()=>{H5(),W5(),G5=`astl.match`,K5=[{namespace:G5,locale:`en`,messages:V5},{namespace:G5,locale:`pl`,messages:U5}]})),J5,Y5=n((()=>{J5={"editor.description":`The student turns two cards at a time and finds the pairs.`,"template.memory.description":`Three pairs of cards: animals and their young`}})),X5,Z5=n((()=>{X5={"editor.description":`Uczeń odkrywa po dwie karty i szuka par.`,"template.memory.description":`Trzy pary kart: zwierzęta i ich młode`}})),Q5,$5,e7=n((()=>{Y5(),Z5(),Q5=`astl.memory`,$5=[{namespace:Q5,locale:`en`,messages:J5},{namespace:Q5,locale:`pl`,messages:X5}]})),t7,n7=n((()=>{t7={"editor.description":`The student puts items in the right order.`,"template.cycle.description":`Four stages of a life cycle to put in order`}})),r7,i7=n((()=>{r7={"editor.description":`Uczeń układa elementy we właściwej kolejności.`,"template.cycle.description":`Cztery etapy życia do ułożenia po kolei`}})),a7,o7,s7=n((()=>{n7(),i7(),a7=`astl.order`,o7=[{namespace:a7,locale:`en`,messages:t7},{namespace:a7,locale:`pl`,messages:r7}]})),c7,l7=n((()=>{c7={"editor.description":`The student picks one answer inside the text.`,"template.list.description":`A sentence with a drop-down list of three words`,"template.click.description":`Two sentences, each with words to click`}})),u7,d7=n((()=>{u7={"editor.description":`Uczeń wybiera jedną odpowiedź w tekście.`,"template.list.description":`Zdanie z listą rozwijaną trzech słów`,"template.click.description":`Dwa zdania, w każdym słowa do kliknięcia`}})),f7,p7,m7=n((()=>{l7(),d7(),f7=`astl.select`,p7=[{namespace:f7,locale:`en`,messages:c7},{namespace:f7,locale:`pl`,messages:u7}]})),h7,g7=n((()=>{h7={"editor.description":`The student marks each statement true or false.`,"template.tf.description":`Three statements to mark true or false`}})),_7,v7=n((()=>{_7={"editor.description":`Uczeń zaznacza przy każdym zdaniu prawdę albo fałsz.`,"template.tf.description":`Trzy zdania do oceny: prawda czy fałsz`}})),y7,b7,x7=n((()=>{g7(),v7(),y7=`astl.true-false`,b7=[{namespace:y7,locale:`en`,messages:h7},{namespace:y7,locale:`pl`,messages:_7}]})),S7,C7=n((()=>{S7={"editor.description":`A video file, or a YouTube or Vimeo video.`,"editor.template.watch.description":`A video with a tip, then a sentence with a gap`}})),w7,T7=n((()=>{w7={"editor.description":`Plik wideo albo film z YouTube lub Vimeo.`,"editor.template.watch.description":`Film ze wskazówką, a potem zdanie z luką`}})),E7,D7,O7=n((()=>{C7(),T7(),E7=`astl.video`,D7=[{namespace:E7,locale:`en`,messages:S7},{namespace:E7,locale:`pl`,messages:w7}]})),k7,A7=n((()=>{k7={"editor.description":`Words the student puts into the gaps of the text.`,"editor.template.dragWords.description":`A sentence with two gaps and a bank of three words, one of them extra.`}})),j7,M7=n((()=>{j7={"editor.description":`Słowa, które uczeń wstawia do luk w tekście.`,"editor.template.dragWords.description":`Zdanie z dwiema lukami i bankiem trzech słów, z których jedno jest zbędne.`}})),N7,P7,F7=n((()=>{A7(),M7(),N7=`astl.word-bank`,P7=[{namespace:N7,locale:`en`,messages:k7},{namespace:N7,locale:`pl`,messages:j7}]})),I7,L7=n((()=>{I7={"editor.description":`Hidden words in a grid of letters.`,"editor.template.wordSearch.description":`Three animals to find in a grid of letters`}})),R7,z7=n((()=>{R7={"editor.description":`Ukryte słowa w siatce liter.`,"editor.template.wordSearch.description":`Trzy zwierzęta do znalezienia w siatce liter`}})),B7,V7,H7=n((()=>{L7(),z7(),B7=`astl.word-search`,V7=[{namespace:B7,locale:`en`,messages:I7},{namespace:B7,locale:`pl`,messages:R7}]})),U7=r({builtInMenuMessages:()=>W7}),W7,G7=n((()=>{u8(),_8(),w8(),j8(),R8(),G8(),Q8(),a5(),f5(),y5(),E5(),N5(),B5(),q5(),e7(),s7(),m7(),x7(),O7(),F7(),H7(),W7=[...l8,...g8,...C8,...A8,...L8,...W8,...Z8,...i5,...d5,...v5,...T5,...M5,...z5,...K5,...$5,...o7,...p7,...b7,...D7,...P7,...V7]}));kI(),Kw(),w();var K7=[],q7=async()=>(await Promise.resolve().then(()=>(G7(),U7))).builtInMenuMessages;function J7(e={}){let t=e.components??Ix,n=new Set(t.map(e=>e.manifest.tag)),{surface:r,ink:i}=Tw.themes.light;r8({styleTemplates:Fw,groundColors:{surface:r,ink:i},featured:K7,menuMessages:q7,...e,components:t,editors:e.editors??hS.filter(e=>n.has(e.manifest.tag)),elements:e.elements??Bj.filter(e=>n.has(e.tag))})}em(),mm(),Tm(),Wm(),dh(),Lh(),eg(),mg(),Gg(),u_(),A_(),J_(),sv(),xv(),Vv(),ly(),Oy(),Ky(),cb(),Ab(),qb();var Y7=[pg,Um,Dy,Gy,cy,wm,bv,kb,Ih,Kb,Bv,uh,$h,q_,ov,pm,Wg,l_,k_,sb,$p];Qp(),Kw(),w(),Or(),Qp();var X7=`astrolabe-in-browser-key`;function Z7(e={}){let{surface:t,ink:n}=Tw.themes.light;return Np({components:Ix,styleTemplates:Fw,groundColors:{surface:t,ink:n},...e})}function Q7(e=Z7({secret:X7})){return async(t,n)=>{let r=await e.compile(t,{salt:location.pathname});if(!r.ok){let t=r.issues.filter(e=>e.severity===`error`).map(t=>e.describe(t,n.locale)).join(`
8007
8061
  `);throw console.error(t),Error(t)}return{view:r.view,checker:En(e,r.key)}}}YE(),Kw(),w(),YE();function $7(e={}){zE({elements:Bj,styleTemplates:Fw,...e})}f(),b(),te(),ke(),We(),Ze(),dt(),ht(),yt(),St(),kt(),Lt(),zt(),Gt(),Qt(),rn(),on(),ln(),xn(),On(),Or(),dl(),Ql(),Bf(),mp(),Op(),Zp(),UC(),qC(),$C(),dw(),Iw(),Hw(),RE(),JE(),lN(),TN(),JP(),OI();var e9=`data-astl-tokens`;if(document.head.querySelector(`style[${e9}]`)===null){let e=document.createElement(`style`);e.setAttribute(e9,``),e.textContent=Vw(`:root, .astl-theme`),document.head.prepend(e)}return $7({compileSource:Q7()}),J7(),e.AstlEditor=t8,e.AstlElement=KE,e.AstlPlayer=LE,e.AttemptController=KC,e.BLOCK_TAGS=ie,e.BUILT_IN_PREFIX=Ve,e.CAPTION_TAG=se,e.CLASS_ATTRIBUTE=ue,e.COLUMNS_TAG=ge,e.COLUMN_TAG=_e,e.COMMON_ATTRIBUTES=Ft,e.CONTENT_ATTRIBUTES=le,e.CheckerError=y,e.DEFAULT_DOC_KIND=we,e.DEFAULT_FEATURED=K7,e.DEFAULT_FONTS=rN,e.DEFAULT_PROFILE=an,e.DEFAULT_STYLES=iN,e.DOC_ATTRIBUTES=Se,e.DOC_KINDS=Ce,e.DOC_TAG=Fe,e.ELEMENT_TAG_PATTERN=Be,e.ENGINE_NAMESPACE=xt,e.EXPLANATION_TAG=Ke,e.EngineIssue=S,e.FEEDBACK_TAG=qe,e.FEEDBACK_VARIANTS=Ye,e.FIGURE_TAG=oe,e.FLAG_SELECTED=d,e.FORMAT_VERSION=Ne,e.HELP_ATTRIBUTES=Xe,e.HELP_TAGS=Je,e.HINT_TAG=Ge,e.INERT_STYLE=de,e.INLINE_TAGS=ae,e.IN_BROWSER_SECRET=X7,e.JSON_MEDIA_TYPE=Jt,e.KEY_FORMAT_VERSION=ee,e.LANGUAGE_TAG_PATTERN=Ue,e.MAX_ANSWER_COUNT=u,e.MAX_ANSWER_LENGTH=s,e.MAX_ATTRIBUTES_PER_ELEMENT=Ee,e.MAX_COLUMNS=ye,e.MAX_INLINED_STYLES=Vn,e.MAX_NESTING_DEPTH=De,e.MAX_OPEN_ANSWER_LENGTH=l,e.MAX_REQUEST_BYTES=Zt,e.MAX_SOURCE_LENGTH=Le,e.MAX_STYLE_LENGTH=zn,e.MAX_STYLE_RULES=Bn,e.MIN_COLUMNS=ve,e.MessageSyntaxError=at,e.OPAQUE_ID_PATTERN=ze,e.OPEN_SLOT_KIND=c,e.PAGE_ATTRIBUTES=Te,e.PAGE_TAG=Ie,e.PLAYER_NAMESPACE=lw,e.PRACTICE_POLICY=Ht,e.PROBLEM_MEDIA_TYPE=Yt,e.PROTOCOL_VERSION=qt,e.PlayerEvent=Rt,e.ProblemCode=C,e.ProtocolPath=Xt,e.REMOVED_WITH_CONTENT=ce,e.SCORING_ATTRIBUTES=It,e.SCORING_RULES=nn,e.SNAPSHOT_FORMAT=cn,e.SOURCE_ID_PATTERN=Re,e.STYLE_OPEN=WP,e.STYLE_PROPERTIES=Tr,e.STYLE_TAG=he,e.STYLE_TEMPLATE_ATTRIBUTE=wt,e.STYLE_TEMPLATE_NAME=Tt,e.SUPPORTED_FORMATS=Pe,e.SingleSlotElement=qE,e.TAG_ATTRIBUTES=be,e.TEST_POLICY=Ut,e.URL_ATTRIBUTES=xe,e.UploadRefused=xN,e.allAttributes=jt,e.announce=IC,e.builtInDefinitions=Ix,e.builtInEditors=hS,e.builtInElements=Bj,e.builtInManifests=Y7,e.builtInStyleTemplates=Fw,e.checkCatalog=pt,e.childElements=_,e.childTagConflict=Pt,e.choiceSlot=Cp,e.cleanClass=An,e.cleanStyle=Fn,e.compareCatalogs=mt,e.createAuthoring=bN,e.createEngine=Z7,e.createI18n=vt,e.createSourceCompiler=Q7,e.createTextareaAdapter=TI,e.defineEditor=J7,e.definePlayer=$7,e.directionOf=Me,e.element=p,e.engineMessages=zf,e.fitsAnswer=a,e.flagSlot=wp,e.groupMax=tn,e.hasErrors=bt,e.helpPolicy=Bt,e.helpShown=un,e.hintCount=_n,e.httpChecker=ZC,e.icuFormatter=ut,e.inertStyles=me,e.isAnswerKey=x,e.isAnswers=o,e.isAttemptPolicy=Vt,e.isElement=h,e.isGradedElement=pn,e.isOpaqueId=je,e.isProblemDetails=Kt,e.isSafeUrl=ne,e.isSnapshot=sn,e.isSourceId=Ae,e.isStyleName=kn,e.isStyleTemplate=Ct,Object.defineProperty(e,"kit",{enumerable:!0,get:function(){return zp}}),e.leakProbe=Xl,e.letterSlot=Tp,e.loadStyleElements=HP,e.localChecker=En,e.maxAnswerLength=i,e.mergeStyles=Nn,e.messageParams=$e,e.negotiateLocale=gt,e.nextHint=vn,e.normalise=Hf,e.numberSlot=Sp,e.overStyleColor=Ln,e.parseHtml=Rc,e.parseMessage=Qe,e.parseNumber=qf,e.parseStyleColor=Mn,e.playerMessages=uw,e.pluralCategories=it,e.refResolver=Zl,e.renderVerdict=FC,e.resultHelp=gn,e.roundScore=$t,e.sameChildSpec=Nt,e.seededShuffle=GE,e.serializeHtml=Gc,e.strictUrlPolicy=re,e.styleContrast=Rn,e.styleLuminance=In,e.styleText=Pn,e.text=m,e.textContent=g,e.textSlot=xp,e.tokensCss=Vw,e.variantAttribute=At,e.verdictIcon=PC,e.verdictStyles=zC,e.visuallyHidden=RC,e})({});