@creaditor/newsletter-starterkit 1.0.53 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1260.creaditor.bundle.js +260 -128
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -1
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js +1 -1
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +276 -77
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +11 -5
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +56 -8
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -2
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +91 -58
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +11 -9
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js +1 -1
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +3 -3
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js +1 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +1 -1
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +141 -108
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +198 -235
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +125 -36
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/589.creaditor.bundle.js +9 -9
- package/dist/589.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +24 -31
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +3 -3
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +151 -0
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +2 -3
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js +3 -3
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +3 -7
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/763.creaditor.bundle.js +1 -1
- package/dist/763.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +63 -115
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +6 -6
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js +1 -1
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +1 -0
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js +4 -4
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +1 -1
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +4 -3
- package/dist/9162.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js +1 -1
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +1780 -608
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,38 +1,99 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>i});var n=o(59929);class s extends n.WF{constructor(){super(),this.label="",this.open=!0}toggle(){this.open=!this.open}render(){return n.qy`
|
|
2
|
+
<div class="section">
|
|
3
|
+
<div class="header" @click=${this.toggle}>
|
|
4
|
+
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
5
|
+
<svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
6
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
7
|
+
</svg>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="content ${this.open?"open":""}">
|
|
10
|
+
<div class="content-inner">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`}}s.styles=n.AH`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
direction: var(--direction-locale, ltr);
|
|
19
|
+
--editor-container-inline-padding: 0;
|
|
20
|
+
}
|
|
21
|
+
.section {
|
|
22
|
+
border-bottom: 1px solid #eaeaee;
|
|
23
|
+
}
|
|
24
|
+
.header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
padding: 12px 16px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
.title {
|
|
33
|
+
font-size: 12.5px;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
color: #222;
|
|
36
|
+
letter-spacing: 0.01em;
|
|
37
|
+
}
|
|
38
|
+
.chevron {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
|
|
42
|
+
color: #ccc;
|
|
43
|
+
}
|
|
44
|
+
.header:hover .chevron {
|
|
45
|
+
color: #888;
|
|
46
|
+
}
|
|
47
|
+
.chevron.open {
|
|
48
|
+
transform: rotate(180deg);
|
|
49
|
+
}
|
|
50
|
+
.content {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
53
|
+
max-height: 0;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
.content.open {
|
|
57
|
+
max-height: 1200px;
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
.content-inner {
|
|
61
|
+
padding: 0 16px 12px 16px;
|
|
62
|
+
}
|
|
63
|
+
`,s.properties={label:{type:String},open:{type:Boolean}},customElements.define("cdtr-editor-section",s);const i=(e,t)=>n.qy`
|
|
64
|
+
<cdtr-editor-section
|
|
65
|
+
.label=${e.label}
|
|
66
|
+
.open=${!1!==e.open}
|
|
67
|
+
>
|
|
68
|
+
${t}
|
|
69
|
+
</cdtr-editor-section>
|
|
70
|
+
`},45340(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>l});var n=o(59929),s=o(86319),i=o(36565),c=(o(12258),o(79307));class l extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{i.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){i.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){i.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(i.Ay.components.length>0){const e=i.Ay.components[0].props;this.show_on_desktop=!!e.show_on_desktop,this.show_on_tablet=!!e.show_on_tablet,this.show_on_mobile=!!e.show_on_mobile,this.name=e.name||"",this.element_ID=e.element_ID||""}}connectedCallback(){super.connectedCallback(),i.Ay.on("select",this.onInspect),i.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),i.Ay.off("select",this.onInspect),i.Ay.off("update",this.onInspect)}render(){const e="block"===i.Ay.getSelectedComponent()[0].type,t="web"===s.M.get("config","channel");return n.qy`
|
|
71
|
+
${e&&t?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
|
|
72
|
+
<div class="device-toggle-row">
|
|
73
|
+
<div
|
|
74
|
+
class="device-toggle-btn ${this.show_on_desktop?"active":""}"
|
|
75
|
+
@click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
|
|
8
76
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<cdtr-checkbox
|
|
16
|
-
.checked=${this.show_on_tablet}
|
|
17
|
-
@change="${t=>this.cmds.onToggleDisplayMode("tablet",!t.target.checked)}"
|
|
77
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.oe}</svg>
|
|
78
|
+
<lang-text text="desktop"></lang-text>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
class="device-toggle-btn ${this.show_on_tablet?"active":""}"
|
|
82
|
+
@click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
|
|
18
83
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.checked=${this.show_on_mobile}
|
|
26
|
-
@change="${t=>this.cmds.onToggleDisplayMode("mobile",!t.target.checked)}"
|
|
84
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.kN}</svg>
|
|
85
|
+
<lang-text text="tablet"></lang-text>
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
class="device-toggle-btn ${this.show_on_mobile?"active":""}"
|
|
89
|
+
@click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
|
|
27
90
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<cdtr-accordion-item isOpen="true" label="properties">
|
|
35
|
-
<cdtr-editor-container>
|
|
91
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.S9}</svg>
|
|
92
|
+
<lang-text text="mobile"></lang-text>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</cdtr-editor-section>`:n.qy``}
|
|
96
|
+
<cdtr-editor-section label="properties" .open=${!0}>
|
|
36
97
|
<cdtr-row mt="1">
|
|
37
98
|
<cdtr-title><lang-text text="name"></lang-text></cdtr-title>
|
|
38
99
|
</cdtr-row>
|
|
@@ -57,10 +118,38 @@
|
|
|
57
118
|
style="width:100%"
|
|
58
119
|
></cdtr-input>
|
|
59
120
|
</cdtr-row>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`}}s.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},s.styles=n.AH`
|
|
121
|
+
</cdtr-editor-section>
|
|
122
|
+
`}}l.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},l.styles=n.AH`
|
|
63
123
|
:host {
|
|
64
124
|
direction: var(--direction-locale);
|
|
65
125
|
}
|
|
66
|
-
|
|
126
|
+
.device-toggle-row {
|
|
127
|
+
display: flex;
|
|
128
|
+
gap: 6px;
|
|
129
|
+
}
|
|
130
|
+
.device-toggle-btn {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 4px;
|
|
134
|
+
padding: 7px 8px;
|
|
135
|
+
border: none;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
color: #bbb;
|
|
139
|
+
background: #f4f4f6;
|
|
140
|
+
transition: all 0.15s;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
}
|
|
143
|
+
.device-toggle-btn:hover {
|
|
144
|
+
background: #eaeaed;
|
|
145
|
+
color: #888;
|
|
146
|
+
}
|
|
147
|
+
.device-toggle-btn svg {
|
|
148
|
+
fill: currentColor;
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
}
|
|
151
|
+
.device-toggle-btn.active {
|
|
152
|
+
background: color-mix(in srgb, var(--accent, #5B5FC7) 12%, transparent);
|
|
153
|
+
color: var(--accent, #5B5FC7);
|
|
154
|
+
}
|
|
155
|
+
`,customElements.define("cdtr-setting-editor",l)}}]);
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[589],{589(e,t,r){r.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[589],{589(e,t,r){r.d(t,{default:()=>Q});var n=r(12106),s=r(59929);let i={};function o(e){i.selected=e}function c(e){return i.selected}const l="https://img.creaditor.ai",a=[{type:"youtube",src:`${l}/icons/serve/Logos/youtube-line.png?width=34&height=34`},{type:"whatsapp",src:`${l}/icons/serve/Logos/whatsapp-line.png?width=34&height=34`},{type:"snapchat",src:`${l}/icons/serve/Logos/snapchat-line.png?width=34&height=34`},{type:"instagram",src:`${l}/icons/serve/Logos/instagram-line.png?width=34&height=34`},{type:"telegram",src:`${l}/icons/serve/Logos/telegram-line.png?width=34&height=34`},{type:"facebook",src:`${l}/icons/serve/Logos/facebook-line.png?width=34&height=34`},{type:"vimeo",src:`${l}/icons/serve/Logos/vimeo-line.png?width=34&height=34`},{type:"x",src:`${l}/icons/serve/Logos/twitter-x-line.png?width=34&height=34`},{type:"linkedin",src:`${l}/icons/serve/Logos/linkedin-box-line.png?width=34&height=34`},{type:"tiktok",src:`${l}/icons/serve/Logos/tiktok-line.png?width=34&height=34`},{type:"reddit",src:`${l}/icons/serve/Logos/reddit-line.png?width=34&height=34`},{type:"twitch",src:`${l}/icons/serve/Logos/twitch-line.png?width=34&height=34`},{type:"messenger",src:`${l}/icons/serve/Logos/messenger-line.png?width=34&height=34`},{type:"pinterest",src:`${l}/icons/serve/Logos/pinterest-line.png?width=34&height=34`},{type:"discord",src:`${l}/icons/serve/Logos/discord-line.png?width=34&height=34`},{type:"skype",src:`${l}/icons/serve/Logos/skype-line.png?width=34&height=34`},{type:"wechat",src:`${l}/icons/serve/Logos/wechat-2-line.png?width=34&height=34`},{type:"email",src:`${l}/icons/serve/Business/mail-line.png?width=34&height=34`},{type:"phone",src:`${l}/icons/serve/Device/phone-line.png?width=34&height=34`},{type:"home",src:`${l}/icons/serve/Buildings/home-line.png?width=34&height=34`},{type:"website",src:`${l}/icons/serve/Map/globe-line.png?width=34&height=34`},{type:"link",src:`${l}/icons/serve/Editor/link.png?width=34&height=34`},{type:"contact",src:`${l}/icons/serve/Business/customer-service-2-line.png?width=34&height=34`},{type:"address",src:`${l}/icons/serve/Map/map-pin-line.png?width=34&height=34`},{type:"send",src:`${l}/icons/serve/Business/send-plane-line.png?width=34&height=34`}],d={twitter:"x","t.co":"x","x.com":"x",youtu:"youtube","youtu.be":"youtube","fb.com":"facebook","fb.me":"facebook","m.me":"messenger","wa.me":"whatsapp","t.me":"telegram","ig.me":"instagram","lnkd.in":"linkedin"};function p(e,t){if(!t||"string"!=typeof t)return;const r=t.toLowerCase().trim();if(r.startsWith("mailto:"))return"email";if(r.startsWith("tel:"))return"phone";try{const n=(r.startsWith("http")?new URL(t):new URL(`https://${t}`)).hostname.replace("www.",""),s=n.split(".")[0];for(const[e,t]of Object.entries(d))if(n.includes(e)||e===n)return t;const i=e.find(e=>{const t=e.type.toLowerCase();return n.includes(t)||t.includes(s)||s.includes(t)});return i?i.type:e.find(e=>r.includes(e.type.toLowerCase()))?.type}catch(t){return e.find(e=>r.includes(e.type.toLowerCase()))?.type}}function h(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),8===t.length&&/^[0-9a-fA-F]+$/.test(t)&&(t=t.slice(0,6)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length?t:"000000"}function u(e,t){if(!e||!e.includes("https://img.creaditor.ai"))return e;const r=h(t||function(e){if(!e||"string"!=typeof e)return null;const t=e.match(/[?&]color=(?:%23|#)?([0-9a-fA-F]{3,8})/);return t?h(t[1]):null}(e));try{const t=new URL(e);return t.searchParams.set("color",r),t.toString()}catch(t){const n=e.includes("?")?"&":"?";return`${e}${n}color=${r}`}}function g(e){const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]}function m(e){let[t,r,n]=e;const[s,i,o]=[t,r,n].map(e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*s+.7152*i+.0722*o}function f(e,t){const r=m(g(e)),n=m(g(t));return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function y(e){if(!e)return null;const t=e.trim();if("transparent"===t||"initial"===t||"inherit"===t||""===t)return null;if(t.startsWith("#"))return h(t);const r=t.match(/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/);if(r){if(0===parseFloat(r[4]))return null;const[,e,t,n]=r;return[e,t,n].map(e=>Number(e).toString(16).padStart(2,"0")).join("")}const n=t.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(n){const[,e,t,r]=n;return[e,t,r].map(e=>Number(e).toString(16).padStart(2,"0")).join("")}return null}function w(e){let t=e?.parentElement;for(;t;){const e=y(t.style?.backgroundColor||t.getAttribute?.("bgcolor")||t.getAttribute?.("data-bgcolor"));if(e)return e;const r=t.ownerDocument?.defaultView?.getComputedStyle?.(t);if(r){const e=y(r.backgroundColor);if(e)return e}t=t.parentElement}return null}function b(e,t){if(!t)return e;const r=h(e);if(!function(e){const t=m(g(e));return t<=.05||t>=.95}(r))return r;if(f(r,t)>=3)return r;const n=f("000000",t);return f("ffffff",t)>=n?"ffffff":"000000"}const v="https://img.creaditor.ai";function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.width??24,n=t.height??24;let s=t.color??"000000";s.startsWith("#")&&(s=s.slice(1));return u(`${v}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${r}&height=${n}`,s)}class C extends s.WF{constructor(){super(),this.searchQuery="",this.iconColor="000000",this.iconSize=34,this.selectedSrc="",this._icons=[],this._loading=!1,this._error=""}willUpdate(e){e.has("searchQuery")&&this.searchQuery?this._fetchIcons():e.has("searchQuery")&&!this.searchQuery&&(this._icons=[],this._error="")}async _fetchIcons(){const e=(this.searchQuery||"").trim();if(e){this._loading=!0,this._error="";try{const t=new URLSearchParams({q:e,limit:"20"}),r=await fetch(`${v}/icons/search?${t.toString()}`);if(!r.ok)throw new Error(r.statusText);const n=await r.json();this._icons=n.icons||[]}catch(e){this._icons=[],this._error=e.message||"Failed to load icons"}finally{this._loading=!1}}else this._icons=[]}_onSelect(e){const t=(this.iconColor||"000000").replace(/^#/,""),r=Number(this.iconSize)||34,n=x(e,{width:r,height:r,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:n,icon:e},bubbles:!0,composed:!0}))}render(){if(!this.searchQuery?.trim())return s.qy``;if(this._loading)return s.qy`<div class="loading"><cdtr-loader></cdtr-loader></div>`;if(this._error)return s.qy`<div class="error">${this._error}</div>`;if(!this._icons.length)return s.qy``;const e=(this.iconColor||"000000").replace(/^#/,"");return s.qy`
|
|
2
2
|
|
|
3
3
|
<div class="grid">
|
|
4
|
-
${this._icons.map(t=>{const r=x(t,{width:24,height:24,color:e}),
|
|
4
|
+
${this._icons.map(t=>{const r=x(t,{width:24,height:24,color:e}),n=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return s.qy`
|
|
5
5
|
<button
|
|
6
6
|
type="button"
|
|
7
|
-
class="icon-wrap ${
|
|
7
|
+
class="icon-wrap ${n?"selected":""}"
|
|
8
8
|
title="${t.name}"
|
|
9
9
|
@click=${()=>this._onSelect(t)}
|
|
10
10
|
>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</button>
|
|
13
13
|
`})}
|
|
14
14
|
</div>
|
|
15
|
-
`}}C.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},C.styles=
|
|
15
|
+
`}}C.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},C.styles=s.AH`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
font-size: 12px;
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
.error {
|
|
61
61
|
color: var(--error-color, #c00);
|
|
62
62
|
}
|
|
63
|
-
`,customElements.define("social-icon-suggestions",C);var k=r(61919);const A=e=>{{const{component:t,commands:r}=e,
|
|
63
|
+
`,customElements.define("social-icon-suggestions",C);var k=r(61919);const A=e=>{{const{component:t,commands:r}=e,n=()=>{let e=c();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:o,tabs:c}=e;const l=n(),d=[{type:"node",node:()=>s.qy`<img
|
|
64
64
|
style="padding:10px;display:block;margin:auto"
|
|
65
65
|
width="52"
|
|
66
66
|
height="52"
|
|
67
|
-
src=${l?.src?
|
|
68
|
-
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const n
|
|
67
|
+
src=${l?.src?u(l.src,l.fgColor||l.iconColor):""}
|
|
68
|
+
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const s=n();if(!s)return;const i=[...t.props.items];if(i.length<2)return;const o=i.findIndex(e=>e.id===s.id);-1!==o&&(i.splice(o,1),r.execCommand("items",i))}},{type:"divider"},{type:"gallery",active:"image"===i.text,src:l?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const s=n();if(!s)return;let i=e.detail;Array.isArray(i)&&(i=i[0]);const o=t.props,c=JSON.parse(JSON.stringify(o.items)),l=c.findIndex(e=>e.id===s.id);-1!==l&&(c[l].src=i.src,r.execCommand("items",c))}},{type:"custom",active:()=>{const e=l?.link?.href||l?.url,t=e?p(a,e):null;return("link"===i.text||"image"===i.text)&&!!t},node:()=>{const e=l?.link?.href||l?.url,i=e&&p(a,e)||"";return s.qy`<cdtr-editor-container><social-icon-suggestions
|
|
69
69
|
.searchQuery=${i}
|
|
70
70
|
.iconColor=${l?.fgColor||l?.iconColor||"000000"}
|
|
71
71
|
.iconSize=${parseInt(l?.style?.width,10)||34}
|
|
72
72
|
.selectedSrc=${l?.src||""}
|
|
73
|
-
@icon-selected=${e=>{const n
|
|
74
|
-
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:l?.link||l?.url,active:()=>"link"===i.text&&!!l,onChange:e=>{const n
|
|
73
|
+
@icon-selected=${e=>{const s=n();if(!s)return;const i=t.props,o=JSON.parse(JSON.stringify(i.items)),c=o.findIndex(e=>e.id===s.id);-1!==c&&(o[c].src=e.detail.src,r.execCommand("items",o))}}
|
|
74
|
+
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:l?.link||l?.url,active:()=>"link"===i.text&&!!l,onChange:e=>{const s=n();if(!s)return;const i=e.target.value,o=t.props,c=JSON.parse(JSON.stringify(o.items)),l=c.findIndex(e=>e.id===s.id);if(-1!==l){const e=c[l].fgColor||c[l].iconColor,t=function(e,t){const r=p(a,e),n=r?a.find(e=>e.type===r):null,s=n?n.src:null;return s?u(s,t):null}(i.href,e);t&&(c[l].src=t),c[l].url=i.href,c[l].link=i,r.execCommand("items",c)}}},{type:"slider",title:"size",active:"design"===i.text,value:parseInt(l?.style?.width),min:10,max:80,onInput:e=>{const n=e.target.value,s=[...t.props.items];s.forEach(e=>{e.style.width=n+"px",e.style.height=n+"px"}),r.execCommand("items",s)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===i.text&&!!l,value:l?.fgColor?l.fgColor.startsWith("#")?l.fgColor:"#"+l.fgColor:"#000000",onChange:e=>{const s=n();if(!s)return;let i=e.target.value;i=(0,k.A)(i).toHex(),i.startsWith("#")&&(i=i.slice(1)),8===i.length&&/^[0-9a-fA-F]+$/.test(i)&&(i=i.slice(0,6));const o=t.props,c=JSON.parse(JSON.stringify(o.items));if(!0===o.applyColorToAll)c.forEach(e=>{e.fgColor=i});else{const e=c.findIndex(e=>e.id===s.id);-1!==e&&(c[e].fgColor=i)}r.execCommand("items",c)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===i.text&&!!l,onChange:e=>{const t=!!e.target.checked;r.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===i.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;r.execCommand("style",{gap:t+"px"})}}];return d}}}};var $=r(52144);const _=()=>({set:(e,t,r)=>{switch(t){case"style":if("object"==typeof r)return e[t]=(0,$.A)(e[t],r),!0;break;case"items":if(e[t]=r,Array.isArray(r)){const e=c(),t=r.find(t=>t.id===e?.id);t&&o(t)}return!0;case"src":const n=c();if(n&&Array.isArray(e.items)){const t=[...e.items],s=t.findIndex(e=>e.id===n.id);if(-1!==s)return t[s].src=r,e.items=t,!0}break;case"applyColorToAll":return e[t]=r,!0}}});var S=r(72591),L=r.n(S),I=r(88639),E=r.n(I),N=r(88128),O=r.n(N),T=r(30855),J=r.n(T),B=r(93051),j=r.n(B),q=r(89820),U={};U.setAttributes=J(),U.insert=O().bind(null,"head"),U.domAPI=E(),U.insertStyleElement=j();L()(q.A,U);const W=q.A&&q.A.locals?q.A.locals:void 0;var z=r(23571),F=r(91597);const Q=()=>{const e="social";return{name:e,create:t=>{let{createElement:r,compose:s,helpers:i}=t;const l=(0,F.S)(),d=document.createElement("div"),h=document.createElement("div");h.classList.add(W.root);new z.Ay(h,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(s.props.items)),{oldIndex:r,newIndex:n}=e,[i]=t.splice(r,1);t.splice(n,0,i),s.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});d.appendChild(h);const g=r({name:e,id:s.id,template:d,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=s.props.items;let t=!1;const r=e.map(e=>{const r=e.url||e.link?.link||"";if(!e.src&&r){const n=p(a,r),s=n?a.find(e=>e.type===n):null;if(s)return t=!0,{...e,src:s.src}}return e});t&&setTimeout(()=>s.editor.store().execCommand("items",r),0);const l=t?r:e;for(;h.firstChild;)h.removeChild(h.firstChild);i.mergeDiff(h,{style:s.props.style});const d=c();l.forEach(e=>{const t=document.createElement("img");d?.id===e.id&&t.classList.add(W.selected),t.addEventListener("click",()=>{o(e),Array.from(h.children).forEach(e=>{e.classList.remove(W.selected)}),t.classList.add(W.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);let r=e.fgColor||e.iconColor;const n=w(h);n&&(r=b(r,n)),t.src=u(e.src,r),i.mergeDiff(t,{style:e.style}),h.append(t)});const g=document.createElement("paper-button");g.style.minWidth="0",g.style.padding=0,g.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",h.append(g),g.addEventListener("click",()=>{setTimeout(()=>{const e=s.props.items[s.props.items.length-1],t={id:(0,n.A)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},r=[...s.props.items];r.push(t),o(t),s.editor.store().execCommand("items",r)},200)})},handleBar:!0,defaultProps:{},validator:_(),schema:s.schema,onSelect:e=>{const t=c();if(t){const r=document.querySelector(`[data-id="${t.id}"]`);r?(window.___social_cdtr_item=r,r.classList.add("selected_underlined")):d.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),d?.classList?.remove(e)},elementProps:s,remove:()=>{d.remove()},createEditor:A});return g.app.on("update",()=>{l.run(()=>{const e=w(h);if(!e)return;const t=h.querySelectorAll("img"),r=s.props.items;t.forEach((t,n)=>{const s=r[n];if(!s)return;let i=s.fgColor||s.iconColor;i=b(i,e),t.src=u(s.src,i)})})}),g}}}},89820(e,t,r){r.d(t,{A:()=>c});var n=r(82001),s=r.n(n),i=r(40935),o=r.n(i)()(s());o.push([e.id,".Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),o.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO"};const c=o}}]);
|
|
Binary file
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,i){i.r(e),i.d(e,{EditorTabs:()=>s});var n=i(59929),o=i(36565);i.e(7937).then(i.bind(i,67937));class s extends n.WF{constructor(){super(),this.onConnected=this.onConnected.bind(this),this.onArrowNavigation=this.onArrowNavigation.bind(this),this.tabs=[]}onClickItem(t){let{target:e}=t;const i=this.value=e.value,n=[...this.tabs],o=n.findIndex(t=>t.text===i);-1!==o&&(n.forEach(t=>{t.selected=!1}),n[o].selected=!0),this.tabs=n;const s=new UIEvent("tabChanged",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(s)}firstUpdated(){super.firstUpdated()}onConnected(t){let{name:e}=t;this.onClickItem({target:{value:e}})}onArrowNavigation(t){const{key:e,currentIcon:i}=t.detail,n=this.tabs.findIndex(t=>t.text===i);if(-1===n)return;let o=n;switch(e){case"ArrowUp":case"ArrowLeft":o=n>0?n-1:this.tabs.length-1;break;case"ArrowDown":case"ArrowRight":o=n<this.tabs.length-1?n+1:0;break;default:return}const s=this.tabs[o];s&&(this.onClickItem({target:{value:s.text}}),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(`cdtr-editor-tab-item[icon="${s.text}"]`);t&&t.focus()}))}connectedCallback(){super.connectedCallback(),o.Ay.on("editor-tabs",this.onConnected)}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("editor-tabs",this.onConnected)}renderContent(){switch(this.value){case"animations":return i.e(3553).then(i.bind(i,3553)),n.qy`<cdtr-animations-editor>
|
|
2
2
|
<cdtr-block-loader></cdtr-block-loader
|
|
3
|
-
></cdtr-animations-editor>`;case"settings":case"setting":return
|
|
3
|
+
></cdtr-animations-editor>`;case"settings":case"setting":return i.e(5340).then(i.bind(i,45340)),n.qy`<cdtr-setting-editor>
|
|
4
4
|
<cdtr-block-loader></cdtr-block-loader
|
|
5
|
-
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return n.qy`<cdtr-row
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
15
|
-
tabindex="0"
|
|
16
|
-
@change=${this.onClickItem}
|
|
17
|
-
.labelMode=${this.labelMode}
|
|
18
|
-
icon=${t.text}
|
|
19
|
-
text=${t.text}
|
|
20
|
-
.selected=${t.selected}
|
|
21
|
-
></cdtr-editor-tab-item>`)}
|
|
22
|
-
</cdtr-row>
|
|
5
|
+
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return this.tabs.length>0&&!this.tabs.some(t=>t.selected)&&(this.tabs[0].selected=!0,this.value=this.tabs[0].text),n.qy`<cdtr-row class="main">
|
|
6
|
+
<div class="icon-tabs" @arrow-navigation=${this.onArrowNavigation}>
|
|
7
|
+
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
8
|
+
tabindex="0"
|
|
9
|
+
@change=${this.onClickItem}
|
|
10
|
+
icon=${t.text}
|
|
11
|
+
text=${t.text}
|
|
12
|
+
.selected=${t.selected}
|
|
13
|
+
></cdtr-editor-tab-item>`)}
|
|
23
14
|
</div>
|
|
24
15
|
<cdtr-col class="content"> ${this.renderContent()} </cdtr-col>
|
|
25
16
|
</cdtr-row>`}}s.styles=n.AH`
|
|
@@ -32,23 +23,25 @@
|
|
|
32
23
|
overflow: hidden;
|
|
33
24
|
}
|
|
34
25
|
cdtr-editor-tab-item:focus {
|
|
35
|
-
background: #e1e1e1;
|
|
36
26
|
outline: none;
|
|
37
27
|
}
|
|
38
28
|
cdtr-editor-tab-item {
|
|
39
29
|
width: 100%;
|
|
40
30
|
}
|
|
41
31
|
.icon-tabs {
|
|
42
|
-
padding
|
|
43
|
-
background: #
|
|
44
|
-
width:
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
background: #fafafa;
|
|
34
|
+
width: 52px;
|
|
45
35
|
height: 100%;
|
|
46
36
|
min-height: 400px;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
border-left: 1px solid #eaeaee;
|
|
38
|
+
direction: ltr;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 2px;
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
|
|
52
45
|
.main {
|
|
53
46
|
height: 100%;
|
|
54
47
|
direction: rtl;
|
|
@@ -56,8 +49,8 @@
|
|
|
56
49
|
.content {
|
|
57
50
|
overflow-y: auto;
|
|
58
51
|
overflow-x: hidden;
|
|
59
|
-
max-height:
|
|
52
|
+
max-height: calc(100vh - 170px);
|
|
60
53
|
min-height: 80%;
|
|
61
|
-
padding-top:
|
|
54
|
+
padding-top: 12px;
|
|
62
55
|
}
|
|
63
|
-
`,s.properties={tabs:{type:Array},
|
|
56
|
+
`,s.properties={tabs:{type:Array},value:{type:String}},customElements.define("cdtr-editor-tabs",s)}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[638],{638(e,t,i){i.r(t),i.d(t,{DevicePicker:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[638],{638(e,t,i){i.r(t),i.d(t,{DevicePicker:()=>h});var o,r,c,n,d=i(59088),s=i(36936),p=i(59929);let h=(o=(0,i(49410).MZ)({type:String}),(n=class extends p.WF{constructor(){super(),(0,d.A)(this,"device",c,this),this.device="desktop"}choose(e){this.device=e}render(){return p.qy` <cdtr-row alignItems="center">
|
|
2
2
|
<paper-button @click=${()=>this.choose("phone")}>
|
|
3
3
|
<cdtr-tooltip content="design_for_phone">
|
|
4
4
|
<cdtr-icon
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
width="18"
|
|
16
16
|
icon="desktop"
|
|
17
17
|
></cdtr-icon></cdtr-tooltip></paper-button
|
|
18
|
-
></cdtr-row>`}}).styles=
|
|
18
|
+
></cdtr-row>`}}).styles=p.AH`
|
|
19
19
|
paper-button {
|
|
20
20
|
padding: 0;
|
|
21
21
|
min-width: 0;
|
|
22
22
|
}
|
|
23
|
-
`,r=n,c=(0,
|
|
23
|
+
`,r=n,c=(0,s.A)(r.prototype,"device",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),r);customElements.define("cdtr-device-picker",h)}}]);
|
|
Binary file
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[6713],{46713(t,e,i){i.r(e),i.d(e,{NextButton:()=>l});var s=i(59929),n=i(86319),o=i(93432),a=i(90090);class r extends s.WF{constructor(){super(),this.raf=0,this.dismissTimer=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.message="Published!",this.sub="Your site is live.",this.url=""}firstUpdated(){this.launchConfetti(),this.dismissTimer=setTimeout(()=>this.dismiss(),4200)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),this.dismissTimer&&clearTimeout(this.dismissTimer)}launchConfetti(){const t=this.renderRoot.querySelector("canvas");if(!t)return;const e=t.getContext("2d");if(!e)return;const i=window.devicePixelRatio||1,s=window.innerWidth,n=window.innerHeight;t.width=s*i,t.height=n*i,e.scale(i,i);const o=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],a=s/2,r=.34*n,l=Math.min(220,Math.round(s/6)),c=Array.from({length:l},(t,e)=>{const i=2*Math.PI*e/l+e%3*.4,s=4+e%9;return{x:a,y:r,vx:Math.cos(i)*s,vy:Math.sin(i)*s-3,size:5+e%5,color:o[e%o.length],rot:e,vrot:(e%2?1:-1)*(.1+e%5*.03),life:1}}),d=performance.now(),h=t=>{const i=t-d;e.clearRect(0,0,s,n);let o=!1;for(const t of c)t.vy+=.16,t.x+=t.vx,t.y+=t.vy,t.rot+=t.vrot,i>2600*.55&&(t.life=Math.max(0,t.life-.02)),t.life>0&&t.y<n+40&&(o=!0),e.save(),e.globalAlpha=t.life,e.translate(t.x,t.y),e.rotate(t.rot),e.fillStyle=t.color,e.fillRect(-t.size/2,-t.size/2,t.size,.6*t.size),e.restore();o&&i<3e3?this.raf=requestAnimationFrame(h):e.clearRect(0,0,s,n)};this.raf=requestAnimationFrame(h)}render(){return s.qy`
|
|
2
|
+
<canvas @click=${this.dismiss}></canvas>
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="check">
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M5 13l4 4L19 7" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
|
|
7
|
+
</svg>
|
|
8
|
+
</div>
|
|
9
|
+
<p class="title">${this.message}</p>
|
|
10
|
+
${this.sub?s.qy`<p class="sub">${this.sub}</p>`:null}
|
|
11
|
+
${this.url?s.qy`<a class="view" href=${this.url} target="_blank" rel="noopener">View site</a>`:null}
|
|
12
|
+
</div>
|
|
13
|
+
`}}r.styles=s.AH`
|
|
14
|
+
:host {
|
|
15
|
+
position: fixed;
|
|
16
|
+
inset: 0;
|
|
17
|
+
z-index: 2147483000;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
canvas {
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
.card {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 34%;
|
|
30
|
+
left: 50%;
|
|
31
|
+
transform: translate(-50%, -50%) scale(0.9);
|
|
32
|
+
background: #ffffff;
|
|
33
|
+
border-radius: 16px;
|
|
34
|
+
box-shadow: 0 24px 60px rgba(26, 26, 46, 0.28);
|
|
35
|
+
padding: 26px 34px;
|
|
36
|
+
text-align: center;
|
|
37
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
38
|
+
pointer-events: auto;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
animation: pop 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
|
|
41
|
+
max-width: 88vw;
|
|
42
|
+
}
|
|
43
|
+
@keyframes pop {
|
|
44
|
+
to {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: translate(-50%, -50%) scale(1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.check {
|
|
50
|
+
width: 56px;
|
|
51
|
+
height: 56px;
|
|
52
|
+
border-radius: 50%;
|
|
53
|
+
background: #2ec7a9;
|
|
54
|
+
margin: 0 auto 14px;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
}
|
|
59
|
+
.check svg {
|
|
60
|
+
width: 30px;
|
|
61
|
+
height: 30px;
|
|
62
|
+
}
|
|
63
|
+
.title {
|
|
64
|
+
font-size: 20px;
|
|
65
|
+
font-weight: bold;
|
|
66
|
+
color: #1a1a2e;
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
.sub {
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
color: #8a8f9c;
|
|
72
|
+
margin: 6px 0 0;
|
|
73
|
+
}
|
|
74
|
+
.view {
|
|
75
|
+
display: inline-block;
|
|
76
|
+
margin-top: 16px;
|
|
77
|
+
background: #e94560;
|
|
78
|
+
color: #fff;
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
font-weight: bold;
|
|
82
|
+
padding: 10px 22px;
|
|
83
|
+
border-radius: 9px;
|
|
84
|
+
}
|
|
85
|
+
`,r.properties={message:{type:String},sub:{type:String},url:{type:String}},customElements.define("cdtr-publish-success",r);class l extends s.WF{constructor(){super(),this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),this.onNextStep||(this.onNextStep=n.M.get("config","onNextStep")),this.channel||(this.channel=n.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async handleClick(){if(!this.isLocked&&!this.isLoading){this.isLoading=!0,this.isLocked=!0,this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{!!n.M.get("config","access")&&"web"===this.channel&&(await(0,a.bK)({}),this.celebratePublish()),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:o.FE,toJSON:o.U2})}catch(t){console.error("Error in publish/onNextStep:",t),this.snackbar(n.M.get("lang","publishError")||"Publish failed")}finally{this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}}snackbar(t){const e=n.M.get("commands");e?.snackbar?.(t)}celebratePublish(){const t=document.createElement("cdtr-publish-success");t.message=n.M.get("lang","published")||"Published!",t.sub=n.M.get("lang","publishedSub")||"Your site is live.";const e=n.M.get("app","domains"),i=e?.[0]?.name;i&&(t.url=/^https?:\/\//.test(i)?i:`https://${i}`),document.body.appendChild(t)}render(){const t=!!n.M.get("config","access");if(!(this.onNextStep||"web"===this.channel&&t))return null;const e="web"===this.channel?"publish":"next";return s.qy`
|
|
86
|
+
<paper-button
|
|
87
|
+
@click=${this.handleClick}
|
|
88
|
+
class="next-button"
|
|
89
|
+
?disabled=${this.isLocked}
|
|
90
|
+
>
|
|
91
|
+
${this.isLoading?s.qy`
|
|
92
|
+
<div class="loading-spinner"></div>
|
|
93
|
+
`:s.qy`
|
|
94
|
+
<div class="button-content ${this.isLoading?"loading":""}">
|
|
95
|
+
<lang-text text=${e}></lang-text>
|
|
96
|
+
</div>
|
|
97
|
+
`}
|
|
98
|
+
</paper-button>
|
|
99
|
+
`}}l.styles=s.AH`
|
|
100
|
+
:host {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.next-button {
|
|
105
|
+
background: var(--primary);
|
|
106
|
+
color: var(--primary-text);
|
|
107
|
+
fill: var(--primary-text);
|
|
108
|
+
text-transform: none;
|
|
109
|
+
color: #fff;
|
|
110
|
+
height: 52px;
|
|
111
|
+
border-radius: 0;
|
|
112
|
+
width: 90px;
|
|
113
|
+
transform: translateX(-4px);
|
|
114
|
+
position: relative;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.next-button:disabled {
|
|
119
|
+
opacity: 0.6;
|
|
120
|
+
cursor: not-allowed;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.loading-spinner {
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: 50%;
|
|
126
|
+
left: 50%;
|
|
127
|
+
transform: translate(-50%, -50%);
|
|
128
|
+
width: 20px;
|
|
129
|
+
height: 20px;
|
|
130
|
+
border: 2px solid transparent;
|
|
131
|
+
border-top: 2px solid #fff;
|
|
132
|
+
border-radius: 50%;
|
|
133
|
+
animation: spin 1s linear infinite;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@keyframes spin {
|
|
137
|
+
0% { transform: translate(-50%, -50%) rotate(0deg); }
|
|
138
|
+
100% { transform: translate(-50%, -50%) rotate(360deg); }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.button-content {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
transition: opacity 0.3s ease;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.button-content.loading {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
`,l.properties={onNextStep:{type:Function},channel:{type:String},isLoading:{type:Boolean},isLocked:{type:Boolean},lockTimer:{type:Number}},customElements.define("cdtr-next-button",l)}}]);
|
|
Binary file
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
color: white;
|
|
624
624
|
font-weight: bold;
|
|
625
625
|
}
|
|
626
|
-
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=[...e]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=[...e]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
|
|
626
|
+
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
|
|
627
627
|
<cdtr-upload-loading></cdtr-upload-loading>
|
|
628
628
|
<cdtr-upload-progress-monitor></cdtr-upload-progress-monitor>
|
|
629
629
|
<cdtr-drawer
|
|
@@ -653,8 +653,7 @@
|
|
|
653
653
|
></cdtr-gallery-files>
|
|
654
654
|
</cdtr-drawer>`}}g.styles=i.AH``,g.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},opened:{type:Boolean},multi:{type:Boolean},uploadStatus:{type:Object}},customElements.define("cdtr-gallery",g)},2590(e,t,s){s.r(t),s.d(t,{TitleEditor:()=>o});var i=s(59929),r=s(86319);class o extends i.WF{constructor(){super(),this.text="",this.whiteSpace="pre"}connectedCallback(){super.connectedCallback(),this.style.fontFamily="var(--font-family)",this.bold&&(this.style.fontWeight="bold")}render(){const e=r.M.get("theme");e&&(this.style.direction=e.direction,this.style.textAlign=this.textAlign||e.textAlign);const t=r.M.get("lang",this.text);return i.qy`<slot
|
|
655
655
|
><span
|
|
656
|
-
style="-webkit-font-smoothing: antialiased;text-
|
|
657
|
-
display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
656
|
+
style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
658
657
|
>${t||this.text}</span
|
|
659
658
|
></slot
|
|
660
659
|
>`}}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 l(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 a(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 l(e),s=r[t];if(s){const e=await crypto.subtle.importKey("raw",a(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 l(e),n=await crypto.subtle.importKey("raw",a(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 l(e);delete r[t]},on:async function(e,t,s){o[e]||(o[e]={});const i=await l(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"}}}}]);
|