@creaditor/web-starterkit 1.0.44 → 1.0.45

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.
@@ -1 +1 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1271],{71271(e,t,n){n.d(t,{default:()=>h});var o=n(53577),i=n(74265),l=n(86319);const s=[100,300,400,500,600,700,900].map(e=>({value:String(e),label:String(e)})),a=e=>{{const{component:t,commands:n,helpers:a}=e,r=t.tiptap,c=r.state.selection.$anchor.node().attrs,p=r.isActive("heading",{level:1})?"h1":r.isActive("heading",{level:2})?"h2":r.isActive("heading",{level:3})?"h3":r.isActive("heading",{level:4})?"h4":r.isActive("heading",{level:5})?"h5":r.isActive("heading",{level:6})?"h6":"paragraph";let u=e.languageJson;const d=e.language||"he";return u||(u="he"===d?o:i),{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=r.isActive("customBulletItem"),n=[{text:"style",selected:!t},...t?[{text:"icons",selected:!0}]:[],{text:"settings"}];return n.forEach(t=>t.selected=t.text===e),n},layout:e=>{let{tab:o,changeTab:i,tabs:a}=e;return[{type:"info",text:"text_micro_copy",active:()=>"style"===o.text},{type:"heading",level:6,text:"typography",active:()=>"style"===o.text},{type:"dropdown",active:()=>"style"===o.text,title:"type",value:p,items:[{value:"H1"},{value:"H2"},{value:"H3"},{value:"H4"},{value:"H5"},{value:"H6"},{value:"paragraph"}],onChange:e=>{const t=e.target.value;switch(t){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":r.chain().setHeading({level:parseInt(t.slice(1))}).run();break;case"paragraph":r.chain().setParagraph().run()}}},{type:"slider",title:"fontSize",min:8,step:2,max:74,value:parseInt(r.getAttributes("textStyle").fontSize||"16px"),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontSize(n).run():o.chain().setFontSize(n).run()}},{type:"dropdown",title:"fontWeight",active:()=>"style"===o.text&&"web"===l.M.get("config","channel"),value:String(r.getAttributes("textStyle").fontWeight||400),selected:String(r.getAttributes("textStyle").fontWeight||400),items:s,onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontWeight(n).run():o.chain().setFontWeight(n).run()}},{type:"heading",level:6,text:"spacing",active:()=>"style"===o.text},{type:"slider",title:"lineHeight",min:1,max:3,step:.1,value:parseFloat(c.lineHeight||1),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setLineHeight(n).run():o.chain().setLineHeight(n).run()}},{type:"slider",title:"letterSpacing",min:1,max:10,step:1,value:parseFloat(c.letterSpacing)||1,active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;n<=1?i.from===i.to?o.chain().selectAll().setLetterSpacing("normal").run():o.chain().setLetterSpacing("normal").run():i.from===i.to?o.chain().selectAll().setLetterSpacing(n+"px").run():o.chain().setLetterSpacing(n+"px").run()}},{type:"heading",level:6,text:"colors",active:()=>"style"===o.text},{type:"colorSwatchGroup",active:()=>"style"===o.text,columns:2,items:[{title:"font_color",value:r.getAttributes("textStyle").color||"#000000",onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;if(i.from===i.to){const{state:e,view:t}=o,i=e.tr,{from:l,to:s}={from:0,to:e.doc.content.size};e.doc.nodesBetween(l,s,(t,o)=>{if(t.isText){t.marks.some(e=>"link"===e.type.name)||i.addMark(o,o+t.nodeSize,e.schema.marks.textStyle.create({color:n}))}}),t.dispatch(i)}else o.chain().setColor(n).focus().run()}},{title:"backgroundColor",allowGradient:!0,value:t.props.style.background||t.props.style.backgroundColor||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{background:t,backgroundColor:null})}}]},{type:"heading",level:6,text:"layout",active:()=>"style"===o.text},{type:"slider",active:()=>"style"===o.text,title:"maxWidth",value:parseFloat(t.props.style.width),min:20,max:1e3,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"divider",active:()=>"style"===o.text},{type:"button",text:"reset_styling",icon:"formatClear",color:"currentColor",fontSize:"var(--text-sm, 13px)",active:()=>"style"===o.text,onClick:()=>(e=>{const{from:t,to:n}=e.view.state.selection,o=e.chain().focus();t===n&&o.selectAll(),o.unsetFontSize().unsetFontWeight().unsetFontFamily().unsetLetterSpacing().unsetLineHeight().unsetColor().unsetBackgroundColor().unsetBold().unsetItalic().unsetUnderline().run()})(t.tiptap)},{type:"divider"},{type:"colorpicker",active:()=>"icons"===o.text,title:u.iconColor||"Icon color",alpha:!1,value:r.getAttributes(" textStyle").color||"#0000",onChange:e=>{const t=e.target.value;r.chain().setCustomBulletStyles({fill:t}).run()}},{type:"divider",active:()=>"icons"===o.text},{type:"slider",active:()=>"icons"===o.text,title:u.iconSize||"Icon size",value:parseInt(r.getAttributes("customBulletItem").width)||24,min:10,max:40,onInput:e=>{const t=e.target.value;r.chain().setCustomBulletStyles({width:t+"px",height:t+"px"}).run()}},{type:"icons",active:()=>"icons"===o.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;t.tiptap.chain().focus().setCustomBulletIcon({svgIcon:n.urlPng}).run()}}]}}}};var r=n(52144);const c=e=>{let{helpers:t,tiptap:n,composeId:o,template:i}=e;return{set:(e,l,s)=>{switch(l){case"style":return"object"==typeof s&&(e[l]=(0,r.A)(e[l],s),t.mergeDiff(i,{style:e[l]})),!0;case"text":e[l]=s;const a=n.getJSON();return s&&"object"==typeof s&&JSON.stringify(a)!==JSON.stringify(s.childNodes)&&(s&&s.focusedElement&&s.focusedElement===o?(n.chain().focus().setContent(s.childNodes).run(),s.to&&s.from&&n.commands.setTextSelection({from:s.from,to:s.to})):n.chain().setContent(s.childNodes).run()),delete e?.text?.markdown,!0}}}};var p=n(84488),u=n.n(p);n(70567);const d=[];let g=!1,m=null;const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="text";return{name:t,create:n=>{const{createElement:o,compose:i,helpers:s}=n,{mergeDiff:r}=s,p=document.createElement("div");r(p,{style:i.props.style});const h=l.M.get("config","editor","configure","editorProps","fonts");let y=l.M.get("config","target");"string"==typeof y&&(y=document.querySelector(y)),y||(y=document.body);const v=u()({element:p,container:y||document.body,editable:!0,offsetTop:40,onClickMagic:e=>{const t=l.M.get("injectEditor"),n=document.createElement("cdtr-text-prompt-editor");n.commands=e,n.elementId=i.id,t(n)},content:"string"==typeof i.props.text.markdown?i.props.text.markdown:i.props.text.childNodes,defaultDirection:"rtl",onBlur:()=>{m===v&&(m=null),setTimeout(()=>{m!==v&&(g=!1)},150)},onFocus:()=>{if(!g||m===v||null===m){if(g=!0,m=v,d.length>0)for(d.forEach(e=>{e!==v&&e.hideEditor()});d.length>0;)d.pop();d.push(v),setTimeout(()=>{m===v&&g&&v.showEditor()},100)}},onUpdate:e=>{let{editor:t,transaction:n}=e;if(0===n.steps.length)return;const o=n.curSelection.from,l=n.curSelection.to,s={childNodes:t.getJSON(),from:o,to:l,focusedElement:i.id};f.commands.execCommand("text",s)},ignoresBlurByQuerySelectors:[".ignore-events"],builder:[{type:"fontFamily",fonts:h||[],useCloud:!0},{type:"fontSize",sizes:e.fontSize||[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74]},{type:"horizonRule"},{type:"clearFormat"},{type:"bold"},{type:"strike"},{type:"italic"},{type:"underline"},{type:"table"},{type:"emoji"},{type:"unLink"},{type:"automation"},{type:"link"},{type:"customList"},{type:"numbered"},{type:"bullet"},{type:"backcolor"},{type:"fontColor"},{type:"direction"},{type:"justify"},{type:"right"},{type:"center"},{type:"left"},{type:"image"},{type:"mergeTags"},{type:"magic"}]}),f=o({name:t,id:i.id,template:p,defaultProps:{text:{},style:{}},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>p,handleBar:!0,validator:c({template:p,helpers:s,tiptap:v,composeId:i.id}),schema:i.schema,onSelect:e=>{p.classList.add(e)},onDeselect:e=>{p.classList.remove(e)},elementProps:i,remove:()=>{p.remove()},createEditor:a});return i.props.text.markdown&&v.chain().insertContent(" ").run(),f.addProp("tiptap",v),f}}}}}]);
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1271],{71271(e,t,n){n.d(t,{default:()=>h});var o=n(53577),i=n(74265),l=n(86319);const a=[100,300,400,500,600,700,900].map(e=>({value:String(e),label:String(e)}));let s=null;const c=e=>{{const{component:t,commands:n,helpers:c}=e,r=t.tiptap,p=r.state.selection.$anchor.node().attrs,u=(()=>{const{selection:e}=r.state;if(e.node&&"icon"===e.node.type.name)return e.from;let t=null;return r.state.doc.nodesBetween(e.from,e.to,(e,n)=>{null===t&&"icon"===e.type.name&&(t=n)}),t})(),d=r.getAttributes("icon"),m=parseInt(d.size,10)||24,g=`#${String(d.color||"000000").replace(/^#/,"")}`,y=r.isActive("heading",{level:1})?"h1":r.isActive("heading",{level:2})?"h2":r.isActive("heading",{level:3})?"h3":r.isActive("heading",{level:4})?"h4":r.isActive("heading",{level:5})?"h5":r.isActive("heading",{level:6})?"h6":"paragraph";let h=e.languageJson;const v=e.language||"he";return h||(h="he"===v?o:i),{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=r.isActive("customBulletItem"),n=[{text:"style",selected:!t},...t?[{text:"icons",selected:!0}]:[],...r.isActive("icon")?[{text:"icon",selected:!0}]:[],{text:"settings"}];return n.forEach(t=>t.selected=t.text===e),n},layout:e=>{let{tab:o,changeTab:i,tabs:c}=e;const v=()=>"icon"===o.text,f=null===u?null:`${t.id}:${u}`;f!==s&&(s=f,null!==f&&"icon"!==o.text&&setTimeout(()=>i("icon"),0));return[{type:"info",text:"text_micro_copy",active:()=>"style"===o.text},{type:"heading",level:6,text:"typography",active:()=>"style"===o.text},{type:"dropdown",active:()=>"style"===o.text,title:"type",value:y,items:[{value:"H1"},{value:"H2"},{value:"H3"},{value:"H4"},{value:"H5"},{value:"H6"},{value:"paragraph"}],onChange:e=>{const t=e.target.value;switch(t){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":r.chain().setHeading({level:parseInt(t.slice(1))}).run();break;case"paragraph":r.chain().setParagraph().run()}}},{type:"slider",title:"fontSize",min:8,step:2,max:74,value:parseInt(r.getAttributes("textStyle").fontSize||"16px"),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontSize(n).run():o.chain().setFontSize(n).run()}},{type:"dropdown",title:"fontWeight",active:()=>"style"===o.text&&"web"===l.M.get("config","channel"),value:String(r.getAttributes("textStyle").fontWeight||400),selected:String(r.getAttributes("textStyle").fontWeight||400),items:a,onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontWeight(n).run():o.chain().setFontWeight(n).run()}},{type:"heading",level:6,text:"spacing",active:()=>"style"===o.text},{type:"slider",title:"lineHeight",min:1,max:3,step:.1,value:parseFloat(p.lineHeight||1),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setLineHeight(n).run():o.chain().setLineHeight(n).run()}},{type:"slider",title:"letterSpacing",min:1,max:10,step:1,value:parseFloat(p.letterSpacing)||1,active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;n<=1?i.from===i.to?o.chain().selectAll().setLetterSpacing("normal").run():o.chain().setLetterSpacing("normal").run():i.from===i.to?o.chain().selectAll().setLetterSpacing(n+"px").run():o.chain().setLetterSpacing(n+"px").run()}},{type:"heading",level:6,text:"colors",active:()=>"style"===o.text},{type:"colorSwatchGroup",active:()=>"style"===o.text,columns:2,items:[{title:"font_color",value:r.getAttributes("textStyle").color||"#000000",onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;if(i.from===i.to){const{state:e,view:t}=o,i=e.tr,{from:l,to:a}={from:0,to:e.doc.content.size};e.doc.nodesBetween(l,a,(t,o)=>{if(t.isText){t.marks.some(e=>"link"===e.type.name)||i.addMark(o,o+t.nodeSize,e.schema.marks.textStyle.create({color:n}))}}),t.dispatch(i)}else o.chain().setColor(n).focus().run()}},{title:"backgroundColor",allowGradient:!0,value:t.props.style.background||t.props.style.backgroundColor||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{background:t,backgroundColor:null})}}]},{type:"heading",level:6,text:"layout",active:()=>"style"===o.text},{type:"slider",active:()=>"style"===o.text,title:"maxWidth",value:parseFloat(t.props.style.width),min:20,max:1e3,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"divider",active:()=>"style"===o.text},{type:"button",text:"reset_styling",icon:"formatClear",color:"currentColor",fontSize:"var(--text-sm, 13px)",active:()=>"style"===o.text,onClick:()=>(e=>{const{from:t,to:n}=e.view.state.selection,o=e.chain().focus();t===n&&o.selectAll(),o.unsetFontSize().unsetFontWeight().unsetFontFamily().unsetLetterSpacing().unsetLineHeight().unsetColor().unsetBackgroundColor().unsetBold().unsetItalic().unsetUnderline().run()})(t.tiptap)},{type:"divider"},{type:"colorpicker",active:()=>"icons"===o.text,title:h.iconColor||"Icon color",alpha:!1,value:r.getAttributes(" textStyle").color||"#0000",onChange:e=>{const t=e.target.value;r.chain().setCustomBulletStyles({fill:t}).run()}},{type:"divider",active:()=>"icons"===o.text},{type:"slider",active:()=>"icons"===o.text,title:h.iconSize||"Icon size",value:parseInt(r.getAttributes("customBulletItem").width)||24,min:10,max:40,onInput:e=>{const t=e.target.value;r.chain().setCustomBulletStyles({width:t+"px",height:t+"px"}).run()}},{type:"icons",active:()=>"icons"===o.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;t.tiptap.chain().focus().setCustomBulletIcon({svgIcon:n.urlPng}).run()}},{type:"heading",level:6,text:"icon",active:v},{type:"slider",active:v,title:h.iconSize||"Icon size",min:8,max:200,value:m,onInput:e=>{const t=parseInt(e.target.value,10);t&&r.commands.updateIcon({size:t,pos:u})}},{type:"colorpicker",active:v,title:h.iconColor||"Icon color",alpha:!1,value:g,onChange:e=>{const t=String(e.target.value||"").replace(/^#/,"");t&&r.commands.updateIcon({color:t,pos:u})}},{type:"icons",active:v,selectedIcon:d.src,useIconsApi:!0,iconColor:g.replace(/^#/,""),iconSize:m,onChange:e=>{const t=e.detail;t&&r.commands.updateIcon({src:t.urlPng||t.src,category:t.category??null,name:t.name??null,alt:t.name||"",pos:u})}}]}}}};var r=n(52144);const p=e=>{let{helpers:t,tiptap:n,composeId:o,template:i}=e;return{set:(e,l,a)=>{switch(l){case"style":return"object"==typeof a&&(e[l]=(0,r.A)(e[l],a),t.mergeDiff(i,{style:e[l]})),!0;case"text":e[l]=a;const s=n.getJSON();return a&&"object"==typeof a&&JSON.stringify(s)!==JSON.stringify(a.childNodes)&&(a&&a.focusedElement&&a.focusedElement===o?(n.chain().focus().setContent(a.childNodes).run(),a.to&&a.from&&n.commands.setTextSelection({from:a.from,to:a.to})):n.chain().setContent(a.childNodes).run()),delete e?.text?.markdown,!0}}}};var u=n(84488),d=n.n(u);n(70567);const m=[];let g=!1,y=null;const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="text";return{name:t,create:n=>{const{createElement:o,compose:i,helpers:a}=n,{mergeDiff:s}=a,r=document.createElement("div");s(r,{style:i.props.style});const u=l.M.get("config","editor","configure","editorProps","fonts");let h=l.M.get("config","target");"string"==typeof h&&(h=document.querySelector(h)),h||(h=document.body);const v=d()({element:r,container:h||document.body,editable:!0,offsetTop:40,onClickMagic:e=>{const t=l.M.get("injectEditor"),n=document.createElement("cdtr-text-prompt-editor");n.commands=e,n.elementId=i.id,t(n)},content:"string"==typeof i.props.text.markdown?i.props.text.markdown:i.props.text.childNodes,defaultDirection:"rtl",onBlur:()=>{y===v&&(y=null),setTimeout(()=>{y!==v&&(g=!1)},150)},onFocus:()=>{if(!g||y===v||null===y){if(g=!0,y=v,m.length>0)for(m.forEach(e=>{e!==v&&e.hideEditor()});m.length>0;)m.pop();m.push(v),setTimeout(()=>{y===v&&g&&v.showEditor()},100)}},onUpdate:e=>{let{editor:t,transaction:n}=e;if(0===n.steps.length)return;const o=n.curSelection.from,l=n.curSelection.to,a={childNodes:t.getJSON(),from:o,to:l,focusedElement:i.id};f.commands.execCommand("text",a)},ignoresBlurByQuerySelectors:[".ignore-events"],builder:[{type:"fontFamily",fonts:u||[],useCloud:!0},{type:"fontSize",sizes:e.fontSize||[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74]},{type:"horizonRule"},{type:"clearFormat"},{type:"bold"},{type:"strike"},{type:"italic"},{type:"underline"},{type:"table"},{type:"emoji"},{type:"unLink"},{type:"automation"},{type:"link"},{type:"customList"},{type:"numbered"},{type:"bullet"},{type:"backcolor"},{type:"fontColor"},{type:"direction"},{type:"justify"},{type:"right"},{type:"center"},{type:"left"},{type:"image"},{type:"mergeTags"},{type:"magic"}]}),f=o({name:t,id:i.id,template:r,defaultProps:{text:{},style:{}},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>r,handleBar:!0,validator:p({template:r,helpers:a,tiptap:v,composeId:i.id}),schema:i.schema,onSelect:e=>{r.classList.add(e)},onDeselect:e=>{r.classList.remove(e)},elementProps:i,remove:()=>{r.remove()},createEditor:c});return i.props.text.markdown&&v.chain().insertContent(" ").run(),f.addProp("tiptap",v),f}}}}}]);
Binary file
@@ -1,10 +1,10 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2655],{72655(e,t,i){i.r(t),i.d(t,{NextButton:()=>P,PUBLISH_ERROR_EVENT:()=>L,PUBLISH_EVENT:()=>S});var s=i(59929),o=i(86319),n=i(93432),r=i(90090),a=i(86959),l=i(15604);const d=`${(0,a.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/seo-generate`;const c=s.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2655],{72655(e,t,i){i.r(t),i.d(t,{NextButton:()=>B,PUBLISH_ERROR_EVENT:()=>E,PUBLISH_EVENT:()=>T});var o=i(59929),s=i(86319),n=i(28177),r=i(90090),a=i(86959),l=i(15604),d=i(85274),c=i(26432);const p=`${(0,a.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/seo-generate`;const h=o.qy`
2
2
  <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16" aria-hidden="true">
3
3
  <path
4
4
  d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"
5
5
  />
6
6
  </svg>
7
- `;class p extends s.WF{constructor(){super(),this.resolver=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.onCancel=()=>{this.loading||(this.settle(null),this.dismiss())},this.onKeywordKeydown=e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),this.commitDraftKeyword()):"Backspace"===e.key&&""===this.keywordDraft&&this.keywordList.length&&(this.keywordList=this.keywordList.slice(0,-1))},this.generateField=async e=>{if(this.loading||this.generatingField)return;const t=function(){const e=document.getElementById("main-page-wrapper");return(e?.innerText||"").trim()}();if(t){this.generatingField=e;try{const i="rtl"===this.direction?"he":"en",s=await this.requestSeo(e,t,i);if("keywords"===e){const e=(Array.isArray(s)?s:String(s).split(",")).map(e=>e.trim()).filter(Boolean),t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t}else"title"===e?this.title=String(s).slice(0,100):this.description=String(s).slice(0,255)}catch(e){console.error("[seo-generate] failed:",e),this.snackbar(this.t("seo_generate_failed","Couldn't generate. Please try again."))}finally{this.generatingField=""}}else this.snackbar(this.t("seo_generate_empty","Add some content to the page first."))},this.onPublish=()=>{this.loading||(this.commitDraftKeyword(),this.loading=!0,this.settle({seo:{title:this.title.trim(),description:this.description.trim(),keywords:[...this.keywordList]},busy:e=>{this.isConnected&&(this.loading=e)},done:this.dismiss}))},this.loading=!1,this.title="",this.description="",this.keywordList=[],this.keywordDraft="",this.keywordsFocused=!1,this.generatingField=""}static open(){const e=document.createElement("cdtr-publish-seo"),t=o.M.get("app","seo")||{};return e.title=t.title||"",e.description=t.description||"",e.keywordList=(Array.isArray(t.keywords)?t.keywords:String(t.keywords||"").split(",")).map(e=>String(e).trim()).filter(Boolean),document.body.appendChild(e),e.waitForChoice()}waitForChoice(){return new Promise(e=>{this.resolver=e})}t(e,t){return o.M.get("lang",e)||t}get direction(){const e=o.M.get("theme");return e?.direction||"rtl"}settle(e){this.resolver&&(this.resolver(e),this.resolver=null)}commitDraftKeyword(){const e=this.keywordDraft.split(",").map(e=>e.trim()).filter(Boolean);if(!e.length)return;const t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t,this.keywordDraft=""}removeKeyword(e){this.keywordList=this.keywordList.filter((t,i)=>i!==e)}snackbar(e){const t=o.M.get("commands");t?.snackbar?.(e)}async requestSeo(e,t,i){const s=async s=>{const o=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=l.Ay;if("function"==typeof t.studioTokenProvider)try{const i=await t.studioTokenProvider({forceRefresh:e});if("string"==typeof i&&i.length>0)return i}catch{}return"string"==typeof t.studioToken&&t.studioToken.length>0?t.studioToken:null}(s),n={"Content-Type":"application/json",Accept:"application/json"};return o&&(n.Authorization=`Bearer ${o}`),fetch(d,{method:"POST",headers:n,body:JSON.stringify({content:t,field:e,language:i})})};let o=await s(!1);if(401===o.status&&(o=await s(!0)),!o.ok)throw new Error(`HTTP ${o.status}`);const n=await o.json();if(!n.ok||void 0===n.value)throw new Error("bad response");return n.value}magicButton(e){const t=this.generatingField===e;return s.qy`
7
+ `;class u extends o.WF{constructor(){super(),this.resolver=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.onCancel=()=>{this.loading||(this.settle(null),this.dismiss())},this.onKeywordKeydown=e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),this.commitDraftKeyword()):"Backspace"===e.key&&""===this.keywordDraft&&this.keywordList.length&&(this.keywordList=this.keywordList.slice(0,-1))},this.generateField=async e=>{if(this.loading||this.generatingField)return;const t=function(){const e=document.getElementById("main-page-wrapper");return(e?.innerText||"").trim()}();if(t){this.generatingField=e;try{const i="rtl"===this.direction?"he":"en",o=await this.requestSeo(e,t,i);if("keywords"===e){const e=(Array.isArray(o)?o:String(o).split(",")).map(e=>e.trim()).filter(Boolean),t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t}else"title"===e?this.title=String(o).slice(0,100):this.description=String(o).slice(0,255)}catch(e){console.error("[seo-generate] failed:",e),this.snackbar(this.t("seo_generate_failed","Couldn't generate. Please try again."))}finally{this.generatingField=""}}else this.snackbar(this.t("seo_generate_empty","Add some content to the page first."))},this.onPublish=()=>{this.loading||(this.commitDraftKeyword(),this.loading=!0,this.settle({seo:{title:this.title.trim(),description:this.description.trim(),keywords:[...this.keywordList]},busy:e=>{this.isConnected&&(this.loading=e)},done:this.dismiss}))},this.loading=!1,this.title="",this.description="",this.keywordList=[],this.keywordDraft="",this.keywordsFocused=!1,this.generatingField=""}static open(){const e=document.createElement("cdtr-publish-seo"),t=s.M.get("app","seo")||{},i=function(){const e={title:"",description:""};if(!(0,c.zZ)())return e;const t=s.M.get(c.yS);if(!t||"string"!=typeof t.html)return e;try{const e=String(d.renderAiDoc(t,{scripts:!1})),i=(new DOMParser).parseFromString(e,"text/html");return{title:(i.title||"").trim(),description:(i.querySelector('meta[name="description"]')?.getAttribute("content")||"").trim()}}catch{return e}}();return e.title=t.title||i.title,e.description=t.description||i.description,e.keywordList=(Array.isArray(t.keywords)?t.keywords:String(t.keywords||"").split(",")).map(e=>String(e).trim()).filter(Boolean),document.body.appendChild(e),e.waitForChoice()}waitForChoice(){return new Promise(e=>{this.resolver=e})}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}settle(e){this.resolver&&(this.resolver(e),this.resolver=null)}commitDraftKeyword(){const e=this.keywordDraft.split(",").map(e=>e.trim()).filter(Boolean);if(!e.length)return;const t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t,this.keywordDraft=""}removeKeyword(e){this.keywordList=this.keywordList.filter((t,i)=>i!==e)}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}async requestSeo(e,t,i){const o=async o=>{const s=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=l.Ay;if("function"==typeof t.studioTokenProvider)try{const i=await t.studioTokenProvider({forceRefresh:e});if("string"==typeof i&&i.length>0)return i}catch{}return"string"==typeof t.studioToken&&t.studioToken.length>0?t.studioToken:null}(o),n={"Content-Type":"application/json",Accept:"application/json"};return s&&(n.Authorization=`Bearer ${s}`),fetch(p,{method:"POST",headers:n,body:JSON.stringify({content:t,field:e,language:i})})};let s=await o(!1);if(401===s.status&&(s=await o(!0)),!s.ok)throw new Error(`HTTP ${s.status}`);const n=await s.json();if(!n.ok||void 0===n.value)throw new Error("bad response");return n.value}magicButton(e){const t=this.generatingField===e;return o.qy`
8
8
  <button
9
9
  class="magic"
10
10
  type="button"
@@ -13,9 +13,9 @@
13
13
  ?disabled=${this.loading||!!this.generatingField}
14
14
  @click=${()=>this.generateField(e)}
15
15
  >
16
- ${t?s.qy`<span class="mini-spinner"></span>`:c}
16
+ ${t?o.qy`<span class="mini-spinner"></span>`:h}
17
17
  </button>
18
- `}render(){const e=this.direction;return s.qy`
18
+ `}render(){const e=this.direction;return o.qy`
19
19
  <div class="backdrop" @click=${this.onCancel}></div>
20
20
  <div class="card" dir=${e}>
21
21
  <h2 class="heading">${this.t("ready_to_publish","Ready to publish")}</h2>
@@ -63,7 +63,7 @@
63
63
  class="chips ${this.keywordsFocused?"focused":""}"
64
64
  @click=${e=>{const t=e.currentTarget.querySelector("input");t?.focus()}}
65
65
  >
66
- ${this.keywordList.map((e,t)=>s.qy`
66
+ ${this.keywordList.map((e,t)=>o.qy`
67
67
  <span class="chip">
68
68
  ${e}
69
69
  <button
@@ -90,14 +90,14 @@
90
90
 
91
91
  <div class="actions">
92
92
  <button class="publish" ?disabled=${this.loading} @click=${this.onPublish}>
93
- ${this.loading?s.qy`<span class="spinner"></span>`:this.t("publish","Publish")}
93
+ ${this.loading?o.qy`<span class="spinner"></span>`:this.t("publish","Publish")}
94
94
  </button>
95
95
  <button class="cancel" ?disabled=${this.loading} @click=${this.onCancel}>
96
96
  ${this.t("cancel","Cancel")}
97
97
  </button>
98
98
  </div>
99
99
  </div>
100
- `}}p.styles=s.AH`
100
+ `}}u.styles=o.AH`
101
101
  :host {
102
102
  position: fixed;
103
103
  inset: 0;
@@ -343,20 +343,20 @@
343
343
  @keyframes spin {
344
344
  to { transform: rotate(360deg); }
345
345
  }
346
- `,p.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",p);class h extends s.WF{constructor(){super(),this.raf=0,this.dismissTimer=null,this.onKeyDown=e=>{"Escape"===e.key&&this.dismiss()},this.dismiss=()=>{this.isConnected&&this.remove()},this.copyLink=async()=>{if(this.url)try{await navigator.clipboard.writeText(this.url),this.copied=!0,setTimeout(()=>this.copied=!1,2e3)}catch{}},this.message="",this.sub="",this.url="",this.seoTitle="",this.seoDescription="",this.copied=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeyDown)}firstUpdated(){this.launchConfetti(),this.dismissTimer=setTimeout(()=>this.dismiss(),6500)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),this.dismissTimer&&clearTimeout(this.dismissTimer),document.removeEventListener("keydown",this.onKeyDown)}t(e,t){return o.M.get("lang",e)||t}get direction(){const e=o.M.get("theme");return e?.direction||"rtl"}get host(){return this.url?this.url.replace(/^https?:\/\//,"").replace(/\/+$/,""):""}launchConfetti(){const e=this.renderRoot.querySelector("canvas");if(!e)return;const t=e.getContext("2d");if(!t)return;const i=window.devicePixelRatio||1,s=window.innerWidth,o=window.innerHeight;e.width=s*i,e.height=o*i,t.scale(i,i);const n=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],r=s/2,a=.42*o,l=Math.min(220,Math.round(s/6)),d=Array.from({length:l},(e,t)=>{const i=2*Math.PI*t/l+t%3*.4,s=4+t%9;return{x:r,y:a,vx:Math.cos(i)*s,vy:Math.sin(i)*s-3,size:5+t%5,color:n[t%n.length],rot:t,vrot:(t%2?1:-1)*(.1+t%5*.03),life:1}}),c=performance.now(),p=e=>{const i=e-c;t.clearRect(0,0,s,o);let n=!1;for(const e of d)e.vy+=.16,e.x+=e.vx,e.y+=e.vy,e.rot+=e.vrot,i>2600*.55&&(e.life=Math.max(0,e.life-.02)),e.life>0&&e.y<o+40&&(n=!0),t.save(),t.globalAlpha=e.life,t.translate(e.x,e.y),t.rotate(e.rot),t.fillStyle=e.color,t.fillRect(-e.size/2,-e.size/2,e.size,.6*e.size),t.restore();n&&i<3e3?this.raf=requestAnimationFrame(p):t.clearRect(0,0,s,o)};this.raf=requestAnimationFrame(p)}renderPreview(){const e=this.host;if(!e)return s.s6;const t=(this.seoTitle||"").trim()||(this.seoDescription?"":e),i=(this.seoDescription||"").trim(),o=(t||e).charAt(0);return s.qy`
346
+ `,u.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",u);class f extends o.WF{constructor(){super(),this.raf=0,this.onKeyDown=e=>{"Escape"===e.key&&this.dismiss()},this.dismiss=()=>{this.isConnected&&this.remove()},this.copyLink=async()=>{if(this.url)try{await navigator.clipboard.writeText(this.url),this.copied=!0,setTimeout(()=>this.copied=!1,2e3)}catch{}},this.message="",this.sub="",this.url="",this.seoTitle="",this.seoDescription="",this.copied=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeyDown)}firstUpdated(){this.launchConfetti()}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),document.removeEventListener("keydown",this.onKeyDown)}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}get host(){return this.url?this.url.replace(/^https?:\/\//,"").replace(/\/+$/,""):""}launchConfetti(){const e=this.renderRoot.querySelector("canvas");if(!e)return;const t=e.getContext("2d");if(!t)return;const i=window.devicePixelRatio||1,o=window.innerWidth,s=window.innerHeight;e.width=o*i,e.height=s*i,t.scale(i,i);const n=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],r=o/2,a=.42*s,l=Math.min(220,Math.round(o/6)),d=Array.from({length:l},(e,t)=>{const i=2*Math.PI*t/l+t%3*.4,o=4+t%9;return{x:r,y:a,vx:Math.cos(i)*o,vy:Math.sin(i)*o-3,size:5+t%5,color:n[t%n.length],rot:t,vrot:(t%2?1:-1)*(.1+t%5*.03),life:1}}),c=performance.now(),p=e=>{const i=e-c;t.clearRect(0,0,o,s);let n=!1;for(const e of d)e.vy+=.16,e.x+=e.vx,e.y+=e.vy,e.rot+=e.vrot,i>2600*.55&&(e.life=Math.max(0,e.life-.02)),e.life>0&&e.y<s+40&&(n=!0),t.save(),t.globalAlpha=e.life,t.translate(e.x,e.y),t.rotate(e.rot),t.fillStyle=e.color,t.fillRect(-e.size/2,-e.size/2,e.size,.6*e.size),t.restore();n&&i<3e3?this.raf=requestAnimationFrame(p):t.clearRect(0,0,o,s)};this.raf=requestAnimationFrame(p)}renderPreview(){const e=this.host;if(!e)return o.s6;const t=(this.seoTitle||"").trim()||(this.seoDescription?"":e),i=(this.seoDescription||"").trim(),s=(t||e).charAt(0);return o.qy`
347
347
  <div class="preview">
348
348
  <p class="preview-caption">${this.t("search_preview_label","How your page will look on Google")}</p>
349
349
  <div class="result-head">
350
- <span class="favicon">${o}</span>
350
+ <span class="favicon">${s}</span>
351
351
  <div class="result-url">
352
352
  <div class="result-host">${e.split("/")[0]}</div>
353
353
  <div class="result-crumb">${e}</div>
354
354
  </div>
355
355
  </div>
356
- ${t?s.qy`<p class="result-title">${t}</p>`:s.s6}
357
- ${i?s.qy`<p class="result-desc">${i}</p>`:s.s6}
356
+ ${t?o.qy`<p class="result-title">${t}</p>`:o.s6}
357
+ ${i?o.qy`<p class="result-desc">${i}</p>`:o.s6}
358
358
  </div>
359
- `}render(){const e=this.direction,t=this.copied?s.qy`<svg viewBox="0 0 24 24" fill="none"><path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" /></svg>`:s.qy`<svg viewBox="0 0 24 24" fill="none"><rect x="9" y="9" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>`;return s.qy`
359
+ `}render(){const e=this.direction,t=this.copied?o.qy`<svg viewBox="0 0 24 24" fill="none"><path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" /></svg>`:o.qy`<svg viewBox="0 0 24 24" fill="none"><rect x="9" y="9" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>`;return o.qy`
360
360
  <canvas @click=${this.dismiss}></canvas>
361
361
  <div class="card" dir=${e}>
362
362
  <button
@@ -378,7 +378,7 @@
378
378
 
379
379
  ${this.renderPreview()}
380
380
 
381
- ${this.url?s.qy`
381
+ ${this.url?o.qy`
382
382
  <div class="actions">
383
383
  <a class="view" href=${this.url} target="_blank" rel="noopener">
384
384
  <svg viewBox="0 0 24 24" fill="none"><path d="M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg>
@@ -389,9 +389,9 @@
389
389
  ${this.copied?this.t("link_copied","Link copied"):this.t("copy_link","Copy link")}
390
390
  </button>
391
391
  </div>
392
- `:s.s6}
392
+ `:o.s6}
393
393
  </div>
394
- `}}h.styles=s.AH`
394
+ `}}f.styles=o.AH`
395
395
  :host {
396
396
  position: fixed;
397
397
  inset: 0;
@@ -429,8 +429,8 @@
429
429
  transform: translate(-50%, -50%) scale(1);
430
430
  }
431
431
  }
432
- /* Manual dismiss. The card also auto-closes, but the confetti + preview
433
- invite lingering — the user needs a way out on their own terms.
432
+ /* The card never auto-closes (the user reads the preview and copies the
433
+ link at their own pace), so this is the way out.
434
434
  inset-inline-end so it lands top-left in the RTL card, top-right in LTR. */
435
435
  .close {
436
436
  position: absolute;
@@ -624,69 +624,69 @@
624
624
  width: 15px;
625
625
  height: 15px;
626
626
  }
627
- `,h.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",h);var u=i(19623),f=i(2285),g=i(69600);const b=l.Ay,x=e=>{if(!e.fix)return!1;let t=!1;for(const i of e.fix.patches){const e=o.M.get("components",i.id);e&&(b.store().execCommand2({transactions:[{key:i.key,value:i.value}],update:[e]}),t=!0)}return t},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(o.M.get("lang",e)||e).replace(/\{(\w+)\}/g,(e,i)=>null!=t[i]?String(t[i]):"")},y=e=>{const t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return t?"#"+t.slice(1,4).map(e=>Number(e).toString(16).padStart(2,"0")).join(""):e},w=e=>new Promise(t=>setTimeout(t,e)),v=()=>!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,k=e=>`${e.ruleId}|${e.elementIds.join(",")}`,$=e=>e.filter(e=>"error"===e.severity).length,_={"col-grid":"inbox","block-too-wide":"inbox","gmail-clip":"inbox","wider-than-container":"phone","fixed-without-max":"phone","cramped-columns":"phone"};class z extends s.WF{constructor(){super(),this.resolve=()=>{},this.htmlBytes=void 0,this.fixedTimer=void 0,this.findings=[],this.collapsed=!1,this.open={},this.fixing=new Set,this.fixedCount=0,this.analyzing=!1,this.stage="",this.stageCount=0,this.autoFixed=0,this.addEventListener("click",e=>{e.composedPath()[0]===this&&this.dismiss()}),this.onKeydown=this.onKeydown.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeydown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onKeydown)}onKeydown(e){"Escape"===e.key&&this.dismiss()}dismiss(){this.collapsed||this.stage||this.fixing.size>0||this.analyzing||this.resolve("edit")}get groups(){return(0,u.kG)(this.findings)}isOpen(e,t){return this.open[e.id]??0===t}toggle(e,t){this.open={...this.open,[e.id]:!this.isOpen(e,t)}}rerun(){this.findings=(0,u.JT)((0,f.D)(),{channel:(0,f.l)(),htmlBytes:this.htmlBytes})}async runFixes(e){!this.fixing.size&&e.length&&(this.fixing=new Set(e.map(k)),await w(v()?0:1100),e.forEach(x),await w(60),this.rerun(),this.fixing=new Set,this.fixedCount=e.reduce((e,t)=>e+t.count,0),clearTimeout(this.fixedTimer),this.fixedTimer=setTimeout(()=>this.fixedCount=0,2400))}fix(e){this.runFixes([e])}fixGroup(e){this.runFixes(e.items.filter(e=>e.fix))}show(e){this.collapsed=!0,(e=>{const t=o.M.get("components",e);t&&(b.clean().selectComponent(t),setTimeout(()=>{const t=document.querySelector(`[data-id="${CSS.escape(e)}"]`);if(!t)return;const i=t.closest(".amazingbar-content-wrapper");if(i){const e=i.getBoundingClientRect(),s=t.getBoundingClientRect();i.scrollTop+=s.top-e.top-(i.clientHeight-s.height)/2}else t.scrollIntoView({block:"center"})},300))})(e.elementIds[0]||e.elementId)}async analyze(e){this.analyzing=!0;try{const[t]=await Promise.all([e(),w(v()?0:600)]);this.findings=t.findings,void 0!==t.htmlBytes&&(this.htmlBytes=t.htmlBytes)}finally{this.analyzing=!1}}expand(){this.collapsed=!1,this.analyze(()=>({findings:(0,u.JT)((0,f.D)(),{channel:(0,f.l)(),htmlBytes:this.htmlBytes})}))}get canFixAndContinue(){const e=this.findings.filter(e=>"error"===e.severity);return e.length>0&&e.every(e=>e.fix)}async fixAndContinue(){const e=this.groups.flatMap(e=>e.items).filter(e=>"error"===e.severity&&e.fix);await this.runFixes(e),$(this.findings)||setTimeout(()=>this.resolve("continue"),v()?0:700)}renderSample(e){const t=e.message.params||{},i=e=>"string"==typeof e&&/^[#\w(),.%\s]+$/.test(e);return i(t.color)&&i(t.background)?s.qy`<div class="sample">
627
+ `,f.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",f);var g=i(30773),b=i(19623),x=i(2285),m=i(69600);const y=l.Ay,w=e=>{if(!e.fix)return!1;let t=!1;for(const i of e.fix.patches){const e=s.M.get("components",i.id);e&&(y.store().execCommand2({transactions:[{key:i.key,value:i.value}],update:[e]}),t=!0)}return t},v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(s.M.get("lang",e)||e).replace(/\{(\w+)\}/g,(e,i)=>null!=t[i]?String(t[i]):"")},k=e=>{const t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return t?"#"+t.slice(1,4).map(e=>Number(e).toString(16).padStart(2,"0")).join(""):e},$=e=>new Promise(t=>setTimeout(t,e)),_=()=>!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,z=e=>`${e.ruleId}|${e.elementIds.join(",")}`,S=e=>e.filter(e=>"error"===e.severity).length,C={"col-grid":"inbox","block-too-wide":"inbox","gmail-clip":"inbox","wider-than-container":"phone","fixed-without-max":"phone","cramped-columns":"phone"};class L extends o.WF{constructor(){super(),this.resolve=()=>{},this.htmlBytes=void 0,this.fixedTimer=void 0,this.findings=[],this.collapsed=!1,this.open={},this.fixing=new Set,this.fixedCount=0,this.analyzing=!1,this.stage="",this.stageCount=0,this.autoFixed=0,this.addEventListener("click",e=>{e.composedPath()[0]===this&&this.dismiss()}),this.onKeydown=this.onKeydown.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeydown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onKeydown)}onKeydown(e){"Escape"===e.key&&this.dismiss()}dismiss(){this.collapsed||this.stage||this.fixing.size>0||this.analyzing||this.resolve("edit")}get groups(){return(0,b.kG)(this.findings)}isOpen(e,t){return this.open[e.id]??0===t}toggle(e,t){this.open={...this.open,[e.id]:!this.isOpen(e,t)}}rerun(){this.findings=(0,b.JT)((0,x.D)(),{channel:(0,x.l)(),htmlBytes:this.htmlBytes})}async runFixes(e){!this.fixing.size&&e.length&&(this.fixing=new Set(e.map(z)),await $(_()?0:1100),e.forEach(w),await $(60),this.rerun(),this.fixing=new Set,this.fixedCount=e.reduce((e,t)=>e+t.count,0),clearTimeout(this.fixedTimer),this.fixedTimer=setTimeout(()=>this.fixedCount=0,2400))}fix(e){this.runFixes([e])}fixGroup(e){this.runFixes(e.items.filter(e=>e.fix))}show(e){this.collapsed=!0,(e=>{const t=s.M.get("components",e);t&&(y.clean().selectComponent(t),setTimeout(()=>{const t=document.querySelector(`[data-id="${CSS.escape(e)}"]`);if(!t)return;const i=t.closest(".amazingbar-content-wrapper");if(i){const e=i.getBoundingClientRect(),o=t.getBoundingClientRect();i.scrollTop+=o.top-e.top-(i.clientHeight-o.height)/2}else t.scrollIntoView({block:"center"})},300))})(e.elementIds[0]||e.elementId)}async analyze(e){this.analyzing=!0;try{const[t]=await Promise.all([e(),$(_()?0:600)]);this.findings=t.findings,void 0!==t.htmlBytes&&(this.htmlBytes=t.htmlBytes)}finally{this.analyzing=!1}}expand(){this.collapsed=!1,this.analyze(()=>({findings:(0,b.JT)((0,x.D)(),{channel:(0,x.l)(),htmlBytes:this.htmlBytes})}))}get canFixAndContinue(){const e=this.findings.filter(e=>"error"===e.severity);return e.length>0&&e.every(e=>e.fix)}async fixAndContinue(){const e=this.groups.flatMap(e=>e.items).filter(e=>"error"===e.severity&&e.fix);await this.runFixes(e),S(this.findings)||setTimeout(()=>this.resolve("continue"),_()?0:700)}renderSample(e){const t=e.message.params||{},i=e=>"string"==typeof e&&/^[#\w(),.%\s]+$/.test(e);return i(t.color)&&i(t.background)?o.qy`<div class="sample">
628
628
  <b style="color:${t.color};background:${t.background}">Aa אב</b>
629
- <code dir="ltr">${y(String(t.color))} / ${y(String(t.background))}</code>
630
- </div>`:null}renderOnlyShows(e){const t=_[e.ruleId];if(!t)return null;const i="phone"===t?s.qy`<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="7" y="2" width="10" height="20" rx="2" /><path d="M11 18h2" /></svg>`:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="5" width="18" height="14" rx="2" /><path d="m3 7 9 6 9-6" /></svg>`;return s.qy`<span class="only-shows" title=${m("preflight_only_shows_hint")}>${i}${m(`preflight_only_${t}`)}</span>`}renderStage(){const e=this.stageCount,t="checking"===this.stage?s.qy`<span class="spark" aria-hidden="true">✦</span><div><b>${m("preflight_checking")}</b></div>`:"fixing"===this.stage?s.qy`<span class="spark" aria-hidden="true">✦</span><div>
631
- <b>${m("preflight_found_breaking",{count:e})}</b><small>${m("preflight_fixing_breaking")}</small></div>`:s.qy`<span class="ok" aria-hidden="true">✓</span><div><b>${m("preflight_fixed_breaking",{count:e})}</b></div>`;return s.qy`<div class="pop" role="status" aria-live="polite">${t}</div>`}renderAnalyzing(){return s.qy`<div class="card" role="dialog" aria-modal="true" aria-labelledby="pf-title" aria-busy="true">
629
+ <code dir="ltr">${k(String(t.color))} / ${k(String(t.background))}</code>
630
+ </div>`:null}renderOnlyShows(e){const t=C[e.ruleId];if(!t)return null;const i="phone"===t?o.qy`<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="7" y="2" width="10" height="20" rx="2" /><path d="M11 18h2" /></svg>`:o.qy`<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="5" width="18" height="14" rx="2" /><path d="m3 7 9 6 9-6" /></svg>`;return o.qy`<span class="only-shows" title=${v("preflight_only_shows_hint")}>${i}${v(`preflight_only_${t}`)}</span>`}renderStage(){const e=this.stageCount,t="checking"===this.stage?o.qy`<span class="spark" aria-hidden="true">✦</span><div><b>${v("preflight_checking")}</b></div>`:"fixing"===this.stage?o.qy`<span class="spark" aria-hidden="true">✦</span><div>
631
+ <b>${v("preflight_found_breaking",{count:e})}</b><small>${v("preflight_fixing_breaking")}</small></div>`:o.qy`<span class="ok" aria-hidden="true">✓</span><div><b>${v("preflight_fixed_breaking",{count:e})}</b></div>`;return o.qy`<div class="pop" role="status" aria-live="polite">${t}</div>`}renderAnalyzing(){return o.qy`<div class="card" role="dialog" aria-modal="true" aria-labelledby="pf-title" aria-busy="true">
632
632
  <header>
633
633
  <div>
634
- <h2 id="pf-title">${m("preflight_title")}</h2>
635
- <p class="ai-note">${m("preflight_ai_note")}</p>
634
+ <h2 id="pf-title">${v("preflight_title")}</h2>
635
+ <p class="ai-note">${v("preflight_ai_note")}</p>
636
636
  </div>
637
637
  </header>
638
638
  <div class="analyzing" role="status">
639
- <span class="spark" aria-hidden="true">✦</span>${m("preflight_analyzing")}
639
+ <span class="spark" aria-hidden="true">✦</span>${v("preflight_analyzing")}
640
640
  </div>
641
641
  <div class="groups">
642
- ${[0,1,2].map(()=>s.qy`<div class="skeleton"></div>`)}
642
+ ${[0,1,2].map(()=>o.qy`<div class="skeleton"></div>`)}
643
643
  </div>
644
644
  <footer>
645
- <button @click=${()=>this.resolve("edit")}>${m("preflight_back")}</button>
645
+ <button @click=${()=>this.resolve("edit")}>${v("preflight_back")}</button>
646
646
  </footer>
647
- </div>`}renderGroup(e,t){const i=this.isOpen(e,t),o=e.items.filter(e=>e.fix);return s.qy`<section class=${e.id} ?data-open=${i}>
647
+ </div>`}renderGroup(e,t){const i=this.isOpen(e,t),s=e.items.filter(e=>e.fix);return o.qy`<section class=${e.id} ?data-open=${i}>
648
648
  <div class="head" role="button" tabindex="0" aria-expanded=${i?"true":"false"}
649
649
  @click=${()=>this.toggle(e,t)}
650
650
  @keydown=${i=>("Enter"===i.key||" "===i.key)&&(i.preventDefault(),this.toggle(e,t))}>
651
651
  <span class="chev">▸</span>
652
- <h3>${m(`preflight_group_${e.id}`)}</h3>
652
+ <h3>${v(`preflight_group_${e.id}`)}</h3>
653
653
  <span class="badge">${e.items.reduce((e,t)=>e+t.count,0)}</span>
654
- ${o.length?s.qy`<button class="fix-all" ?disabled=${this.fixing.size>0}
654
+ ${s.length?o.qy`<button class="fix-all" ?disabled=${this.fixing.size>0}
655
655
  @click=${t=>{t.stopPropagation(),this.fixGroup(e)}}>
656
- ${o.some(e=>this.fixing.has(k(e)))?s.qy`<span class="spark" aria-hidden="true">✦</span> ${m("preflight_fixing")}`:m("preflight_fix_group",{count:o.reduce((e,t)=>e+t.count,0)})}
656
+ ${s.some(e=>this.fixing.has(z(e)))?o.qy`<span class="spark" aria-hidden="true">✦</span> ${v("preflight_fixing")}`:v("preflight_fix_group",{count:s.reduce((e,t)=>e+t.count,0)})}
657
657
  </button>`:null}
658
658
  </div>
659
- ${i?s.qy`<ul>
660
- ${e.items.map(e=>s.qy`<li class=${this.fixing.has(k(e))?"fixing":""}>
661
- <span class="text">${m(e.message.key,e.message.params||{})}${e.count>1?s.qy` <bdi class="times">×${e.count}</bdi>`:null}${this.renderSample(e)}${this.renderOnlyShows(e)}</span>
662
- <button @click=${()=>this.show(e)}>${m("preflight_show")}</button>
663
- ${e.fix?s.qy`<button ?disabled=${this.fixing.size>0} @click=${()=>this.fix(e)}>
664
- ${this.fixing.has(k(e))?s.qy`<span class="spark" aria-hidden="true">✦</span>`:null}${m(e.fix.label)}
659
+ ${i?o.qy`<ul>
660
+ ${e.items.map(e=>o.qy`<li class=${this.fixing.has(z(e))?"fixing":""}>
661
+ <span class="text">${v(e.message.key,e.message.params||{})}${e.count>1?o.qy` <bdi class="times">×${e.count}</bdi>`:null}${this.renderSample(e)}${this.renderOnlyShows(e)}</span>
662
+ <button @click=${()=>this.show(e)}>${v("preflight_show")}</button>
663
+ ${e.fix?o.qy`<button ?disabled=${this.fixing.size>0} @click=${()=>this.fix(e)}>
664
+ ${this.fixing.has(z(e))?o.qy`<span class="spark" aria-hidden="true">✦</span>`:null}${v(e.fix.label)}
665
665
  </button>`:null}
666
666
  </li>`)}
667
667
  </ul>`:null}
668
- </section>`}render(){const e=this.findings.length;if(this.collapsed)return s.qy`<button class="primary" @click=${this.expand}>${m("preflight_title")} (${e})</button>`;if(this.stage)return this.renderStage();if(this.analyzing)return this.renderAnalyzing();const t=$(this.findings);let i;return i=t?this.canFixAndContinue?s.qy`<button class="primary" ?disabled=${this.fixing.size>0} @click=${this.fixAndContinue}>
669
- ${this.fixing.size?s.qy`<span class="spark" aria-hidden="true">✦</span> ${m("preflight_fixing")}`:m("preflight_fix_and_continue")}
670
- </button>`:s.qy`<button class="primary" @click=${()=>this.resolve("continue")}>${m("preflight_continue_anyway")}</button>`:s.qy`<button class="primary" @click=${()=>this.resolve("continue")}>${m("preflight_continue")}</button>`,s.qy`<div class="card" role="dialog" aria-modal="true" aria-labelledby="pf-title">
668
+ </section>`}render(){const e=this.findings.length;if(this.collapsed)return o.qy`<button class="primary" @click=${this.expand}>${v("preflight_title")} (${e})</button>`;if(this.stage)return this.renderStage();if(this.analyzing)return this.renderAnalyzing();const t=S(this.findings);let i;return i=t?this.canFixAndContinue?o.qy`<button class="primary" ?disabled=${this.fixing.size>0} @click=${this.fixAndContinue}>
669
+ ${this.fixing.size?o.qy`<span class="spark" aria-hidden="true">✦</span> ${v("preflight_fixing")}`:v("preflight_fix_and_continue")}
670
+ </button>`:o.qy`<button class="primary" @click=${()=>this.resolve("continue")}>${v("preflight_continue_anyway")}</button>`:o.qy`<button class="primary" @click=${()=>this.resolve("continue")}>${v("preflight_continue")}</button>`,o.qy`<div class="card" role="dialog" aria-modal="true" aria-labelledby="pf-title">
671
671
  <header>
672
672
  <div>
673
- <h2 id="pf-title">${m("preflight_title")}</h2>
674
- <p class="ai-note">${m("preflight_ai_note")}</p>
673
+ <h2 id="pf-title">${v("preflight_title")}</h2>
674
+ <p class="ai-note">${v("preflight_ai_note")}</p>
675
675
  </div>
676
676
  <span class="summary ${t?"bad":""}">
677
- ${t?m("preflight_must_fix",{count:t}):m("preflight_nothing_must_fix")}
677
+ ${t?v("preflight_must_fix",{count:t}):v("preflight_nothing_must_fix")}
678
678
  </span>
679
679
  </header>
680
- ${this.autoFixed?s.qy`<div class="auto-note">✨ ${m("preflight_auto_fixed",{count:this.autoFixed})}</div>`:null}
681
- ${this.fixedCount?s.qy`<div class="fixed-note" role="status">✨ ${m("preflight_fixed_count",{count:this.fixedCount})}</div>`:null}
680
+ ${this.autoFixed?o.qy`<div class="auto-note">✨ ${v("preflight_auto_fixed",{count:this.autoFixed})}</div>`:null}
681
+ ${this.fixedCount?o.qy`<div class="fixed-note" role="status">✨ ${v("preflight_fixed_count",{count:this.fixedCount})}</div>`:null}
682
682
  <div class="groups">
683
- ${this.findings.length?this.groups.map((e,t)=>this.renderGroup(e,t)):s.qy`<p class="all-good">✓ ${m("preflight_all_good")}</p>`}
683
+ ${this.findings.length?this.groups.map((e,t)=>this.renderGroup(e,t)):o.qy`<p class="all-good">✓ ${v("preflight_all_good")}</p>`}
684
684
  </div>
685
685
  <footer>
686
- <button @click=${()=>this.resolve("edit")}>${m("preflight_back")}</button>
686
+ <button @click=${()=>this.resolve("edit")}>${v("preflight_back")}</button>
687
687
  ${i}
688
688
  </footer>
689
- </div>`}}z.properties={findings:{attribute:!1},collapsed:{type:Boolean,reflect:!0},open:{attribute:!1},fixing:{attribute:!1},fixedCount:{attribute:!1},analyzing:{attribute:!1},stage:{type:String,reflect:!0},stageCount:{attribute:!1},autoFixed:{attribute:!1}},z.styles=s.AH`
689
+ </div>`}}L.properties={findings:{attribute:!1},collapsed:{type:Boolean,reflect:!0},open:{attribute:!1},fixing:{attribute:!1},fixedCount:{attribute:!1},analyzing:{attribute:!1},stage:{type:String,reflect:!0},stageCount:{attribute:!1},autoFixed:{attribute:!1}},L.styles=o.AH`
690
690
  :host { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(15 23 42 / 0.35); font: 14px/1.5 system-ui, sans-serif; color: #0f172a; }
691
691
  :host([stage]:not([stage=""])) { inset: auto; display: block; background: none; }
692
692
  .pop { width: 290px; padding: 14px 16px; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
@@ -755,21 +755,22 @@
755
755
  animation: shimmer 1.1s ease-in-out infinite; }
756
756
  @media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
757
757
  footer { padding: 14px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #eef0f3; flex-wrap: wrap; }
758
- `,customElements.get("cdtr-preflight")||customElements.define("cdtr-preflight",z);const C={check:(e,t)=>new Promise((i,s)=>{const n=document.createElement("cdtr-preflight");n.dir=(()=>{const e=o.M.get("theme");if("rtl"===e?.direction||"ltr"===e?.direction)return e.direction;const t=getComputedStyle(document.documentElement).getPropertyValue("--direction-locale").trim();if("rtl"===t||"ltr"===t)return t;const i=String(o.M.get("config","language")||"");return/^(he|ar|fa|ur)/i.test(i)?"rtl":"ltr"})(),n.style.zIndex=String(Number((0,g.A)())+10);(()=>{const t=e.getBoundingClientRect();n.style.top=`${Math.round(t.bottom+8)}px`;const i="rtl"===n.dir?t.left:t.right-290;n.style.left=`${Math.max(8,Math.min(Math.round(i),window.innerWidth-298))}px`})(),n.stage="checking",n.resolve=e=>{n.remove(),i(e)},document.body.appendChild(n);const r=e=>w(v()?0:e);(async()=>{const[e]=await Promise.all([t(),r(700)]);n.htmlBytes=e.htmlBytes;let i=e.findings;const s=(e=>e.filter(e=>e.fix&&_[e.ruleId]))(i);s.length&&(n.stageCount=s.length,n.stage="fixing",await r(1200),s.forEach(x),await w(60),i=(0,u.JT)((0,f.D)(),{channel:(0,f.l)(),htmlBytes:n.htmlBytes}),n.stage="fixed",await r(900)),i.length?(n.findings=i,n.autoFixed=s.length,n.style.top=n.style.left="",n.stage=""):n.resolve("continue")})().catch(e=>{n.remove(),s(e)})})};const S="creaditor:publish",L="creaditor:publish-error",T=async()=>{const e=(0,f.l)(),t=await async function(e){if("newsletter"===e)try{const e=await Promise.race([(0,n.FE)("newsletter"),new Promise(e=>setTimeout(()=>e(void 0),8e3))]);return"string"==typeof e?new Blob([e]).size:void 0}catch{return}}(e);return{findings:(0,u.JT)((0,f.D)(),{channel:e,htmlBytes:t}),htmlBytes:t}};class P extends s.WF{constructor(){super(),this.preflightOpen=!1,this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),this.onNextStep||(this.onNextStep=o.M.get("config","onNextStep")),this.onPublish||(this.onPublish=o.M.get("config","onPublish")),this.channel||(this.channel=o.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async onNextClick(){if(this.isLocked||this.isLoading)return;if(this.preflightOpen)return void document.querySelector("cdtr-preflight")?.expand?.();if("newsletter"!==(0,f.l)())return this.handleClick();let e="continue";this.preflightOpen=!0;try{e=await C.check(this,T)}catch(t){console.warn("[preflight] checks failed",t),e="continue"}finally{this.preflightOpen=!1}"continue"===e&&await this.handleClick()}async handleClick(){if(this.isLocked||this.isLoading)return;document.querySelector("cdtr-preflight")?.resolve?.("edit");const e=!!o.M.get("config","access"),t="web"===this.channel,i=e&&t;let s=null;if(t&&(s=await p.open(),!s))return;const a=s?s.seo:null;this.isLoading=!0,this.isLocked=!0;const l=Date.now();this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{if(t&&s){let e=!1;try{i&&a&&(await(0,r.YE)({seo:a}),await(0,r.bK)({})),"function"==typeof this.onPublish?e=await this.runHostPublish(this.onPublish,a,i,s):"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:n.FE,toJSON:n.U2,seo:a??void 0})}finally{s.done()}return void(e||(this.emitPublished(i,a),this.celebratePublish(a)))}const e=o.M.get("config","editor","props","onSave"),l=Date.now();"function"==typeof e&&await e({transactions:[],toJson:n.U2,toJSON:n.U2,toHTML:n.FE});const d=Date.now()-l;d<3e3&&await new Promise(e=>setTimeout(e,3e3-d)),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:n.FE,toJSON:n.U2}),this.emitPublished(i,a)}catch(e){console.error("Error in publish/onNextStep:",e),this.emitPublishError(i,a,e),this.snackbar(o.M.get("lang","publishError")||"Publish failed")}finally{const e=Date.now()-l;e<400&&await new Promise(t=>setTimeout(t,400-e)),this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}runHostPublish(e,t,i,s){return new Promise(a=>{let l=!1;const d=(e,n,r)=>{l||(l=!0,clearTimeout(c),s.done(),e?(this.celebratePublish(t),this.emitPublished(i,t)):(this.snackbar(r||o.M.get("lang","publishError")||"Publish failed"),this.emitPublishError(i,t,n)),a(!0))},c=setTimeout(()=>{l||(console.warn("config.onPublish never signalled completion — finishing the publish without it. Call success() or error() (or return a promise) so the modal can come down."),l=!0,s.done(),a(!1))},6e4),p={title:t.title,description:t.description,keywords:t.keywords},h={loading:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return s.busy(e)},success:()=>d(!0),confetti:()=>d(!0),error:e=>d(!1,new Error(e||"host publish failed"),e),commands:{patchSite:e=>(0,r.YE)(e??{}),publishSite:e=>(0,r.bK)(e??{}),toHTML:n.FE,toJSON:n.U2}};let u;try{u=e(p,h)}catch(e){return console.error("Error in config.onPublish:",e),void d(!1,e)}u&&"function"==typeof u.then&&Promise.resolve(u).then(()=>d(!0),e=>{console.error("Error in config.onPublish:",e),d(!1,e)})})}snackbar(e){const t=o.M.get("commands");t?.snackbar?.(e)}siteUrl(){const e=o.M.get("app","domains"),t=e?.[0]?.name;if(t)return/^https?:\/\//.test(t)?t:`https://${t}`}emitPublished(e,t){const i={channel:this.channel,selfPublish:e,seo:t??void 0,url:this.siteUrl(),toHTML:n.FE,toJSON:n.U2};window.dispatchEvent(new CustomEvent(S,{detail:i}))}emitPublishError(e,t,i){const s={channel:this.channel,selfPublish:e,seo:t??void 0,error:i};window.dispatchEvent(new CustomEvent(L,{detail:s}))}celebratePublish(e){const t=document.createElement("cdtr-publish-success");e&&(t.seoTitle=e.title,t.seoDescription=e.description);const i=this.siteUrl();i&&(t.url=i),document.body.appendChild(t)}render(){const e=!!o.M.get("config","access");if(!(this.onNextStep||"function"==typeof this.onPublish||"web"===this.channel&&e))return null;const t="web"===this.channel?"publish":"next";return s.qy`
758
+ `,customElements.get("cdtr-preflight")||customElements.define("cdtr-preflight",L);const P={check:(e,t)=>new Promise((i,o)=>{const n=document.createElement("cdtr-preflight");n.dir=(()=>{const e=s.M.get("theme");if("rtl"===e?.direction||"ltr"===e?.direction)return e.direction;const t=getComputedStyle(document.documentElement).getPropertyValue("--direction-locale").trim();if("rtl"===t||"ltr"===t)return t;const i=String(s.M.get("config","language")||"");return/^(he|ar|fa|ur)/i.test(i)?"rtl":"ltr"})(),n.style.zIndex=String(Number((0,m.A)())+10);(()=>{const t=e.getBoundingClientRect();n.style.top=`${Math.round(t.bottom+8)}px`;const i="rtl"===n.dir?t.left:t.right-290;n.style.left=`${Math.max(8,Math.min(Math.round(i),window.innerWidth-298))}px`})(),n.stage="checking",n.resolve=e=>{n.remove(),i(e)},document.body.appendChild(n);const r=e=>$(_()?0:e);(async()=>{const[e]=await Promise.all([t(),r(700)]);n.htmlBytes=e.htmlBytes;let i=e.findings;const o=(e=>e.filter(e=>e.fix&&C[e.ruleId]))(i);o.length&&(n.stageCount=o.length,n.stage="fixing",await r(1200),o.forEach(w),await $(60),i=(0,b.JT)((0,x.D)(),{channel:(0,x.l)(),htmlBytes:n.htmlBytes}),n.stage="fixed",await r(900)),i.length?(n.findings=i,n.autoFixed=o.length,n.style.top=n.style.left="",n.stage=""):n.resolve("continue")})().catch(e=>{n.remove(),o(e)})})};const T="creaditor:publish",E="creaditor:publish-error",q=async()=>{const e=(0,x.l)(),t=await async function(e){if("newsletter"===e)try{const e=await Promise.race([(0,n.FE)("newsletter"),new Promise(e=>setTimeout(()=>e(void 0),8e3))]);return"string"==typeof e?new Blob([e]).size:void 0}catch{return}}(e);return{findings:(0,b.JT)((0,x.D)(),{channel:e,htmlBytes:t}),htmlBytes:t}};class B extends o.WF{constructor(){super(),this._onAiActivity=e=>{this.aiBusy="thinking"===e.detail?.state},this.preflightOpen=!1,this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),window.addEventListener(g.bm,this._onAiActivity),this.onNextStep||(this.onNextStep=s.M.get("config","onNextStep")),this.onPublish||(this.onPublish=s.M.get("config","onPublish")),this.channel||(this.channel=s.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(g.bm,this._onAiActivity),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async onNextClick(){if(this.isLocked||this.isLoading)return;if(this.preflightOpen)return void document.querySelector("cdtr-preflight")?.expand?.();if("newsletter"!==(0,x.l)())return this.handleClick();let e="continue";this.preflightOpen=!0;try{e=await P.check(this,q)}catch(t){console.warn("[preflight] checks failed",t),e="continue"}finally{this.preflightOpen=!1}"continue"===e&&await this.handleClick()}async handleClick(){if(this.isLocked||this.isLoading||this.aiBusy)return;document.querySelector("cdtr-preflight")?.resolve?.("edit");const e=!!s.M.get("config","access"),t="web"===this.channel,i=e&&t;let o=null;if(t&&(o=await u.open(),!o))return;const a=o?o.seo:null;this.isLoading=!0,this.isLocked=!0;const l=Date.now();this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{if(t&&o){let e=!1;try{i&&a&&(await(0,r.YE)({seo:a}),await(0,r.bK)({})),"function"==typeof this.onPublish?e=await this.runHostPublish(this.onPublish,a,i,o):"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:n.FE,toJSON:n.U2,seo:a??void 0})}finally{o.done()}return void(e||(this.emitPublished(i,a),this.celebratePublish(a)))}const e=s.M.get("config","editor","props","onSave"),l=Date.now();"function"==typeof e&&await e({transactions:[],toJson:n.U2,toJSON:n.U2,toHTML:n.FE});const d=Date.now()-l;d<3e3&&await new Promise(e=>setTimeout(e,3e3-d)),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:n.FE,toJSON:n.U2}),this.emitPublished(i,a)}catch(e){console.error("Error in publish/onNextStep:",e),this.emitPublishError(i,a,e),this.snackbar(s.M.get("lang","publishError")||"Publish failed")}finally{const e=Date.now()-l;e<400&&await new Promise(t=>setTimeout(t,400-e)),this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}runHostPublish(e,t,i,o){return new Promise(a=>{let l=!1;const d=(e,n,r)=>{l||(l=!0,clearTimeout(c),o.done(),e?(this.celebratePublish(t),this.emitPublished(i,t)):(this.snackbar(r||s.M.get("lang","publishError")||"Publish failed"),this.emitPublishError(i,t,n)),a(!0))},c=setTimeout(()=>{l||(console.warn("config.onPublish never signalled completion — finishing the publish without it. Call success() or error() (or return a promise) so the modal can come down."),l=!0,o.done(),a(!1))},6e4),p={title:t.title,description:t.description,keywords:t.keywords},h={loading:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return o.busy(e)},success:()=>d(!0),confetti:()=>d(!0),error:e=>d(!1,new Error(e||"host publish failed"),e),commands:{patchSite:e=>(0,r.YE)(e??{}),publishSite:e=>(0,r.bK)(e??{}),toHTML:n.FE,toJSON:n.U2}};let u;try{u=e(p,h)}catch(e){return console.error("Error in config.onPublish:",e),void d(!1,e)}u&&"function"==typeof u.then&&Promise.resolve(u).then(()=>d(!0),e=>{console.error("Error in config.onPublish:",e),d(!1,e)})})}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}siteUrl(){const e=s.M.get("app","domains"),t=e?.[0]?.name;if(t)return/^https?:\/\//.test(t)?t:`https://${t}`}emitPublished(e,t){const i={channel:this.channel,selfPublish:e,seo:t??void 0,url:this.siteUrl(),toHTML:n.FE,toJSON:n.U2};window.dispatchEvent(new CustomEvent(T,{detail:i}))}emitPublishError(e,t,i){const o={channel:this.channel,selfPublish:e,seo:t??void 0,error:i};window.dispatchEvent(new CustomEvent(E,{detail:o}))}celebratePublish(e){const t=document.createElement("cdtr-publish-success");e&&(t.seoTitle=e.title,t.seoDescription=e.description);const i=this.siteUrl();i&&(t.url=i),document.body.appendChild(t)}render(){const e=!!s.M.get("config","access");if(!(this.onNextStep||"function"==typeof this.onPublish||"web"===this.channel&&e))return null;const t="web"===this.channel?"publish":"next";return o.qy`
759
759
  <paper-button
760
760
  @click=${this.onNextClick}
761
761
  class="next-button"
762
- ?disabled=${this.isLocked}
762
+ ?disabled=${this.isLocked||this.aiBusy}
763
+ style=${this.aiBusy?"opacity:.4;pointer-events:none;transition:opacity .2s ease;":""}
763
764
  >
764
- ${this.isLoading?s.qy`
765
+ ${this.isLoading?o.qy`
765
766
  <div class="loading-spinner"></div>
766
- `:s.qy`
767
+ `:o.qy`
767
768
  <div class="button-content ${this.isLoading?"loading":""}">
768
769
  <lang-text text=${t}></lang-text>
769
770
  </div>
770
771
  `}
771
772
  </paper-button>
772
- `}}P.styles=s.AH`
773
+ `}}B.styles=o.AH`
773
774
  :host {
774
775
  display: block;
775
776
  }
@@ -820,4 +821,4 @@
820
821
  opacity: 0;
821
822
  }
822
823
 
823
- `,P.properties={onNextStep:{type:Function},onPublish:{type:Function},channel:{type:String},isLoading:{type:Boolean},isLocked:{type:Boolean},lockTimer:{type:Number}},customElements.define("cdtr-next-button",P)}}]);
824
+ `,B.properties={onNextStep:{type:Function},onPublish:{type:Function},channel:{type:String},isLoading:{type:Boolean},isLocked:{type:Boolean},aiBusy:{type:Boolean},lockTimer:{type:Number}},customElements.define("cdtr-next-button",B)}}]);
Binary file
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[6151],{36151(e,n,t){t.d(n,{default:()=>w});let a=!0;const o=e=>{{const{component:n,commands:t,helpers:o}=e,i=n.parent("col"),r=e=>"style"===e.text;return{select:e=>{let{changeTab:n,tab:t}=e;t.text||n("style")},tabs:e=>{const n=[{text:"style",selected:!0},{text:"interactions"},{text:"settings"}];return e?(n.forEach(n=>n.selected=n.text===e),n):n},layout:e=>{const{tab:o,changeTab:s,tabs:l}=e;return[{type:"heading",level:6,text:"image",active:()=>r(o)},{type:"gallery",active:()=>r(o),src:n.props.src,hasPreview:!0,previewWidth:n.props.style?.width,text:"openGalleryImage",justify:"flex-start",onChange:e=>{let n=e.detail;Array.isArray(n)&&(n=n[0]),t.execCommand("src",n.src)}},{type:"input",title:"altText",active:()=>r(o),value:n.props.alt||"",onChange:e=>{const n=e.target.value;t.execCommand("alt",n)}},{type:"input",title:"add_urlAddress_from_media_site",active:()=>r(o),value:n.props.src||"",onChange:e=>{const n=e.target.value;t.execCommand("src",n)}},{type:"checkbox",title:"fullWidthOnMobile",checked:!!n.props.isFullWidthOnMobile,active:()=>r(o),onChange:e=>{const n=e.target.checked;t.execCommand("isFullWidthOnMobile",n)}},{type:"heading",level:6,text:"size",active:()=>r(o)},{type:"checkbox",title:"keep_ratio",checked:!!a,active:()=>r(o),onChange:e=>{a=!a,s("style")}},{type:"slider",min:10,title:"size",active:()=>r(o)&&a,max:a?1e3:i?.element?.offsetWidth,value:parseInt(n.props.style.width),onInput:e=>{const n=e.target.value;t.execCommand("style",{width:n+"px",height:"auto"})}},{type:"slider",min:10,title:"width",active:()=>r(o)&&!a,max:a?1e3:i?.element?.offsetWidth,value:parseInt(n.props.style.width),onInput:e=>{const a=e.target.value,o=n.atomElement.getBoundingClientRect().height;t.execCommand("style",{width:a+"px",height:o+"px"})}},{type:"slider",min:10,title:"height",active:()=>r(o)&&!a,max:2*i?.element?.offsetWidth,value:parseInt(n.props.style.height),onInput:e=>{const a=e.target.value,o=n.atomElement.getBoundingClientRect().width;t.execCommand("style",{height:a+"px",width:o+"px"})}},{type:"heading",level:6,text:"border_design",active:()=>r(o)},{type:"radius",title:"radius",active:()=>r(o),min:0,max:parseInt(n.props.style.width)/2,value:parseInt(n.props.style.borderRadius),elementId:n.id,borderTopRightRadius:parseInt(n.props.style.borderTopRightRadius),borderTopLeftRadius:parseInt(n.props.style.borderTopLeftRadius),borderBottomRightRadius:parseInt(n.props.style.borderBottomRightRadius),borderBottomLeftRadius:parseInt(n.props.style.borderBottomLeftRadius),onInput:e=>{const n=e.target.json;t.execCommand("style",{borderTopRightRadius:n.borderTopRightRadius+"px",borderTopLeftRadius:n.borderTopLeftRadius+"px",borderBottomRightRadius:n.borderBottomRightRadius+"px",borderBottomLeftRadius:n.borderBottomLeftRadius+"px",borderRadius:null})}},{type:"heading",level:6,text:"alignment",active:()=>r(o)},{type:"dropdown",title:"horizontal_align",active:()=>r(o),value:"auto"===n.props.style.marginLeft&&"auto"===n.props.style.marginRight?"center":"auto"===n.props.style.marginLeft?"right":"left",items:[{value:"left",label:"left"},{value:"center",label:"center"},{value:"right",label:"right"}],onChange:e=>{const n=e.target.value,a={marginLeft:null,marginRight:null};"center"===n?(a.marginLeft="auto",a.marginRight="auto"):"right"===n?(a.marginLeft="auto",a.marginRight="0"):(a.marginLeft="0",a.marginRight="auto"),t.execCommand("style",a)}},{type:"dropdown",title:"vertical_align",active:()=>r(o),value:n.props.style.verticalAlign||"top",items:[{value:"top",label:"top"},{value:"middle",label:"middle"},{value:"bottom",label:"bottom"}],onChange:e=>{const n=e.target.value;t.execCommand("style",{verticalAlign:n})}},{type:"heading",level:6,text:"ai",active:()=>r(o)},{type:"imagePrompt",active:()=>r(o),onChange:e=>{e.target.value}},{type:"heading",level:6,text:"link",active:()=>"interactions"===o.text},{type:"linkpicker",href:n.props.onClick?.link,protocol:n.props.onClick?.link?.protocol,target:n.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===o.text,onChange:e=>{const n={link:e.target.value};t.execCommand("onClick",n)}}]}}}};var i=t(52144);const r=()=>({set:(e,n,t)=>{switch(n){case"src":case"isFullWidthOnMobile":case"isOpenWithModal":case"isCircle":case"alt":case"onClick":return e[n]=t,!0;case"style":if("object"==typeof t)return e[n]=(0,i.A)(e[n],t),!0}}});var s=t(72591),l=t.n(s),A=t(88639),d=t.n(A),p=t(88128),c=t.n(p),m=t(30855),g=t.n(m),u=t(93051),h=t.n(u),C=t(98481),E={};E.setAttributes=g(),E.insert=c().bind(null,"head"),E.domAPI=d(),E.insertStyleElement=h();l()(C.A,E);const v=C.A&&C.A.locals?C.A.locals:void 0;function b(e){const n=document.createElement("div");n.className=v.wrapper;const t=document.createElement("div");t.className=v.skeleton;const a=document.createElement("div");a.className=v.shimmer,t.appendChild(a);const o=document.createElement("div");o.className=v.scanline,t.appendChild(o);const i=document.createElement("div");i.className=v.imageContainer,i.appendChild(e);let r=!1;function s(){if(!r)return;r=!1,n.classList.remove(v.loading),n.classList.add(v.revealed),e.classList.remove(v.imageHidden),e.classList.add(v.imageRevealed);const t=()=>{n.classList.remove(v.revealed),e.classList.remove(v.imageRevealed),e.removeEventListener("animationend",t)};e.addEventListener("animationend",t)}return e.addEventListener("load",s),e.addEventListener("error",s),{wrapper:n,showLoader:function(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||e.src&&!e.complete)&&(r=!0,n.classList.add(v.loading),e.classList.add(v.imageHidden))},hideLoader:s,wrap:function(e){n.appendChild(t),n.appendChild(i),e.appendChild(n)},skeleton:t}}var y=t(15364),f=t(86319),k=t(44217),B={};B.setAttributes=g(),B.insert=c().bind(null,"head"),B.domAPI=d(),B.insertStyleElement=h();l()(k.A,B);const x=k.A&&k.A.locals?k.A.locals:void 0,w=()=>{const e="image";return{name:e,create:n=>{const{createElement:t,compose:a,helpers:i}=n,{arrayToString:s,mergeDiff:l}=i,A=document.createElement("img"),d=document.createElement("div");a.props.style&&!parseInt(a.props.style.height)&&(a.props.style.height="auto"),A.addEventListener("drop",e=>{e.preventDefault();var n=e.dataTransfer.getData("text/html");const t=document.createElement("div");t.innerHTML=n;const o=t.querySelector("img");o&&o.src&&a.editor.store().updateComponent(a,"src",o.src)}),A.draggable=!0,A.src=a.props.src;const p=s(a.classList);A.className=s(p,"editor-image",x.image),d.append(A);const c=b(A);c.wrap(d);let m=a.props.src;a.props.src&&c.showLoader();const g=document.createElement("button");g.type="button",g.className=v.cropButton;const u=f.M.get("lang","crop_image")||"Crop image";function h(e){const n=e.target;n.classList.contains("amazingbar-content-wrapper")&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&("Delete"!==e.key&&"Backspace"!==e.key||C.commands.remove())}g.title=u,g.setAttribute("aria-label",u),g.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 2v14a2 2 0 0 0 2 2h14"/><path d="M18 22V8a2 2 0 0 0-2-2H2"/></svg>',g.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),(0,y.f)(a)}),c.wrapper.appendChild(g),A.addEventListener("dblclick",()=>{const e=document.createElement("cdtr-gallery");e.opened=!0,e.multi=!0,document.body.append(e),e.addEventListener("file",n=>{let t=n.detail;Array.isArray(t)&&(t=t[0]),a.editor.store().execCommands([{key:"src",value:t.src},{key:"style",value:{height:"auto"}}]),e.opened=!1,setTimeout(()=>{e.remove()},1500)}),e.addEventListener("close",()=>{e.remove()})});const C=t({name:e,id:a.id,template:d,defaultProps:{style:{height:"auto",width:"200px"}},draggable:{group:"element"},droppable:{group:"element"},render:()=>{l(A,{style:a.props.style}),A.width=a.props.width||a.props.style.width,A.height=a.props.height||a.props.style.height,a.props.src&&a.props.src!==m&&(m=a.props.src,c.showLoader(!0)),l(A,{src:a.props.src}),l(A,{alt:a.props.alt})},resizeable:()=>d,handleBar:!0,validator:r(),schema:a.schema,onSelect:e=>{A.classList.add(e),document.addEventListener("keyup",h)},onDeselect:e=>{A.classList.remove(e),document.removeEventListener("keyup",h)},elementProps:a,remove:()=>{d.remove()},createEditor:o});let E=0,k=0,B=!1,w=!1,R=!1,L=!1;return A.addEventListener("dragover",e=>{e.preventDefault()}),A.addEventListener("dragstart",e=>{E=e.clientX,k=e.clientY,B=!0,w=!1,R=!1,L=!1}),A.addEventListener("drag",e=>{if(!B)return;const n=A.closest(".block-component")||A.closest("[data-block]")||A.parentElement;if(!n)return;const t=n.getBoundingClientRect(),a=t.width,o=t.left,i=e.clientX-o,r=.3*a,s=.7*a;if(i<r&&!w){w=!0,L=!1,R=!1;const e=C.parent("col");e&&e.commands.execCommand("justify","start")}else if(i>s&&!R){R=!0,L=!1,w=!1;const e=C.parent("col");e&&e.commands.execCommand("justify","end")}else if(i>=r&&i<=s&&!L){L=!0,w=!1,R=!1;const e=C.closest("col");e&&e.commands.execCommand("justify","center")}}),A.addEventListener("dragend",e=>{B=!1,w=!1,R=!1,L=!1}),C}}}},98481(e,n,t){t.d(n,{A:()=>s});var a=t(82001),o=t.n(a),i=t(40935),r=t.n(i)()(o());r.push([e.id,".lohuqKHS721dHgrbXSxR {\n position: relative;\n display: inline-block;\n overflow: hidden;\n}\n\n.svsvvszZebJje0J5_aR0 {\n position: relative;\n display: block;\n line-height: 0;\n}\n\n/* Crop / edit-image button — appears on hover over the image */\n.pQ89uz0UlGnGPEecwX2t {\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 2;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 8px;\n color: #fff;\n background: rgba(0, 0, 0, 0.55);\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.15s ease-out, background 0.15s ease-out;\n}\n\n.lohuqKHS721dHgrbXSxR:hover .pQ89uz0UlGnGPEecwX2t {\n opacity: 1;\n}\n\n.pQ89uz0UlGnGPEecwX2t:hover {\n background: rgba(0, 0, 0, 0.75);\n}\n\n.X_p_Nfsu3cFahVFu4_Bw {\n opacity: 0;\n transition: opacity 0.15s ease-out;\n}\n\n._6bzBNhs7hY6_EZJBee1 {\n animation: RDp05pdkytBCK3jwjH1H 0.4s ease-out forwards;\n}\n\n@keyframes RDp05pdkytBCK3jwjH1H {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/* Skeleton overlay - light purple placeholder */\n.gT24aWaYLc3ogXj85wMz {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: linear-gradient(\n 110deg,\n #e8e4f0 8%,\n #f0ecf8 18%,\n #e8e4f0 33%\n );\n background-size: 200% 100%;\n animation: _Mzf8MsKMSARt4xYISlA 1.5s ease-in-out infinite;\n pointer-events: none;\n}\n\n.lohuqKHS721dHgrbXSxR.MhfE6WSo5ganwIXH6eLf .gT24aWaYLc3ogXj85wMz {\n opacity: 1;\n z-index: 1;\n}\n\n.lohuqKHS721dHgrbXSxR:not(.MhfE6WSo5ganwIXH6eLf) .gT24aWaYLc3ogXj85wMz {\n opacity: 0;\n pointer-events: none;\n z-index: -1;\n transition: opacity 0.2s ease-out;\n}\n\n.lohuqKHS721dHgrbXSxR.MsTRDhZG2BCJz9_2FibU .gT24aWaYLc3ogXj85wMz {\n animation: j0DUaUfa5Px2EIxpK3zU 0.4s ease-out forwards;\n}\n\n@keyframes _Mzf8MsKMSARt4xYISlA {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n}\n\n@keyframes j0DUaUfa5Px2EIxpK3zU {\n to {\n opacity: 0;\n }\n}\n\n/* Shimmer highlight sweep */\n.EcbfYuWAe3Ej6GnLZxPW {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n rgba(255, 255, 255, 0.4) 50%,\n transparent 100%\n );\n background-size: 50% 100%;\n animation: dOhdOxhPYbAyl0kAuAmR 2s ease-in-out infinite;\n}\n\n@keyframes dOhdOxhPYbAyl0kAuAmR {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/* Print-style scanline */\n.ixwwhz1RPbWh52COfXpg {\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n background: linear-gradient(\n to bottom,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: qDDvb69LDcaVxWWlah1p 1.2s ease-in-out infinite;\n box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);\n}\n\n@keyframes qDDvb69LDcaVxWWlah1p {\n 0% {\n top: 0;\n opacity: 1;\n }\n 90% {\n top: 100%;\n opacity: 0.8;\n }\n 100% {\n top: 100%;\n opacity: 0;\n }\n}\n","",{version:3,sources:["webpack://./../web-editors/image-editor-component/lib/image-loader.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,cAAc;EACd,cAAc;AAChB;;AAEA,+DAA+D;AAC/D;EACE,kBAAkB;EAClB,QAAQ;EACR,UAAU;EACV,UAAU;EACV,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,kBAAkB;EAClB,WAAW;EACX,+BAA+B;EAC/B,eAAe;EACf,UAAU;EACV,6DAA6D;AAC/D;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,UAAU;EACV,kCAAkC;AACpC;;AAEA;EACE,sDAA6C;AAC/C;;AAEA;EACE;IACE,UAAU;EACZ;EACA;IACE,UAAU;EACZ;AACF;;AAEA,gDAAgD;AAChD;EACE,kBAAkB;EAClB,MAAQ;EAAR,QAAQ;EAAR,SAAQ;EAAR,OAAQ;EACR;;;;;GAKC;EACD,0BAA0B;EAC1B,yDAAoD;EACpD,oBAAoB;AACtB;;AAEA;EACE,UAAU;EACV,UAAU;AACZ;;AAEA;EACE,UAAU;EACV,oBAAoB;EACpB,WAAW;EACX,iCAAiC;AACnC;;AAEA;EACE,sDAAiD;AACnD;;AAEA;EACE;IACE,2BAA2B;EAC7B;EACA;IACE,4BAA4B;EAC9B;AACF;;AAEA;EACE;IACE,UAAU;EACZ;AACF;;AAEA,4BAA4B;AAC5B;EACE,kBAAkB;EAClB,MAAQ;EAAR,QAAQ;EAAR,SAAQ;EAAR,OAAQ;EACR;;;;;GAKC;EACD,yBAAyB;EACzB,uDAA+C;AACjD;;AAEA;EACE;IACE,4BAA4B;EAC9B;EACA;IACE,2BAA2B;EAC7B;AACF;;AAEA,yBAAyB;AACzB;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,WAAW;EACX;;;;;GAKC;EACD,yDAAiD;EACjD,4CAA4C;AAC9C;;AAEA;EACE;IACE,MAAM;IACN,UAAU;EACZ;EACA;IACE,SAAS;IACT,YAAY;EACd;EACA;IACE,SAAS;IACT,UAAU;EACZ;AACF",sourcesContent:[".wrapper {\n position: relative;\n display: inline-block;\n overflow: hidden;\n}\n\n.imageContainer {\n position: relative;\n display: block;\n line-height: 0;\n}\n\n/* Crop / edit-image button — appears on hover over the image */\n.cropButton {\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 2;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 8px;\n color: #fff;\n background: rgba(0, 0, 0, 0.55);\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.15s ease-out, background 0.15s ease-out;\n}\n\n.wrapper:hover .cropButton {\n opacity: 1;\n}\n\n.cropButton:hover {\n background: rgba(0, 0, 0, 0.75);\n}\n\n.imageHidden {\n opacity: 0;\n transition: opacity 0.15s ease-out;\n}\n\n.imageRevealed {\n animation: imageFadeIn 0.4s ease-out forwards;\n}\n\n@keyframes imageFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n/* Skeleton overlay - light purple placeholder */\n.skeleton {\n position: absolute;\n inset: 0;\n background: linear-gradient(\n 110deg,\n #e8e4f0 8%,\n #f0ecf8 18%,\n #e8e4f0 33%\n );\n background-size: 200% 100%;\n animation: skeletonShimmer 1.5s ease-in-out infinite;\n pointer-events: none;\n}\n\n.wrapper.loading .skeleton {\n opacity: 1;\n z-index: 1;\n}\n\n.wrapper:not(.loading) .skeleton {\n opacity: 0;\n pointer-events: none;\n z-index: -1;\n transition: opacity 0.2s ease-out;\n}\n\n.wrapper.revealed .skeleton {\n animation: skeletonFadeOut 0.4s ease-out forwards;\n}\n\n@keyframes skeletonShimmer {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n}\n\n@keyframes skeletonFadeOut {\n to {\n opacity: 0;\n }\n}\n\n/* Shimmer highlight sweep */\n.shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n rgba(255, 255, 255, 0.4) 50%,\n transparent 100%\n );\n background-size: 50% 100%;\n animation: shimmerSweep 2s ease-in-out infinite;\n}\n\n@keyframes shimmerSweep {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(200%);\n }\n}\n\n/* Print-style scanline */\n.scanline {\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n background: linear-gradient(\n to bottom,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: scanlineMove 1.2s ease-in-out infinite;\n box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);\n}\n\n@keyframes scanlineMove {\n 0% {\n top: 0;\n opacity: 1;\n }\n 90% {\n top: 100%;\n opacity: 0.8;\n }\n 100% {\n top: 100%;\n opacity: 0;\n }\n}\n"],sourceRoot:""}]),r.locals={wrapper:"lohuqKHS721dHgrbXSxR",imageContainer:"svsvvszZebJje0J5_aR0",cropButton:"pQ89uz0UlGnGPEecwX2t",imageHidden:"X_p_Nfsu3cFahVFu4_Bw",imageRevealed:"_6bzBNhs7hY6_EZJBee1",imageFadeIn:"RDp05pdkytBCK3jwjH1H",skeleton:"gT24aWaYLc3ogXj85wMz",skeletonShimmer:"_Mzf8MsKMSARt4xYISlA",loading:"MhfE6WSo5ganwIXH6eLf",revealed:"MsTRDhZG2BCJz9_2FibU",skeletonFadeOut:"j0DUaUfa5Px2EIxpK3zU",shimmer:"EcbfYuWAe3Ej6GnLZxPW",shimmerSweep:"dOhdOxhPYbAyl0kAuAmR",scanline:"ixwwhz1RPbWh52COfXpg",scanlineMove:"qDDvb69LDcaVxWWlah1p"};const s=r},44217(e,n,t){t.d(n,{A:()=>s});var a=t(82001),o=t.n(a),i=t(40935),r=t.n(i)()(o());r.push([e.id,".YbsG1_k3QD06_W0gNo53{\n display: block;\n max-width: 100%;\n}","",{version:3,sources:["webpack://./../web-editors/image-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;IACI,cAAc;IACd,eAAe;AACnB",sourcesContent:[".image{\n display: block;\n max-width: 100%;\n}"],sourceRoot:""}]),r.locals={image:"YbsG1_k3QD06_W0gNo53"};const s=r}}]);
Binary file
@@ -148,7 +148,7 @@
148
148
  .gallery-container {
149
149
  padding: var(--space-8, 32px) var(--space-5, 20px);
150
150
  }
151
- `},27209(e,t,s){s.r(t),s.d(t,{CreaditorGalleryWrapper:()=>b,DEFAULT_LABELS:()=>g});var i=s(59929),r=s(5441),o=s(86319),a=s(49549),l=s(91597),n=s(21421),d=s(93967);function c(e){try{localStorage.setItem("creaditor-gallery-folder",e)}catch(e){console.warn("Could not write to localStorage:",e)}}class p extends i.WF{constructor(){super(),this.newFolderModalRef=(0,n._)(),this.newFolderInputRef=(0,n._)(),this.drop=this.drop.bind(this),this.controls=!0,this.folderName=o.M.get("lang","myImages")||"My Images",this.sendFiles=this.sendFiles.bind(this),this.onSearch=this.onSearch.bind(this),this.coverEl=document.createElement("div"),this.sortItems=[{index:0,text:"fromNewToOld",value:{filter:"date",sortBy:"ASC"},checked:!0},{index:1,text:"fromOldToNew",value:{filter:"date",sortBy:"DESC"},checked:!1},{index:2,text:o.M.get("lang","aToZ"),value:{filter:"name",sortBy:"ASC"},checked:!1},{index:3,text:o.M.get("lang","zToA"),value:{filter:"name",sortBy:"DESC"},checked:!1}],this.filterItems=[{index:0,text:o.M.get("lang","folders"),value:"folders",checked:!0},{index:1,text:o.M.get("lang","images"),value:"images",checked:!0}]}openNewFolderModal(e){const t=this.newFolderModalRef.value;t&&(t.positionTarget=e.target,t.open(),this.newFolderInputRef.value.focus())}sendFiles(){const e={detail:this.files.filter(e=>e.selected),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onLiked(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("like",t))}onClickFolder(e,t){this.freeImages=!1,this.controls=t;const s={detail:e,bubbles:!1,composed:!1};this.folderName=e.name,this.dispatchEvent(new CustomEvent("folder",s))}onSelectFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onSelectPexelsImage(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onUpload(){const e=(0,r.A)("input",{hidden:!0,type:"file",accept:"image/*"});e.onchange=e=>{const t=e.target;if(t.files&&t.files[0]){const e=new FileReader,s=t.files[0];e.onload=e=>{const t={detail:s,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("upload",t))},e.readAsDataURL(s)}},e.click()}onCreateNewFolder(){const e=this.newFolderInputRef.value.value;if(e.length<=30){const t={detail:e,bubbles:!1,composed:!1};this.newFolderModalRef.value.close(),this.dispatchEvent(new CustomEvent("newFolder",t)),this.newFolderInputRef.value.value=""}}onClickCategory(){}onReset(){c(null),this.freeImages=!1,this._favorites=!1,this.folderName=o.M.get("lang","myImages"),this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!0}:e),this.dispatchEvent(new CustomEvent("reset",{}))}onFavorites(){c(null),this.freeImages=!1,this._favorites=!0,this.folderName="",this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!1}:e),this.dispatchEvent(new CustomEvent("search",{detail:{value:"",isLiked:!0},bubbles:!1,composed:!1}))}onSearch(e,t){c(null),this.freeImages=!1;let s=!1;"object"==typeof t&&t.isLiked&&(s=!0);const i=e.target?.value||"";(0,l.A)(()=>{const e={detail:{value:i,isLiked:s},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("search",e))})}drop(e,t){e.preventDefault();const s=e.dataTransfer.getData("fileId"),i=(e.dataTransfer.getData("folderId"),{detail:{fileId:s,folderId:t},bubbles:!1,composed:!1});this.dispatchEvent(new CustomEvent("moveFile",i))}onFilterMedia(e){const t=e.detail.value,s=t.index,i=[...this.filterItems];i[s].checked=!i[s].checked,this.filterItems=i}onSort(e){const t=e.detail.value,s={detail:t,bubbles:!1,composed:!1},i=t.index,r=[...this.sortItems];r.forEach((e,t)=>{e.checked=i===t}),this.sortItems=r,this.dispatchEvent(new CustomEvent("filter",s))}onDeleteFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFile",t))}onDeleteFolder(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFolder",t))}dragStart(e,t){e.dataTransfer.setData("fileId",t)}dragOver(e,t){e.dataTransfer.setData("folderId",t),e.preventDefault()}onFreeImages(){this.freeImages=!0,c("freeImages"),s.e(767).then(s.bind(s,70767))}onScroll(e){const t=e.target;if(t.scrollTop+t.offsetHeight>=t.scrollHeight-50){const e={detail:{folderId:this.folderId,page:this.page},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("loadMore",e))}}connectedCallback(){super.connectedCallback(),s.e(5156).then(s.bind(s,85156));"freeImages"===function(){try{return localStorage.getItem("creaditor-gallery-folder")}catch(e){return console.warn("Could not read from localStorage:",e),null}}()&&(this.freeImages=!0,s.e(767).then(s.bind(s,70767)))}render(){Array.isArray(this.files)||(this.files=[]),Array.isArray(this.folders)||(this.folders=[]);const e=this.folders.filter(e=>"public"!==e.visibility),t=this.folders.filter(e=>"public"===e.visibility);return i.qy` <cdtr-row>
151
+ `},27209(e,t,s){s.r(t),s.d(t,{CreaditorGalleryWrapper:()=>b,DEFAULT_LABELS:()=>g});var i=s(59929),r=s(5441),o=s(86319),a=s(49549),l=s(91597),d=s(21421),n=s(93967);function c(e){try{localStorage.setItem("creaditor-gallery-folder",e)}catch(e){console.warn("Could not write to localStorage:",e)}}class p extends i.WF{constructor(){super(),this.newFolderModalRef=(0,d._)(),this.newFolderInputRef=(0,d._)(),this.drop=this.drop.bind(this),this.controls=!0,this.folderName=o.M.get("lang","myImages")||"My Images",this.sendFiles=this.sendFiles.bind(this),this.onSearch=this.onSearch.bind(this),this.coverEl=document.createElement("div"),this.sortItems=[{index:0,text:"fromNewToOld",value:{filter:"date",sortBy:"ASC"},checked:!0},{index:1,text:"fromOldToNew",value:{filter:"date",sortBy:"DESC"},checked:!1},{index:2,text:o.M.get("lang","aToZ"),value:{filter:"name",sortBy:"ASC"},checked:!1},{index:3,text:o.M.get("lang","zToA"),value:{filter:"name",sortBy:"DESC"},checked:!1}],this.filterItems=[{index:0,text:o.M.get("lang","folders"),value:"folders",checked:!0},{index:1,text:o.M.get("lang","images"),value:"images",checked:!0}]}openNewFolderModal(e){const t=this.newFolderModalRef.value;t&&(t.positionTarget=e.target,t.open(),this.newFolderInputRef.value.focus())}sendFiles(){const e={detail:this.files.filter(e=>e.selected),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onLiked(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("like",t))}onClickFolder(e,t){this.freeImages=!1,this.controls=t;const s={detail:e,bubbles:!1,composed:!1};this.folderName=e.name,this.dispatchEvent(new CustomEvent("folder",s))}onSelectFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onSelectPexelsImage(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}onUpload(){const e=(0,r.A)("input",{hidden:!0,type:"file",accept:"image/*"});e.onchange=e=>{const t=e.target;if(t.files&&t.files[0]){const e=new FileReader,s=t.files[0];e.onload=e=>{const t={detail:s,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("upload",t))},e.readAsDataURL(s)}},e.click()}onCreateNewFolder(){const e=this.newFolderInputRef.value.value;if(e.length<=30){const t={detail:e,bubbles:!1,composed:!1};this.newFolderModalRef.value.close(),this.dispatchEvent(new CustomEvent("newFolder",t)),this.newFolderInputRef.value.value=""}}onClickCategory(){}onReset(){c(null),this.freeImages=!1,this._favorites=!1,this.folderName=o.M.get("lang","myImages"),this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!0}:e),this.dispatchEvent(new CustomEvent("reset",{}))}onFavorites(){c(null),this.freeImages=!1,this._favorites=!0,this.folderName="",this.filterItems=this.filterItems.map(e=>"folders"===e.value?{...e,checked:!1}:e),this.dispatchEvent(new CustomEvent("search",{detail:{value:"",isLiked:!0},bubbles:!1,composed:!1}))}onSearch(e,t){c(null),this.freeImages=!1;let s=!1;"object"==typeof t&&t.isLiked&&(s=!0);const i=e.target?.value||"";(0,l.A)(()=>{const e={detail:{value:i,isLiked:s},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("search",e))})}drop(e,t){e.preventDefault();const s=e.dataTransfer.getData("fileId"),i=(e.dataTransfer.getData("folderId"),{detail:{fileId:s,folderId:t},bubbles:!1,composed:!1});this.dispatchEvent(new CustomEvent("moveFile",i))}onFilterMedia(e){const t=e.detail.value,s=t.index,i=[...this.filterItems];i[s].checked=!i[s].checked,this.filterItems=i}onSort(e){const t=e.detail.value,s={detail:t,bubbles:!1,composed:!1},i=t.index,r=[...this.sortItems];r.forEach((e,t)=>{e.checked=i===t}),this.sortItems=r,this.dispatchEvent(new CustomEvent("filter",s))}onDeleteFile(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFile",t))}onDeleteFolder(e){const t={detail:e,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("deleteFolder",t))}dragStart(e,t){e.dataTransfer.setData("fileId",t)}dragOver(e,t){e.dataTransfer.setData("folderId",t),e.preventDefault()}onFreeImages(){this.freeImages=!0,c("freeImages"),s.e(767).then(s.bind(s,70767))}onScroll(e){const t=e.target;if(t.scrollTop+t.offsetHeight>=t.scrollHeight-50){const e={detail:{folderId:this.folderId,page:this.page},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("loadMore",e))}}connectedCallback(){super.connectedCallback(),s.e(5156).then(s.bind(s,85156));"freeImages"===function(){try{return localStorage.getItem("creaditor-gallery-folder")}catch(e){return console.warn("Could not read from localStorage:",e),null}}()&&(this.freeImages=!0,s.e(767).then(s.bind(s,70767)))}render(){Array.isArray(this.files)||(this.files=[]),Array.isArray(this.folders)||(this.folders=[]);const e=this.folders.filter(e=>"public"!==e.visibility),t=this.folders.filter(e=>"public"===e.visibility);return i.qy` <cdtr-row>
152
152
  <cdtr-col class="list" sm="3">
153
153
  <cdtr-row alignItems="center" class="upload-container">
154
154
  <paper-button @click=${this.onUpload} class="upload">
@@ -279,7 +279,7 @@
279
279
  </div>
280
280
  </cdtr-col>`}
281
281
  <paper-dialog
282
- ${(0,n.K)(this.newFolderModalRef)}
282
+ ${(0,d.K)(this.newFolderModalRef)}
283
283
  no-overlap
284
284
  horizontal-align="left"
285
285
  vertical-align="top"
@@ -295,7 +295,7 @@
295
295
  <cdtr-col sm="10"
296
296
  ><cdtr-input
297
297
  @submit=${this.onCreateNewFolder}
298
- ${(0,n.K)(this.newFolderInputRef)}
298
+ ${(0,d.K)(this.newFolderInputRef)}
299
299
  autofocus=${!0}
300
300
  maxLength=${30}
301
301
  ></cdtr-input
@@ -308,7 +308,7 @@
308
308
  </cdtr-row>
309
309
  </form>
310
310
  </paper-dialog>
311
- </cdtr-row>`}}p.styles=d.T,p.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},folderName:{type:String},filterItems:{type:Array},multi:{type:Boolean},controls:{type:Boolean},freeImages:{type:Boolean}},customElements.define("cdtr-gallery-files",p);class h extends i.WF{constructor(){super(),this.uploads={}}connectedCallback(){super.connectedCallback(),this.addEventListener("upload-start",this.handleUploadStart.bind(this)),this.addEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.addEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.addEventListener("upload-error",this.handleUploadError.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("upload-start",this.handleUploadStart.bind(this)),this.removeEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.removeEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.removeEventListener("upload-error",this.handleUploadError.bind(this))}handleUploadStart(e){const{uploadId:t,fileName:s}=e.detail;this.uploads[t]={fileName:s,status:"uploading",progress:0,error:null},this.requestUpdate()}handleUploadProgress(e){const{uploadId:t,progress:s}=e.detail;this.uploads[t]&&(this.uploads[t].progress=s,this.requestUpdate())}handleUploadComplete(e){const{uploadId:t}=e.detail;this.uploads[t]&&(this.uploads[t].status="completed",this.uploads[t].progress=100,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},3e3))}handleUploadError(e){const{uploadId:t,error:s}=e.detail;this.uploads[t]&&(this.uploads[t].status="error",this.uploads[t].error=s,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},5e3))}removeUpload(e){delete this.uploads[e],this.requestUpdate()}getStatusIcon(e){switch(e){case"uploading":default:return i.qy`<div class="status-icon uploading"></div>`;case"completed":return i.qy`<div class="status-icon completed"></div>`;case"error":return i.qy`<div class="status-icon error"></div>`}}getProgressFillClass(e){switch(e){case"completed":return"progress-fill completed";case"error":return"progress-fill error";default:return"progress-fill"}}render(){const e=Object.entries(this.uploads).map(e=>{let[t,s]=e;return i.qy`
311
+ </cdtr-row>`}}p.styles=n.T,p.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},folderName:{type:String},filterItems:{type:Array},multi:{type:Boolean},controls:{type:Boolean},freeImages:{type:Boolean}},customElements.define("cdtr-gallery-files",p);class h extends i.WF{constructor(){super(),this.uploads={}}connectedCallback(){super.connectedCallback(),this.addEventListener("upload-start",this.handleUploadStart.bind(this)),this.addEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.addEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.addEventListener("upload-error",this.handleUploadError.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("upload-start",this.handleUploadStart.bind(this)),this.removeEventListener("upload-progress",this.handleUploadProgress.bind(this)),this.removeEventListener("upload-complete",this.handleUploadComplete.bind(this)),this.removeEventListener("upload-error",this.handleUploadError.bind(this))}handleUploadStart(e){const{uploadId:t,fileName:s}=e.detail;this.uploads[t]={fileName:s,status:"uploading",progress:0,error:null},this.requestUpdate()}handleUploadProgress(e){const{uploadId:t,progress:s}=e.detail;this.uploads[t]&&(this.uploads[t].progress=s,this.requestUpdate())}handleUploadComplete(e){const{uploadId:t}=e.detail;this.uploads[t]&&(this.uploads[t].status="completed",this.uploads[t].progress=100,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},3e3))}handleUploadError(e){const{uploadId:t,error:s}=e.detail;this.uploads[t]&&(this.uploads[t].status="error",this.uploads[t].error=s,this.requestUpdate(),setTimeout(()=>{this.removeUpload(t)},5e3))}removeUpload(e){delete this.uploads[e],this.requestUpdate()}getStatusIcon(e){switch(e){case"uploading":default:return i.qy`<div class="status-icon uploading"></div>`;case"completed":return i.qy`<div class="status-icon completed"></div>`;case"error":return i.qy`<div class="status-icon error"></div>`}}getProgressFillClass(e){switch(e){case"completed":return"progress-fill completed";case"error":return"progress-fill error";default:return"progress-fill"}}render(){const e=Object.entries(this.uploads).map(e=>{let[t,s]=e;return i.qy`
312
312
  <div class="upload-item">
313
313
  <div class="upload-header">
314
314
  <span class="file-name" title="${s.fileName}">${s.fileName}</span>
@@ -700,4 +700,4 @@
700
700
  style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
701
701
  >${t||this.text}</span
702
702
  ></slot
703
- >`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)},13681(e,t,s){s.d(t,{vP:()=>c});const i=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=i,window[i]||(window[i]={});const r=window[i],o=window.__cdtrEvents||{};function a(e){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then(e=>Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""))}function l(e){if(e.length%2!=0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)t[s/2]=parseInt(e.substr(s,2),16);return t}async function n(e){const t=await a(e),s=r[t];if(s){const e=await crypto.subtle.importKey("raw",l(t),{name:"AES-GCM"},!1,["encrypt","decrypt"]),i=await async function(e,t,s){const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,s);return(new TextDecoder).decode(i)}(e,s.iv,s.encrypted);return JSON.parse(i)}return null}function d(e,t){if(o[e])for(const s in o[e])Object.prototype.hasOwnProperty.call(o[e],s)&&o[e][s].forEach(e=>e(t));Array.isArray(o["*"])&&o["*"].forEach(e=>e(t))}window.__cdtrEvents=o;const c={set:async function(e,t){const s=JSON.parse(JSON.stringify(t)),i=await a(e),n=await crypto.subtle.importKey("raw",l(i),{name:"AES-GCM"},!1,["encrypt","decrypt"]),c=await async function(e,t){const s=crypto.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},e,i);return{iv:s,encrypted:new Uint8Array(r)}}(n,JSON.stringify(s));r[i]=c,o.set&&o.set[i]&&o.set[i].forEach(e=>e(s)),Array.isArray(o["*"])&&o["*"].forEach(e=>e(s)),d(e,s)},get:n,remove:async function(e){const t=await a(e);delete r[t]},on:async function(e,t,s){o[e]||(o[e]={});const i=await a(t);o[e][i]||(o[e][i]=[]),o[e][i].push(e=>{!function(){const e=(new Error).stack;if(e&&e.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),s(e)});const r=await n(t);return r&&s(r),i},off:function(e,t){o[e]&&o[e][t]&&delete o[e][t]},dispatch:d,OPTIONS:{SET:"set"}}}}]);
703
+ >`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)}}]);
Binary file